76 lines
2.5 KiB
Markdown
76 lines
2.5 KiB
Markdown
# Sequential Chaining Patterns
|
|
|
|
Chain agents when tasks have dependencies or require outputs from previous steps. Each agent completes fully before the next begins.
|
|
|
|
## Standard Pipelines
|
|
|
|
### Feature Implementation Pipeline
|
|
|
|
```
|
|
1. ck-research (parallel, multiple topics)
|
|
↓ reports saved to plans/reports/
|
|
2. ck-planning (reads research reports, creates plan.md)
|
|
↓ plan path passed explicitly
|
|
3. [/clear context]
|
|
↓
|
|
4. ck-cook path/to/plan.md --auto
|
|
↓ dispatches internally:
|
|
├── ck-scout
|
|
├── ck-frontend-design (if UI work)
|
|
├── ck-web-testing
|
|
├── ck-code-review
|
|
└── ck-git (on approval)
|
|
```
|
|
|
|
### Debug + Fix Pipeline
|
|
|
|
```
|
|
1. ck-debug (investigate root cause)
|
|
↓ debug report with findings
|
|
2. ck-fix (implement fix based on findings)
|
|
↓ fix applied
|
|
3. ck-web-testing (verify fix, check regressions)
|
|
↓ test report
|
|
4. ck-code-review (review changes)
|
|
↓ review complete
|
|
5. ck-git (commit and push)
|
|
```
|
|
|
|
### Research + Design Pipeline
|
|
|
|
```
|
|
1. ck-research (technology evaluation)
|
|
↓ research report
|
|
2. ck-brainstorm (evaluate approaches, choose direction)
|
|
↓ brainstorm summary with agreed solution
|
|
3. ck-planning (detailed implementation plan)
|
|
↓ plan.md created
|
|
4. ck-cook (execute plan)
|
|
```
|
|
|
|
## Rules for Sequential Chains
|
|
|
|
1. **Pass explicit paths** — never assume an agent's output location; read it from the report or plan
|
|
2. **Read before proceeding** — always read the output of step N before dispatching step N+1
|
|
3. **Complete means complete** — an agent is done when its report is written, not when it stops responding
|
|
4. **Context clearing** — after `ck-planning`, clear context (`/clear`) before invoking `ck-cook` to prevent bloated context windows during implementation
|
|
|
|
## Context Passing Pattern
|
|
|
|
When dispatching each agent, include the output of all prior steps:
|
|
|
|
```
|
|
Dispatch ck-fix with:
|
|
- Debug report: plans/reports/debugger-{pattern}.md
|
|
- Plan context: plans/{plan-dir}/
|
|
- Work context: /path/to/project
|
|
- Reports: /path/to/project/plans/reports/
|
|
```
|
|
|
|
## Chaining Anti-Patterns
|
|
|
|
- **Skipping steps**: Never skip `ck-web-testing` before `ck-code-review` — tests must pass first
|
|
- **Parallel when dependent**: If step B needs step A's output, they cannot run in parallel
|
|
- **Assuming completion**: Never proceed to next step based on "seems done" — verify report file exists
|
|
- **Ignoring failures**: If any step reports failures, fix before continuing the chain
|