{"id":"agentic-workflow","name":"agentic-workflow","summary":"エージェントワークフローパターン","body":"# Agentic Workflow Pattern\n\nStandard multi-agent pipeline for implementation tasks.\n\n## Architecture Principles\n\n- Use `run_in_background: true` for all agents to keep main context minimal\n- Use `Task` tool (never `TaskOutput`) to avoid receiving full agent transcripts\n- Agents write outputs to `.claude/cache/agents/<stage>/` for injection into subsequent agents\n- Main conversation is pure orchestration — no heavy lifting, only coordination\n\n## Workflow Stages\n\n### 1. Research Agent\n```\nTask(subagent_type=\"oracle\", run_in_background=true, prompt=\"\"\"\nQuery NIA Oracle (via /nia-docs skill) to verify approach and gather best practices.\n\nOutput to: .claude/cache/agents/oracle/<task>-research.md\n\"\"\")\n```\n- Enforce NIA as the research layer\n- Output: Research findings\n\n### 2. Planning Agent\n```\nTask(subagent_type=\"plan-agent\", run_in_background=true, prompt=\"\"\"\nRead: .claude/cache/agents/oracle/<task>-research.md\nUse RP-CLI to analyze the target codebase section.\nGenerate implementation plan informed by research.\n\nOutput to: .claude/cache/agents/plan-agent/<task>-plan.md\n\"\"\")\n```\n- Receives: Research agent output as context\n- Output: Implementation plan\n\n### 3. Validation Agent\n```\nTask(subagent_type=\"validate-agent\", run_in_background=true, prompt=\"\"\"\nRead: .claude/cache/agents/plan-agent/<task>-plan.md\nRead: .claude/cache/agents/oracle/<task>-research.md\nReview plan against research findings and best practices.\n\nOutput to: .claude/cache/agents/validate-agent/<task>-validated.md\n\"\"\")\n```\n- Reviews plan against research\n- Output: Validated plan with amendments\n\n### 4. Implementation Agent\n```\nTask(subagent_type=\"agentica-agent\", run_in_background=true, prompt=\"\"\"\nRead: .claude/cache/agents/validate-agent/<task>-validated.md\nRead: .claude/cache/agents/oracle/<task>-research.md\n\nTDD approach: Write failing tests FIRST, then implement.\nRun tests to verify.\n\nOutput summary to: .claude/cache/agents/implement-agent/<task>-implementation.md\n\"\"\")\n```\n- Receives: Validated plan + research context\n- **TDD**: Failing tests first\n- Output: Implementation + tests\n\n### 5. Review Agent\n```\nTask(subagent_type=\"review-agent\", run_in_background=true, prompt=\"\"\"\nRead: .claude/cache/agents/implement-agent/<task>-implementation.md\nRead: .claude/cache/agents/validate-agent/<task>-validated.md\nRead: .claude/cache/agents/oracle/<task>-research.md\n\nCross-reference implementation against plan and research.\nRun tests to confirm passing.\n\nOutput to: .claude/cache/agents/review-agent/<task>-review.md\n\"\"\")\n```\n- Cross-references all artifacts\n- Confirms tests pass\n- Output: Review summary\n\n## Agent Progress Monitoring\n\n```bash\n# Watch for system reminders:\n# \"Agent a42a16e progress: 6 new tools used, 88914 new tokens\"\n\n# Poll for output files:\nfind .claude/cache/agents -name \"*.md\" -mmin -5\n\n# Check task file size growth:\nwc -c /tmp/claude/.../tasks/<id>.output\n```\n\n**Stuck detection:**\n1. Progress reminders stop arriving\n2. Task output file size stops growing\n3. Expected output file not created after reasonable time\n\n## Directory Structure\n\n```\n.claude/cache/agents/\n├── oracle/\n│   └── <task>-research.md\n├── plan-agent/\n│   └── <task>-plan.md\n├── validate-agent/\n│   └── <task>-validated.md\n├── implement-agent/\n│   └── <task>-implementation.md\n└── review-agent/\n    └── <task>-review.md\n```\n\n## Key Rules\n\n1. **Never use TaskOutput** - floods context with 70k+ token transcripts\n2. **Always run_in_background=true** - isolates agent context\n3. **File-based handoff** - each agent reads previous agent's output file\n4. **Poll, don't block** - check file system for outputs, don't wait\n5. **TDD in implementation** - failing tests first, then make them pass\n\n## Source\n- Session 2026-01-01: SDK Phase 3 implementation using this pattern","author":"@parcadei","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/parcadei/Continuous-Claude-v3/tree/main/.claude/skills/agentic-workflow","license":"MIT","category":"writing","lang":"en","tokens":963,"stars":0,"calls30d":1,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[],"scannedAt":"2026-08-22","hasScripts":false,"networkEndpoints":[]}}