oh-my-customcode 0.33.0 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/README.md +22 -21
  2. package/package.json +1 -1
  3. package/templates/.claude/hooks/scripts/stuck-detector.sh +61 -1
  4. package/templates/.claude/hooks/scripts/task-outcome-recorder.sh +2 -1
  5. package/templates/.claude/rules/MUST-agent-design.md +2 -2
  6. package/templates/.claude/skills/analysis/SKILL.md +2 -2
  7. package/templates/.claude/skills/audit-agents/SKILL.md +1 -1
  8. package/templates/.claude/skills/create-agent/SKILL.md +1 -1
  9. package/templates/.claude/skills/deep-plan/SKILL.md +292 -0
  10. package/templates/.claude/skills/dev-refactor/SKILL.md +11 -0
  11. package/templates/.claude/skills/dev-review/SKILL.md +11 -0
  12. package/templates/.claude/skills/evaluator-optimizer/SKILL.md +256 -0
  13. package/templates/.claude/skills/fix-refs/SKILL.md +1 -1
  14. package/templates/.claude/skills/help/SKILL.md +2 -2
  15. package/templates/.claude/skills/lists/SKILL.md +2 -2
  16. package/templates/.claude/skills/monitoring-setup/SKILL.md +1 -1
  17. package/templates/.claude/skills/npm-audit/SKILL.md +1 -1
  18. package/templates/.claude/skills/npm-publish/SKILL.md +1 -1
  19. package/templates/.claude/skills/npm-version/SKILL.md +1 -1
  20. package/templates/.claude/skills/research/SKILL.md +13 -0
  21. package/templates/.claude/skills/sauron-watch/SKILL.md +1 -1
  22. package/templates/.claude/skills/status/SKILL.md +2 -2
  23. package/templates/.claude/skills/task-decomposition/SKILL.md +13 -0
  24. package/templates/.claude/skills/update-docs/SKILL.md +1 -1
  25. package/templates/.claude/skills/update-external/SKILL.md +1 -1
  26. package/templates/.claude/skills/worker-reviewer-pipeline/SKILL.md +10 -0
  27. package/templates/CLAUDE.md.en +22 -21
  28. package/templates/CLAUDE.md.ko +22 -21
  29. package/templates/guides/claude-code/12-workflow-patterns.md +182 -0
  30. package/templates/manifest.json +3 -3
package/README.md CHANGED
@@ -21,7 +21,7 @@ Like oh-my-zsh transformed shell customization, oh-my-customcode makes personali
21
21
 
22
22
  | Feature | Description |
23
23
  |---------|-------------|
24
- | **Batteries Included** | 44 agents, 69 skills, 25 guides, 19 rules, 2 hooks, 4 contexts, ontology graph - ready to use out of the box |
24
+ | **Batteries Included** | 44 agents, 71 skills, 25 guides, 19 rules, 1 hook, 4 contexts, ontology graph - ready to use out of the box |
25
25
  | **Sub-Agent Model** | Supports hierarchical agent orchestration with specialized roles |
26
26
  | **Dead Simple Customization** | Create a folder + markdown file = new agent or skill |
27
27
  | **Mix and Match** | Use built-in components, create your own, or combine both |
@@ -101,7 +101,7 @@ All commands are invoked inside the Claude Code conversation.
101
101
 
102
102
  | Command | Description |
103
103
  |---------|-------------|
104
- | `/analysis` | Analyze project and auto-configure agents, skills, rules |
104
+ | `/omcustom:analysis` | Analyze project and auto-configure agents, skills, rules |
105
105
  | `/research` | 10-team parallel deep analysis with cross-verification |
106
106
 
107
107
  #### Development
@@ -115,11 +115,11 @@ All commands are invoked inside the Claude Code conversation.
115
115
 
116
116
  | Command | Description |
117
117
  |---------|-------------|
118
- | `/create-agent` | Create new agent |
119
- | `/update-docs` | Sync project structure and documentation |
120
- | `/update-external` | Update agents from external sources |
121
- | `/audit-agents` | Audit agent dependencies |
122
- | `/fix-refs` | Fix broken references |
118
+ | `/omcustom:create-agent` | Create new agent |
119
+ | `/omcustom:update-docs` | Sync project structure and documentation |
120
+ | `/omcustom:update-external` | Update agents from external sources |
121
+ | `/omcustom:audit-agents` | Audit agent dependencies |
122
+ | `/omcustom:fix-refs` | Fix broken references |
123
123
 
124
124
  #### Memory
125
125
 
@@ -128,13 +128,13 @@ All commands are invoked inside the Claude Code conversation.
128
128
  | `/memory-save` | Save session context to claude-mem |
129
129
  | `/memory-recall` | Search and recall memories |
130
130
 
131
- #### DevOps & Publishing
131
+ #### DevOps & Package Management
132
132
 
133
133
  | Command | Description |
134
134
  |---------|-------------|
135
- | `/npm-publish` | Publish package to npm registry |
136
- | `/npm-version` | Semantic version management |
137
- | `/npm-audit` | Dependency security audit |
135
+ | `/omcustom:npm-publish` | Publish package to npm registry |
136
+ | `/omcustom:npm-version` | Semantic version management |
137
+ | `/omcustom:npm-audit` | Dependency security audit |
138
138
 
139
139
  #### Optimization
140
140
 
@@ -148,13 +148,14 @@ All commands are invoked inside the Claude Code conversation.
148
148
 
149
149
  | Command | Description |
150
150
  |---------|-------------|
151
- | `/sauron-watch` | Full R017 sync verification |
152
- | `/monitoring-setup` | OTel console monitoring enable/disable |
151
+ | `/omcustom:sauron-watch` | Full R017 sync verification |
152
+ | `/omcustom:monitoring-setup` | OTel console monitoring enable/disable |
153
153
  | `/codex-exec` | Execute Codex CLI prompt |
154
+ | `/deep-plan` | Research-validated planning (research → plan → verify) |
154
155
  | `/structured-dev-cycle` | 6-phase structured development cycle |
155
- | `/lists` | Show all available commands |
156
- | `/status` | System status and health checks |
157
- | `/help` | Help information |
156
+ | `/omcustom:lists` | Show all available commands |
157
+ | `/omcustom:status` | System status and health checks |
158
+ | `/omcustom:help` | Help information |
158
159
 
159
160
  ---
160
161
 
@@ -178,7 +179,7 @@ All commands are invoked inside the Claude Code conversation.
178
179
  | **Security** | 1 | sec-codeql-expert |
179
180
  | **Total** | **44** | |
180
181
 
181
- ### Skills (69)
182
+ ### Skills (71)
182
183
 
183
184
  | Category | Count | Skills |
184
185
  |----------|-------|--------|
@@ -191,7 +192,7 @@ All commands are invoked inside the Claude Code conversation.
191
192
  | **Package Management** | 3 | npm-publish, npm-version, npm-audit |
192
193
  | **Operations** | 7 | update-docs, update-external, audit-agents, fix-refs, sauron-watch, monitoring-setup, claude-code-bible |
193
194
  | **Utilities** | 5 | lists, help, status, result-aggregation, writing-clearly-and-concisely |
194
- | **Quality & Workflow** | 9 | multi-model-verification, structured-dev-cycle, model-escalation, stuck-recovery, dag-orchestration, task-decomposition, worker-reviewer-pipeline, pr-auto-improve, pipeline-guards |
195
+ | **Quality & Workflow** | 11 | multi-model-verification, structured-dev-cycle, model-escalation, stuck-recovery, dag-orchestration, task-decomposition, worker-reviewer-pipeline, pr-auto-improve, pipeline-guards, deep-plan, evaluator-optimizer |
195
196
  | **Security** | 2 | cve-triage, jinja2-prompts |
196
197
  | **Research** | 1 | research |
197
198
  | **Deploy** | 2 | vercel-deploy, codex-exec |
@@ -218,7 +219,7 @@ Comprehensive reference documentation covering:
218
219
  | **SHOULD** | 6 | Interactions, error handling (recommended) |
219
220
  | **MAY** | 1 | Optimization guidelines (optional) |
220
221
 
221
- ### Hooks (2)
222
+ ### Hooks (1)
222
223
 
223
224
  Event-driven automation for agent lifecycle events (PreToolUse, PostToolUse, etc.).
224
225
 
@@ -280,7 +281,7 @@ your-project/
280
281
  │ │ ├── be-fastapi-expert.md
281
282
  │ │ ├── mgr-creator.md
282
283
  │ │ └── ...
283
- │ ├── skills/ # Skill modules (69 directories, each with SKILL.md)
284
+ │ ├── skills/ # Skill modules (71 directories, each with SKILL.md)
284
285
  │ │ ├── go-best-practices/
285
286
  │ │ ├── react-best-practices/
286
287
  │ │ ├── secretary-routing/
@@ -292,7 +293,7 @@ your-project/
292
293
  │ │ ├── rules.yaml
293
294
  │ │ └── graphs/
294
295
  │ ├── rules/ # Behavior rules (19 total)
295
- │ ├── hooks/ # Event hooks (2 total)
296
+ │ ├── hooks/ # Event hooks (1 total)
296
297
  │ └── contexts/ # Context files (4 total)
297
298
  └── templates/
298
299
  └── guides/ # Reference docs (25 total)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-customcode",
3
- "version": "0.33.0",
3
+ "version": "0.34.0",
4
4
  "description": "Batteries-included agent harness for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {
@@ -4,7 +4,12 @@ set -euo pipefail
4
4
  # Stuck Detector Hook
5
5
  # Trigger: PostToolUse, tool matches "Edit|Write|Bash|Task|Agent"
6
6
  # Purpose: Detect repetitive failure loops and advise recovery
7
- # Protocol: stdin JSON -> process -> stdout pass-through, exit 0 always
7
+ # Protocol: stdin JSON -> process -> stdout pass-through
8
+ # - exit 0: advisory (normal cases, < HARD_BLOCK_THRESHOLD repetitions)
9
+ # - exit 1: hard block (extreme stuck loops, >= HARD_BLOCK_THRESHOLD repetitions)
10
+
11
+ # Hard block threshold: consecutive identical operations before blocking
12
+ HARD_BLOCK_THRESHOLD=5
8
13
 
9
14
  input=$(cat)
10
15
 
@@ -120,6 +125,61 @@ if [ "$stuck_detected" = true ]; then
120
125
  echo "----------------------------------------" >&2
121
126
  fi
122
127
 
128
+ # --- Hard Block Detection (extreme stuck loops) ---
129
+ # Check if the same operation has been repeated HARD_BLOCK_THRESHOLD+ times consecutively.
130
+ # This catches cases where advisory warnings are being ignored.
131
+
132
+ hard_block=false
133
+ hard_block_reason=""
134
+
135
+ if [ -f "$HISTORY_FILE" ]; then
136
+ last_n=$(tail -"$HARD_BLOCK_THRESHOLD" "$HISTORY_FILE" 2>/dev/null)
137
+ last_n_count=$(echo "$last_n" | wc -l | tr -d ' ')
138
+
139
+ if [ "$last_n_count" -ge "$HARD_BLOCK_THRESHOLD" ]; then
140
+ # Check 1: Same file edited HARD_BLOCK_THRESHOLD+ times consecutively
141
+ if [ -n "$file_path" ]; then
142
+ escaped_path=$(echo "$file_path" | sed 's/[.[\*^$()+?{|]/\\&/g')
143
+ consecutive_file=$(echo "$last_n" | grep -c "\"path\":\"${escaped_path}\"" 2>/dev/null || echo "0")
144
+ if [ "$consecutive_file" -ge "$HARD_BLOCK_THRESHOLD" ]; then
145
+ hard_block=true
146
+ hard_block_reason="Same file ($(basename "$file_path")) edited ${consecutive_file} consecutive times"
147
+ fi
148
+ fi
149
+
150
+ # Check 2: Same error repeated HARD_BLOCK_THRESHOLD+ times consecutively
151
+ if [ "$hard_block" = false ] && [ "$is_error" = "true" ] && [ -n "$error_hash" ]; then
152
+ consecutive_error=$(echo "$last_n" | grep -c "\"error_hash\":\"${error_hash}\"" 2>/dev/null || echo "0")
153
+ if [ "$consecutive_error" -ge "$HARD_BLOCK_THRESHOLD" ]; then
154
+ hard_block=true
155
+ hard_block_reason="Same error repeated ${consecutive_error} consecutive times"
156
+ fi
157
+ fi
158
+
159
+ # Check 3: Same tool+target combination HARD_BLOCK_THRESHOLD+ times consecutively
160
+ if [ "$hard_block" = false ] && [ -n "$file_path" ]; then
161
+ escaped_path=$(echo "$file_path" | sed 's/[.[\*^$()+?{|]/\\&/g')
162
+ consecutive_tool_target=$(echo "$last_n" | grep "\"tool\":\"${tool_name}\"" | grep -c "\"path\":\"${escaped_path}\"" 2>/dev/null || echo "0")
163
+ if [ "$consecutive_tool_target" -ge "$HARD_BLOCK_THRESHOLD" ]; then
164
+ hard_block=true
165
+ hard_block_reason="${tool_name} called on $(basename "$file_path") ${consecutive_tool_target} consecutive times"
166
+ fi
167
+ fi
168
+ fi
169
+ fi
170
+
171
+ if [ "$hard_block" = true ]; then
172
+ echo "" >&2
173
+ echo "=== [Stuck Detection] HARD BLOCK ===" >&2
174
+ echo " ${hard_block_reason}" >&2
175
+ echo " Threshold: ${HARD_BLOCK_THRESHOLD} consecutive identical operations" >&2
176
+ echo " Action: Blocking this tool call to break the stuck loop." >&2
177
+ echo " Recovery: Step back, re-read the error, and try a fundamentally different approach." >&2
178
+ echo "=====================================" >&2
179
+ echo "$input"
180
+ exit 1
181
+ fi
182
+
123
183
  # Pass through
124
184
  echo "$input"
125
185
  exit 0
@@ -34,9 +34,10 @@ entry=$(jq -n \
34
34
  --arg agent "$agent_type" \
35
35
  --arg model "$model" \
36
36
  --arg outcome "$outcome" \
37
+ --arg pattern "unknown" \
37
38
  --arg desc "$description" \
38
39
  --arg err "$error_summary" \
39
- '{timestamp: $ts, agent_type: $agent, model: $model, outcome: $outcome, description: $desc, error_summary: $err}')
40
+ '{timestamp: $ts, agent_type: $agent, model: $model, outcome: $outcome, pattern_used: $pattern, description: $desc, error_summary: $err}')
40
41
 
41
42
  echo "$entry" >> "$OUTCOME_FILE"
42
43
 
@@ -165,10 +165,10 @@ Use `context: fork` for skills that orchestrate multi-agent workflows. Cap at **
165
165
  | Multi-agent coordination patterns | Single-agent reference skills |
166
166
  | Task decomposition/planning | External tool integrations |
167
167
 
168
- Current skills with `context: fork` (8/10 cap):
168
+ Current skills with `context: fork` (9/10 cap):
169
169
  - secretary-routing, dev-lead-routing, de-lead-routing, qa-lead-routing
170
170
  - dag-orchestration, task-decomposition, worker-reviewer-pipeline
171
- - pipeline-guards
171
+ - pipeline-guards, deep-plan
172
172
 
173
173
  ## Naming
174
174
 
@@ -1,7 +1,7 @@
1
1
  ---
2
- name: analysis
2
+ name: omcustom:analysis
3
3
  description: Analyze project and auto-configure agents, skills, rules, and guides
4
- scope: core
4
+ scope: harness
5
5
  argument-hint: "[--dry-run] [--verbose]"
6
6
  ---
7
7
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: audit-agents
2
+ name: omcustom:audit-agents
3
3
  description: Audit agent dependencies and references
4
4
  scope: harness
5
5
  argument-hint: "[agent-name] [--all] [--fix]"
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: create-agent
2
+ name: omcustom:create-agent
3
3
  description: Create a new agent with complete structure
4
4
  scope: harness
5
5
  argument-hint: "<name> --type <type>"
@@ -0,0 +1,292 @@
1
+ ---
2
+ name: deep-plan
3
+ description: Research-validated planning — research → plan → verify cycle for high-confidence implementation plans
4
+ scope: core
5
+ version: 1.0.0
6
+ user-invocable: true
7
+ argument-hint: "<topic-or-issue>"
8
+ context: fork
9
+ ---
10
+
11
+ # Deep Plan Skill
12
+
13
+ Research-validated planning that eliminates the gap between research assumptions and actual code. Orchestrates a 3-phase cycle: Discovery Research → Reality-Check Planning → Plan Verification.
14
+
15
+ **Orchestrator-only** — only the main conversation uses this skill (R010). All phases execute as subagents.
16
+
17
+ ## Usage
18
+
19
+ ```
20
+ /deep-plan <topic-or-issue>
21
+ /deep-plan "implement caching layer for API responses"
22
+ /deep-plan #325 new authentication system
23
+ /deep-plan Rust async runtime migration
24
+ ```
25
+
26
+ ## Problem Solved
27
+
28
+ Research-only analysis (like `/research`) produces findings based on assumptions about the codebase. These assumptions often diverge from reality:
29
+
30
+ | Assumption | Reality | Impact |
31
+ |------------|---------|--------|
32
+ | "Feature X is missing" | Already implemented | Wasted effort on duplicate work |
33
+ | "Pattern Y is needed" | Partially exists | Over-engineering existing code |
34
+ | "Library Z is required" | Already a dependency | Unnecessary integration effort |
35
+
36
+ `/deep-plan` solves this by cross-referencing research findings against actual code before committing to a plan.
37
+
38
+ ## Architecture — 3 Phases
39
+
40
+ ### Phase 1: Discovery Research
41
+
42
+ Invoke the `/research` skill internally for comprehensive topic analysis.
43
+
44
+ ```
45
+ Phase 1: Discovery Research
46
+ ├── Skill(research, args="<topic>")
47
+ ├── 10-team parallel analysis (3 batches × 4/4/2)
48
+ ├── Cross-verification loop (opus + codex)
49
+ ├── ADOPT / ADAPT / AVOID taxonomy
50
+ └── Output: research report (artifact)
51
+ ```
52
+
53
+ **Execution**: Delegates to `/research` skill via `Skill(research, args="<topic>")`. The orchestrator waits for completion before proceeding to Phase 2.
54
+
55
+ **Output**: Full research report with ADOPT/ADAPT/AVOID taxonomy.
56
+
57
+ ### Phase 2: Reality-Check Planning
58
+
59
+ Ground-truth the research findings against the actual codebase.
60
+
61
+ ```
62
+ Phase 2: Reality-Check Planning
63
+ ├── EnterPlanMode
64
+ ├── Explore agents (up to 3 parallel)
65
+ │ ├── Explore 1: Verify ADOPT items exist/don't exist
66
+ │ ├── Explore 2: Check ADAPT items for current state
67
+ │ └── Explore 3: Validate AVOID alternatives
68
+ ├── Gap analysis table
69
+ ├── Refined plan (real gaps only)
70
+ └── ExitPlanMode → user approval
71
+ ```
72
+
73
+ **Steps**:
74
+
75
+ 1. **Enter Plan Mode**: `EnterPlanMode` to activate planning context
76
+ 2. **Codebase Exploration**: Spawn up to 3 Explore agents in parallel to verify research assumptions:
77
+ - Each ADOPT item: Does it already exist? Partially implemented?
78
+ - Each ADAPT item: What is the current state to adapt from?
79
+ - Each AVOID item: Are the alternatives already available?
80
+ 3. **Gap Analysis**: Build a reconciliation table:
81
+
82
+ ```
83
+ | Research Finding | Actual Code State | Gap Type | Action |
84
+ |-----------------|-------------------|----------|--------|
85
+ | "No caching" | Redis client exists | Overestimate | Remove from plan |
86
+ | "Need auth middleware" | No auth layer | Real gap | Keep in plan |
87
+ | "Migrate to v3" | Already on v3.1 | Overestimate | Remove from plan |
88
+ | "Add rate limiting" | Basic limiter exists | Partial gap | Adapt existing |
89
+ ```
90
+
91
+ 4. **Refined Plan**: Write implementation plan containing ONLY real gaps:
92
+ - Remove overestimates (already implemented)
93
+ - Adjust partial gaps (adapt, don't rebuild)
94
+ - Prioritize real gaps by impact
95
+ 5. **User Approval**: `ExitPlanMode` presents the refined plan for user review
96
+
97
+ ### Phase 3: Plan Verification Research
98
+
99
+ Validate the refined plan with focused research before implementation begins.
100
+
101
+ ```
102
+ Phase 3: Plan Verification Research
103
+ ├── 3-team focused verification
104
+ │ ├── T1: Technical feasibility
105
+ │ ├── T2: Conflict/duplication check
106
+ │ └── T3: Test strategy & risk
107
+ ├── Verdict: PASS or REVISE
108
+ ├── PASS → implementation advisory
109
+ └── REVISE → return to Phase 2
110
+ ```
111
+
112
+ **Teams** (3 parallel, NOT full 10-team):
113
+
114
+ | Team | Focus | Verifies |
115
+ |------|-------|----------|
116
+ | T1 | Technical feasibility | Can the plan be implemented with current stack/deps? |
117
+ | T2 | Conflict & duplication | Does the plan conflict with in-flight work or duplicate existing code? |
118
+ | T3 | Test strategy & risk | Is the plan testable? What are the failure modes? |
119
+
120
+ **Invocation**: Phase 3 teams are spawned directly as parallel agents (NOT via `Skill(research)`). The orchestrator creates 3 focused agents, each with a specific verification mandate derived from the Phase 2 plan.
121
+
122
+ **Model selection**: sonnet for teams, opus for synthesis.
123
+
124
+ **Verdict**:
125
+ - **PASS**: Plan is verified. Display implementation advisory.
126
+ - **REVISE**: Issues found. Return to Phase 2 with feedback for plan refinement.
127
+ - **REVISE limit**: After 2 REVISE cycles, escalate to user for manual judgment.
128
+
129
+ ## Workflow Diagram
130
+
131
+ ```
132
+ User: /deep-plan "topic"
133
+
134
+ ├─ Phase 1: Discovery Research
135
+ │ ├─ Skill(research, args="topic")
136
+ │ ├─ 10-team analysis → ADOPT/ADAPT/AVOID
137
+ │ └─ Output: research artifact
138
+
139
+ ├─ Phase 2: Reality-Check Planning
140
+ │ ├─ EnterPlanMode
141
+ │ ├─ Explore agents (up to 3 parallel)
142
+ │ ├─ Gap analysis: research vs actual code
143
+ │ ├─ Refined plan (real gaps only)
144
+ │ └─ ExitPlanMode → user approval
145
+
146
+ └─ Phase 3: Plan Verification
147
+ ├─ 3-team focused research
148
+ ├─ Verdict: PASS or REVISE
149
+ ├─ PASS → implementation advisory
150
+ └─ REVISE → loop back to Phase 2 (max 2 cycles)
151
+ ```
152
+
153
+ ## Differentiation
154
+
155
+ | Skill | Scope | Code Verification | Phases |
156
+ |-------|-------|-------------------|--------|
157
+ | `/research` | Analysis only | None — assumption-based | 1 |
158
+ | Plan mode | Planning only | Yes — code exploration | 1 |
159
+ | `/structured-dev-cycle` | Full implementation | Yes — stage-by-stage | 6 |
160
+ | **`/deep-plan`** | **Analysis + Planning + Verification** | **3-pass cross-verification** | **3** |
161
+
162
+ `/deep-plan` fills the gap between research (which lacks code grounding) and implementation (which lacks upfront analysis). It produces a **verified plan** ready for execution.
163
+
164
+ ## Display Format
165
+
166
+ Before execution:
167
+ ```
168
+ [Deep Plan] {topic}
169
+ ├── Phase 1: Discovery Research (10 teams, 3 batches)
170
+ ├── Phase 2: Reality-Check Planning (up to 3 Explore agents)
171
+ └── Phase 3: Plan Verification (3 focused teams)
172
+
173
+ Estimated phases: 3 | Models: sonnet → opus
174
+ Execute? [Y/n]
175
+ ```
176
+
177
+ Phase transitions:
178
+ ```
179
+ [Deep Plan] Phase 1/3 — Discovery Research
180
+ ├── Research skill active...
181
+ └── Awaiting 10-team results
182
+
183
+ [Deep Plan] Phase 2/3 — Reality-Check Planning
184
+ ├── Gap analysis: 6 ADOPT items → 2 real gaps, 4 overestimates
185
+ └── Refined plan: 5 action items (down from 12)
186
+
187
+ [Deep Plan] Phase 3/3 — Plan Verification
188
+ ├── T1 (feasibility): ✓ PASS
189
+ ├── T2 (conflicts): ✓ PASS
190
+ ├── T3 (test/risk): ✓ PASS
191
+ └── Verdict: PASS — ready for implementation
192
+ ```
193
+
194
+ ## Post-Completion Advisory
195
+
196
+ After PASS verdict:
197
+ ```
198
+ [Advisory] Verified plan ready for implementation.
199
+ ├── For complex implementations (10+ files): /structured-dev-cycle
200
+ ├── For parallel task execution: superpowers:subagent-driven-development
201
+ └── For simple tasks (< 3 files): proceed directly
202
+ ```
203
+
204
+ ## Execution Rules
205
+
206
+ | Rule | Detail |
207
+ |------|--------|
208
+ | Phase 1 | Full `/research` skill invocation (10 teams) |
209
+ | Phase 2 | Max 3 parallel Explore agents (R009) |
210
+ | Phase 3 | Max 3 parallel verification teams (R009) |
211
+ | Orchestrator only | Main conversation manages all phases (R010) |
212
+ | Intent display | Show phase plan before execution (R015) |
213
+ | Ecomode | Auto-activate for team result aggregation (R013) |
214
+ | REVISE limit | Max 2 cycles before user escalation |
215
+
216
+ ## Agent Teams (R018)
217
+
218
+ When Agent Teams is enabled, Phase 1 and Phase 3 parallel teams SHOULD use Agent Teams instead of individual Agent tool calls:
219
+
220
+ | Phase | Without Agent Teams | With Agent Teams |
221
+ |-------|--------------------|--------------------|
222
+ | Phase 1 | Delegates to `/research` (handles internally) | Delegates to `/research` (handles internally) |
223
+ | Phase 2 | Up to 3 Explore agents via Agent tool | Up to 3 Explore agents via Agent tool (below threshold) |
224
+ | Phase 3 | 3 agents via Agent tool | 3 agents — at threshold, prefer Agent Teams for coordination |
225
+
226
+ Phase 1 delegation to `/research` means Agent Teams decisions are handled by the research skill itself. Phase 3's 3-team verification is at the Agent Teams threshold (3+ agents) and benefits from peer messaging for cross-verification.
227
+
228
+ ## Model Selection
229
+
230
+ | Phase | Component | Model | Rationale |
231
+ |-------|-----------|-------|-----------|
232
+ | Phase 1 | Research teams | sonnet | Delegated to /research skill |
233
+ | Phase 1 | Verification | opus | Delegated to /research skill |
234
+ | Phase 2 | Explore agents | haiku | Fast codebase search |
235
+ | Phase 2 | Gap analysis | opus | Complex reconciliation reasoning |
236
+ | Phase 3 | Verification teams | sonnet | Balanced analysis |
237
+ | Phase 3 | Synthesis/verdict | opus | Final judgment |
238
+
239
+ ## Cost Estimate
240
+
241
+ | Phase | Approximate Cost | Driver |
242
+ |-------|-----------------|--------|
243
+ | Phase 1 | High | Full 10-team `/research` invocation |
244
+ | Phase 2 | Low-Medium | Up to 3 Explore agents (haiku) + 1 opus synthesis |
245
+ | Phase 3 | Medium | 3 sonnet verification teams + 1 opus synthesis |
246
+ | **Total** | **High** | Dominated by Phase 1 research cost |
247
+
248
+ `/deep-plan` is designed for high-stakes decisions where plan quality justifies the cost. For quick planning, use `EnterPlanMode` directly.
249
+
250
+ ## Integration
251
+
252
+ | Component | Integration |
253
+ |-----------|-------------|
254
+ | `/research` | Phase 1 full invocation + Phase 3 reduced invocation pattern |
255
+ | EnterPlanMode/ExitPlanMode | Phase 2 plan creation and user approval |
256
+ | Explore agents | Phase 2 codebase verification (up to 3 parallel) |
257
+ | R009 | Phase 1 (10 teams batched), Phase 2 (3 Explore), Phase 3 (3 teams) |
258
+ | R010 | Orchestrator manages all 3 phases; teams are subagents |
259
+ | R013 | Ecomode for team result aggregation |
260
+ | R015 | Phase transition intent display |
261
+ | result-aggregation | Phase 1 and 3 result formatting |
262
+ | superpowers:subagent-driven-development | Post-PASS implementation advisory (external plugin) |
263
+
264
+ ## Fallback Behavior
265
+
266
+ | Scenario | Fallback |
267
+ |----------|----------|
268
+ | Phase 1 `/research` fails | Manual analysis, then proceed to Phase 2 |
269
+ | Phase 2 EnterPlanMode unavailable | Perform analysis without plan mode context |
270
+ | Phase 3 REVISE ≥ 2 times | Escalate to user for manual judgment |
271
+ | Explore agent failure | Reduce parallel count, retry with remaining |
272
+ | Partial team failure | Synthesize from available results, note gaps |
273
+
274
+ ## Artifact Persistence
275
+
276
+ Phase 1 research artifact is persisted by the `/research` skill.
277
+
278
+ Phase 3 verification report is persisted by the final synthesis agent:
279
+ ```
280
+ .claude/outputs/sessions/{YYYY-MM-DD}/deep-plan-{HHmmss}.md
281
+ ```
282
+
283
+ With metadata header:
284
+ ```markdown
285
+ ---
286
+ skill: deep-plan
287
+ date: {ISO-8601 with timezone}
288
+ query: "{original user query}"
289
+ phases_completed: 3
290
+ verdict: PASS|REVISE
291
+ ---
292
+ ```
@@ -9,6 +9,17 @@ argument-hint: "<file-or-directory> [--lang <language>]"
9
9
 
10
10
  Refactor code for better structure, naming, and patterns using language-specific expert agents.
11
11
 
12
+ ## When NOT to Use
13
+
14
+ | Scenario | Better Alternative |
15
+ |----------|--------------------|
16
+ | Renaming only (no structural change) | IDE rename refactoring or `sed` |
17
+ | Formatting cleanup | Run formatter (`prettier`, `gofmt`, `black`) |
18
+ | No test coverage for target code | Write tests first (`/structured-dev-cycle`) |
19
+ | Moving files between directories | `git mv` via mgr-gitnerd |
20
+
21
+ **Pre-execution check**: Verify test coverage exists for the refactoring target. Refactoring without tests risks silent regressions.
22
+
12
23
  ## Parameters
13
24
 
14
25
  | Name | Type | Required | Description |
@@ -9,6 +9,17 @@ argument-hint: "<file-or-directory> [--lang <language>]"
9
9
 
10
10
  Review code for best practices using language-specific expert agents.
11
11
 
12
+ ## When NOT to Use
13
+
14
+ | Scenario | Better Alternative |
15
+ |----------|--------------------|
16
+ | Formatting/style issues only | Run linter or formatter directly (`prettier`, `gofmt`, `black`) |
17
+ | Single syntax error | IDE/LSP diagnostics |
18
+ | Auto-generated code | Skip — generated code follows its own conventions |
19
+ | Pre-commit quick check | Git hooks with linter integration |
20
+
21
+ **Pre-execution check**: If the issue is purely formatting, run the appropriate formatter first.
22
+
12
23
  ## Parameters
13
24
 
14
25
  | Name | Type | Required | Description |