<instructions Phase 0: Prerequisites Check Agent: developer | Action: Verify and install required tools Context: This phase auto-checks prerequisites. If all required components are present, it skips to Phase 1 silently. Step 1: State Check EXECUTE using Bash tool: STOP if ❌ — verify install.sh exists in scripts/. Step 2: Evaluate Results Parse the state output table. Check required components: brew , timeout , jq . - If ALL required show ✅ → Skip to Phase 1 (log: "All prerequisites present, skipping installation.") - If ANY required show ❌ missing → Continue to Step 3 Step 2.5: Load Deferred…

\\x01'\n sed \\\n -e \"s${_sep}{ADAPTATION_TIMESTAMP}${_sep}$(date -u +%Y-%m-%dT%H:%M:%SZ)${_sep}g\" \\\n -e \"s${_sep}{DETECTED_TECH}${_sep}${DETECTED_TECH:-unknown}${_sep}g\" \\\n -e \"s${_sep}{AGENT_COUNT}${_sep}${AGENT_COUNT:-0}${_sep}g\" \\\n -e \"s${_sep}{GROUP_COUNT}${_sep}${GROUP_COUNT:-3}${_sep}g\" \\\n -e \"s${_sep}{MAIN_AGENT}${_sep}${MAIN_AGENT:-reviewer}${_sep}g\" \\\n -e \"s${_sep}{TEST_AGENT}${_sep}${TEST_AGENT:-tester}${_sep}g\" \\\n -e \"s${_sep}{DB_AGENT}${_sep}${DB_AGENT:-sql_expert}${_sep}g\" \\\n -e \"s${_sep}{PROJECT_AGENTS_TABLE}${_sep}${PROJECT_AGENTS_TABLE:-| reviewer | General | All layers |}${_sep}g\" \\\n -e \"s${_sep}{TECH_SPECIFIC_CHECKS}${_sep}${TECH_SPECIFIC_CHECKS:-General code quality checks}${_sep}g\" \\\n -e \"s${_sep}{PROJECT_RULES}${_sep}${PROJECT_RULES:-Standard coding conventions}${_sep}g\" \\\n -e \"s${_sep}{CUSTOM_GROUPS}${_sep}${CUSTOM_GROUPS:-}${_sep}g\" \\\n -e \"s${_sep}{CODEBASE_BLOCKS}${_sep}${CODEBASE_BLOCKS:-src/**}${_sep}g\" \\\n -e \"s${_sep}{REVIEW_PROMPT}${_sep}${REVIEW_PROMPT:-Review for quality and correctness}${_sep}g\" \\\n \"$PLUGIN_TEMPLATES/skills/review/SKILL.md.template\" \\\n > .claude/skills/brewcode-review/SKILL.md\n _runtime_placeholders='CONFIRMED_FINDINGS_JSON|REJECTED_FINDINGS_JSON|DISCARDED_FINDINGS_JSON|FILE_LIST|CRITIC_MISSED_FINDINGS_JSON|CRITIC_CHALLENGES_JSON|CRITIC_BLIND_SPOTS|TOTAL|BLOCKERS|CRITICAL|MAJOR|N|P0_COUNT|ACCEPTED|COUNT|TIMESTAMP|NAME'\n _unresolved=$(grep -oE '\\{[A-Z_]+\\}' .claude/skills/brewcode-review/SKILL.md | sort -u | grep -vE \"^\\{(${_runtime_placeholders})\\}$\" || true)\n if [ -n \"$_unresolved\" ]; then\n echo \"⚠️ WARNING: unresolved setup-time placeholders remain in brewcode-review/SKILL.md\"\n echo \"$_unresolved\"\n fi\n echo \"✅ brewcode-review/SKILL.md generated\"\n else\n echo \"❌ Template not found: $PLUGIN_TEMPLATES/skills/review/SKILL.md.template\"\n exit 1\n fi\n\n # Copy references\n if [ -d \"$PLUGIN_TEMPLATES/skills/review/references\" ]; then\n mkdir -p .claude/skills/brewcode-review/references\n cp \"$PLUGIN_TEMPLATES/skills/review/references/\"*.md .claude/skills/brewcode-review/references/\n echo \"✅ Copied: references/ (agent-prompt.md, report-template.md)\"\n fi\n\n # Verify\n test -f .claude/skills/brewcode-review/SKILL.md && echo \"✅ Review skill created\" || echo \"❌ Review skill MISSING\"\n}\n\n# Phase 3.6: Copy config\ncopy_config() {\n echo \"=== Phase 3.6: Config ===\"\n validate_plugin\n\n TEMPLATE=\"$SETUP_TEMPLATES/brewcode.config.json.template\"\n PROJECT_CFG=\".claude/tasks/cfg/brewcode.config.json\"\n\n mkdir -p .claude/tasks/cfg\n\n if [ ! -f \"$PROJECT_CFG\" ]; then\n cp \"$TEMPLATE\" \"$PROJECT_CFG\"\n echo \"✅ Config created: $PROJECT_CFG\"\n else\n MERGED=$(jq -s '.[0] * .[1]' \"$TEMPLATE\" \"$PROJECT_CFG\" 2>/dev/null)\n if [ -n \"$MERGED\" ]; then\n MERGED_HASH=$(echo \"$MERGED\" | jq -S . | shasum -a 256 | cut -d' ' -f1)\n PROJECT_HASH=$(jq -S . \"$PROJECT_CFG\" 2>/dev/null | shasum -a 256 | cut -d' ' -f1 || true)\n if [ \"$MERGED_HASH\" != \"$PROJECT_HASH\" ]; then\n cp \"$PROJECT_CFG\" \"$PROJECT_CFG.bak\"\n echo \"$MERGED\" | jq -S . > \"$PROJECT_CFG\"\n echo \"🔄 Config merged (new keys added, user values preserved): $PROJECT_CFG\"\n echo \" Backup: $PROJECT_CFG.bak\"\n else\n echo \"⏭️ Config unchanged: $PROJECT_CFG\"\n fi\n else\n echo \"⚠️ Config merge failed (jq error), keeping existing: $PROJECT_CFG\"\n fi\n fi\n}\n\n# Collect agents for CLAUDE.md\ncollect_agents() {\n echo \"=== Collect Agents ===\"\n echo \"\"\n\n # Header\n cat \u003c\u003c 'EOF'\n## Agents — DELEGATE!\n\n> **MANAGER:** Delegate via Task tool. Never implement directly.\n\n| Name | Scope | Purpose |\n|------|-------|---------|\n| Explore | system | Find files, search code |\n| Plan | system | Design implementation |\n| general-purpose | system | Multi-step research |\nEOF\n\n # Global agents from ~/.claude/agents/\n if [ -d \"$HOME/.claude/agents\" ]; then\n for f in \"$HOME/.claude/agents\"/*.md; do\n [ -f \"$f\" ] || continue\n name=$(grep \"^name:\" \"$f\" 2>/dev/null | head -1 | sed 's/^name: *//' | tr -d '\"' | xargs || true)\n desc=$(grep \"^description:\" \"$f\" 2>/dev/null | head -1 | sed 's/^description: *//' | tr -d '\"' || true)\n # Truncate to 5 words max\n purpose=$(echo \"$desc\" | awk '{for(i=1;i\u003c=5&&i\u003c=NF;i++) printf \"%s \", $i}' | xargs)\n [ -n \"$name\" ] && echo \"| $name | global | $purpose |\"\n done\n fi\n\n # Plugin agents from PLUGIN_ROOT/agents/ (excluding internal agents)\n # Internal agents (bc-coordinator, bc-grepai-configurator, bc-knowledge-manager) are not listed\n # because they are only called by the plugin itself, not by users\n INTERNAL_AGENTS=\"bc-coordinator bc-grepai-configurator bc-knowledge-manager\"\n if [ -d \"$PLUGIN_ROOT/agents\" ]; then\n for f in \"$PLUGIN_ROOT/agents\"/*.md; do\n [ -f \"$f\" ] || continue\n name=$(grep \"^name:\" \"$f\" 2>/dev/null | head -1 | sed 's/^name: *//' | tr -d '\"' | xargs || true)\n # Skip internal agents\n echo \"$INTERNAL_AGENTS\" | grep -qw \"$name\" && continue\n desc=$(grep \"^description:\" \"$f\" 2>/dev/null | head -1 | sed 's/^description: *//' | tr -d '\"' || true)\n purpose=$(echo \"$desc\" | awk '{for(i=1;i\u003c=5&&i\u003c=NF;i++) printf \"%s \", $i}' | xargs)\n [ -n \"$name\" ] && echo \"| $name | plugin | $purpose |\"\n done\n fi\n}\n\n# Phase 4: Validation\nvalidate_setup() {\n echo \"=== Phase 4: Validation ===\"\n ERRORS=0\n\n test -f .claude/tasks/templates/PLAN.md.template && echo \"✅ PLAN template\" || { echo \"❌ PLAN template MISSING\"; ERRORS=$((ERRORS+1)); }\n test -f .claude/tasks/templates/SPEC.md.template && echo \"✅ SPEC template\" || { echo \"❌ SPEC template MISSING\"; ERRORS=$((ERRORS+1)); }\n test -f .claude/tasks/templates/KNOWLEDGE.jsonl.template && echo \"✅ KNOWLEDGE template\" || { echo \"❌ KNOWLEDGE template MISSING\"; ERRORS=$((ERRORS+1)); }\n test -f .claude/tasks/templates/phase.md.template && echo \"✅ phase template\" || { echo \"❌ phase template MISSING\"; ERRORS=$((ERRORS+1)); }\n test -f .claude/tasks/templates/phase-verify.md.template && echo \"✅ phase-verify template\" || { echo \"❌ phase-verify template MISSING\"; ERRORS=$((ERRORS+1)); }\n test -f .claude/tasks/templates/phase-fix.md.template && echo \"✅ phase-fix template\" || { echo \"❌ phase-fix template MISSING\"; ERRORS=$((ERRORS+1)); }\n test -f .claude/tasks/templates/phase-final-review.md.template && echo \"✅ phase-final-review template\" || { echo \"❌ phase-final-review template MISSING\"; ERRORS=$((ERRORS+1)); }\n test -f .claude/rules/avoid.md && echo \"✅ avoid.md rules\" || { echo \"❌ avoid.md MISSING\"; ERRORS=$((ERRORS+1)); }\n test -f .claude/rules/best-practice.md && echo \"✅ best-practice.md rules\" || { echo \"❌ best-practice.md MISSING\"; ERRORS=$((ERRORS+1)); }\n test -f .claude/tasks/cfg/brewcode.config.json && echo \"✅ Config file\" || echo \"⚠️ Config MISSING (optional)\"\n\n exit $ERRORS\n}\n\n# Main dispatch\ncase \"$MODE\" in\n scan)\n scan_project\n ;;\n structure)\n create_structure\n ;;\n sync)\n sync_templates\n ;;\n review)\n copy_review_skill\n ;;\n config)\n copy_config\n ;;\n validate)\n validate_setup\n ;;\n agents)\n collect_agents\n ;;\n all)\n scan_project\n echo \"\"\n create_structure\n echo \"\"\n sync_templates\n echo \"\"\n copy_review_skill\n echo \"\"\n copy_config\n echo \"\"\n validate_setup\n ;;\n *)\n echo \"Usage: setup.sh \u003cmode>\"\n echo \"\"\n echo \"Modes:\"\n echo \" scan - Scan project structure\"\n echo \" structure - Create directories\"\n echo \" sync - Sync templates from plugin\"\n echo \" review - Copy review skill template\"\n echo \" config - Copy config file\"\n echo \" validate - Validation checks\"\n echo \" agents - Collect agents for CLAUDE.md\"\n echo \" all - Run all phases\"\n exit 1\n ;;\nesac\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":13005,"content_sha256":"7597e82da668ec6d79277aa425a0cf4e99c80b611b678fadf9980269750fe74a"}],"content_json":{"type":"doc","content":[{"type":"paragraph","content":[{"text":"\u003cinstructions>","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 0: Prerequisites Check","type":"text"}]},{"type":"paragraph","content":[{"text":"Agent:","type":"text","marks":[{"type":"strong"}]},{"text":" developer | ","type":"text"},{"text":"Action:","type":"text","marks":[{"type":"strong"}]},{"text":" Verify and install required tools","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Context:","type":"text","marks":[{"type":"strong"}]},{"text":" This phase auto-checks prerequisites. If all required components are present, it skips to Phase 1 silently.","type":"text"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 1: State Check","type":"text"}]},{"type":"paragraph","content":[{"text":"EXECUTE","type":"text","marks":[{"type":"strong"}]},{"text":" using Bash tool:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash \"${CLAUDE_SKILL_DIR}/scripts/install.sh\" state && echo \"✅ state\" || echo \"❌ state FAILED\"","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"STOP if ❌","type":"text","marks":[{"type":"strong"}]},{"text":" — verify install.sh exists in scripts/.","type":"text"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 2: Evaluate Results","type":"text"}]},{"type":"paragraph","content":[{"text":"Parse the state output table. Check required components: ","type":"text"},{"text":"brew","type":"text","marks":[{"type":"strong"}]},{"text":", ","type":"text"},{"text":"timeout","type":"text","marks":[{"type":"strong"}]},{"text":", ","type":"text"},{"text":"jq","type":"text","marks":[{"type":"strong"}]},{"text":".","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If ALL required show ✅","type":"text","marks":[{"type":"strong"}]},{"text":" → Skip to Phase 1 (log: \"All prerequisites present, skipping installation.\")","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If ANY required show ❌ missing","type":"text","marks":[{"type":"strong"}]},{"text":" → Continue to Step 3","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 2.5: Load Deferred Tool Schemas","type":"text"}]},{"type":"paragraph","content":[{"text":"Call ","type":"text"},{"text":"ToolSearch","type":"text","marks":[{"type":"strong"}]},{"text":" with ","type":"text"},{"text":"query: \"select:AskUserQuestion\"","type":"text","marks":[{"type":"code_inline"}]},{"text":" to load its schema. This is required for Claude Code v2.1.107+ where AskUserQuestion is deferred. If ToolSearch fails or returns no result, continue — AskUserQuestion may already be loaded.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 3: Install Required Components","type":"text"}]},{"type":"paragraph","content":[{"text":"EXECUTE","type":"text","marks":[{"type":"strong"}]},{"text":" using Bash tool:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash \"${CLAUDE_SKILL_DIR}/scripts/install.sh\" check-timeout && echo \"✅ timeout-check\" || echo \"❌ timeout-check FAILED\"","type":"text"}]},{"type":"paragraph","content":[{"text":"If TIMEOUT_EXISTS=false","type":"text","marks":[{"type":"strong"}]},{"text":" → ","type":"text"},{"text":"ASK","type":"text","marks":[{"type":"strong"}]},{"text":" (AskUserQuestion):","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Question: \"The ","type":"text"},{"text":"timeout","type":"text","marks":[{"type":"code_inline"}]},{"text":" command is missing. Create symlink to ","type":"text"},{"text":"gtimeout","type":"text","marks":[{"type":"code_inline"}]},{"text":"? This is REQUIRED for brewcode.\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Options: \"Yes, create\" | \"Cancel setup\"","type":"text"}]}]}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"If cancel","type":"text","marks":[{"type":"strong"}]},{"text":" → STOP: \"Setup cancelled. timeout command is required for brewcode.\"","type":"text"}]}]},{"type":"paragraph","content":[{"text":"EXECUTE","type":"text","marks":[{"type":"strong"}]},{"text":" using Bash tool:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash \"${CLAUDE_SKILL_DIR}/scripts/install.sh\" required && echo \"✅ required\" || echo \"❌ required FAILED\"","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"STOP if ❌","type":"text","marks":[{"type":"strong"}]},{"text":" — required components must be installed before continuing.","type":"text"}]}]},{"type":"paragraph","content":[{"text":"If timeout still missing","type":"text","marks":[{"type":"strong"}]},{"text":" → ","type":"text"},{"text":"EXECUTE","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"bash \"${CLAUDE_SKILL_DIR}/scripts/install.sh\" timeout","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 4: Semantic Search (Optional)","type":"text"}]},{"type":"paragraph","content":[{"text":"If grepai not installed","type":"text","marks":[{"type":"strong"}]},{"text":" → ","type":"text"},{"text":"ASK","type":"text","marks":[{"type":"strong"}]},{"text":" (AskUserQuestion):","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Question: \"Install semantic search (grepai)? Enables AI-powered code search (~1.5GB).\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Options: \"Yes, install grepai\" | \"Skip\"","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"If Yes","type":"text","marks":[{"type":"strong"}]},{"text":" → ","type":"text"},{"text":"EXECUTE","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"bash \"${CLAUDE_SKILL_DIR}/scripts/install.sh\" grepai","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 5: Summary","type":"text"}]},{"type":"paragraph","content":[{"text":"EXECUTE","type":"text","marks":[{"type":"strong"}]},{"text":" using Bash tool:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash \"${CLAUDE_SKILL_DIR}/scripts/install.sh\" summary && echo \"✅ summary\" || echo \"❌ summary FAILED\"","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 1: Project Structure Analysis","type":"text"}]},{"type":"paragraph","content":[{"text":"Agent:","type":"text","marks":[{"type":"strong"}]},{"text":" Explore | ","type":"text"},{"text":"Action:","type":"text","marks":[{"type":"strong"}]},{"text":" Scan project and gather intelligence","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Context:","type":"text","marks":[{"type":"strong"}]},{"text":" BC_PLUGIN_ROOT is available in your context (injected by pre-task.mjs hook).","type":"text"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Scan Commands","type":"text"}]},{"type":"paragraph","content":[{"text":"EXECUTE","type":"text","marks":[{"type":"strong"}]},{"text":" using Bash tool — gather project info:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash \"scripts/setup.sh\" scan && echo \"✅ scan\" || echo \"❌ scan FAILED\"","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"STOP if ❌","type":"text","marks":[{"type":"strong"}]},{"text":" — check script exists and plugin is installed.","type":"text"}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 2: Intelligence Analysis","type":"text"}]},{"type":"paragraph","content":[{"text":"Agent:","type":"text","marks":[{"type":"strong"}]},{"text":" Plan | ","type":"text"},{"text":"Action:","type":"text","marks":[{"type":"strong"}]},{"text":" Consolidate findings and create adaptation strategy","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Create Adaptation Plan","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"# Adaptation Plan\n\n## Tech Stack\n- Language: [Java/Node.js/Python/Go/Rust]\n- Framework: [Spring Boot/Express/Django/etc]\n- Build: [Maven/Gradle/npm/pip/cargo]\n\n## Testing\n- Framework: [JUnit 5/pytest/Jest/Go testing]\n- Assertion: [AssertJ/Hamcrest/Chai/assert]\n- Mocking: [Mockito/unittest.mock/Sinon]\n- Data: [DBRider/Testcontainers/fixtures]\n\n## Database\n- Type: [PostgreSQL/MySQL/MongoDB/Redis/ClickHouse]\n- Access: [JOOQ/JPA/Hibernate/Sequelize/SQLAlchemy]\n\n## Project Agents\n- agent-name: purpose (model)\n\n## Key Patterns (from CLAUDE.md)\n- Pattern 1\n- Pattern 2\n- Pattern 3\n\n## Template Adaptations\n- Update AGENTS section with project agents\n- Add tech-specific constraints\n- Customize verification checklists\n- Add database-specific final review agent","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 3: Template Generation","type":"text"}]},{"type":"paragraph","content":[{"text":"Agent:","type":"text","marks":[{"type":"strong"}]},{"text":" developer | ","type":"text"},{"text":"Action:","type":"text","marks":[{"type":"strong"}]},{"text":" Generate adapted template at ","type":"text"},{"text":".claude/tasks/templates/PLAN.md.template","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Create Structure","type":"text"}]},{"type":"paragraph","content":[{"text":"EXECUTE","type":"text","marks":[{"type":"strong"}]},{"text":" using Bash tool:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash \"scripts/setup.sh\" structure && echo \"✅ structure\" || echo \"❌ structure FAILED\"","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"STOP if ❌","type":"text","marks":[{"type":"strong"}]},{"text":" — verify .claude/tasks directory is writable.","type":"text"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Copy/Update Templates","type":"text"}]},{"type":"paragraph","content":[{"text":"EXECUTE","type":"text","marks":[{"type":"strong"}]},{"text":" using Bash tool — sync templates from plugin (always overwrites if changed):","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash \"scripts/setup.sh\" sync && echo \"✅ sync\" || echo \"❌ sync FAILED\"","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"STOP if ❌","type":"text","marks":[{"type":"strong"}]},{"text":" — verify plugin templates exist.","type":"text"}]}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Note:","type":"text","marks":[{"type":"strong"}]},{"text":" Templates synced from plugin. Rules created once (never overwritten). Review skill adapted by AI.","type":"text"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Template Modifications","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Section","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Adaptation","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Agents","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Add project-specific agents from ","type":"text"},{"text":".claude/agents/","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Reference Examples","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Fill with project's reference files (controllers, services, tests)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase V agents","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Customize reviewer focus for detected testing/code patterns","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Final Review","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Add project agents (db_expert, etc.) if relevant tech detected","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Required Sections","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Preserve universal structure. Key sections to adapt:","type":"text"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"## Agents — Add project agents above Core Agents\n## Reference Examples — R1..RN with project's canonical files\n## Phases — Each phase has: Agent, Status, Context (C#), Refs (R#)\n## Phase NV: Verification — 2+ agents, one checks patterns compliance\n## Final Review — 3+ agents parallel\n## Context Index — C1..CN task-specific files","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 3.5: Copy and Adapt Review Skill","type":"text"}]},{"type":"paragraph","content":[{"text":"Agent:","type":"text","marks":[{"type":"strong"}]},{"text":" developer | ","type":"text"},{"text":"Action:","type":"text","marks":[{"type":"strong"}]},{"text":" Copy review skill template and adapt for project","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Create Review Skill Directory and Copy Template","type":"text"}]},{"type":"paragraph","content":[{"text":"Before running the script, export project analysis results as environment variables:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"export DETECTED_TECH=\"\u003cdetected technology stack from analysis>\"\nexport AGENT_COUNT=\"\u003cnumber of agents discovered>\"\nexport GROUP_COUNT=\"\u003cnumber of review groups>\"\nexport MAIN_AGENT=\"\u003cprimary review agent name>\"\nexport TEST_AGENT=\"\u003ctest review agent name>\"\nexport DB_AGENT=\"\u003cdatabase review agent name>\"","type":"text"}]},{"type":"paragraph","content":[{"text":"EXECUTE","type":"text","marks":[{"type":"strong"}]},{"text":" using Bash tool — create directory and copy review skill template:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash \"scripts/setup.sh\" review && echo \"✅ review\" || echo \"❌ review FAILED\"","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"STOP if ❌","type":"text","marks":[{"type":"strong"}]},{"text":" — verify review template exists in plugin.","type":"text"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Adapt Review Skill","type":"text"}]},{"type":"paragraph","content":[{"text":"Replace placeholders based on Phase 2 analysis:","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Placeholder","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Source","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Example","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"{PROJECT_AGENTS_TABLE}","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":".claude/agents/","type":"text","marks":[{"type":"code_inline"}]},{"text":" scan","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"| db_expert | PostgreSQL | DB layer |","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"{TECH_SPECIFIC_CHECKS}","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Detected tech stack","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"See Tech-Specific Checks below","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"{PROJECT_RULES}","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"CLAUDE.md patterns","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"AssertJ rules, Lombok, logging","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"{MAIN_AGENT}","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Project agent or ","type":"text"},{"text":"reviewer","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"reviewer","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"{TEST_AGENT}","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Project agent or ","type":"text"},{"text":"tester","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"tester","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"{DB_AGENT}","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Project agent or ","type":"text"},{"text":"sql_expert","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"db_expert","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"{CUSTOM_GROUPS}","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Additional review groups","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Security, API validation","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"{CODEBASE_BLOCKS}","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Detected source patterns","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"src/main/**","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"src/test/**","type":"text","marks":[{"type":"code_inline"}]}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Tech-Specific Checks Templates","type":"text"}]},{"type":"paragraph","content":[{"text":"Java/Spring:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"| Category | Checks |\n|----------|--------|\n| DI | Constructor injection, no field injection, @RequiredArgsConstructor |\n| Transactions | @Transactional scope, rollback rules, isolation levels |\n| Null-safety | Optional usage, @NonNull/@Nullable, null checks |\n| N+1 | Eager vs lazy loading, batch fetching, entity graphs |\n| Security | @PreAuthorize, input validation, SQL injection |\n| Lombok | @Value, @Builder, @Slf4j usage |","type":"text"}]},{"type":"paragraph","content":[{"text":"Node.js/TypeScript:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"| Category | Checks |\n|----------|--------|\n| Async | Promise handling, unhandled rejections, async/await |\n| Types | Strict null checks, type guards, generics |\n| Validation | Input sanitization, schema validation (Zod/Joi) |\n| Security | XSS prevention, CSRF tokens, helmet.js |\n| Imports | ESM vs CJS, barrel exports, circular deps |","type":"text"}]},{"type":"paragraph","content":[{"text":"Python:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"| Category | Checks |\n|----------|--------|\n| Type hints | Function signatures, return types, generics |\n| Exceptions | Specific exception types, context managers |\n| Async | asyncio patterns, event loop handling |\n| Security | SQL parameterization, input validation |\n| Style | PEP8, docstrings, comprehensions |","type":"text"}]},{"type":"paragraph","content":[{"text":"Go:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"| Category | Checks |\n|----------|--------|\n| Error handling | Error wrapping, sentinel errors, error types |\n| Concurrency | Goroutine leaks, channel patterns, sync primitives |\n| Memory | Slice capacity, pointer semantics, defer usage |\n| Security | SQL injection, input validation |\n| Interfaces | Small interfaces, composition |","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Validation","type":"text"}]},{"type":"paragraph","content":[{"text":"EXECUTE","type":"text","marks":[{"type":"strong"}]},{"text":" using Bash tool — verify review skill:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"test -f .claude/skills/brewcode-review/SKILL.md && echo \"✅ Review skill created\" || echo \"❌ Review skill MISSING\"\ngrep -q \"Tech-Specific\\|tech-specific\\|Category.*Checks\" .claude/skills/brewcode-review/SKILL.md && echo \"✅ Tech checks\" || echo \"❌ Tech checks MISSING\"","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"STOP if any ❌","type":"text","marks":[{"type":"strong"}]},{"text":" — review skill must be created before continuing.","type":"text"}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 3.6: Copy Configuration","type":"text"}]},{"type":"paragraph","content":[{"text":"Agent:","type":"text","marks":[{"type":"strong"}]},{"text":" developer | ","type":"text"},{"text":"Action:","type":"text","marks":[{"type":"strong"}]},{"text":" Copy configuration template for runtime settings","type":"text"}]},{"type":"paragraph","content":[{"text":"EXECUTE","type":"text","marks":[{"type":"strong"}]},{"text":" using Bash tool — copy/update config template:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash \"scripts/setup.sh\" config && echo \"✅ config\" || echo \"❌ config FAILED\"","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"STOP if ❌","type":"text","marks":[{"type":"strong"}]},{"text":" — verify .claude/tasks/cfg directory exists.","type":"text"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Configuration Options","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Setting","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Default","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Description","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"knowledge.maxEntries","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"100","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Max KNOWLEDGE.jsonl entries after compaction","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"knowledge.maxTokens","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"500","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Max tokens in ## K block injected to agents","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"knowledge.priorities","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"[\"❌\",\"✅\",\"ℹ️\"]","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Priority order for knowledge entries","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"stop.maxAttempts","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"20","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Stop attempts before escape mechanism triggers","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"agents.system","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"[...]","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"System agents (don't receive ## K injection)","type":"text"}]}]}]}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Hooks-only architecture:","type":"text","marks":[{"type":"strong"}]},{"text":" No external runtime. All context management via Claude Code hooks.","type":"text"}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 4: Validation","type":"text"}]},{"type":"paragraph","content":[{"text":"Agent:","type":"text","marks":[{"type":"strong"}]},{"text":" developer | ","type":"text"},{"text":"Action:","type":"text","marks":[{"type":"strong"}]},{"text":" Verify template structure","type":"text"}]},{"type":"paragraph","content":[{"text":"EXECUTE","type":"text","marks":[{"type":"strong"}]},{"text":" using Bash tool — ALL must pass:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash \"scripts/setup.sh\" validate && echo \"✅ validate\" || echo \"❌ validate FAILED\"","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"STOP if any ❌","type":"text","marks":[{"type":"strong"}]},{"text":" — go back to \"Copy Templates\" step and fix.","type":"text"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Validation Report","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Check","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Status","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PLAN template","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":".claude/tasks/templates/PLAN.md.template","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"SPEC template","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":".claude/tasks/templates/SPEC.md.template","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"KNOWLEDGE template","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":".claude/tasks/templates/KNOWLEDGE.jsonl.template","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Config file","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":".claude/tasks/cfg/brewcode.config.json","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Project agents","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"[N] from ","type":"text"},{"text":".claude/agents/","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Reference Examples","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"[N] canonical files populated","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Tech-specific adaptations","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Testing framework, DB patterns","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Review skill","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":".claude/skills/brewcode-review/SKILL.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 5: Update Global CLAUDE.md Agents","type":"text"}]},{"type":"paragraph","content":[{"text":"Agent:","type":"text","marks":[{"type":"strong"}]},{"text":" developer | ","type":"text"},{"text":"Action:","type":"text","marks":[{"type":"strong"}]},{"text":" Update agents section in global CLAUDE.md","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 1: Collect Agents","type":"text"}]},{"type":"paragraph","content":[{"text":"EXECUTE","type":"text","marks":[{"type":"strong"}]},{"text":" using Bash tool:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash \"scripts/setup.sh\" agents > /tmp/agents-section.md && cat /tmp/agents-section.md","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Output = Ready-to-insert content.","type":"text","marks":[{"type":"strong"}]},{"text":" Script collects system + global + plugin agents. Internal agents (bc-coordinator, bc-grepai-configurator, bc-knowledge-manager) are automatically excluded.","type":"text"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 2: Analyze Existing CLAUDE.md","type":"text"}]},{"type":"paragraph","content":[{"text":"READ","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"~/.claude/CLAUDE.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" using Read tool.","type":"text"}]},{"type":"paragraph","content":[{"text":"LLM Analysis","type":"text","marks":[{"type":"strong"}]},{"text":" — find ALL agent-related sections:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"## Agents","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"## Agent Selection","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"### Core Agents","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"### Global Utility Agents","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Any tables with columns like ","type":"text"},{"text":"Agent | Model | Purpose","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Any lists of agent names (developer, tester, reviewer, etc.)","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Identify boundaries:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Start line number of agent section(s)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"End line number (before next unrelated ## heading)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 3: Ask User","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Preflight:","type":"text","marks":[{"type":"strong"}]},{"text":" Call ToolSearch with ","type":"text"},{"text":"query: \"select:AskUserQuestion\"","type":"text","marks":[{"type":"code_inline"}]},{"text":" before proceeding.","type":"text"}]}]},{"type":"paragraph","content":[{"text":"ASK USER","type":"text","marks":[{"type":"strong"}]},{"text":" with AskUserQuestion:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Question: \"Found agent sections in ~/.claude/CLAUDE.md. Replace with optimized LLM-friendly format?\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Options:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"Yes — replace all agent sections\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"No — keep current format\"","type":"text"}]}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 4: If YES — Replace","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"CRITICAL:","type":"text","marks":[{"type":"strong"}]},{"text":" Use EXACTLY the content from ","type":"text"},{"text":"/tmp/agents-section.md","type":"text","marks":[{"type":"code_inline"}]},{"text":". DO NOT add agents manually — the script already filters internal agents. Internal agents (bc-coordinator, bc-grepai-configurator, bc-knowledge-manager) are excluded by design.","type":"text"}]}]},{"type":"paragraph","content":[{"text":"Using Edit tool:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Read","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/tmp/agents-section.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" to get the exact replacement content","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Find the ","type":"text"},{"text":"## Agents — DELEGATE!","type":"text","marks":[{"type":"code_inline"}]},{"text":" section in ","type":"text"},{"text":"~/.claude/CLAUDE.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Replace that section with the EXACT content from ","type":"text"},{"text":"/tmp/agents-section.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Preserve ","type":"text"},{"text":"### Global Skills","type":"text","marks":[{"type":"code_inline"}]},{"text":" subsection if it exists (append after agents table)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Preserve all non-agent content","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Key:","type":"text","marks":[{"type":"strong"}]},{"text":" LLM determines section boundaries, not grep. Content comes from script output.","type":"text"}]},{"type":"paragraph","content":[{"text":"\u003c/instructions>","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Output Format","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"# Template Adaptation Complete\n\n## Detection\n\n| Field | Value |\n|-------|-------|\n| Arguments | `{received args or empty}` |\n| Mode | `full` |\n\n## Tech Stack\n\n| Category | Value |\n|----------|-------|\n| Language | [detected] |\n| Framework | [detected] |\n| Testing | [framework] |\n| Database | [type/access] |\n| Project Agents | [N]: `agent1`, `agent2` |\n\n## Adaptations\n\n| Section | Changes |\n|---------|---------|\n| Agents | +[N] project agents |\n| Reference Examples | [N] canonical files |\n| Phase V | Reviewers for [tech] patterns |\n| Final Review | +[db_expert/project agents] |\n| Review Skill | Tech-specific checks, project rules |\n\n## Templates\n\n**Plan template:** `.claude/tasks/templates/PLAN.md.template`\n**Review skill:** `.claude/skills/brewcode-review/SKILL.md`\n\n## Usage\n\n/brewcode:spec \"Implement feature X\"\n/brewcode:review \"Check null safety\"","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"brewcode:setup","model":"opus","author":"@skillopedia","source":{"stars":27,"repo_name":"claude-brewcode","origin_url":"https://github.com/kochetkov-ma/claude-brewcode/blob/HEAD/brewcode/skills/setup/SKILL.md","repo_owner":"kochetkov-ma","body_sha256":"c5facf6262f045069c9732da3430e465dcdffbff87954e1ffb8864c5dcc5cb80","cluster_key":"677036539760b366c469582034ef4d0eb2f0716d97bb146566e46414120cd82f","clean_bundle":{"format":"clean-skill-bundle-v1","source":"kochetkov-ma/claude-brewcode/brewcode/skills/setup/SKILL.md","attachments":[{"id":"99189960-abd1-59ce-9bfb-7ef1446cf341","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/99189960-abd1-59ce-9bfb-7ef1446cf341/attachment.md","path":"README.md","size":4600,"sha256":"4203b91661111f78f58d8157f0834d5ab7740630143a24de5ea6aa6b8936310a","contentType":"text/markdown; charset=utf-8"},{"id":"1e8514ca-e509-5073-8069-ab0d013c741d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/1e8514ca-e509-5073-8069-ab0d013c741d/attachment.sh","path":"scripts/install.sh","size":18148,"sha256":"531cdb6a6ac577cba5d37b5c590a4b6ee4e129feae3ea6fb1aac9553cb3a6f24","contentType":"application/x-sh; charset=utf-8"},{"id":"cb90edfb-a6cc-5c5f-99cd-48f894418d3e","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/cb90edfb-a6cc-5c5f-99cd-48f894418d3e/attachment.sh","path":"scripts/setup.sh","size":13005,"sha256":"7597e82da668ec6d79277aa425a0cf4e99c80b611b678fadf9980269750fe74a","contentType":"application/x-sh; charset=utf-8"},{"id":"a030d501-8897-5007-9934-18277046876a","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/a030d501-8897-5007-9934-18277046876a/attachment.template","path":"templates/KNOWLEDGE.jsonl.template","size":1401,"sha256":"6d70c913d3bfcd41fb1c5188e06154206a88df241d22f6df3998e97b2c11307d","contentType":"text/plain; charset=utf-8"},{"id":"4a07b542-8bed-5a5d-b6ed-260174f2fa43","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4a07b542-8bed-5a5d-b6ed-260174f2fa43/attachment.template","path":"templates/PLAN.md.template","size":4874,"sha256":"fcf318450060af5ae4c145a066de275b8f4f74954f76ea237fb8d5272ed4ceae","contentType":"text/plain; charset=utf-8"},{"id":"4eeddb88-6569-5622-8d73-63925b02c845","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4eeddb88-6569-5622-8d73-63925b02c845/attachment.template","path":"templates/SPEC.md.template","size":656,"sha256":"d432e08641e4e16d640fdb876725b1c3c5ce1a68cd90e00efe644171541bd673","contentType":"text/plain; charset=utf-8"},{"id":"07f116c4-1571-5e18-8671-a642fffd4c4e","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/07f116c4-1571-5e18-8671-a642fffd4c4e/attachment.template","path":"templates/brewcode.config.json.template","size":711,"sha256":"59e052e6a469926c79cbee2ffac4636753f97102525e405ad3c5ede2a0a08f1f","contentType":"text/plain; charset=utf-8"},{"id":"e92a646e-cdf8-5ca3-8d5c-021b79f224ec","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e92a646e-cdf8-5ca3-8d5c-021b79f224ec/attachment.template","path":"templates/phase-final-review.md.template","size":916,"sha256":"e3da0554783594f1ee6ebacf9836bd6698e8d0b28aec05e1601940069d582fc1","contentType":"text/plain; charset=utf-8"},{"id":"bd105da7-e7db-5e67-814d-48c4bdb2d198","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/bd105da7-e7db-5e67-814d-48c4bdb2d198/attachment.template","path":"templates/phase-fix.md.template","size":605,"sha256":"9386597b4b5dc94a06121f0a4ad48fb63dc482db28956f381ee14a980cdfa95f","contentType":"text/plain; charset=utf-8"},{"id":"ae58583a-fc02-54b9-a6c5-ee00678798e1","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/ae58583a-fc02-54b9-a6c5-ee00678798e1/attachment.template","path":"templates/phase-verify.md.template","size":667,"sha256":"ea5dc65aef643a42a73aec37e33f3c058e80c9199610a70bb0f6bfeb8e38eb15","contentType":"text/plain; charset=utf-8"},{"id":"5121cf03-b0e4-50ee-b95c-8aa6b06aa6fc","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5121cf03-b0e4-50ee-b95c-8aa6b06aa6fc/attachment.template","path":"templates/phase.md.template","size":687,"sha256":"1ae20c03b890a393a881febdb0ee946888611b53ff0055fede0829f0fa5fae24","contentType":"text/plain; charset=utf-8"}],"bundle_sha256":"614c87b32c79880a03937522d3dc9f2a63358fbec5728a86d846c12b6517199e","attachment_count":11,"text_attachments":9,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":2,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"brewcode/skills/setup/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"web-development","category_label":"Web"},"exact_dupes_collapsed_into_this":0},"context":"fork","version":"v1","category":"web-development","import_tag":"clean-skills-v1","description":"Checks prerequisites and analyzes project structure to generate adapted templates in .claude/tasks/templates/.","allowed-tools":"Read, Write, Glob, Grep, Bash, AskUserQuestion","argument-hint":"[universal-template-path]","disable-model-invocation":true}},"renderedAt":1782986760752}

<instructions Phase 0: Prerequisites Check Agent: developer | Action: Verify and install required tools Context: This phase auto-checks prerequisites. If all required components are present, it skips to Phase 1 silently. Step 1: State Check EXECUTE using Bash tool: STOP if ❌ — verify install.sh exists in scripts/. Step 2: Evaluate Results Parse the state output table. Check required components: brew , timeout , jq . - If ALL required show ✅ → Skip to Phase 1 (log: "All prerequisites present, skipping installation.") - If ANY required show ❌ missing → Continue to Step 3 Step 2.5: Load Deferred…