Skip to content
Kitsy Docs Open COOP

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:

Terminal window
coop current
coop next
coop 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:

Terminal window
coop help-ai --initial-prompt --rigour balanced --repo C:/path/to/repo --delivery MVP --command coop.cmd

Use --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:

Terminal window
coop prompt <id>
coop prompt <id> --format markdown
coop prompt <id> --format json
coop prompt <id> --save docs/agent-prompts/<id>.md

coop 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:

Terminal window
coop help-ai
coop help-ai --selection --format markdown
coop help-ai --state-transitions --format markdown
coop help-ai --artifacts --format markdown
coop help-ai --post-execution --format markdown
coop help-ai --naming --format markdown

Use 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:

Terminal window
coop create task --from-file task-draft.yml
cat task-draft.md | coop create task --stdin
coop apply draft --from-file refinement.yml
cat refinement.yml | coop apply draft --stdin

COOP 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:

Terminal window
coop start <id>
coop review <id>
coop complete <id>
coop block <id>
coop unblock <id>

Important behavior:

  • complete still requires in_review
  • start can resume blocked work directly when allowed
  • unblock always returns the task to todo
  • multi-step recovery auto-hops create audit artifacts; direct transitions do not

For a human + code-agent loop:

Terminal window
coop current
coop next
coop prompt <id> --format markdown
coop help-ai --initial-prompt --rigour balanced --repo C:/path/to/repo --delivery MVP --command coop.cmd

Then let the agent implement against that context, and return to COOP for lifecycle updates and follow-up selection.