Code Agents and COOP
Code Agents and COOP
This is one of COOP’s main workflow advantages: your code agent should not guess task selection, lifecycle, or prompt structure. COOP should provide those.
1. Let COOP choose or confirm the task
Start with:
coop currentcoop nextcoop show <id>Use coop next when the agent needs the top ready task.
Use coop show <id> when you already know the target task and want the authoritative acceptance criteria, tests, dependencies, and refs.
2. Hand COOP context to the code agent
For a repository bootstrap prompt:
coop help-ai --initial-prompt --rigour balanced --repo C:/path/to/repo --delivery MVP --command coop.cmdUse --strict when you want the agent to stop after the selected task instead of continuing.
This teaches the agent:
- how COOP is laid out in the repo
- how to inspect task selection and lifecycle rules
- which exact COOP commands exist
- where artifacts should be written
3. Generate a task-specific code prompt
When you want a task-focused handoff:
coop prompt <id>coop prompt <id> --format markdowncoop prompt <id> --format jsoncoop prompt <id> --save docs/agent-prompts/<id>.mdcoop prompt is the shortest path to a code prompt that already includes:
- task identity and status
- effective working context
- home track and contributing delivery tracks
- acceptance criteria
- tests required
- origin refs and execution hints
4. Let the agent learn COOP instead of inventing commands
These are the main discovery surfaces:
coop help-aicoop help-ai --selection --format markdowncoop help-ai --state-transitions --format markdowncoop help-ai --artifacts --format markdowncoop help-ai --post-execution --format markdowncoop help-ai --naming --format markdownUse them when the agent is unsure about:
- how to pick work
- how to move task status
- where to store artifacts
- whether to continue after finishing a task
- how IDs and naming tokens work
5. Use structured draft flows for richer task intake
If the agent needs to create or refine work from a bundle:
coop create task --from-file task-draft.ymlcat task-draft.md | coop create task --stdincoop apply draft --from-file refinement.ymlcat refinement.yml | coop apply draft --stdinCOOP treats these as structured input bundles:
- recognized fields are accepted
- canonical metadata is generated by COOP
- unknown fields are ignored with warning
That is safer than asking the agent to hand-edit .coop files.
6. Keep lifecycle changes inside COOP
Once implementation starts, use COOP lifecycle verbs instead of treating the task as external state:
coop start <id>coop review <id>coop complete <id>coop block <id>coop unblock <id>Important behavior:
completestill requiresin_reviewstartcan resume blocked work directly when allowedunblockalways returns the task totodo- multi-step recovery auto-hops create audit artifacts; direct transitions do not
Recommended day-to-day pattern
For a human + code-agent loop:
coop currentcoop nextcoop prompt <id> --format markdowncoop help-ai --initial-prompt --rigour balanced --repo C:/path/to/repo --delivery MVP --command coop.cmdThen let the agent implement against that context, and return to COOP for lifecycle updates and follow-up selection.