@ia-ccun/code-agent-cli 0.0.3 → 0.0.4-8.beta.1

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 (189) hide show
  1. package/README.md +92 -11
  2. package/bin/cli.js +212 -59
  3. package/config/agent/APPEND_SYSTEM.md +46 -5
  4. package/config/agent/bin/fd +0 -0
  5. package/config/agent/bin/rg +0 -0
  6. package/config/agent/dangerous-patterns.json +106 -0
  7. package/config/agent/extensions/aicode-tips.ts +191 -0
  8. package/config/agent/extensions/bash-check.ts +227 -0
  9. package/config/agent/extensions/context-monitor.ts +275 -0
  10. package/config/agent/extensions/context.ts +1 -0
  11. package/config/agent/extensions/custom-footer.ts +33 -2
  12. package/config/agent/extensions/custom.ts +24 -91
  13. package/config/agent/extensions/error-monitor.ts +142 -0
  14. package/config/agent/extensions/msg-debug.ts +185 -0
  15. package/config/agent/extensions/review.ts +4 -0
  16. package/config/agent/extensions/working-msg.ts +39 -20
  17. package/config/agent/mcp.json +4 -0
  18. package/config/agent/models.json +16 -43
  19. package/config/agent/prompts/code-simplifier.md +51 -0
  20. package/config/agent/prompts/feat.md +2 -2
  21. package/config/agent/prompts/git-commit.md +9 -15
  22. package/config/agent/prompts/init-project.md +2 -1
  23. package/config/agent/prompts/workflow.md +3 -2
  24. package/config/agent/settings.json +17 -5
  25. package/config/agent/skills/brainstorming/SKILL.md +167 -0
  26. package/config/agent/skills/brainstorming/scripts/frame-template.html +214 -0
  27. package/config/agent/skills/brainstorming/scripts/helper.js +88 -0
  28. package/config/agent/skills/brainstorming/scripts/server.cjs +338 -0
  29. package/config/agent/skills/brainstorming/scripts/start-server.sh +153 -0
  30. package/config/agent/skills/brainstorming/scripts/stop-server.sh +55 -0
  31. package/config/agent/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  32. package/config/agent/skills/brainstorming/visual-companion.md +286 -0
  33. package/config/agent/skills/code-review/SKILL.md +4 -2
  34. package/config/agent/skills/commit/SKILL.md +10 -5
  35. package/config/agent/skills/csv-data-summarizer/SKILL.md +2 -1
  36. package/config/agent/skills/design-md/README.md +34 -0
  37. package/config/agent/skills/design-md/SKILL.md +172 -0
  38. package/config/agent/skills/design-md/examples/DESIGN.md +154 -0
  39. package/config/agent/skills/dispatching-parallel-agents/SKILL.md +185 -0
  40. package/config/agent/skills/executing-plans/SKILL.md +73 -0
  41. package/config/agent/skills/find-skills/SKILL.md +5 -1
  42. package/config/agent/skills/finishing-a-development-branch/SKILL.md +204 -0
  43. package/config/agent/skills/fireworks-tech-graph/LICENSE +21 -0
  44. package/config/agent/skills/fireworks-tech-graph/README.md +528 -0
  45. package/config/agent/skills/fireworks-tech-graph/README.zh.md +499 -0
  46. package/config/agent/skills/fireworks-tech-graph/SKILL.md +537 -0
  47. package/config/agent/skills/fireworks-tech-graph/agentloop-core.svg +101 -0
  48. package/config/agent/skills/fireworks-tech-graph/agents/openai.yaml +4 -0
  49. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style1-flat.png +0 -0
  50. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style2-dark.png +0 -0
  51. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style3-blueprint.png +0 -0
  52. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style4-notion.png +0 -0
  53. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style5-glass.png +0 -0
  54. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style6-claude.png +0 -0
  55. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style7-openai.png +0 -0
  56. package/config/agent/skills/fireworks-tech-graph/fixtures/agent-memory-types-style4.json +181 -0
  57. package/config/agent/skills/fireworks-tech-graph/fixtures/api-flow-style7.json +40 -0
  58. package/config/agent/skills/fireworks-tech-graph/fixtures/mem0-style1.json +297 -0
  59. package/config/agent/skills/fireworks-tech-graph/fixtures/microservices-style3.json +64 -0
  60. package/config/agent/skills/fireworks-tech-graph/fixtures/multi-agent-style5.json +45 -0
  61. package/config/agent/skills/fireworks-tech-graph/fixtures/system-architecture-style6.json +48 -0
  62. package/config/agent/skills/fireworks-tech-graph/fixtures/tool-call-style2.json +182 -0
  63. package/config/agent/skills/fireworks-tech-graph/package.json +42 -0
  64. package/config/agent/skills/fireworks-tech-graph/references/icons.md +406 -0
  65. package/config/agent/skills/fireworks-tech-graph/references/style-1-flat-icon.md +108 -0
  66. package/config/agent/skills/fireworks-tech-graph/references/style-2-dark-terminal.md +107 -0
  67. package/config/agent/skills/fireworks-tech-graph/references/style-3-blueprint.md +113 -0
  68. package/config/agent/skills/fireworks-tech-graph/references/style-4-notion-clean.md +94 -0
  69. package/config/agent/skills/fireworks-tech-graph/references/style-5-glassmorphism.md +125 -0
  70. package/config/agent/skills/fireworks-tech-graph/references/style-6-claude-official.md +209 -0
  71. package/config/agent/skills/fireworks-tech-graph/references/style-7-openai.md +215 -0
  72. package/config/agent/skills/fireworks-tech-graph/references/style-diagram-matrix.md +135 -0
  73. package/config/agent/skills/fireworks-tech-graph/references/svg-layout-best-practices.md +100 -0
  74. package/config/agent/skills/fireworks-tech-graph/scripts/README.md +244 -0
  75. package/config/agent/skills/fireworks-tech-graph/scripts/generate-diagram.sh +157 -0
  76. package/config/agent/skills/fireworks-tech-graph/scripts/generate-from-template.py +1556 -0
  77. package/config/agent/skills/fireworks-tech-graph/scripts/test-all-styles.sh +135 -0
  78. package/config/agent/skills/fireworks-tech-graph/scripts/validate-svg.sh +292 -0
  79. package/config/agent/skills/fireworks-tech-graph/templates/agent-architecture.svg +28 -0
  80. package/config/agent/skills/fireworks-tech-graph/templates/architecture.svg +23 -0
  81. package/config/agent/skills/fireworks-tech-graph/templates/comparison-matrix.svg +14 -0
  82. package/config/agent/skills/fireworks-tech-graph/templates/data-flow.svg +28 -0
  83. package/config/agent/skills/fireworks-tech-graph/templates/er-diagram.svg +21 -0
  84. package/config/agent/skills/fireworks-tech-graph/templates/flowchart.svg +21 -0
  85. package/config/agent/skills/fireworks-tech-graph/templates/sequence.svg +20 -0
  86. package/config/agent/skills/fireworks-tech-graph/templates/state-machine.svg +20 -0
  87. package/config/agent/skills/fireworks-tech-graph/templates/timeline.svg +19 -0
  88. package/config/agent/skills/fireworks-tech-graph/templates/use-case.svg +21 -0
  89. package/config/agent/skills/frontend-design/SKILL.md +4 -1
  90. package/config/agent/skills/hello/SKILL.md +5 -2
  91. package/config/agent/skills/impeccable/adapt/SKILL.md +204 -0
  92. package/config/agent/skills/impeccable/animate/SKILL.md +177 -0
  93. package/config/agent/skills/impeccable/arrange/SKILL.md +127 -0
  94. package/config/agent/skills/impeccable/audit/SKILL.md +128 -0
  95. package/config/agent/skills/impeccable/bolder/SKILL.md +119 -0
  96. package/config/agent/skills/impeccable/clarify/SKILL.md +185 -0
  97. package/config/agent/skills/impeccable/colorize/SKILL.md +145 -0
  98. package/config/agent/skills/impeccable/critique/SKILL.md +122 -0
  99. package/config/agent/skills/impeccable/delight/SKILL.md +306 -0
  100. package/config/agent/skills/impeccable/distill/SKILL.md +124 -0
  101. package/config/agent/skills/impeccable/extract/SKILL.md +94 -0
  102. package/config/agent/skills/impeccable/frontend-design/reference/color-and-contrast.md +132 -0
  103. package/config/agent/skills/impeccable/frontend-design/reference/interaction-design.md +123 -0
  104. package/config/agent/skills/impeccable/frontend-design/reference/motion-design.md +99 -0
  105. package/config/agent/skills/impeccable/frontend-design/reference/responsive-design.md +114 -0
  106. package/config/agent/skills/impeccable/frontend-design/reference/spatial-design.md +100 -0
  107. package/config/agent/skills/impeccable/frontend-design/reference/typography.md +133 -0
  108. package/config/agent/skills/impeccable/frontend-design/reference/ux-writing.md +107 -0
  109. package/config/agent/skills/impeccable/harden/SKILL.md +357 -0
  110. package/config/agent/skills/impeccable/normalize/SKILL.md +73 -0
  111. package/config/agent/skills/impeccable/onboard/SKILL.md +248 -0
  112. package/config/agent/skills/impeccable/optimize/SKILL.md +268 -0
  113. package/config/agent/skills/impeccable/overdrive/SKILL.md +144 -0
  114. package/config/agent/skills/impeccable/polish/SKILL.md +205 -0
  115. package/config/agent/skills/impeccable/quieter/SKILL.md +105 -0
  116. package/config/agent/skills/impeccable/teach-impeccable/SKILL.md +71 -0
  117. package/config/agent/skills/impeccable/typeset/SKILL.md +118 -0
  118. package/config/agent/skills/librarian/SKILL.md +5 -1
  119. package/config/agent/skills/markdown-to-html/SKILL.md +5 -2
  120. package/config/agent/skills/owasp-security/SKILL.md +539 -0
  121. package/config/agent/skills/pr/SKILL.md +5 -2
  122. package/config/agent/skills/receiving-code-review/SKILL.md +216 -0
  123. package/config/agent/skills/refactor/SKILL.md +5 -2
  124. package/config/agent/skills/requesting-code-review/SKILL.md +108 -0
  125. package/config/agent/skills/requesting-code-review/code-reviewer.md +146 -0
  126. package/config/agent/skills/session-learning/SKILL.md +185 -0
  127. package/config/agent/skills/skill-creator/SKILL.md +339 -213
  128. package/config/agent/skills/skill-creator/agents/analyzer.md +274 -0
  129. package/config/agent/skills/skill-creator/agents/comparator.md +202 -0
  130. package/config/agent/skills/skill-creator/agents/grader.md +223 -0
  131. package/config/agent/skills/skill-creator/assets/eval_review.html +146 -0
  132. package/config/agent/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  133. package/config/agent/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  134. package/config/agent/skills/skill-creator/references/schemas.md +430 -0
  135. package/config/agent/skills/skill-creator/scripts/__init__.py +0 -0
  136. package/config/agent/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  137. package/config/agent/skills/skill-creator/scripts/generate_report.py +326 -0
  138. package/config/agent/skills/skill-creator/scripts/improve_description.py +248 -0
  139. package/config/agent/skills/skill-creator/scripts/package_skill.py +33 -7
  140. package/config/agent/skills/skill-creator/scripts/quick_validate.py +11 -3
  141. package/config/agent/skills/skill-creator/scripts/run_eval.py +310 -0
  142. package/config/agent/skills/skill-creator/scripts/run_loop.py +332 -0
  143. package/config/agent/skills/skill-creator/scripts/utils.py +47 -0
  144. package/config/agent/skills/subagent-driven-development/SKILL.md +280 -0
  145. package/config/agent/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
  146. package/config/agent/skills/subagent-driven-development/implementer-prompt.md +113 -0
  147. package/config/agent/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  148. package/config/agent/skills/systematic-debugging/CREATION-LOG.md +119 -0
  149. package/config/agent/skills/systematic-debugging/SKILL.md +300 -0
  150. package/config/agent/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  151. package/config/agent/skills/systematic-debugging/condition-based-waiting.md +115 -0
  152. package/config/agent/skills/systematic-debugging/defense-in-depth.md +122 -0
  153. package/config/agent/skills/systematic-debugging/find-polluter.sh +63 -0
  154. package/config/agent/skills/systematic-debugging/root-cause-tracing.md +169 -0
  155. package/config/agent/skills/systematic-debugging/test-academic.md +14 -0
  156. package/config/agent/skills/systematic-debugging/test-pressure-1.md +58 -0
  157. package/config/agent/skills/systematic-debugging/test-pressure-2.md +68 -0
  158. package/config/agent/skills/systematic-debugging/test-pressure-3.md +69 -0
  159. package/config/agent/skills/test-driven-development/SKILL.md +375 -0
  160. package/config/agent/skills/test-driven-development/testing-anti-patterns.md +299 -0
  161. package/config/agent/skills/ui-ux-pro-max/SKILL.md +4 -1
  162. package/config/agent/skills/unit-test/SKILL.md +4 -2
  163. package/config/agent/skills/using-git-worktrees/SKILL.md +222 -0
  164. package/config/agent/skills/using-superpowers/SKILL.md +118 -0
  165. package/config/agent/skills/using-superpowers/references/codex-tools.md +25 -0
  166. package/config/agent/skills/using-superpowers/references/gemini-tools.md +33 -0
  167. package/config/agent/skills/verification-before-completion/SKILL.md +142 -0
  168. package/config/agent/skills/writing-plans/SKILL.md +148 -0
  169. package/config/agent/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  170. package/config/agent/skills/writing-skills/SKILL.md +669 -0
  171. package/config/agent/skills/writing-skills/anthropic-best-practices.md +1150 -0
  172. package/config/agent/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  173. package/config/agent/skills/writing-skills/graphviz-conventions.dot +172 -0
  174. package/config/agent/skills/writing-skills/persuasion-principles.md +187 -0
  175. package/config/agent/skills/writing-skills/render-graphs.js +168 -0
  176. package/config/agent/skills/writing-skills/testing-skills-with-subagents.md +384 -0
  177. package/config.json +23 -2
  178. package/dist/banner.js +3 -3
  179. package/dist/banner.js.map +1 -1
  180. package/package.json +21 -16
  181. package/scripts/banner.txt +4 -3
  182. package/scripts/postinstall.js +203 -11
  183. package/config/agent/prompts/git-rollback.md +0 -91
  184. package/config/agent/prompts/git-worktree.md +0 -277
  185. package/config/agent/prompts/help.md +0 -10
  186. package/config/agent/skills/github/SKILL.md +0 -47
  187. package/config/agent/skills/skill-creator/references/output-patterns.md +0 -82
  188. package/config/agent/skills/skill-creator/references/workflows.md +0 -28
  189. package/config/agent/skills/skill-creator/scripts/init_skill.py +0 -303
@@ -0,0 +1,216 @@
1
+ ---
2
+ name: receiving-code-review
3
+ description: "Handle code review feedback with technical rigor and verification. Use when receiving code review feedback, implementing review comments, or handling review suggestions."
4
+ metadata:
5
+ version: "1.0.0"
6
+ author: "xujianjiang"
7
+ ---
8
+
9
+ # Code Review Reception
10
+
11
+ ## Overview
12
+
13
+ Code review requires technical evaluation, not emotional performance.
14
+
15
+ **Core principle:** Verify before implementing. Ask before assuming. Technical correctness over social comfort.
16
+
17
+ ## The Response Pattern
18
+
19
+ ```
20
+ WHEN receiving code review feedback:
21
+
22
+ 1. READ: Complete feedback without reacting
23
+ 2. UNDERSTAND: Restate requirement in own words (or ask)
24
+ 3. VERIFY: Check against codebase reality
25
+ 4. EVALUATE: Technically sound for THIS codebase?
26
+ 5. RESPOND: Technical acknowledgment or reasoned pushback
27
+ 6. IMPLEMENT: One item at a time, test each
28
+ ```
29
+
30
+ ## Forbidden Responses
31
+
32
+ **NEVER:**
33
+ - "You're absolutely right!" (explicit CLAUDE.md violation)
34
+ - "Great point!" / "Excellent feedback!" (performative)
35
+ - "Let me implement that now" (before verification)
36
+
37
+ **INSTEAD:**
38
+ - Restate the technical requirement
39
+ - Ask clarifying questions
40
+ - Push back with technical reasoning if wrong
41
+ - Just start working (actions > words)
42
+
43
+ ## Handling Unclear Feedback
44
+
45
+ ```
46
+ IF any item is unclear:
47
+ STOP - do not implement anything yet
48
+ ASK for clarification on unclear items
49
+
50
+ WHY: Items may be related. Partial understanding = wrong implementation.
51
+ ```
52
+
53
+ **Example:**
54
+ ```
55
+ your human partner: "Fix 1-6"
56
+ You understand 1,2,3,6. Unclear on 4,5.
57
+
58
+ ❌ WRONG: Implement 1,2,3,6 now, ask about 4,5 later
59
+ ✅ RIGHT: "I understand items 1,2,3,6. Need clarification on 4 and 5 before proceeding."
60
+ ```
61
+
62
+ ## Source-Specific Handling
63
+
64
+ ### From your human partner
65
+ - **Trusted** - implement after understanding
66
+ - **Still ask** if scope unclear
67
+ - **No performative agreement**
68
+ - **Skip to action** or technical acknowledgment
69
+
70
+ ### From External Reviewers
71
+ ```
72
+ BEFORE implementing:
73
+ 1. Check: Technically correct for THIS codebase?
74
+ 2. Check: Breaks existing functionality?
75
+ 3. Check: Reason for current implementation?
76
+ 4. Check: Works on all platforms/versions?
77
+ 5. Check: Does reviewer understand full context?
78
+
79
+ IF suggestion seems wrong:
80
+ Push back with technical reasoning
81
+
82
+ IF can't easily verify:
83
+ Say so: "I can't verify this without [X]. Should I [investigate/ask/proceed]?"
84
+
85
+ IF conflicts with your human partner's prior decisions:
86
+ Stop and discuss with your human partner first
87
+ ```
88
+
89
+ **your human partner's rule:** "External feedback - be skeptical, but check carefully"
90
+
91
+ ## YAGNI Check for "Professional" Features
92
+
93
+ ```
94
+ IF reviewer suggests "implementing properly":
95
+ grep codebase for actual usage
96
+
97
+ IF unused: "This endpoint isn't called. Remove it (YAGNI)?"
98
+ IF used: Then implement properly
99
+ ```
100
+
101
+ **your human partner's rule:** "You and reviewer both report to me. If we don't need this feature, don't add it."
102
+
103
+ ## Implementation Order
104
+
105
+ ```
106
+ FOR multi-item feedback:
107
+ 1. Clarify anything unclear FIRST
108
+ 2. Then implement in this order:
109
+ - Blocking issues (breaks, security)
110
+ - Simple fixes (typos, imports)
111
+ - Complex fixes (refactoring, logic)
112
+ 3. Test each fix individually
113
+ 4. Verify no regressions
114
+ ```
115
+
116
+ ## When To Push Back
117
+
118
+ Push back when:
119
+ - Suggestion breaks existing functionality
120
+ - Reviewer lacks full context
121
+ - Violates YAGNI (unused feature)
122
+ - Technically incorrect for this stack
123
+ - Legacy/compatibility reasons exist
124
+ - Conflicts with your human partner's architectural decisions
125
+
126
+ **How to push back:**
127
+ - Use technical reasoning, not defensiveness
128
+ - Ask specific questions
129
+ - Reference working tests/code
130
+ - Involve your human partner if architectural
131
+
132
+ **Signal if uncomfortable pushing back out loud:** "Strange things are afoot at the Circle K"
133
+
134
+ ## Acknowledging Correct Feedback
135
+
136
+ When feedback IS correct:
137
+ ```
138
+ ✅ "Fixed. [Brief description of what changed]"
139
+ ✅ "Good catch - [specific issue]. Fixed in [location]."
140
+ ✅ [Just fix it and show in the code]
141
+
142
+ ❌ "You're absolutely right!"
143
+ ❌ "Great point!"
144
+ ❌ "Thanks for catching that!"
145
+ ❌ "Thanks for [anything]"
146
+ ❌ ANY gratitude expression
147
+ ```
148
+
149
+ **Why no thanks:** Actions speak. Just fix it. The code itself shows you heard the feedback.
150
+
151
+ **If you catch yourself about to write "Thanks":** DELETE IT. State the fix instead.
152
+
153
+ ## Gracefully Correcting Your Pushback
154
+
155
+ If you pushed back and were wrong:
156
+ ```
157
+ ✅ "You were right - I checked [X] and it does [Y]. Implementing now."
158
+ ✅ "Verified this and you're correct. My initial understanding was wrong because [reason]. Fixing."
159
+
160
+ ❌ Long apology
161
+ ❌ Defending why you pushed back
162
+ ❌ Over-explaining
163
+ ```
164
+
165
+ State the correction factually and move on.
166
+
167
+ ## Common Mistakes
168
+
169
+ | Mistake | Fix |
170
+ |---------|-----|
171
+ | Performative agreement | State requirement or just act |
172
+ | Blind implementation | Verify against codebase first |
173
+ | Batch without testing | One at a time, test each |
174
+ | Assuming reviewer is right | Check if breaks things |
175
+ | Avoiding pushback | Technical correctness > comfort |
176
+ | Partial implementation | Clarify all items first |
177
+ | Can't verify, proceed anyway | State limitation, ask for direction |
178
+
179
+ ## Real Examples
180
+
181
+ **Performative Agreement (Bad):**
182
+ ```
183
+ Reviewer: "Remove legacy code"
184
+ ❌ "You're absolutely right! Let me remove that..."
185
+ ```
186
+
187
+ **Technical Verification (Good):**
188
+ ```
189
+ Reviewer: "Remove legacy code"
190
+ ✅ "Checking... build target is 10.15+, this API needs 13+. Need legacy for backward compat. Current impl has wrong bundle ID - fix it or drop pre-13 support?"
191
+ ```
192
+
193
+ **YAGNI (Good):**
194
+ ```
195
+ Reviewer: "Implement proper metrics tracking with database, date filters, CSV export"
196
+ ✅ "Grepped codebase - nothing calls this endpoint. Remove it (YAGNI)? Or is there usage I'm missing?"
197
+ ```
198
+
199
+ **Unclear Item (Good):**
200
+ ```
201
+ your human partner: "Fix items 1-6"
202
+ You understand 1,2,3,6. Unclear on 4,5.
203
+ ✅ "Understand 1,2,3,6. Need clarification on 4 and 5 before implementing."
204
+ ```
205
+
206
+ ## GitHub Thread Replies
207
+
208
+ When replying to inline review comments on GitHub, reply in the comment thread (`gh api repos/{owner}/{repo}/pulls/{pr}/comments/{id}/replies`), not as a top-level PR comment.
209
+
210
+ ## The Bottom Line
211
+
212
+ **External feedback = suggestions to evaluate, not orders to follow.**
213
+
214
+ Verify. Question. Then implement.
215
+
216
+ No performative agreement. Technical rigor always.
@@ -1,7 +1,10 @@
1
1
  ---
2
2
  name: refactor
3
- description: "对代码进行重构,提高可读性和可维护性,同时保持功能不变。"
4
- author: xujianjiang
3
+ description: "对代码进行重构,提高可读性和可维护性,同时保持功能不变。Use when refactoring code, improving code readability, or optimizing code structure."
4
+ disable-model-invocation: true
5
+ metadata:
6
+ version: "1.0.0"
7
+ author: "xujianjiang"
5
8
  ---
6
9
 
7
10
  # 重构代码 Skill
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: requesting-code-review
3
+ description: "Request code review to verify work meets requirements before merging. Use when needing review, requesting code review, or before merging PRs."
4
+ metadata:
5
+ version: "1.0.0"
6
+ author: "xujianjiang"
7
+ ---
8
+
9
+ # Requesting Code Review
10
+
11
+ Dispatch superpowers:code-reviewer subagent to catch issues before they cascade. The reviewer gets precisely crafted context for evaluation — never your session's history. This keeps the reviewer focused on the work product, not your thought process, and preserves your own context for continued work.
12
+
13
+ **Core principle:** Review early, review often.
14
+
15
+ ## When to Request Review
16
+
17
+ **Mandatory:**
18
+ - After each task in subagent-driven development
19
+ - After completing major feature
20
+ - Before merge to main
21
+
22
+ **Optional but valuable:**
23
+ - When stuck (fresh perspective)
24
+ - Before refactoring (baseline check)
25
+ - After fixing complex bug
26
+
27
+ ## How to Request
28
+
29
+ **1. Get git SHAs:**
30
+ ```bash
31
+ BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
32
+ HEAD_SHA=$(git rev-parse HEAD)
33
+ ```
34
+
35
+ **2. Dispatch code-reviewer subagent:**
36
+
37
+ Use Task tool with superpowers:code-reviewer type, fill template at `code-reviewer.md`
38
+
39
+ **Placeholders:**
40
+ - `{WHAT_WAS_IMPLEMENTED}` - What you just built
41
+ - `{PLAN_OR_REQUIREMENTS}` - What it should do
42
+ - `{BASE_SHA}` - Starting commit
43
+ - `{HEAD_SHA}` - Ending commit
44
+ - `{DESCRIPTION}` - Brief summary
45
+
46
+ **3. Act on feedback:**
47
+ - Fix Critical issues immediately
48
+ - Fix Important issues before proceeding
49
+ - Note Minor issues for later
50
+ - Push back if reviewer is wrong (with reasoning)
51
+
52
+ ## Example
53
+
54
+ ```
55
+ [Just completed Task 2: Add verification function]
56
+
57
+ You: Let me request code review before proceeding.
58
+
59
+ BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
60
+ HEAD_SHA=$(git rev-parse HEAD)
61
+
62
+ [Dispatch superpowers:code-reviewer subagent]
63
+ WHAT_WAS_IMPLEMENTED: Verification and repair functions for conversation index
64
+ PLAN_OR_REQUIREMENTS: Task 2 from docs/superpowers/plans/deployment-plan.md
65
+ BASE_SHA: a7981ec
66
+ HEAD_SHA: 3df7661
67
+ DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
68
+
69
+ [Subagent returns]:
70
+ Strengths: Clean architecture, real tests
71
+ Issues:
72
+ Important: Missing progress indicators
73
+ Minor: Magic number (100) for reporting interval
74
+ Assessment: Ready to proceed
75
+
76
+ You: [Fix progress indicators]
77
+ [Continue to Task 3]
78
+ ```
79
+
80
+ ## Integration with Workflows
81
+
82
+ **Subagent-Driven Development:**
83
+ - Review after EACH task
84
+ - Catch issues before they compound
85
+ - Fix before moving to next task
86
+
87
+ **Executing Plans:**
88
+ - Review after each batch (3 tasks)
89
+ - Get feedback, apply, continue
90
+
91
+ **Ad-Hoc Development:**
92
+ - Review before merge
93
+ - Review when stuck
94
+
95
+ ## Red Flags
96
+
97
+ **Never:**
98
+ - Skip review because "it's simple"
99
+ - Ignore Critical issues
100
+ - Proceed with unfixed Important issues
101
+ - Argue with valid technical feedback
102
+
103
+ **If reviewer wrong:**
104
+ - Push back with technical reasoning
105
+ - Show code/tests that prove it works
106
+ - Request clarification
107
+
108
+ See template at: requesting-code-review/code-reviewer.md
@@ -0,0 +1,146 @@
1
+ # Code Review Agent
2
+
3
+ You are reviewing code changes for production readiness.
4
+
5
+ **Your task:**
6
+ 1. Review {WHAT_WAS_IMPLEMENTED}
7
+ 2. Compare against {PLAN_OR_REQUIREMENTS}
8
+ 3. Check code quality, architecture, testing
9
+ 4. Categorize issues by severity
10
+ 5. Assess production readiness
11
+
12
+ ## What Was Implemented
13
+
14
+ {DESCRIPTION}
15
+
16
+ ## Requirements/Plan
17
+
18
+ {PLAN_REFERENCE}
19
+
20
+ ## Git Range to Review
21
+
22
+ **Base:** {BASE_SHA}
23
+ **Head:** {HEAD_SHA}
24
+
25
+ ```bash
26
+ git diff --stat {BASE_SHA}..{HEAD_SHA}
27
+ git diff {BASE_SHA}..{HEAD_SHA}
28
+ ```
29
+
30
+ ## Review Checklist
31
+
32
+ **Code Quality:**
33
+ - Clean separation of concerns?
34
+ - Proper error handling?
35
+ - Type safety (if applicable)?
36
+ - DRY principle followed?
37
+ - Edge cases handled?
38
+
39
+ **Architecture:**
40
+ - Sound design decisions?
41
+ - Scalability considerations?
42
+ - Performance implications?
43
+ - Security concerns?
44
+
45
+ **Testing:**
46
+ - Tests actually test logic (not mocks)?
47
+ - Edge cases covered?
48
+ - Integration tests where needed?
49
+ - All tests passing?
50
+
51
+ **Requirements:**
52
+ - All plan requirements met?
53
+ - Implementation matches spec?
54
+ - No scope creep?
55
+ - Breaking changes documented?
56
+
57
+ **Production Readiness:**
58
+ - Migration strategy (if schema changes)?
59
+ - Backward compatibility considered?
60
+ - Documentation complete?
61
+ - No obvious bugs?
62
+
63
+ ## Output Format
64
+
65
+ ### Strengths
66
+ [What's well done? Be specific.]
67
+
68
+ ### Issues
69
+
70
+ #### Critical (Must Fix)
71
+ [Bugs, security issues, data loss risks, broken functionality]
72
+
73
+ #### Important (Should Fix)
74
+ [Architecture problems, missing features, poor error handling, test gaps]
75
+
76
+ #### Minor (Nice to Have)
77
+ [Code style, optimization opportunities, documentation improvements]
78
+
79
+ **For each issue:**
80
+ - File:line reference
81
+ - What's wrong
82
+ - Why it matters
83
+ - How to fix (if not obvious)
84
+
85
+ ### Recommendations
86
+ [Improvements for code quality, architecture, or process]
87
+
88
+ ### Assessment
89
+
90
+ **Ready to merge?** [Yes/No/With fixes]
91
+
92
+ **Reasoning:** [Technical assessment in 1-2 sentences]
93
+
94
+ ## Critical Rules
95
+
96
+ **DO:**
97
+ - Categorize by actual severity (not everything is Critical)
98
+ - Be specific (file:line, not vague)
99
+ - Explain WHY issues matter
100
+ - Acknowledge strengths
101
+ - Give clear verdict
102
+
103
+ **DON'T:**
104
+ - Say "looks good" without checking
105
+ - Mark nitpicks as Critical
106
+ - Give feedback on code you didn't review
107
+ - Be vague ("improve error handling")
108
+ - Avoid giving a clear verdict
109
+
110
+ ## Example Output
111
+
112
+ ```
113
+ ### Strengths
114
+ - Clean database schema with proper migrations (db.ts:15-42)
115
+ - Comprehensive test coverage (18 tests, all edge cases)
116
+ - Good error handling with fallbacks (summarizer.ts:85-92)
117
+
118
+ ### Issues
119
+
120
+ #### Important
121
+ 1. **Missing help text in CLI wrapper**
122
+ - File: index-conversations:1-31
123
+ - Issue: No --help flag, users won't discover --concurrency
124
+ - Fix: Add --help case with usage examples
125
+
126
+ 2. **Date validation missing**
127
+ - File: search.ts:25-27
128
+ - Issue: Invalid dates silently return no results
129
+ - Fix: Validate ISO format, throw error with example
130
+
131
+ #### Minor
132
+ 1. **Progress indicators**
133
+ - File: indexer.ts:130
134
+ - Issue: No "X of Y" counter for long operations
135
+ - Impact: Users don't know how long to wait
136
+
137
+ ### Recommendations
138
+ - Add progress reporting for user experience
139
+ - Consider config file for excluded projects (portability)
140
+
141
+ ### Assessment
142
+
143
+ **Ready to merge: With fixes**
144
+
145
+ **Reasoning:** Core implementation is solid with good architecture and tests. Important issues (help text, date validation) are easily fixed and don't affect core functionality.
146
+ ```
@@ -0,0 +1,185 @@
1
+ ---
2
+ name: session-learning
3
+ description: "Summarize conversation experiences and 沉淀 skills. Use when summarizing lessons learned, refining skills, reflecting on experience, or doing post-task reviews."
4
+ metadata:
5
+ version: "1.0.0"
6
+ author: "xujianjiang"
7
+ ---
8
+
9
+ # 对话经验总结与 Skills 沉淀
10
+
11
+ ## 📋 概述
12
+
13
+ 此 skill 用于在对话任务完成后,系统性地总结经验教训并沉淀到仓库的 skills 中,持续提升 AICode 助手的能力。
14
+
15
+ ---
16
+
17
+ ## 🎯 触发时机
18
+
19
+ 当以下情况发生时使用此 skill:
20
+ - 用户请求总结本轮对话的经验
21
+ - 用户询问是否需要补充/更新 skills
22
+ - 一个复杂任务成功完成后,主动询问用户是否需要沉淀经验
23
+ - 用户使用关键词:总结经验、沉淀、学习、skill 补充
24
+
25
+ ---
26
+
27
+ ## 📝 执行流程
28
+
29
+ ### 第一步:对话上下文分析
30
+
31
+ 1. **回顾对话历史**,识别:
32
+ - 任务目标是什么
33
+ - 遇到了哪些挑战或问题
34
+ - 最终解决方案是什么
35
+ - 任务是否成功完成
36
+
37
+ 2. **提取关键信息**:
38
+ - 涉及的技术领域(如 VS Code 服务、TypeScript、Rust 等)
39
+ - 使用的工具或命令
40
+ - 发现的最佳实践
41
+ - 踩过的坑和解决方法
42
+
43
+ ### 第二步:经验教训分析
44
+
45
+ **仅在任务成功完成时**进行深度分析:
46
+
47
+ 1. **成功因素分析**:
48
+ - 什么方法/策略有效
49
+ - 哪些工具使用得当
50
+ - 发现了什么规律或模式
51
+
52
+ 2. **可复用知识提炼**:
53
+ - 通用的解决方案模板
54
+ - 可重复使用的代码模式
55
+ - 值得记录的注意事项
56
+
57
+ 3. **失败教训总结**(如果过程中有失败):
58
+ - 走过的弯路
59
+ - 错误的假设
60
+ - 需要避免的陷阱
61
+
62
+ ### 第三步:Skills 匹配与更新
63
+
64
+ 1. **浏览现有 skills**
65
+
66
+ 首先列出 `.aicode-cli/agent/skills/` 目录下的所有 skills:
67
+
68
+ ```
69
+ 现有 skills 列表:
70
+ - xxxxx
71
+ - xxxxx
72
+
73
+ ```
74
+
75
+ 2. **判断扩充策略**
76
+
77
+ **优先级顺序**(从高到低):
78
+
79
+ | 优先级 | 策略 | 适用场景 |
80
+ |--------|------|----------|
81
+ | 1️⃣ | 扩充现有 skill 的 docs | 经验与现有 skill 主题直接相关 |
82
+ | 2️⃣ | 补充现有 skill 的 SKILL.md | 发现了现有 skill 缺失的核心知识 |
83
+ | 3️⃣ | 新增独立 skill | 经验属于全新领域,无法归入现有 skill |
84
+
85
+ 3. **内容定位决策表**
86
+
87
+ | 经验类型 | 归属 skill | 具体位置 |
88
+ ------|----------|------------|----------|
89
+ | xxx | xxx | 对应 docs/*.md |
90
+
91
+ ### 第四步:生成更新建议
92
+
93
+ 输出格式:
94
+
95
+ ```markdown
96
+ ## 📊 对话总结
97
+
98
+ **任务**: [简述任务目标]
99
+ **结果**: ✅ 成功 / ❌ 失败 / ⏳ 进行中
100
+
101
+ ## 💡 经验教训
102
+
103
+ ### 成功经验
104
+ 1. [经验1]
105
+ 2. [经验2]
106
+
107
+ ### 踩坑记录
108
+ 1. [坑点1] - [解决方案]
109
+
110
+ ## 📝 Skills 更新建议
111
+
112
+ ### 建议更新: [skill 名称]
113
+
114
+ **更新类型**: 扩充 docs / 补充 SKILL.md / 新增 skill
115
+ **目标文件**: [具体文件路径]
116
+ **更新内容**:
117
+
118
+ [具体的内容草稿]
119
+ ```
120
+
121
+ ### 第五步:用户确认
122
+
123
+ **必须使用 `AskUserQuestion` 工具**询问用户是否需要执行更新,**禁止**直接通过文本对话询问。
124
+
125
+ **工具调用配置:**
126
+
127
+ - `questions`: 包含一个问题对象
128
+ - `header`: "Skills 更新"
129
+ - `question`: "根据上述分析,是否需要我帮你更新这些 skills?"
130
+ - `options`:
131
+ - 选项 1:
132
+ - `label`: "更新全部"
133
+ - `description`: "应用所有建议的更新"
134
+ - 选项 2:
135
+ - `label`: "暂不更新"
136
+ - `description`: "结束当前任务,不进行更改"
137
+
138
+ **处理用户选择:**
139
+
140
+ 1. **用户选择"更新全部"**:
141
+ - 直接执行第四步中列出的所有更新建议。
142
+
143
+ 2. **用户选择"暂不更新"**:
144
+ - 结束任务,不进行任何文件修改。
145
+
146
+ ---
147
+
148
+ ## ⚠️ 注意事项
149
+
150
+ 1. **不要过度总结** - 只提取真正有价值的、可复用的经验
151
+ 2. **保持简洁** - 每条经验应该简明扼要,避免冗长
152
+ 3. **优先扩充** - 始终优先考虑扩充现有 skills,而非创建新的
153
+ 4. **尊重用户** - 任何更新都必须先征得用户同意
154
+ 5. **避免重复** - 更新前检查是否已存在类似内容
155
+ 6. **保持一致** - 新内容应与现有 skill 的风格保持一致
156
+
157
+ ---
158
+
159
+ ## 📐 更新规范
160
+
161
+ ### 扩充 docs 文件
162
+
163
+ 遵循现有文档的结构和风格,通常包括:
164
+ - 简短的概述
165
+ - 具体的代码示例
166
+ - 注意事项或常见问题
167
+
168
+ ### 补充 SKILL.md
169
+
170
+ 通常添加到以下位置:
171
+ - 路由表(新增场景-文档映射)
172
+ - 快速索引(新增常用条目)
173
+ - 注意事项(新增通用提醒)
174
+
175
+ ### 新增独立 skill
176
+
177
+ 必须包含:
178
+ - `SKILL.md` - 核心说明文件
179
+ - `docs/` 目录 - 详细文档(如需要)
180
+
181
+ ---
182
+
183
+ ## 🔗 相关资源
184
+
185
+ - Skills 目录: `.aicode-cli/agent/skills/`