$npx -y skills add parcadei/Continuous-Claude-v3 --skill agentic-workflowAgentic Workflow Pattern
| 1 | # Agentic Workflow Pattern |
| 2 | |
| 3 | Standard multi-agent pipeline for implementation tasks. |
| 4 | |
| 5 | ## Architecture Principles |
| 6 | |
| 7 | - Use `run_in_background: true` for all agents to keep main context minimal |
| 8 | - Use `Task` tool (never `TaskOutput`) to avoid receiving full agent transcripts |
| 9 | - Agents write outputs to `.claude/cache/agents/<stage>/` for injection into subsequent agents |
| 10 | - Main conversation is pure orchestration — no heavy lifting, only coordination |
| 11 | |
| 12 | ## Workflow Stages |
| 13 | |
| 14 | ### 1. Research Agent |
| 15 | ``` |
| 16 | Task(subagent_type="oracle", run_in_background=true, prompt=""" |
| 17 | Query NIA Oracle (via /nia-docs skill) to verify approach and gather best practices. |
| 18 | |
| 19 | Output to: .claude/cache/agents/oracle/<task>-research.md |
| 20 | """) |
| 21 | ``` |
| 22 | - Enforce NIA as the research layer |
| 23 | - Output: Research findings |
| 24 | |
| 25 | ### 2. Planning Agent |
| 26 | ``` |
| 27 | Task(subagent_type="plan-agent", run_in_background=true, prompt=""" |
| 28 | Read: .claude/cache/agents/oracle/<task>-research.md |
| 29 | Use RP-CLI to analyze the target codebase section. |
| 30 | Generate implementation plan informed by research. |
| 31 | |
| 32 | Output to: .claude/cache/agents/plan-agent/<task>-plan.md |
| 33 | """) |
| 34 | ``` |
| 35 | - Receives: Research agent output as context |
| 36 | - Output: Implementation plan |
| 37 | |
| 38 | ### 3. Validation Agent |
| 39 | ``` |
| 40 | Task(subagent_type="validate-agent", run_in_background=true, prompt=""" |
| 41 | Read: .claude/cache/agents/plan-agent/<task>-plan.md |
| 42 | Read: .claude/cache/agents/oracle/<task>-research.md |
| 43 | Review plan against research findings and best practices. |
| 44 | |
| 45 | Output to: .claude/cache/agents/validate-agent/<task>-validated.md |
| 46 | """) |
| 47 | ``` |
| 48 | - Reviews plan against research |
| 49 | - Output: Validated plan with amendments |
| 50 | |
| 51 | ### 4. Implementation Agent |
| 52 | ``` |
| 53 | Task(subagent_type="agentica-agent", run_in_background=true, prompt=""" |
| 54 | Read: .claude/cache/agents/validate-agent/<task>-validated.md |
| 55 | Read: .claude/cache/agents/oracle/<task>-research.md |
| 56 | |
| 57 | TDD approach: Write failing tests FIRST, then implement. |
| 58 | Run tests to verify. |
| 59 | |
| 60 | Output summary to: .claude/cache/agents/implement-agent/<task>-implementation.md |
| 61 | """) |
| 62 | ``` |
| 63 | - Receives: Validated plan + research context |
| 64 | - **TDD**: Failing tests first |
| 65 | - Output: Implementation + tests |
| 66 | |
| 67 | ### 5. Review Agent |
| 68 | ``` |
| 69 | Task(subagent_type="review-agent", run_in_background=true, prompt=""" |
| 70 | Read: .claude/cache/agents/implement-agent/<task>-implementation.md |
| 71 | Read: .claude/cache/agents/validate-agent/<task>-validated.md |
| 72 | Read: .claude/cache/agents/oracle/<task>-research.md |
| 73 | |
| 74 | Cross-reference implementation against plan and research. |
| 75 | Run tests to confirm passing. |
| 76 | |
| 77 | Output to: .claude/cache/agents/review-agent/<task>-review.md |
| 78 | """) |
| 79 | ``` |
| 80 | - Cross-references all artifacts |
| 81 | - Confirms tests pass |
| 82 | - Output: Review summary |
| 83 | |
| 84 | ## Agent Progress Monitoring |
| 85 | |
| 86 | ```bash |
| 87 | # Watch for system reminders: |
| 88 | # "Agent a42a16e progress: 6 new tools used, 88914 new tokens" |
| 89 | |
| 90 | # Poll for output files: |
| 91 | find .claude/cache/agents -name "*.md" -mmin -5 |
| 92 | |
| 93 | # Check task file size growth: |
| 94 | wc -c /tmp/claude/.../tasks/<id>.output |
| 95 | ``` |
| 96 | |
| 97 | **Stuck detection:** |
| 98 | 1. Progress reminders stop arriving |
| 99 | 2. Task output file size stops growing |
| 100 | 3. Expected output file not created after reasonable time |
| 101 | |
| 102 | ## Directory Structure |
| 103 | |
| 104 | ``` |
| 105 | .claude/cache/agents/ |
| 106 | ├── oracle/ |
| 107 | │ └── <task>-research.md |
| 108 | ├── plan-agent/ |
| 109 | │ └── <task>-plan.md |
| 110 | ├── validate-agent/ |
| 111 | │ └── <task>-validated.md |
| 112 | ├── implement-agent/ |
| 113 | │ └── <task>-implementation.md |
| 114 | └── review-agent/ |
| 115 | └── <task>-review.md |
| 116 | ``` |
| 117 | |
| 118 | ## Key Rules |
| 119 | |
| 120 | 1. **Never use TaskOutput** - floods context with 70k+ token transcripts |
| 121 | 2. **Always run_in_background=true** - isolates agent context |
| 122 | 3. **File-based handoff** - each agent reads previous agent's output file |
| 123 | 4. **Poll, don't block** - check file system for outputs, don't wait |
| 124 | 5. **TDD in implementation** - failing tests first, then make them pass |
| 125 | |
| 126 | ## Source |
| 127 | - Session 2026-01-01: SDK Phase 3 implementation using this pattern |