@@ -818,116 +818,35 @@ Use appropriate template format:
818818- ** Blocks:** [ ]
819819```
820820
821- ** Generate PLAN.md content based on issue type :**
821+ ** Generate PLAN.md via plan-builder-agent :**
822822
823- Use appropriate template (Feature, Bugfix, or Refactor) from issue-plan.md reference.
823+ Invoke the plan-builder-agent skill to generate the PLAN.md. This centralizes all planning logic (effort-based depth,
824+ comprehensiveness requirements, sub-agent waves, templates) in one place.
824825
825- ** CRITICAL:** Follow template guidance to separate Sub-Agent Waves/Steps (actions only) from Success Criteria
826- (measurable outcomes). Do NOT include expected values like "score = 1.0" in Execution sections as this primes subagents
827- to fabricate
828- results.
826+ 1 . Write a temporary context file with the issue details:
829827
830- ** PLAN.md Comprehensiveness:** The PLAN.md must be comprehensive enough for a haiku-level
831- model to implement mechanically without making architectural decisions. Include:
832- - Exact file paths to create/modify
833- - Specific code patterns or formats to use
834- - Complete lists (all files, all references to update, all post-conditions)
835- - Research findings that inform implementation decisions
836-
837- If the execution subagent needs to make judgment calls about "how" to implement, the PLAN.md
838- is not detailed enough. The subagent should only decide "how to write the code", not "what approach to take".
839-
840- ** Effort-Based Planning Depth:**
841-
842- Use the EFFORT value set in issue_read_config to calibrate planning thoroughness.
843-
844- Apply the following depth to PLAN.md content based on ` $EFFORT ` :
845-
846- - ` low ` : Generate a concise plan. Assume the obvious approach. Skip alternative analysis. List only essential steps
847- and post-conditions.
848- - ` medium ` : Explore two or three alternative approaches before settling on one. Note key trade-offs in a brief
849- section. Execution steps should cover non-obvious edge cases.
850- - ` high ` : Perform deep research on the problem space. Document the reasoning for the chosen approach and explicitly
851- list rejected alternatives with rationale. Execution steps must cover all known edge cases and failure modes.
852-
853- ** Batch Execution Check:** When the issue involves multiple files AND a skill (e.g., compress 9 files with
854- /cat: optimize-doc-agent ):
855- 1 . Read the target skill's documentation for batch/parallel execution patterns
856- 2 . If the skill documents using ` /cat:delegate-agent ` for multiple files, write execution steps to use delegate
857- 3 . Example: Instead of "For each file: Run /cat: optimize-doc-agent ", use "/cat: delegate-agent --skill optimize-doc-agent file1.md file2.md
858- ..."
859-
860- This ensures batch tasks leverage parallel execution rather than sequential processing.
861-
862- ** Sub-Agent Waves for Parallel Execution:** When the issue has clearly independent work that can run simultaneously,
863- use ` ## Sub-Agent Waves ` with ` ### Wave N ` sections to enable parallel subagent spawning. Use sparingly — only when
864- items genuinely don't depend on each other and won't modify the same files.
865-
866- Rules for sub-agent waves:
867- - Create ` ## Sub-Agent Waves ` section (replaces ` ## Execution Steps ` )
868- - Each ` ### Wave N ` subsection contains bullet items for parallel execution
869- - Waves execute sequentially (Wave 1 completes before Wave 2 starts)
870- - All items within a wave run in parallel
871- - Waves must not modify the same files (to avoid merge conflicts)
872- - The last wave is responsible for updating STATE.md
873-
874- ** Main Agent Waves (optional):** If the issue requires skills that spawn their own subagents (e.g.,
875- ` /cat:optimize-doc ` , ` /cat:compare-docs ` , ` /cat:stakeholder-review-agent ` ), add a ` ## Main Agent Waves ` section
876- ** above** ` ## Sub-Agent Waves ` . The main agent executes these skills directly before spawning implementation
877- subagents. Each bullet is a skill invocation:
878-
879- ``` markdown
880- ## Main Agent Waves
881-
882- - /cat: optimize-doc path/to/file.md
883- ```
884-
885- Omit ` ## Main Agent Waves ` entirely when the issue has no pre-delegation skills.
886-
887- Example valid sub-agent wave structure (independent modules):
888-
889- ``` markdown
890- ## Sub-Agent Waves
891-
892- ### Wave 1
893- - Implement parser module
894- - Add parser tests
895-
896- ### Wave 2
897- - Implement formatter module
898- - Add formatter tests
899- - Run full test suite
828+ ``` bash
829+ PLAN_CONTEXT=" /tmp/plan-context-${ISSUE_NAME} .json"
830+ cat > " $PLAN_CONTEXT " << EOF
831+ {
832+ "issue_type": "${ISSUE_TYPE} ",
833+ "description": "${ISSUE_DESCRIPTION} ",
834+ "postconditions": ${POSTCONDITIONS_JSON} ,
835+ "research_findings": "${RESEARCH_FINDINGS:- } ",
836+ "impact_notes": "${IMPACT_NOTES:- } "
837+ }
838+ EOF
900839```
901840
902- Do NOT use multiple waves if items share files or if the sequential dependency is unclear. In such cases, use a single
903- ` ## Sub-Agent Waves ` / ` ### Wave 1 ` section or revert to ` ## Execution Steps ` for sequential execution.
904-
905- ** If RESEARCH_FINDINGS exists:**
906-
907- Add a Research Findings section to PLAN.md after the Goal/Problem section:
841+ 2 . Invoke plan-builder-agent:
908842
909- ``` markdown
910- ## Research Findings
911- {RESEARCH_FINDINGS}
912843```
913-
914- This section should appear before the "Parent Requirements" section in all templates.
915-
916- ** If IMPACT_NOTES is non-empty:**
917-
918- Add an Impact Notes section to PLAN.md after the Research Findings section (or after the Goal/Problem section if no
919- Research Findings):
920-
921- ``` markdown
922- ## Impact Notes
923- {IMPACT_NOTES}
844+ Skill tool:
845+ skill: "cat:plan-builder-agent"
846+ args: "${CAT_AGENT_ID} ${EFFORT} initial ${PLAN_CONTEXT}"
924847```
925848
926- This section documents the potential impact of this issue on existing features, identified during issue creation.
927-
928- ** After generating STATE.md and PLAN.md content, create the issue:**
929-
930- Call the create-issue binary with JSON input:
849+ 3 . Create the issue, passing the generated PLAN.md file path:
931850
932851``` bash
933852" ${CLAUDE_PLUGIN_ROOT} /client/bin/create-issue" --json ' {
@@ -937,7 +856,7 @@ Call the create-issue binary with JSON input:
937856 "issue_type": "{issue-type}",
938857 "dependencies": ["{dep1}", "{dep2}"],
939858 "state_content": "{full STATE.md content}",
940- "plan_content ": "{full PLAN.md content} ",
859+ "plan_file ": "' " ${PLAN_CONTEXT % .json} .plan.md " ' ",
941860 "commit_description": "{one-line description}"
942861}'
943862```
0 commit comments