@ia-ccun/code-agent-cli 0.0.15 → 0.0.16

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 (75) hide show
  1. package/bin/cli.js +153 -84
  2. package/config/agent/extensions/working-msg.ts +33 -8
  3. package/config/agent/models.json +41 -11
  4. package/config/agent/prompts/code-simplifier.md +52 -0
  5. package/config/agent/skills/brainstorming/SKILL.md +165 -0
  6. package/config/agent/skills/brainstorming/scripts/frame-template.html +214 -0
  7. package/config/agent/skills/brainstorming/scripts/helper.js +88 -0
  8. package/config/agent/skills/brainstorming/scripts/server.cjs +338 -0
  9. package/config/agent/skills/brainstorming/scripts/start-server.sh +153 -0
  10. package/config/agent/skills/brainstorming/scripts/stop-server.sh +55 -0
  11. package/config/agent/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  12. package/config/agent/skills/brainstorming/visual-companion.md +286 -0
  13. package/config/agent/skills/dispatching-parallel-agents/SKILL.md +183 -0
  14. package/config/agent/skills/executing-plans/SKILL.md +71 -0
  15. package/config/agent/skills/finishing-a-development-branch/SKILL.md +201 -0
  16. package/config/agent/skills/owasp-security/SKILL.md +537 -0
  17. package/config/agent/skills/receiving-code-review/SKILL.md +214 -0
  18. package/config/agent/skills/requesting-code-review/SKILL.md +106 -0
  19. package/config/agent/skills/requesting-code-review/code-reviewer.md +146 -0
  20. package/config/agent/skills/skill-creator/SKILL.md +337 -213
  21. package/config/agent/skills/skill-creator/agents/analyzer.md +274 -0
  22. package/config/agent/skills/skill-creator/agents/comparator.md +202 -0
  23. package/config/agent/skills/skill-creator/agents/grader.md +223 -0
  24. package/config/agent/skills/skill-creator/assets/eval_review.html +146 -0
  25. package/config/agent/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  26. package/config/agent/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  27. package/config/agent/skills/skill-creator/references/schemas.md +430 -0
  28. package/config/agent/skills/skill-creator/scripts/__init__.py +0 -0
  29. package/config/agent/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  30. package/config/agent/skills/skill-creator/scripts/generate_report.py +326 -0
  31. package/config/agent/skills/skill-creator/scripts/improve_description.py +248 -0
  32. package/config/agent/skills/skill-creator/scripts/package_skill.py +33 -7
  33. package/config/agent/skills/skill-creator/scripts/quick_validate.py +11 -3
  34. package/config/agent/skills/skill-creator/scripts/run_eval.py +310 -0
  35. package/config/agent/skills/skill-creator/scripts/run_loop.py +332 -0
  36. package/config/agent/skills/skill-creator/scripts/utils.py +47 -0
  37. package/config/agent/skills/subagent-driven-development/SKILL.md +278 -0
  38. package/config/agent/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
  39. package/config/agent/skills/subagent-driven-development/implementer-prompt.md +113 -0
  40. package/config/agent/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  41. package/config/agent/skills/systematic-debugging/CREATION-LOG.md +119 -0
  42. package/config/agent/skills/systematic-debugging/SKILL.md +297 -0
  43. package/config/agent/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  44. package/config/agent/skills/systematic-debugging/condition-based-waiting.md +115 -0
  45. package/config/agent/skills/systematic-debugging/defense-in-depth.md +122 -0
  46. package/config/agent/skills/systematic-debugging/find-polluter.sh +63 -0
  47. package/config/agent/skills/systematic-debugging/root-cause-tracing.md +169 -0
  48. package/config/agent/skills/systematic-debugging/test-academic.md +14 -0
  49. package/config/agent/skills/systematic-debugging/test-pressure-1.md +58 -0
  50. package/config/agent/skills/systematic-debugging/test-pressure-2.md +68 -0
  51. package/config/agent/skills/systematic-debugging/test-pressure-3.md +69 -0
  52. package/config/agent/skills/test-driven-development/SKILL.md +372 -0
  53. package/config/agent/skills/test-driven-development/testing-anti-patterns.md +299 -0
  54. package/config/agent/skills/using-git-worktrees/SKILL.md +219 -0
  55. package/config/agent/skills/using-superpowers/SKILL.md +116 -0
  56. package/config/agent/skills/using-superpowers/references/codex-tools.md +25 -0
  57. package/config/agent/skills/using-superpowers/references/gemini-tools.md +33 -0
  58. package/config/agent/skills/verification-before-completion/SKILL.md +140 -0
  59. package/config/agent/skills/writing-plans/SKILL.md +146 -0
  60. package/config/agent/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  61. package/config/agent/skills/writing-skills/SKILL.md +667 -0
  62. package/config/agent/skills/writing-skills/anthropic-best-practices.md +1150 -0
  63. package/config/agent/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  64. package/config/agent/skills/writing-skills/graphviz-conventions.dot +172 -0
  65. package/config/agent/skills/writing-skills/persuasion-principles.md +187 -0
  66. package/config/agent/skills/writing-skills/render-graphs.js +168 -0
  67. package/config/agent/skills/writing-skills/testing-skills-with-subagents.md +384 -0
  68. package/package.json +14 -7
  69. package/scripts/postinstall.js +4 -18
  70. package/config/agent/skills/github/SKILL.md +0 -47
  71. package/config/agent/skills/owasp/SKILL.md +0 -169
  72. package/config/agent/skills/pua/SKILL.md +0 -364
  73. package/config/agent/skills/skill-creator/references/output-patterns.md +0 -82
  74. package/config/agent/skills/skill-creator/references/workflows.md +0 -28
  75. package/config/agent/skills/skill-creator/scripts/init_skill.py +0 -303
@@ -0,0 +1,219 @@
1
+ ---
2
+ name: using-git-worktrees
3
+ author: xujianjiang
4
+ description: Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
5
+ ---
6
+
7
+ # Using Git Worktrees
8
+
9
+ ## Overview
10
+
11
+ Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.
12
+
13
+ **Core principle:** Systematic directory selection + safety verification = reliable isolation.
14
+
15
+ **Announce at start:** "I'm using the using-git-worktrees skill to set up an isolated workspace."
16
+
17
+ ## Directory Selection Process
18
+
19
+ Follow this priority order:
20
+
21
+ ### 1. Check Existing Directories
22
+
23
+ ```bash
24
+ # Check in priority order
25
+ ls -d .worktrees 2>/dev/null # Preferred (hidden)
26
+ ls -d worktrees 2>/dev/null # Alternative
27
+ ```
28
+
29
+ **If found:** Use that directory. If both exist, `.worktrees` wins.
30
+
31
+ ### 2. Check CLAUDE.md
32
+
33
+ ```bash
34
+ grep -i "worktree.*director" CLAUDE.md 2>/dev/null
35
+ ```
36
+
37
+ **If preference specified:** Use it without asking.
38
+
39
+ ### 3. Ask User
40
+
41
+ If no directory exists and no CLAUDE.md preference:
42
+
43
+ ```
44
+ No worktree directory found. Where should I create worktrees?
45
+
46
+ 1. .worktrees/ (project-local, hidden)
47
+ 2. ~/.config/superpowers/worktrees/<project-name>/ (global location)
48
+
49
+ Which would you prefer?
50
+ ```
51
+
52
+ ## Safety Verification
53
+
54
+ ### For Project-Local Directories (.worktrees or worktrees)
55
+
56
+ **MUST verify directory is ignored before creating worktree:**
57
+
58
+ ```bash
59
+ # Check if directory is ignored (respects local, global, and system gitignore)
60
+ git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null
61
+ ```
62
+
63
+ **If NOT ignored:**
64
+
65
+ Per Jesse's rule "Fix broken things immediately":
66
+ 1. Add appropriate line to .gitignore
67
+ 2. Commit the change
68
+ 3. Proceed with worktree creation
69
+
70
+ **Why critical:** Prevents accidentally committing worktree contents to repository.
71
+
72
+ ### For Global Directory (~/.config/superpowers/worktrees)
73
+
74
+ No .gitignore verification needed - outside project entirely.
75
+
76
+ ## Creation Steps
77
+
78
+ ### 1. Detect Project Name
79
+
80
+ ```bash
81
+ project=$(basename "$(git rev-parse --show-toplevel)")
82
+ ```
83
+
84
+ ### 2. Create Worktree
85
+
86
+ ```bash
87
+ # Determine full path
88
+ case $LOCATION in
89
+ .worktrees|worktrees)
90
+ path="$LOCATION/$BRANCH_NAME"
91
+ ;;
92
+ ~/.config/superpowers/worktrees/*)
93
+ path="~/.config/superpowers/worktrees/$project/$BRANCH_NAME"
94
+ ;;
95
+ esac
96
+
97
+ # Create worktree with new branch
98
+ git worktree add "$path" -b "$BRANCH_NAME"
99
+ cd "$path"
100
+ ```
101
+
102
+ ### 3. Run Project Setup
103
+
104
+ Auto-detect and run appropriate setup:
105
+
106
+ ```bash
107
+ # Node.js
108
+ if [ -f package.json ]; then npm install; fi
109
+
110
+ # Rust
111
+ if [ -f Cargo.toml ]; then cargo build; fi
112
+
113
+ # Python
114
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
115
+ if [ -f pyproject.toml ]; then poetry install; fi
116
+
117
+ # Go
118
+ if [ -f go.mod ]; then go mod download; fi
119
+ ```
120
+
121
+ ### 4. Verify Clean Baseline
122
+
123
+ Run tests to ensure worktree starts clean:
124
+
125
+ ```bash
126
+ # Examples - use project-appropriate command
127
+ npm test
128
+ cargo test
129
+ pytest
130
+ go test ./...
131
+ ```
132
+
133
+ **If tests fail:** Report failures, ask whether to proceed or investigate.
134
+
135
+ **If tests pass:** Report ready.
136
+
137
+ ### 5. Report Location
138
+
139
+ ```
140
+ Worktree ready at <full-path>
141
+ Tests passing (<N> tests, 0 failures)
142
+ Ready to implement <feature-name>
143
+ ```
144
+
145
+ ## Quick Reference
146
+
147
+ | Situation | Action |
148
+ |-----------|--------|
149
+ | `.worktrees/` exists | Use it (verify ignored) |
150
+ | `worktrees/` exists | Use it (verify ignored) |
151
+ | Both exist | Use `.worktrees/` |
152
+ | Neither exists | Check CLAUDE.md → Ask user |
153
+ | Directory not ignored | Add to .gitignore + commit |
154
+ | Tests fail during baseline | Report failures + ask |
155
+ | No package.json/Cargo.toml | Skip dependency install |
156
+
157
+ ## Common Mistakes
158
+
159
+ ### Skipping ignore verification
160
+
161
+ - **Problem:** Worktree contents get tracked, pollute git status
162
+ - **Fix:** Always use `git check-ignore` before creating project-local worktree
163
+
164
+ ### Assuming directory location
165
+
166
+ - **Problem:** Creates inconsistency, violates project conventions
167
+ - **Fix:** Follow priority: existing > CLAUDE.md > ask
168
+
169
+ ### Proceeding with failing tests
170
+
171
+ - **Problem:** Can't distinguish new bugs from pre-existing issues
172
+ - **Fix:** Report failures, get explicit permission to proceed
173
+
174
+ ### Hardcoding setup commands
175
+
176
+ - **Problem:** Breaks on projects using different tools
177
+ - **Fix:** Auto-detect from project files (package.json, etc.)
178
+
179
+ ## Example Workflow
180
+
181
+ ```
182
+ You: I'm using the using-git-worktrees skill to set up an isolated workspace.
183
+
184
+ [Check .worktrees/ - exists]
185
+ [Verify ignored - git check-ignore confirms .worktrees/ is ignored]
186
+ [Create worktree: git worktree add .worktrees/auth -b feature/auth]
187
+ [Run npm install]
188
+ [Run npm test - 47 passing]
189
+
190
+ Worktree ready at /Users/jesse/myproject/.worktrees/auth
191
+ Tests passing (47 tests, 0 failures)
192
+ Ready to implement auth feature
193
+ ```
194
+
195
+ ## Red Flags
196
+
197
+ **Never:**
198
+ - Create worktree without verifying it's ignored (project-local)
199
+ - Skip baseline test verification
200
+ - Proceed with failing tests without asking
201
+ - Assume directory location when ambiguous
202
+ - Skip CLAUDE.md check
203
+
204
+ **Always:**
205
+ - Follow directory priority: existing > CLAUDE.md > ask
206
+ - Verify directory is ignored for project-local
207
+ - Auto-detect and run project setup
208
+ - Verify clean test baseline
209
+
210
+ ## Integration
211
+
212
+ **Called by:**
213
+ - **brainstorming** (Phase 4) - REQUIRED when design is approved and implementation follows
214
+ - **subagent-driven-development** - REQUIRED before executing any tasks
215
+ - **executing-plans** - REQUIRED before executing any tasks
216
+ - Any skill needing isolated workspace
217
+
218
+ **Pairs with:**
219
+ - **finishing-a-development-branch** - REQUIRED for cleanup after work complete
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: using-superpowers
3
+ author: xujianjiang
4
+ description: Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions
5
+ ---
6
+
7
+ <SUBAGENT-STOP>
8
+ If you were dispatched as a subagent to execute a specific task, skip this skill.
9
+ </SUBAGENT-STOP>
10
+
11
+ <EXTREMELY-IMPORTANT>
12
+ If you think there is even a 1% chance a skill might apply to what you are doing, you ABSOLUTELY MUST invoke the skill.
13
+
14
+ IF A SKILL APPLIES TO YOUR TASK, YOU DO NOT HAVE A CHOICE. YOU MUST USE IT.
15
+
16
+ This is not negotiable. This is not optional. You cannot rationalize your way out of this.
17
+ </EXTREMELY-IMPORTANT>
18
+
19
+ ## Instruction Priority
20
+
21
+ Superpowers skills override default system prompt behavior, but **user instructions always take precedence**:
22
+
23
+ 1. **User's explicit instructions** (CLAUDE.md, GEMINI.md, AGENTS.md, direct requests) — highest priority
24
+ 2. **Superpowers skills** — override default system behavior where they conflict
25
+ 3. **Default system prompt** — lowest priority
26
+
27
+ If CLAUDE.md, GEMINI.md, or AGENTS.md says "don't use TDD" and a skill says "always use TDD," follow the user's instructions. The user is in control.
28
+
29
+ ## How to Access Skills
30
+
31
+ **In Claude Code:** Use the `Skill` tool. When you invoke a skill, its content is loaded and presented to you—follow it directly. Never use the Read tool on skill files.
32
+
33
+ **In Gemini CLI:** Skills activate via the `activate_skill` tool. Gemini loads skill metadata at session start and activates the full content on demand.
34
+
35
+ **In other environments:** Check your platform's documentation for how skills are loaded.
36
+
37
+ ## Platform Adaptation
38
+
39
+ Skills use Claude Code tool names. Non-CC platforms: see `references/codex-tools.md` (Codex) for tool equivalents. Gemini CLI users get the tool mapping loaded automatically via GEMINI.md.
40
+
41
+ # Using Skills
42
+
43
+ ## The Rule
44
+
45
+ **Invoke relevant or requested skills BEFORE any response or action.** Even a 1% chance a skill might apply means that you should invoke the skill to check. If an invoked skill turns out to be wrong for the situation, you don't need to use it.
46
+
47
+ ```dot
48
+ digraph skill_flow {
49
+ "User message received" [shape=doublecircle];
50
+ "About to EnterPlanMode?" [shape=doublecircle];
51
+ "Already brainstormed?" [shape=diamond];
52
+ "Invoke brainstorming skill" [shape=box];
53
+ "Might any skill apply?" [shape=diamond];
54
+ "Invoke Skill tool" [shape=box];
55
+ "Announce: 'Using [skill] to [purpose]'" [shape=box];
56
+ "Has checklist?" [shape=diamond];
57
+ "Create TodoWrite todo per item" [shape=box];
58
+ "Follow skill exactly" [shape=box];
59
+ "Respond (including clarifications)" [shape=doublecircle];
60
+
61
+ "About to EnterPlanMode?" -> "Already brainstormed?";
62
+ "Already brainstormed?" -> "Invoke brainstorming skill" [label="no"];
63
+ "Already brainstormed?" -> "Might any skill apply?" [label="yes"];
64
+ "Invoke brainstorming skill" -> "Might any skill apply?";
65
+
66
+ "User message received" -> "Might any skill apply?";
67
+ "Might any skill apply?" -> "Invoke Skill tool" [label="yes, even 1%"];
68
+ "Might any skill apply?" -> "Respond (including clarifications)" [label="definitely not"];
69
+ "Invoke Skill tool" -> "Announce: 'Using [skill] to [purpose]'";
70
+ "Announce: 'Using [skill] to [purpose]'" -> "Has checklist?";
71
+ "Has checklist?" -> "Create TodoWrite todo per item" [label="yes"];
72
+ "Has checklist?" -> "Follow skill exactly" [label="no"];
73
+ "Create TodoWrite todo per item" -> "Follow skill exactly";
74
+ }
75
+ ```
76
+
77
+ ## Red Flags
78
+
79
+ These thoughts mean STOP—you're rationalizing:
80
+
81
+ | Thought | Reality |
82
+ |---------|---------|
83
+ | "This is just a simple question" | Questions are tasks. Check for skills. |
84
+ | "I need more context first" | Skill check comes BEFORE clarifying questions. |
85
+ | "Let me explore the codebase first" | Skills tell you HOW to explore. Check first. |
86
+ | "I can check git/files quickly" | Files lack conversation context. Check for skills. |
87
+ | "Let me gather information first" | Skills tell you HOW to gather information. |
88
+ | "This doesn't need a formal skill" | If a skill exists, use it. |
89
+ | "I remember this skill" | Skills evolve. Read current version. |
90
+ | "This doesn't count as a task" | Action = task. Check for skills. |
91
+ | "The skill is overkill" | Simple things become complex. Use it. |
92
+ | "I'll just do this one thing first" | Check BEFORE doing anything. |
93
+ | "This feels productive" | Undisciplined action wastes time. Skills prevent this. |
94
+ | "I know what that means" | Knowing the concept ≠ using the skill. Invoke it. |
95
+
96
+ ## Skill Priority
97
+
98
+ When multiple skills could apply, use this order:
99
+
100
+ 1. **Process skills first** (brainstorming, debugging) - these determine HOW to approach the task
101
+ 2. **Implementation skills second** (frontend-design, mcp-builder) - these guide execution
102
+
103
+ "Let's build X" → brainstorming first, then implementation skills.
104
+ "Fix this bug" → debugging first, then domain-specific skills.
105
+
106
+ ## Skill Types
107
+
108
+ **Rigid** (TDD, debugging): Follow exactly. Don't adapt away discipline.
109
+
110
+ **Flexible** (patterns): Adapt principles to context.
111
+
112
+ The skill itself tells you which.
113
+
114
+ ## User Instructions
115
+
116
+ Instructions say WHAT, not HOW. "Add X" or "Fix Y" doesn't mean skip workflows.
@@ -0,0 +1,25 @@
1
+ # Codex Tool Mapping
2
+
3
+ Skills use Claude Code tool names. When you encounter these in a skill, use your platform equivalent:
4
+
5
+ | Skill references | Codex equivalent |
6
+ |-----------------|------------------|
7
+ | `Task` tool (dispatch subagent) | `spawn_agent` |
8
+ | Multiple `Task` calls (parallel) | Multiple `spawn_agent` calls |
9
+ | Task returns result | `wait` |
10
+ | Task completes automatically | `close_agent` to free slot |
11
+ | `TodoWrite` (task tracking) | `update_plan` |
12
+ | `Skill` tool (invoke a skill) | Skills load natively — just follow the instructions |
13
+ | `Read`, `Write`, `Edit` (files) | Use your native file tools |
14
+ | `Bash` (run commands) | Use your native shell tools |
15
+
16
+ ## Subagent dispatch requires multi-agent support
17
+
18
+ Add to your Codex config (`~/.codex/config.toml`):
19
+
20
+ ```toml
21
+ [features]
22
+ multi_agent = true
23
+ ```
24
+
25
+ This enables `spawn_agent`, `wait`, and `close_agent` for skills like `dispatching-parallel-agents` and `subagent-driven-development`.
@@ -0,0 +1,33 @@
1
+ # Gemini CLI Tool Mapping
2
+
3
+ Skills use Claude Code tool names. When you encounter these in a skill, use your platform equivalent:
4
+
5
+ | Skill references | Gemini CLI equivalent |
6
+ |-----------------|----------------------|
7
+ | `Read` (file reading) | `read_file` |
8
+ | `Write` (file creation) | `write_file` |
9
+ | `Edit` (file editing) | `replace` |
10
+ | `Bash` (run commands) | `run_shell_command` |
11
+ | `Grep` (search file content) | `grep_search` |
12
+ | `Glob` (search files by name) | `glob` |
13
+ | `TodoWrite` (task tracking) | `write_todos` |
14
+ | `Skill` tool (invoke a skill) | `activate_skill` |
15
+ | `WebSearch` | `google_web_search` |
16
+ | `WebFetch` | `web_fetch` |
17
+ | `Task` tool (dispatch subagent) | No equivalent — Gemini CLI does not support subagents |
18
+
19
+ ## No subagent support
20
+
21
+ Gemini CLI has no equivalent to Claude Code's `Task` tool. Skills that rely on subagent dispatch (`subagent-driven-development`, `dispatching-parallel-agents`) will fall back to single-session execution via `executing-plans`.
22
+
23
+ ## Additional Gemini CLI tools
24
+
25
+ These tools are available in Gemini CLI but have no Claude Code equivalent:
26
+
27
+ | Tool | Purpose |
28
+ |------|---------|
29
+ | `list_directory` | List files and subdirectories |
30
+ | `save_memory` | Persist facts to GEMINI.md across sessions |
31
+ | `ask_user` | Request structured input from the user |
32
+ | `tracker_create_task` | Rich task management (create, update, list, visualize) |
33
+ | `enter_plan_mode` / `exit_plan_mode` | Switch to read-only research mode before making changes |
@@ -0,0 +1,140 @@
1
+ ---
2
+ name: verification-before-completion
3
+ author: xujianjiang
4
+ description: Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
5
+ ---
6
+
7
+ # Verification Before Completion
8
+
9
+ ## Overview
10
+
11
+ Claiming work is complete without verification is dishonesty, not efficiency.
12
+
13
+ **Core principle:** Evidence before claims, always.
14
+
15
+ **Violating the letter of this rule is violating the spirit of this rule.**
16
+
17
+ ## The Iron Law
18
+
19
+ ```
20
+ NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
21
+ ```
22
+
23
+ If you haven't run the verification command in this message, you cannot claim it passes.
24
+
25
+ ## The Gate Function
26
+
27
+ ```
28
+ BEFORE claiming any status or expressing satisfaction:
29
+
30
+ 1. IDENTIFY: What command proves this claim?
31
+ 2. RUN: Execute the FULL command (fresh, complete)
32
+ 3. READ: Full output, check exit code, count failures
33
+ 4. VERIFY: Does output confirm the claim?
34
+ - If NO: State actual status with evidence
35
+ - If YES: State claim WITH evidence
36
+ 5. ONLY THEN: Make the claim
37
+
38
+ Skip any step = lying, not verifying
39
+ ```
40
+
41
+ ## Common Failures
42
+
43
+ | Claim | Requires | Not Sufficient |
44
+ |-------|----------|----------------|
45
+ | Tests pass | Test command output: 0 failures | Previous run, "should pass" |
46
+ | Linter clean | Linter output: 0 errors | Partial check, extrapolation |
47
+ | Build succeeds | Build command: exit 0 | Linter passing, logs look good |
48
+ | Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
49
+ | Regression test works | Red-green cycle verified | Test passes once |
50
+ | Agent completed | VCS diff shows changes | Agent reports "success" |
51
+ | Requirements met | Line-by-line checklist | Tests passing |
52
+
53
+ ## Red Flags - STOP
54
+
55
+ - Using "should", "probably", "seems to"
56
+ - Expressing satisfaction before verification ("Great!", "Perfect!", "Done!", etc.)
57
+ - About to commit/push/PR without verification
58
+ - Trusting agent success reports
59
+ - Relying on partial verification
60
+ - Thinking "just this once"
61
+ - Tired and wanting work over
62
+ - **ANY wording implying success without having run verification**
63
+
64
+ ## Rationalization Prevention
65
+
66
+ | Excuse | Reality |
67
+ |--------|---------|
68
+ | "Should work now" | RUN the verification |
69
+ | "I'm confident" | Confidence ≠ evidence |
70
+ | "Just this once" | No exceptions |
71
+ | "Linter passed" | Linter ≠ compiler |
72
+ | "Agent said success" | Verify independently |
73
+ | "I'm tired" | Exhaustion ≠ excuse |
74
+ | "Partial check is enough" | Partial proves nothing |
75
+ | "Different words so rule doesn't apply" | Spirit over letter |
76
+
77
+ ## Key Patterns
78
+
79
+ **Tests:**
80
+ ```
81
+ ✅ [Run test command] [See: 34/34 pass] "All tests pass"
82
+ ❌ "Should pass now" / "Looks correct"
83
+ ```
84
+
85
+ **Regression tests (TDD Red-Green):**
86
+ ```
87
+ ✅ Write → Run (pass) → Revert fix → Run (MUST FAIL) → Restore → Run (pass)
88
+ ❌ "I've written a regression test" (without red-green verification)
89
+ ```
90
+
91
+ **Build:**
92
+ ```
93
+ ✅ [Run build] [See: exit 0] "Build passes"
94
+ ❌ "Linter passed" (linter doesn't check compilation)
95
+ ```
96
+
97
+ **Requirements:**
98
+ ```
99
+ ✅ Re-read plan → Create checklist → Verify each → Report gaps or completion
100
+ ❌ "Tests pass, phase complete"
101
+ ```
102
+
103
+ **Agent delegation:**
104
+ ```
105
+ ✅ Agent reports success → Check VCS diff → Verify changes → Report actual state
106
+ ❌ Trust agent report
107
+ ```
108
+
109
+ ## Why This Matters
110
+
111
+ From 24 failure memories:
112
+ - your human partner said "I don't believe you" - trust broken
113
+ - Undefined functions shipped - would crash
114
+ - Missing requirements shipped - incomplete features
115
+ - Time wasted on false completion → redirect → rework
116
+ - Violates: "Honesty is a core value. If you lie, you'll be replaced."
117
+
118
+ ## When To Apply
119
+
120
+ **ALWAYS before:**
121
+ - ANY variation of success/completion claims
122
+ - ANY expression of satisfaction
123
+ - ANY positive statement about work state
124
+ - Committing, PR creation, task completion
125
+ - Moving to next task
126
+ - Delegating to agents
127
+
128
+ **Rule applies to:**
129
+ - Exact phrases
130
+ - Paraphrases and synonyms
131
+ - Implications of success
132
+ - ANY communication suggesting completion/correctness
133
+
134
+ ## The Bottom Line
135
+
136
+ **No shortcuts for verification.**
137
+
138
+ Run the command. Read the output. THEN claim the result.
139
+
140
+ This is non-negotiable.
@@ -0,0 +1,146 @@
1
+ ---
2
+ name: writing-plans
3
+ author: xujianjiang
4
+ description: Use when you have a spec or requirements for a multi-step task, before touching code
5
+ ---
6
+
7
+ # Writing Plans
8
+
9
+ ## Overview
10
+
11
+ Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
12
+
13
+ Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
14
+
15
+ **Announce at start:** "I'm using the writing-plans skill to create the implementation plan."
16
+
17
+ **Context:** This should be run in a dedicated worktree (created by brainstorming skill).
18
+
19
+ **Save plans to:** `docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md`
20
+ - (User preferences for plan location override this default)
21
+
22
+ ## Scope Check
23
+
24
+ If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
25
+
26
+ ## File Structure
27
+
28
+ Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
29
+
30
+ - Design units with clear boundaries and well-defined interfaces. Each file should have one clear responsibility.
31
+ - You reason best about code you can hold in context at once, and your edits are more reliable when files are focused. Prefer smaller, focused files over large ones that do too much.
32
+ - Files that change together should live together. Split by responsibility, not by technical layer.
33
+ - In existing codebases, follow established patterns. If the codebase uses large files, don't unilaterally restructure - but if a file you're modifying has grown unwieldy, including a split in the plan is reasonable.
34
+
35
+ This structure informs the task decomposition. Each task should produce self-contained changes that make sense independently.
36
+
37
+ ## Bite-Sized Task Granularity
38
+
39
+ **Each step is one action (2-5 minutes):**
40
+ - "Write the failing test" - step
41
+ - "Run it to make sure it fails" - step
42
+ - "Implement the minimal code to make the test pass" - step
43
+ - "Run the tests and make sure they pass" - step
44
+ - "Commit" - step
45
+
46
+ ## Plan Document Header
47
+
48
+ **Every plan MUST start with this header:**
49
+
50
+ ```markdown
51
+ # [Feature Name] Implementation Plan
52
+
53
+ > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
54
+
55
+ **Goal:** [One sentence describing what this builds]
56
+
57
+ **Architecture:** [2-3 sentences about approach]
58
+
59
+ **Tech Stack:** [Key technologies/libraries]
60
+
61
+ ---
62
+ ```
63
+
64
+ ## Task Structure
65
+
66
+ ````markdown
67
+ ### Task N: [Component Name]
68
+
69
+ **Files:**
70
+ - Create: `exact/path/to/file.py`
71
+ - Modify: `exact/path/to/existing.py:123-145`
72
+ - Test: `tests/exact/path/to/test.py`
73
+
74
+ - [ ] **Step 1: Write the failing test**
75
+
76
+ ```python
77
+ def test_specific_behavior():
78
+ result = function(input)
79
+ assert result == expected
80
+ ```
81
+
82
+ - [ ] **Step 2: Run test to verify it fails**
83
+
84
+ Run: `pytest tests/path/test.py::test_name -v`
85
+ Expected: FAIL with "function not defined"
86
+
87
+ - [ ] **Step 3: Write minimal implementation**
88
+
89
+ ```python
90
+ def function(input):
91
+ return expected
92
+ ```
93
+
94
+ - [ ] **Step 4: Run test to verify it passes**
95
+
96
+ Run: `pytest tests/path/test.py::test_name -v`
97
+ Expected: PASS
98
+
99
+ - [ ] **Step 5: Commit**
100
+
101
+ ```bash
102
+ git add tests/path/test.py src/path/file.py
103
+ git commit -m "feat: add specific feature"
104
+ ```
105
+ ````
106
+
107
+ ## Remember
108
+ - Exact file paths always
109
+ - Complete code in plan (not "add validation")
110
+ - Exact commands with expected output
111
+ - Reference relevant skills with @ syntax
112
+ - DRY, YAGNI, TDD, frequent commits
113
+
114
+ ## Plan Review Loop
115
+
116
+ After writing the complete plan:
117
+
118
+ 1. Dispatch a single plan-document-reviewer subagent (see plan-document-reviewer-prompt.md) with precisely crafted review context — never your session history. This keeps the reviewer focused on the plan, not your thought process.
119
+ - Provide: path to the plan document, path to spec document
120
+ 2. If ❌ Issues Found: fix the issues, re-dispatch reviewer for the whole plan
121
+ 3. If ✅ Approved: proceed to execution handoff
122
+
123
+ **Review loop guidance:**
124
+ - Same agent that wrote the plan fixes it (preserves context)
125
+ - If loop exceeds 3 iterations, surface to human for guidance
126
+ - Reviewers are advisory — explain disagreements if you believe feedback is incorrect
127
+
128
+ ## Execution Handoff
129
+
130
+ After saving the plan, offer execution choice:
131
+
132
+ **"Plan complete and saved to `docs/superpowers/plans/<filename>.md`. Two execution options:**
133
+
134
+ **1. Subagent-Driven (recommended)** - I dispatch a fresh subagent per task, review between tasks, fast iteration
135
+
136
+ **2. Inline Execution** - Execute tasks in this session using executing-plans, batch execution with checkpoints
137
+
138
+ **Which approach?"**
139
+
140
+ **If Subagent-Driven chosen:**
141
+ - **REQUIRED SUB-SKILL:** Use superpowers:subagent-driven-development
142
+ - Fresh subagent per task + two-stage review
143
+
144
+ **If Inline Execution chosen:**
145
+ - **REQUIRED SUB-SKILL:** Use superpowers:executing-plans
146
+ - Batch execution with checkpoints for review