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

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 +81 -19
  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,183 @@
1
+ ---
2
+ name: dispatching-parallel-agents
3
+ author: xujianjiang
4
+ description: Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
5
+ ---
6
+
7
+ # Dispatching Parallel Agents
8
+
9
+ ## Overview
10
+
11
+ You delegate tasks to specialized agents with isolated context. By precisely crafting their instructions and context, you ensure they stay focused and succeed at their task. They should never inherit your session's context or history — you construct exactly what they need. This also preserves your own context for coordination work.
12
+
13
+ When you have multiple unrelated failures (different test files, different subsystems, different bugs), investigating them sequentially wastes time. Each investigation is independent and can happen in parallel.
14
+
15
+ **Core principle:** Dispatch one agent per independent problem domain. Let them work concurrently.
16
+
17
+ ## When to Use
18
+
19
+ ```dot
20
+ digraph when_to_use {
21
+ "Multiple failures?" [shape=diamond];
22
+ "Are they independent?" [shape=diamond];
23
+ "Single agent investigates all" [shape=box];
24
+ "One agent per problem domain" [shape=box];
25
+ "Can they work in parallel?" [shape=diamond];
26
+ "Sequential agents" [shape=box];
27
+ "Parallel dispatch" [shape=box];
28
+
29
+ "Multiple failures?" -> "Are they independent?" [label="yes"];
30
+ "Are they independent?" -> "Single agent investigates all" [label="no - related"];
31
+ "Are they independent?" -> "Can they work in parallel?" [label="yes"];
32
+ "Can they work in parallel?" -> "Parallel dispatch" [label="yes"];
33
+ "Can they work in parallel?" -> "Sequential agents" [label="no - shared state"];
34
+ }
35
+ ```
36
+
37
+ **Use when:**
38
+ - 3+ test files failing with different root causes
39
+ - Multiple subsystems broken independently
40
+ - Each problem can be understood without context from others
41
+ - No shared state between investigations
42
+
43
+ **Don't use when:**
44
+ - Failures are related (fix one might fix others)
45
+ - Need to understand full system state
46
+ - Agents would interfere with each other
47
+
48
+ ## The Pattern
49
+
50
+ ### 1. Identify Independent Domains
51
+
52
+ Group failures by what's broken:
53
+ - File A tests: Tool approval flow
54
+ - File B tests: Batch completion behavior
55
+ - File C tests: Abort functionality
56
+
57
+ Each domain is independent - fixing tool approval doesn't affect abort tests.
58
+
59
+ ### 2. Create Focused Agent Tasks
60
+
61
+ Each agent gets:
62
+ - **Specific scope:** One test file or subsystem
63
+ - **Clear goal:** Make these tests pass
64
+ - **Constraints:** Don't change other code
65
+ - **Expected output:** Summary of what you found and fixed
66
+
67
+ ### 3. Dispatch in Parallel
68
+
69
+ ```typescript
70
+ // In Claude Code / AI environment
71
+ Task("Fix agent-tool-abort.test.ts failures")
72
+ Task("Fix batch-completion-behavior.test.ts failures")
73
+ Task("Fix tool-approval-race-conditions.test.ts failures")
74
+ // All three run concurrently
75
+ ```
76
+
77
+ ### 4. Review and Integrate
78
+
79
+ When agents return:
80
+ - Read each summary
81
+ - Verify fixes don't conflict
82
+ - Run full test suite
83
+ - Integrate all changes
84
+
85
+ ## Agent Prompt Structure
86
+
87
+ Good agent prompts are:
88
+ 1. **Focused** - One clear problem domain
89
+ 2. **Self-contained** - All context needed to understand the problem
90
+ 3. **Specific about output** - What should the agent return?
91
+
92
+ ```markdown
93
+ Fix the 3 failing tests in src/agents/agent-tool-abort.test.ts:
94
+
95
+ 1. "should abort tool with partial output capture" - expects 'interrupted at' in message
96
+ 2. "should handle mixed completed and aborted tools" - fast tool aborted instead of completed
97
+ 3. "should properly track pendingToolCount" - expects 3 results but gets 0
98
+
99
+ These are timing/race condition issues. Your task:
100
+
101
+ 1. Read the test file and understand what each test verifies
102
+ 2. Identify root cause - timing issues or actual bugs?
103
+ 3. Fix by:
104
+ - Replacing arbitrary timeouts with event-based waiting
105
+ - Fixing bugs in abort implementation if found
106
+ - Adjusting test expectations if testing changed behavior
107
+
108
+ Do NOT just increase timeouts - find the real issue.
109
+
110
+ Return: Summary of what you found and what you fixed.
111
+ ```
112
+
113
+ ## Common Mistakes
114
+
115
+ **❌ Too broad:** "Fix all the tests" - agent gets lost
116
+ **✅ Specific:** "Fix agent-tool-abort.test.ts" - focused scope
117
+
118
+ **❌ No context:** "Fix the race condition" - agent doesn't know where
119
+ **✅ Context:** Paste the error messages and test names
120
+
121
+ **❌ No constraints:** Agent might refactor everything
122
+ **✅ Constraints:** "Do NOT change production code" or "Fix tests only"
123
+
124
+ **❌ Vague output:** "Fix it" - you don't know what changed
125
+ **✅ Specific:** "Return summary of root cause and changes"
126
+
127
+ ## When NOT to Use
128
+
129
+ **Related failures:** Fixing one might fix others - investigate together first
130
+ **Need full context:** Understanding requires seeing entire system
131
+ **Exploratory debugging:** You don't know what's broken yet
132
+ **Shared state:** Agents would interfere (editing same files, using same resources)
133
+
134
+ ## Real Example from Session
135
+
136
+ **Scenario:** 6 test failures across 3 files after major refactoring
137
+
138
+ **Failures:**
139
+ - agent-tool-abort.test.ts: 3 failures (timing issues)
140
+ - batch-completion-behavior.test.ts: 2 failures (tools not executing)
141
+ - tool-approval-race-conditions.test.ts: 1 failure (execution count = 0)
142
+
143
+ **Decision:** Independent domains - abort logic separate from batch completion separate from race conditions
144
+
145
+ **Dispatch:**
146
+ ```
147
+ Agent 1 → Fix agent-tool-abort.test.ts
148
+ Agent 2 → Fix batch-completion-behavior.test.ts
149
+ Agent 3 → Fix tool-approval-race-conditions.test.ts
150
+ ```
151
+
152
+ **Results:**
153
+ - Agent 1: Replaced timeouts with event-based waiting
154
+ - Agent 2: Fixed event structure bug (threadId in wrong place)
155
+ - Agent 3: Added wait for async tool execution to complete
156
+
157
+ **Integration:** All fixes independent, no conflicts, full suite green
158
+
159
+ **Time saved:** 3 problems solved in parallel vs sequentially
160
+
161
+ ## Key Benefits
162
+
163
+ 1. **Parallelization** - Multiple investigations happen simultaneously
164
+ 2. **Focus** - Each agent has narrow scope, less context to track
165
+ 3. **Independence** - Agents don't interfere with each other
166
+ 4. **Speed** - 3 problems solved in time of 1
167
+
168
+ ## Verification
169
+
170
+ After agents return:
171
+ 1. **Review each summary** - Understand what changed
172
+ 2. **Check for conflicts** - Did agents edit same code?
173
+ 3. **Run full suite** - Verify all fixes work together
174
+ 4. **Spot check** - Agents can make systematic errors
175
+
176
+ ## Real-World Impact
177
+
178
+ From debugging session (2025-10-03):
179
+ - 6 failures across 3 files
180
+ - 3 agents dispatched in parallel
181
+ - All investigations completed concurrently
182
+ - All fixes integrated successfully
183
+ - Zero conflicts between agent changes
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: executing-plans
3
+ author: xujianjiang
4
+ description: Use when you have a written implementation plan to execute in a separate session with review checkpoints
5
+ ---
6
+
7
+ # Executing Plans
8
+
9
+ ## Overview
10
+
11
+ Load plan, review critically, execute all tasks, report when complete.
12
+
13
+ **Announce at start:** "I'm using the executing-plans skill to implement this plan."
14
+
15
+ **Note:** Tell your human partner that Superpowers works much better with access to subagents. The quality of its work will be significantly higher if run on a platform with subagent support (such as Claude Code or Codex). If subagents are available, use superpowers:subagent-driven-development instead of this skill.
16
+
17
+ ## The Process
18
+
19
+ ### Step 1: Load and Review Plan
20
+ 1. Read plan file
21
+ 2. Review critically - identify any questions or concerns about the plan
22
+ 3. If concerns: Raise them with your human partner before starting
23
+ 4. If no concerns: Create TodoWrite and proceed
24
+
25
+ ### Step 2: Execute Tasks
26
+
27
+ For each task:
28
+ 1. Mark as in_progress
29
+ 2. Follow each step exactly (plan has bite-sized steps)
30
+ 3. Run verifications as specified
31
+ 4. Mark as completed
32
+
33
+ ### Step 3: Complete Development
34
+
35
+ After all tasks complete and verified:
36
+ - Announce: "I'm using the finishing-a-development-branch skill to complete this work."
37
+ - **REQUIRED SUB-SKILL:** Use superpowers:finishing-a-development-branch
38
+ - Follow that skill to verify tests, present options, execute choice
39
+
40
+ ## When to Stop and Ask for Help
41
+
42
+ **STOP executing immediately when:**
43
+ - Hit a blocker (missing dependency, test fails, instruction unclear)
44
+ - Plan has critical gaps preventing starting
45
+ - You don't understand an instruction
46
+ - Verification fails repeatedly
47
+
48
+ **Ask for clarification rather than guessing.**
49
+
50
+ ## When to Revisit Earlier Steps
51
+
52
+ **Return to Review (Step 1) when:**
53
+ - Partner updates the plan based on your feedback
54
+ - Fundamental approach needs rethinking
55
+
56
+ **Don't force through blockers** - stop and ask.
57
+
58
+ ## Remember
59
+ - Review plan critically first
60
+ - Follow plan steps exactly
61
+ - Don't skip verifications
62
+ - Reference skills when plan says to
63
+ - Stop when blocked, don't guess
64
+ - Never start implementation on main/master branch without explicit user consent
65
+
66
+ ## Integration
67
+
68
+ **Required workflow skills:**
69
+ - **superpowers:using-git-worktrees** - REQUIRED: Set up isolated workspace before starting
70
+ - **superpowers:writing-plans** - Creates the plan this skill executes
71
+ - **superpowers:finishing-a-development-branch** - Complete development after all tasks
@@ -0,0 +1,201 @@
1
+ ---
2
+ name: finishing-a-development-branch
3
+ author: xujianjiang
4
+ description: Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
5
+ ---
6
+
7
+ # Finishing a Development Branch
8
+
9
+ ## Overview
10
+
11
+ Guide completion of development work by presenting clear options and handling chosen workflow.
12
+
13
+ **Core principle:** Verify tests → Present options → Execute choice → Clean up.
14
+
15
+ **Announce at start:** "I'm using the finishing-a-development-branch skill to complete this work."
16
+
17
+ ## The Process
18
+
19
+ ### Step 1: Verify Tests
20
+
21
+ **Before presenting options, verify tests pass:**
22
+
23
+ ```bash
24
+ # Run project's test suite
25
+ npm test / cargo test / pytest / go test ./...
26
+ ```
27
+
28
+ **If tests fail:**
29
+ ```
30
+ Tests failing (<N> failures). Must fix before completing:
31
+
32
+ [Show failures]
33
+
34
+ Cannot proceed with merge/PR until tests pass.
35
+ ```
36
+
37
+ Stop. Don't proceed to Step 2.
38
+
39
+ **If tests pass:** Continue to Step 2.
40
+
41
+ ### Step 2: Determine Base Branch
42
+
43
+ ```bash
44
+ # Try common base branches
45
+ git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
46
+ ```
47
+
48
+ Or ask: "This branch split from main - is that correct?"
49
+
50
+ ### Step 3: Present Options
51
+
52
+ Present exactly these 4 options:
53
+
54
+ ```
55
+ Implementation complete. What would you like to do?
56
+
57
+ 1. Merge back to <base-branch> locally
58
+ 2. Push and create a Pull Request
59
+ 3. Keep the branch as-is (I'll handle it later)
60
+ 4. Discard this work
61
+
62
+ Which option?
63
+ ```
64
+
65
+ **Don't add explanation** - keep options concise.
66
+
67
+ ### Step 4: Execute Choice
68
+
69
+ #### Option 1: Merge Locally
70
+
71
+ ```bash
72
+ # Switch to base branch
73
+ git checkout <base-branch>
74
+
75
+ # Pull latest
76
+ git pull
77
+
78
+ # Merge feature branch
79
+ git merge <feature-branch>
80
+
81
+ # Verify tests on merged result
82
+ <test command>
83
+
84
+ # If tests pass
85
+ git branch -d <feature-branch>
86
+ ```
87
+
88
+ Then: Cleanup worktree (Step 5)
89
+
90
+ #### Option 2: Push and Create PR
91
+
92
+ ```bash
93
+ # Push branch
94
+ git push -u origin <feature-branch>
95
+
96
+ # Create PR
97
+ gh pr create --title "<title>" --body "$(cat <<'EOF'
98
+ ## Summary
99
+ <2-3 bullets of what changed>
100
+
101
+ ## Test Plan
102
+ - [ ] <verification steps>
103
+ EOF
104
+ )"
105
+ ```
106
+
107
+ Then: Cleanup worktree (Step 5)
108
+
109
+ #### Option 3: Keep As-Is
110
+
111
+ Report: "Keeping branch <name>. Worktree preserved at <path>."
112
+
113
+ **Don't cleanup worktree.**
114
+
115
+ #### Option 4: Discard
116
+
117
+ **Confirm first:**
118
+ ```
119
+ This will permanently delete:
120
+ - Branch <name>
121
+ - All commits: <commit-list>
122
+ - Worktree at <path>
123
+
124
+ Type 'discard' to confirm.
125
+ ```
126
+
127
+ Wait for exact confirmation.
128
+
129
+ If confirmed:
130
+ ```bash
131
+ git checkout <base-branch>
132
+ git branch -D <feature-branch>
133
+ ```
134
+
135
+ Then: Cleanup worktree (Step 5)
136
+
137
+ ### Step 5: Cleanup Worktree
138
+
139
+ **For Options 1, 2, 4:**
140
+
141
+ Check if in worktree:
142
+ ```bash
143
+ git worktree list | grep $(git branch --show-current)
144
+ ```
145
+
146
+ If yes:
147
+ ```bash
148
+ git worktree remove <worktree-path>
149
+ ```
150
+
151
+ **For Option 3:** Keep worktree.
152
+
153
+ ## Quick Reference
154
+
155
+ | Option | Merge | Push | Keep Worktree | Cleanup Branch |
156
+ |--------|-------|------|---------------|----------------|
157
+ | 1. Merge locally | ✓ | - | - | ✓ |
158
+ | 2. Create PR | - | ✓ | ✓ | - |
159
+ | 3. Keep as-is | - | - | ✓ | - |
160
+ | 4. Discard | - | - | - | ✓ (force) |
161
+
162
+ ## Common Mistakes
163
+
164
+ **Skipping test verification**
165
+ - **Problem:** Merge broken code, create failing PR
166
+ - **Fix:** Always verify tests before offering options
167
+
168
+ **Open-ended questions**
169
+ - **Problem:** "What should I do next?" → ambiguous
170
+ - **Fix:** Present exactly 4 structured options
171
+
172
+ **Automatic worktree cleanup**
173
+ - **Problem:** Remove worktree when might need it (Option 2, 3)
174
+ - **Fix:** Only cleanup for Options 1 and 4
175
+
176
+ **No confirmation for discard**
177
+ - **Problem:** Accidentally delete work
178
+ - **Fix:** Require typed "discard" confirmation
179
+
180
+ ## Red Flags
181
+
182
+ **Never:**
183
+ - Proceed with failing tests
184
+ - Merge without verifying tests on result
185
+ - Delete work without confirmation
186
+ - Force-push without explicit request
187
+
188
+ **Always:**
189
+ - Verify tests before offering options
190
+ - Present exactly 4 options
191
+ - Get typed confirmation for Option 4
192
+ - Clean up worktree for Options 1 & 4 only
193
+
194
+ ## Integration
195
+
196
+ **Called by:**
197
+ - **subagent-driven-development** (Step 7) - After all tasks complete
198
+ - **executing-plans** (Step 5) - After all batches complete
199
+
200
+ **Pairs with:**
201
+ - **using-git-worktrees** - Cleans up worktree created by that skill