Skip to content

Commit c377cda

Browse files
committed
planning: revise plan to create plan-builder-agent skill and delete delegate-agent
1 parent 6d89acb commit c377cda

2 files changed

Lines changed: 87 additions & 34 deletions

File tree

.claude/cat/issues/v2/v2.1/extract-shared-planning-approach/PLAN.md

Lines changed: 84 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,56 @@
22

33
## Current State
44

5-
`delegate-agent/first-use.md` and `work-with-issue-agent/first-use.md` both describe how to plan and delegate work
6-
to subagents, but they document the approach independently. This leads to duplication and drift between the two
7-
files. For example, `delegate-agent` describes a two-stage planning subagent pattern (Stage 1: approach outline,
8-
Stage 2: detailed spec) while `work-with-issue-agent` has its own delegation prompt construction guidance.
5+
Planning logic is scattered across three skills:
6+
7+
- **`add/first-use.md`** contains effort-based planning depth, PLAN.md comprehensiveness requirements, execution wave
8+
guidance, and batch execution checks — all inline within the add workflow
9+
- **`delegate-agent/first-use.md`** contains two-stage planning pattern, model selection, hook inheritance block,
10+
main agent responsibilities, execution plan format, prompt completeness checklist, and batch orchestration
11+
- **`work-with-issue-agent/first-use.md`** contains delegation prompt construction guidance
12+
13+
This duplication and scattering causes:
14+
1. Planning logic drifts between files
15+
2. No single authoritative source for how to build a comprehensive PLAN.md
16+
3. `delegate-agent` mixes planning with batch orchestration with subagent principles — all of which are covered
17+
better elsewhere or unnecessary
918

1019
## Target State
1120

12-
Common planning/delegation content is extracted into a shared file (e.g., `plugin/concepts/planning-approach.md`)
13-
that both `delegate-agent` and `work-with-issue-agent` reference. Each skill retains only its unique orchestration
14-
logic.
21+
1. A new `cat:plan-builder-agent` skill owns all PLAN.md generation logic (effort-based depth, approach research,
22+
execution plan format, comprehensiveness requirements)
23+
2. `/cat:add` invokes `plan-builder-agent` to generate initial PLAN.md
24+
3. `/cat:work` can invoke `plan-builder-agent` for mid-work PLAN.md revisions when requirements change
25+
4. `delegate-agent` is deleted entirely — its content is either moved or unnecessary:
26+
- Model selection → `subagent-delegation.md`
27+
- Hook inheritance block → deleted (rules injection handles this)
28+
- Batch orchestration → deleted (agent already knows how to spawn parallel subagents)
29+
- Planning content → `plan-builder-agent`
30+
- Subagent principles → already in `subagent-delegation.md`
31+
5. Planning-related instructions removed from `work-with-issue-agent` (only a hook for mid-work revision remains)
1532

1633
## Parent Requirements
1734

1835
None
1936

2037
## Risk Assessment
2138

22-
- **Risk Level:** MEDIUM
23-
- **Breaking Changes:** Skill file restructuring; content moves but semantics preserved
24-
- **Mitigation:** Both skills reference the shared file; verify no behavioral regression via E2E
39+
- **Risk Level:** HIGH
40+
- **Breaking Changes:** Deleting `delegate-agent` removes a user-invocable skill; `optimize-doc` references it
41+
- **Mitigation:** Update `optimize-doc` to remove delegate references; verify `/cat:work` still functions after
42+
removing planning content from `work-with-issue-agent`
2543

2644
## Files to Modify
2745

28-
- `plugin/concepts/planning-approach.md` (new) ��� shared planning/delegation approach documentation
29-
- `plugin/skills/delegate-agent/first-use.md` ��� extract common sections, reference shared file
30-
- `plugin/skills/work-with-issue-agent/first-use.md` ��� extract common sections, reference shared file
46+
- `plugin/skills/plan-builder-agent/SKILL.md` (new) — skill definition
47+
- `plugin/skills/plan-builder-agent/first-use.md` (new) — planning logic extracted from add and delegate
48+
- `plugin/skills/add/first-use.md` — replace inline planning logic with plan-builder invocation
49+
- `plugin/skills/add-agent/SKILL.md` — add Skill to allowed-tools if needed
50+
- `plugin/skills/work-with-issue-agent/first-use.md` — remove planning content, add mid-work revision hook
51+
- `plugin/skills/delegate-agent/` (delete) — entire skill directory
52+
- `plugin/concepts/subagent-delegation.md` — add model selection table from delegate-agent
53+
- `plugin/skills/optimize-doc/first-use.md` — remove `/cat:delegate-agent` references
54+
- `plugin/concepts/planning-approach.md` (delete if exists) — replaced by plan-builder-agent
3155

3256
## Pre-conditions
3357

@@ -37,28 +61,56 @@ None
3761

3862
### Wave 1
3963

40-
- Identify common content between delegate-agent and work-with-issue-agent:
41-
- Files: `plugin/skills/delegate-agent/first-use.md`, `plugin/skills/work-with-issue-agent/first-use.md`
42-
- Compare planning/delegation sections in both files
43-
- Extract shared concepts: two-stage planning pattern, delegation prompt construction, subagent responsibilities
64+
- Create `plan-builder-agent` skill:
65+
- Files: `plugin/skills/plan-builder-agent/SKILL.md`, `plugin/skills/plan-builder-agent/first-use.md`
66+
- Extract from `add/first-use.md`: effort-based planning depth, PLAN.md comprehensiveness requirements,
67+
execution wave guidance, batch execution check, PLAN.md templates
68+
- Extract from `delegate-agent/first-use.md`: two-stage planning pattern, execution plan format,
69+
prompt completeness checklist
70+
- The skill should accept an issue description and effort level, and produce a complete PLAN.md
4471

45-
- Create shared planning approach file:
46-
- Files: `plugin/concepts/planning-approach.md`
47-
- Document the canonical planning/delegation approach in one place
48-
- Include: two-stage planning (Stage 1 approach, Stage 2 spec), delegation prompt patterns,
49-
main agent vs subagent responsibilities
72+
- Move model selection to `subagent-delegation.md`:
73+
- Files: `plugin/concepts/subagent-delegation.md`
74+
- Move the model selection table and opus guidance from `delegate-agent/first-use.md`
75+
76+
- Commit: `feature: create plan-builder-agent skill with extracted planning logic`
77+
78+
### Wave 2
5079

51-
- Update both skills to reference shared file:
52-
- Files: `plugin/skills/delegate-agent/first-use.md`, `plugin/skills/work-with-issue-agent/first-use.md`
53-
- Replace duplicated content with references to `plugin/concepts/planning-approach.md`
54-
- Keep skill-specific orchestration logic in each skill
80+
- Update `add` skill to invoke plan-builder:
81+
- Files: `plugin/skills/add/first-use.md`, `plugin/skills/add-agent/SKILL.md`
82+
- Replace inline planning logic (effort-based depth, comprehensiveness, wave guidance) with
83+
invocation of `plan-builder-agent`
84+
- Keep issue creation workflow (version selection, naming, STATE.md generation)
85+
86+
- Remove planning content from `work-with-issue-agent`:
87+
- Files: `plugin/skills/work-with-issue-agent/first-use.md`
88+
- Remove "Delegation Prompt Construction" section
89+
- Add a brief mid-work revision hook: "If PLAN.md needs revision mid-work, invoke
90+
`cat:plan-builder-agent` to update it, then resume execution"
91+
92+
- Update `optimize-doc` to remove delegate references:
93+
- Files: `plugin/skills/optimize-doc/first-use.md`
94+
- Remove references to `/cat:delegate-agent` for batch operations
95+
- Simplify batch section (agent spawns parallel subagents directly)
96+
97+
- Delete `delegate-agent`:
98+
- Files: `plugin/skills/delegate-agent/` (entire directory)
99+
- Verify no other skills reference it beyond optimize-doc
100+
101+
- Delete `planning-approach.md` if it exists from prior implementation attempt:
102+
- Files: `plugin/concepts/planning-approach.md`
55103

56-
- Commit: `refactor: extract shared planning approach from delegate and work-with-issue skills`
104+
- Commit: `refactor: integrate plan-builder-agent, delete delegate-agent`
57105

58106
## Post-conditions
59107

60-
- [ ] Common planning content exists in a single shared file
61-
- [ ] Both delegate-agent and work-with-issue-agent reference the shared file
62-
- [ ] No duplication of planning approach between the two skills
63-
- [ ] No behavioral regression in either skill
64-
- [ ] E2E: Run /cat:work and verify delegation still works correctly
108+
- [ ] `plan-builder-agent` skill exists and contains all planning logic
109+
- [ ] `add` skill invokes `plan-builder-agent` instead of inline planning
110+
- [ ] `work-with-issue-agent` has no planning content except mid-work revision hook
111+
- [ ] `delegate-agent` is fully deleted
112+
- [ ] `subagent-delegation.md` contains model selection guidance
113+
- [ ] `optimize-doc` has no references to `delegate-agent`
114+
- [ ] No other files reference `delegate-agent`
115+
- [ ] E2E: Run `/cat:add` with a test issue and verify PLAN.md is generated correctly
116+
- [ ] E2E: Run `/cat:work` and verify implementation subagent receives proper PLAN.md
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# State
22

3-
- **Status:** open
3+
- **Status:** in-progress
44
- **Progress:** 0%
55
- **Dependencies:** []
6-
- **Blocks:** []
6+
- **Blocks:** []
7+
- **Target Branch:** v2.1

0 commit comments

Comments
 (0)