@zcy2nn/agent-forge 1.0.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.
- package/LICENSE +21 -0
- package/README.md +266 -0
- package/agent-forge.schema.json +675 -0
- package/dist/agents/council.d.ts +27 -0
- package/dist/agents/councillor.d.ts +2 -0
- package/dist/agents/implementer.d.ts +2 -0
- package/dist/agents/index.d.ts +30 -0
- package/dist/agents/orchestrator.d.ts +30 -0
- package/dist/agents/researcher.d.ts +2 -0
- package/dist/agents/reviewer.d.ts +2 -0
- package/dist/cli/config-io.d.ts +24 -0
- package/dist/cli/config-manager.d.ts +4 -0
- package/dist/cli/custom-skills.d.ts +29 -0
- package/dist/cli/doctor.d.ts +38 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +1932 -0
- package/dist/cli/install.d.ts +2 -0
- package/dist/cli/migration.d.ts +46 -0
- package/dist/cli/model-key-normalization.d.ts +1 -0
- package/dist/cli/paths.d.ts +35 -0
- package/dist/cli/providers.d.ts +99 -0
- package/dist/cli/skills.d.ts +52 -0
- package/dist/cli/system.d.ts +6 -0
- package/dist/cli/types.d.ts +40 -0
- package/dist/config/agent-mcps.d.ts +15 -0
- package/dist/config/constants.d.ts +28 -0
- package/dist/config/council-schema.d.ts +127 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/loader.d.ts +57 -0
- package/dist/config/runtime-preset.d.ts +12 -0
- package/dist/config/schema.d.ts +371 -0
- package/dist/config/utils.d.ts +15 -0
- package/dist/council/council-manager.d.ts +49 -0
- package/dist/council/index.d.ts +1 -0
- package/dist/divoom/council.gif +0 -0
- package/dist/divoom/designer.gif +0 -0
- package/dist/divoom/explorer.gif +0 -0
- package/dist/divoom/fixer.gif +0 -0
- package/dist/divoom/input.gif +0 -0
- package/dist/divoom/intro.gif +0 -0
- package/dist/divoom/librarian.gif +0 -0
- package/dist/divoom/manager.d.ts +57 -0
- package/dist/divoom/oracle.gif +0 -0
- package/dist/divoom/orchestrator.gif +0 -0
- package/dist/hooks/apply-patch/codec.d.ts +7 -0
- package/dist/hooks/apply-patch/errors.d.ts +25 -0
- package/dist/hooks/apply-patch/execution-context.d.ts +27 -0
- package/dist/hooks/apply-patch/index.d.ts +15 -0
- package/dist/hooks/apply-patch/matching.d.ts +26 -0
- package/dist/hooks/apply-patch/operations.d.ts +3 -0
- package/dist/hooks/apply-patch/patch.d.ts +2 -0
- package/dist/hooks/apply-patch/prepared-changes.d.ts +17 -0
- package/dist/hooks/apply-patch/resolution.d.ts +19 -0
- package/dist/hooks/apply-patch/rewrite.d.ts +7 -0
- package/dist/hooks/apply-patch/test-helpers.d.ts +6 -0
- package/dist/hooks/apply-patch/types.d.ts +80 -0
- package/dist/hooks/auto-update-checker/cache.d.ts +11 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +32 -0
- package/dist/hooks/auto-update-checker/constants.d.ts +11 -0
- package/dist/hooks/auto-update-checker/index.d.ts +18 -0
- package/dist/hooks/auto-update-checker/types.d.ts +22 -0
- package/dist/hooks/chat-headers.d.ts +16 -0
- package/dist/hooks/delegate-task-retry/guidance.d.ts +2 -0
- package/dist/hooks/delegate-task-retry/hook.d.ts +8 -0
- package/dist/hooks/delegate-task-retry/index.d.ts +4 -0
- package/dist/hooks/delegate-task-retry/patterns.d.ts +11 -0
- package/dist/hooks/filter-available-skills/index.d.ts +32 -0
- package/dist/hooks/foreground-fallback/index.d.ts +72 -0
- package/dist/hooks/image-hook.d.ts +19 -0
- package/dist/hooks/index.d.ts +13 -0
- package/dist/hooks/json-error-recovery/hook.d.ts +18 -0
- package/dist/hooks/json-error-recovery/index.d.ts +1 -0
- package/dist/hooks/phase-reminder/index.d.ts +26 -0
- package/dist/hooks/post-file-tool-nudge/index.d.ts +19 -0
- package/dist/hooks/task-session-manager/index.d.ts +52 -0
- package/dist/hooks/todo-continuation/index.d.ts +53 -0
- package/dist/hooks/todo-continuation/todo-hygiene.d.ts +35 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +32981 -0
- package/dist/interview/dashboard.d.ts +62 -0
- package/dist/interview/document.d.ts +25 -0
- package/dist/interview/helpers.d.ts +10 -0
- package/dist/interview/index.d.ts +1 -0
- package/dist/interview/manager.d.ts +35 -0
- package/dist/interview/parser.d.ts +11 -0
- package/dist/interview/prompts.d.ts +7 -0
- package/dist/interview/server.d.ts +13 -0
- package/dist/interview/service.d.ts +34 -0
- package/dist/interview/types.d.ts +96 -0
- package/dist/interview/ui.d.ts +12 -0
- package/dist/mcp/context7.d.ts +6 -0
- package/dist/mcp/grep-app.d.ts +6 -0
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/types.d.ts +12 -0
- package/dist/mcp/websearch.d.ts +9 -0
- package/dist/multiplexer/factory.d.ts +26 -0
- package/dist/multiplexer/index.d.ts +9 -0
- package/dist/multiplexer/session-manager.d.ts +53 -0
- package/dist/multiplexer/tmux/index.d.ts +22 -0
- package/dist/multiplexer/types.d.ts +54 -0
- package/dist/multiplexer/zellij/index.d.ts +34 -0
- package/dist/tools/ast-grep/cli.d.ts +15 -0
- package/dist/tools/ast-grep/constants.d.ts +25 -0
- package/dist/tools/ast-grep/downloader.d.ts +5 -0
- package/dist/tools/ast-grep/index.d.ts +10 -0
- package/dist/tools/ast-grep/tools.d.ts +3 -0
- package/dist/tools/ast-grep/types.d.ts +30 -0
- package/dist/tools/ast-grep/utils.d.ts +4 -0
- package/dist/tools/council.d.ts +10 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/preset-manager.d.ts +27 -0
- package/dist/tools/skill.d.ts +9 -0
- package/dist/tools/smartfetch/binary.d.ts +3 -0
- package/dist/tools/smartfetch/cache.d.ts +6 -0
- package/dist/tools/smartfetch/constants.d.ts +12 -0
- package/dist/tools/smartfetch/index.d.ts +3 -0
- package/dist/tools/smartfetch/network.d.ts +38 -0
- package/dist/tools/smartfetch/secondary-model.d.ts +28 -0
- package/dist/tools/smartfetch/tool.d.ts +3 -0
- package/dist/tools/smartfetch/types.d.ts +122 -0
- package/dist/tools/smartfetch/utils.d.ts +18 -0
- package/dist/tui-state.d.ts +15 -0
- package/dist/tui.d.ts +8 -0
- package/dist/tui.js +248 -0
- package/dist/utils/agent-variant.d.ts +63 -0
- package/dist/utils/compat.d.ts +30 -0
- package/dist/utils/env.d.ts +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/internal-initiator.d.ts +6 -0
- package/dist/utils/logger.d.ts +8 -0
- package/dist/utils/polling.d.ts +21 -0
- package/dist/utils/session-manager.d.ts +55 -0
- package/dist/utils/session.d.ts +74 -0
- package/dist/utils/subagent-depth.d.ts +35 -0
- package/dist/utils/system-collapse.d.ts +6 -0
- package/dist/utils/task.d.ts +4 -0
- package/dist/utils/zip-extractor.d.ts +1 -0
- package/package.json +104 -0
- package/src/skills/brainstorming/SKILL.md +177 -0
- package/src/skills/brainstorming/scripts/frame-template.html +214 -0
- package/src/skills/brainstorming/scripts/helper.js +88 -0
- package/src/skills/brainstorming/scripts/server.cjs +354 -0
- package/src/skills/brainstorming/scripts/start-server.sh +148 -0
- package/src/skills/brainstorming/scripts/stop-server.sh +56 -0
- package/src/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/src/skills/brainstorming/visual-companion.md +279 -0
- package/src/skills/codemap/README.md +59 -0
- package/src/skills/codemap/SKILL.md +163 -0
- package/src/skills/codemap/codemap.md +36 -0
- package/src/skills/codemap/scripts/codemap.mjs +483 -0
- package/src/skills/codemap/scripts/codemap.test.ts +129 -0
- package/src/skills/codemap.md +40 -0
- package/src/skills/dispatching-parallel-agents/SKILL.md +193 -0
- package/src/skills/executing-plans/SKILL.md +78 -0
- package/src/skills/finishing-a-development-branch/SKILL.md +211 -0
- package/src/skills/receiving-code-review/SKILL.md +224 -0
- package/src/skills/requesting-code-review/SKILL.md +113 -0
- package/src/skills/requesting-code-review/code-reviewer.md +146 -0
- package/src/skills/simplify/README.md +19 -0
- package/src/skills/simplify/SKILL.md +138 -0
- package/src/skills/simplify/codemap.md +36 -0
- package/src/skills/subagent-driven-development/SKILL.md +288 -0
- package/src/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
- package/src/skills/subagent-driven-development/implementer-prompt.md +113 -0
- package/src/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/src/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/src/skills/systematic-debugging/SKILL.md +308 -0
- package/src/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/src/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/src/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/src/skills/systematic-debugging/find-polluter.sh +63 -0
- package/src/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/src/skills/systematic-debugging/test-academic.md +14 -0
- package/src/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/src/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/src/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/src/skills/test-driven-development/SKILL.md +383 -0
- package/src/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/src/skills/using-git-worktrees/SKILL.md +226 -0
- package/src/skills/verification-before-completion/SKILL.md +147 -0
- package/src/skills/writing-plans/SKILL.md +165 -0
- package/src/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/src/skills/writing-skills/SKILL.md +666 -0
- package/src/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/src/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/src/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/src/skills/writing-skills/persuasion-principles.md +187 -0
- package/src/skills/writing-skills/render-graphs.js +168 -0
- package/src/skills/writing-skills/testing-skills-with-subagents.md +384 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: receiving-code-review
|
|
3
|
+
description: Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review Reception
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Code review requires technical evaluation, not emotional performance.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Verify before implementing. Ask before assuming. Technical correctness over social comfort.
|
|
13
|
+
|
|
14
|
+
## The Response Pattern
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
WHEN receiving code review feedback:
|
|
18
|
+
|
|
19
|
+
1. READ: Complete feedback without reacting
|
|
20
|
+
2. UNDERSTAND: Restate requirement in own words (or ask)
|
|
21
|
+
3. VERIFY: Check against codebase reality
|
|
22
|
+
4. EVALUATE: Technically sound for THIS codebase?
|
|
23
|
+
5. RESPOND: Technical acknowledgment or reasoned pushback
|
|
24
|
+
6. IMPLEMENT: One item at a time, test each
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Forbidden Responses
|
|
28
|
+
|
|
29
|
+
**NEVER:**
|
|
30
|
+
- "You're absolutely right!" (explicit CLAUDE.md violation)
|
|
31
|
+
- "Great point!" / "Excellent feedback!" (performative)
|
|
32
|
+
- "Let me implement that now" (before verification)
|
|
33
|
+
|
|
34
|
+
**INSTEAD:**
|
|
35
|
+
- Restate the technical requirement
|
|
36
|
+
- Ask clarifying questions
|
|
37
|
+
- Push back with technical reasoning if wrong
|
|
38
|
+
- Just start working (actions > words)
|
|
39
|
+
|
|
40
|
+
## Handling Unclear Feedback
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
IF any item is unclear:
|
|
44
|
+
STOP - do not implement anything yet
|
|
45
|
+
ASK for clarification on unclear items
|
|
46
|
+
|
|
47
|
+
WHY: Items may be related. Partial understanding = wrong implementation.
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Example:**
|
|
51
|
+
```
|
|
52
|
+
your human partner: "Fix 1-6"
|
|
53
|
+
You understand 1,2,3,6. Unclear on 4,5.
|
|
54
|
+
|
|
55
|
+
❌ WRONG: Implement 1,2,3,6 now, ask about 4,5 later
|
|
56
|
+
✅ RIGHT: "I understand items 1,2,3,6. Need clarification on 4 and 5 before proceeding."
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Source-Specific Handling
|
|
60
|
+
|
|
61
|
+
### From your human partner
|
|
62
|
+
- **Trusted** - implement after understanding
|
|
63
|
+
- **Still ask** if scope unclear
|
|
64
|
+
- **No performative agreement**
|
|
65
|
+
- **Skip to action** or technical acknowledgment
|
|
66
|
+
|
|
67
|
+
### From External Reviewers
|
|
68
|
+
```
|
|
69
|
+
BEFORE implementing:
|
|
70
|
+
1. Check: Technically correct for THIS codebase?
|
|
71
|
+
2. Check: Breaks existing functionality?
|
|
72
|
+
3. Check: Reason for current implementation?
|
|
73
|
+
4. Check: Works on all platforms/versions?
|
|
74
|
+
5. Check: Does reviewer understand full context?
|
|
75
|
+
|
|
76
|
+
IF suggestion seems wrong:
|
|
77
|
+
Push back with technical reasoning
|
|
78
|
+
|
|
79
|
+
IF can't easily verify:
|
|
80
|
+
Say so: "I can't verify this without [X]. Should I [investigate/ask/proceed]?"
|
|
81
|
+
|
|
82
|
+
IF conflicts with your human partner's prior decisions:
|
|
83
|
+
Stop and discuss with your human partner first
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**your human partner's rule:** "External feedback - be skeptical, but check carefully"
|
|
87
|
+
|
|
88
|
+
## YAGNI Check for "Professional" Features
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
IF reviewer suggests "implementing properly":
|
|
92
|
+
grep codebase for actual usage
|
|
93
|
+
|
|
94
|
+
IF unused: "This endpoint isn't called. Remove it (YAGNI)?"
|
|
95
|
+
IF used: Then implement properly
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**your human partner's rule:** "You and reviewer both report to me. If we don't need this feature, don't add it."
|
|
99
|
+
|
|
100
|
+
## Implementation Order
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
FOR multi-item feedback:
|
|
104
|
+
1. Clarify anything unclear FIRST
|
|
105
|
+
2. Then implement in this order:
|
|
106
|
+
- Blocking issues (breaks, security)
|
|
107
|
+
- Simple fixes (typos, imports)
|
|
108
|
+
- Complex fixes (refactoring, logic)
|
|
109
|
+
3. Test each fix individually
|
|
110
|
+
4. Verify no regressions
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## When To Push Back
|
|
114
|
+
|
|
115
|
+
Push back when:
|
|
116
|
+
- Suggestion breaks existing functionality
|
|
117
|
+
- Reviewer lacks full context
|
|
118
|
+
- Violates YAGNI (unused feature)
|
|
119
|
+
- Technically incorrect for this stack
|
|
120
|
+
- Legacy/compatibility reasons exist
|
|
121
|
+
- Conflicts with your human partner's architectural decisions
|
|
122
|
+
|
|
123
|
+
**How to push back:**
|
|
124
|
+
- Use technical reasoning, not defensiveness
|
|
125
|
+
- Ask specific questions
|
|
126
|
+
- Reference working tests/code
|
|
127
|
+
- Involve your human partner if architectural
|
|
128
|
+
|
|
129
|
+
**Signal if uncomfortable pushing back out loud:** "Strange things are afoot at the Circle K"
|
|
130
|
+
|
|
131
|
+
## Acknowledging Correct Feedback
|
|
132
|
+
|
|
133
|
+
When feedback IS correct:
|
|
134
|
+
```
|
|
135
|
+
✅ "Fixed. [Brief description of what changed]"
|
|
136
|
+
✅ "Good catch - [specific issue]. Fixed in [location]."
|
|
137
|
+
✅ [Just fix it and show in the code]
|
|
138
|
+
|
|
139
|
+
❌ "You're absolutely right!"
|
|
140
|
+
❌ "Great point!"
|
|
141
|
+
❌ "Thanks for catching that!"
|
|
142
|
+
❌ "Thanks for [anything]"
|
|
143
|
+
❌ ANY gratitude expression
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Why no thanks:** Actions speak. Just fix it. The code itself shows you heard the feedback.
|
|
147
|
+
|
|
148
|
+
**If you catch yourself about to write "Thanks":** DELETE IT. State the fix instead.
|
|
149
|
+
|
|
150
|
+
## Gracefully Correcting Your Pushback
|
|
151
|
+
|
|
152
|
+
If you pushed back and were wrong:
|
|
153
|
+
```
|
|
154
|
+
✅ "You were right - I checked [X] and it does [Y]. Implementing now."
|
|
155
|
+
✅ "Verified this and you're correct. My initial understanding was wrong because [reason]. Fixing."
|
|
156
|
+
|
|
157
|
+
❌ Long apology
|
|
158
|
+
❌ Defending why you pushed back
|
|
159
|
+
❌ Over-explaining
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
State the correction factually and move on.
|
|
163
|
+
|
|
164
|
+
## Common Mistakes
|
|
165
|
+
|
|
166
|
+
| Mistake | Fix |
|
|
167
|
+
|---------|-----|
|
|
168
|
+
| Performative agreement | State requirement or just act |
|
|
169
|
+
| Blind implementation | Verify against codebase first |
|
|
170
|
+
| Batch without testing | One at a time, test each |
|
|
171
|
+
| Assuming reviewer is right | Check if breaks things |
|
|
172
|
+
| Avoiding pushback | Technical correctness > comfort |
|
|
173
|
+
| Partial implementation | Clarify all items first |
|
|
174
|
+
| Can't verify, proceed anyway | State limitation, ask for direction |
|
|
175
|
+
|
|
176
|
+
## Real Examples
|
|
177
|
+
|
|
178
|
+
**Performative Agreement (Bad):**
|
|
179
|
+
```
|
|
180
|
+
Reviewer: "Remove legacy code"
|
|
181
|
+
❌ "You're absolutely right! Let me remove that..."
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Technical Verification (Good):**
|
|
185
|
+
```
|
|
186
|
+
Reviewer: "Remove legacy code"
|
|
187
|
+
✅ "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?"
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**YAGNI (Good):**
|
|
191
|
+
```
|
|
192
|
+
Reviewer: "Implement proper metrics tracking with database, date filters, CSV export"
|
|
193
|
+
✅ "Grepped codebase - nothing calls this endpoint. Remove it (YAGNI)? Or is there usage I'm missing?"
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Unclear Item (Good):**
|
|
197
|
+
```
|
|
198
|
+
your human partner: "Fix items 1-6"
|
|
199
|
+
You understand 1,2,3,6. Unclear on 4,5.
|
|
200
|
+
✅ "Understand 1,2,3,6. Need clarification on 4 and 5 before implementing."
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## GitHub Thread Replies
|
|
204
|
+
|
|
205
|
+
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.
|
|
206
|
+
|
|
207
|
+
## Complexity Assessment
|
|
208
|
+
|
|
209
|
+
**Lightweight usage:**
|
|
210
|
+
- Accept clear feedback directly, fix quickly
|
|
211
|
+
|
|
212
|
+
**Standard usage:**
|
|
213
|
+
- Evaluate each piece of feedback → verify validity → accept or push back
|
|
214
|
+
|
|
215
|
+
**Deep usage:**
|
|
216
|
+
- Standard + detailed technical argumentation + multiple rounds of discussion
|
|
217
|
+
|
|
218
|
+
## The Bottom Line
|
|
219
|
+
|
|
220
|
+
**External feedback = suggestions to evaluate, not orders to follow.**
|
|
221
|
+
|
|
222
|
+
Verify. Question. Then implement.
|
|
223
|
+
|
|
224
|
+
No performative agreement. Technical rigor always.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: requesting-code-review
|
|
3
|
+
description: Use when completing tasks, implementing major features, or before merging to verify work meets requirements
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Requesting Code Review
|
|
7
|
+
|
|
8
|
+
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.
|
|
9
|
+
|
|
10
|
+
**Core principle:** Review early, review often.
|
|
11
|
+
|
|
12
|
+
## When to Request Review
|
|
13
|
+
|
|
14
|
+
**Mandatory:**
|
|
15
|
+
- After each task in subagent-driven development
|
|
16
|
+
- After completing major feature
|
|
17
|
+
- Before merge to main
|
|
18
|
+
|
|
19
|
+
**Optional but valuable:**
|
|
20
|
+
- When stuck (fresh perspective)
|
|
21
|
+
- Before refactoring (baseline check)
|
|
22
|
+
- After fixing complex bug
|
|
23
|
+
|
|
24
|
+
## How to Request
|
|
25
|
+
|
|
26
|
+
**1. Get git SHAs:**
|
|
27
|
+
```bash
|
|
28
|
+
BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
|
|
29
|
+
HEAD_SHA=$(git rev-parse HEAD)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**2. Dispatch code-reviewer subagent:**
|
|
33
|
+
|
|
34
|
+
Use Task tool with superpowers:code-reviewer type, fill template at `code-reviewer.md`
|
|
35
|
+
|
|
36
|
+
**Placeholders:**
|
|
37
|
+
- `{WHAT_WAS_IMPLEMENTED}` - What you just built
|
|
38
|
+
- `{PLAN_OR_REQUIREMENTS}` - What it should do
|
|
39
|
+
- `{BASE_SHA}` - Starting commit
|
|
40
|
+
- `{HEAD_SHA}` - Ending commit
|
|
41
|
+
- `{DESCRIPTION}` - Brief summary
|
|
42
|
+
|
|
43
|
+
**3. Act on feedback:**
|
|
44
|
+
- Fix Critical issues immediately
|
|
45
|
+
- Fix Important issues before proceeding
|
|
46
|
+
- Note Minor issues for later
|
|
47
|
+
- Push back if reviewer is wrong (with reasoning)
|
|
48
|
+
|
|
49
|
+
## Example
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
[Just completed Task 2: Add verification function]
|
|
53
|
+
|
|
54
|
+
You: Let me request code review before proceeding.
|
|
55
|
+
|
|
56
|
+
BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
|
|
57
|
+
HEAD_SHA=$(git rev-parse HEAD)
|
|
58
|
+
|
|
59
|
+
[Dispatch superpowers:code-reviewer subagent]
|
|
60
|
+
WHAT_WAS_IMPLEMENTED: Verification and repair functions for conversation index
|
|
61
|
+
PLAN_OR_REQUIREMENTS: Task 2 from docs/superpowers/plans/deployment-plan.md
|
|
62
|
+
BASE_SHA: a7981ec
|
|
63
|
+
HEAD_SHA: 3df7661
|
|
64
|
+
DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
|
|
65
|
+
|
|
66
|
+
[Subagent returns]:
|
|
67
|
+
Strengths: Clean architecture, real tests
|
|
68
|
+
Issues:
|
|
69
|
+
Important: Missing progress indicators
|
|
70
|
+
Minor: Magic number (100) for reporting interval
|
|
71
|
+
Assessment: Ready to proceed
|
|
72
|
+
|
|
73
|
+
You: [Fix progress indicators]
|
|
74
|
+
[Continue to Task 3]
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Integration with Workflows
|
|
78
|
+
|
|
79
|
+
**Subagent-Driven Development:**
|
|
80
|
+
- Review after EACH task
|
|
81
|
+
- Catch issues before they compound
|
|
82
|
+
- Fix before moving to next task
|
|
83
|
+
|
|
84
|
+
**Executing Plans:**
|
|
85
|
+
- Review after each batch (3 tasks)
|
|
86
|
+
- Get feedback, apply, continue
|
|
87
|
+
|
|
88
|
+
**Ad-Hoc Development:**
|
|
89
|
+
- Review before merge
|
|
90
|
+
- Review when stuck
|
|
91
|
+
|
|
92
|
+
## Complexity Assessment
|
|
93
|
+
|
|
94
|
+
**Lightweight usage:**
|
|
95
|
+
- Prompt user to check key changes, no detailed checklist
|
|
96
|
+
|
|
97
|
+
**Standard usage:**
|
|
98
|
+
- Generate full review checklist + self-check + submit for review
|
|
99
|
+
|
|
100
|
+
## Red Flags
|
|
101
|
+
|
|
102
|
+
**Never:**
|
|
103
|
+
- Skip review because "it's simple"
|
|
104
|
+
- Ignore Critical issues
|
|
105
|
+
- Proceed with unfixed Important issues
|
|
106
|
+
- Argue with valid technical feedback
|
|
107
|
+
|
|
108
|
+
**If reviewer wrong:**
|
|
109
|
+
- Push back with technical reasoning
|
|
110
|
+
- Show code/tests that prove it works
|
|
111
|
+
- Request clarification
|
|
112
|
+
|
|
113
|
+
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,19 @@
|
|
|
1
|
+
# Simplify Skill
|
|
2
|
+
|
|
3
|
+
Behavior-preserving code simplification and readability-focused refactoring.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This bundled skill helps the `reviewer` agent review and simplify code without
|
|
8
|
+
changing behavior. It focuses on readability, maintainability, and reducing
|
|
9
|
+
unnecessary complexity.
|
|
10
|
+
|
|
11
|
+
## Source
|
|
12
|
+
|
|
13
|
+
Adapted from Addy Osmani's
|
|
14
|
+
[`code-simplification` skill](https://github.com/addyosmani/agent-skills/blob/main/skills/code-simplification/SKILL.md).
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
Bundled with `agent-forge` and installed automatically when bundled
|
|
19
|
+
skills are enabled via the installer.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: simplify
|
|
3
|
+
description: Simplifies code for clarity without changing behavior. Use for readability, maintainability, and complexity reduction after behavior is understood.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Simplification
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Simplify code by reducing complexity while preserving exact behavior. The goal is not fewer lines — it's code that is easier to read, understand, modify, and debug. Every simplification must pass a simple test: "Would a new team member understand this faster than the original?"
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- After a feature is working and tests pass, but the implementation feels heavier than it needs to be
|
|
15
|
+
- During code review when readability or complexity issues are flagged
|
|
16
|
+
- When you encounter deeply nested logic, long functions, or unclear names
|
|
17
|
+
- When refactoring code written under time pressure
|
|
18
|
+
- When consolidating related logic scattered across files
|
|
19
|
+
- After merging changes that introduced duplication or inconsistency
|
|
20
|
+
|
|
21
|
+
**When NOT to use:**
|
|
22
|
+
|
|
23
|
+
- Code is already clean and readable — don't simplify for the sake of it
|
|
24
|
+
- You don't understand what the code does yet — comprehend before you simplify
|
|
25
|
+
- The code is performance-critical and the "simpler" version would be measurably slower
|
|
26
|
+
- You're about to rewrite the module entirely — simplifying throwaway code wastes effort
|
|
27
|
+
|
|
28
|
+
## The Five Principles
|
|
29
|
+
|
|
30
|
+
### 1. Preserve Behavior Exactly
|
|
31
|
+
|
|
32
|
+
Don't change what the code does — only how it expresses it. All inputs, outputs, side effects, error behavior, and edge cases must remain identical. If you're not sure a simplification preserves behavior, don't make it.
|
|
33
|
+
|
|
34
|
+
Before every change, ask:
|
|
35
|
+
|
|
36
|
+
- Does this produce the same output for every input?
|
|
37
|
+
- Does this maintain the same error behavior?
|
|
38
|
+
- Does this preserve the same side effects and ordering?
|
|
39
|
+
- Do all existing tests still pass without modification?
|
|
40
|
+
|
|
41
|
+
### 2. Follow Project Conventions
|
|
42
|
+
|
|
43
|
+
Simplification means making code more consistent with the codebase, not imposing external preferences.
|
|
44
|
+
|
|
45
|
+
Before simplifying:
|
|
46
|
+
|
|
47
|
+
1. Read `AGENTS.md` / project conventions
|
|
48
|
+
2. Study how neighboring code handles similar patterns
|
|
49
|
+
3. Match the project's style for imports, naming, function style, error handling, and type annotations
|
|
50
|
+
|
|
51
|
+
Simplification that breaks project consistency is not simplification — it's churn.
|
|
52
|
+
|
|
53
|
+
### 3. Prefer Clarity Over Cleverness
|
|
54
|
+
|
|
55
|
+
Explicit code is better than compact code when the compact version requires a mental pause to parse.
|
|
56
|
+
|
|
57
|
+
- Replace nested ternaries with readable control flow
|
|
58
|
+
- Replace dense inline transforms with named intermediate steps when they clarify intent
|
|
59
|
+
- Keep helpful names even if they cost a few extra lines
|
|
60
|
+
|
|
61
|
+
### 4. Maintain Balance
|
|
62
|
+
|
|
63
|
+
Watch for over-simplification:
|
|
64
|
+
|
|
65
|
+
- Don't inline away names that carry meaning
|
|
66
|
+
- Don't merge unrelated logic into one larger function
|
|
67
|
+
- Don't remove abstractions that serve testability or extensibility
|
|
68
|
+
- Don't optimize for line count over comprehension
|
|
69
|
+
|
|
70
|
+
### 5. Scope to What Changed
|
|
71
|
+
|
|
72
|
+
Default to simplifying recently modified code. Avoid unrelated drive-by refactors unless explicitly asked.
|
|
73
|
+
|
|
74
|
+
## Process
|
|
75
|
+
|
|
76
|
+
### Step 1: Understand Before Touching
|
|
77
|
+
|
|
78
|
+
Before changing or removing anything, understand why it exists.
|
|
79
|
+
|
|
80
|
+
Answer:
|
|
81
|
+
|
|
82
|
+
- What is this code's responsibility?
|
|
83
|
+
- What calls it? What does it call?
|
|
84
|
+
- What are the edge cases and error paths?
|
|
85
|
+
- Are there tests that define expected behavior?
|
|
86
|
+
- Why might it have been written this way?
|
|
87
|
+
|
|
88
|
+
If you can't answer these, read more context first.
|
|
89
|
+
|
|
90
|
+
### Step 2: Look for Simplification Opportunities
|
|
91
|
+
|
|
92
|
+
Signals:
|
|
93
|
+
|
|
94
|
+
- Deep nesting
|
|
95
|
+
- Long functions with mixed responsibilities
|
|
96
|
+
- Nested ternaries
|
|
97
|
+
- Boolean flag arguments
|
|
98
|
+
- Repeated conditionals
|
|
99
|
+
- Generic or misleading names
|
|
100
|
+
- Duplicated logic
|
|
101
|
+
- Dead code
|
|
102
|
+
- Wrappers or abstractions that add no value
|
|
103
|
+
|
|
104
|
+
### Step 3: Apply Changes Incrementally
|
|
105
|
+
|
|
106
|
+
Make one simplification at a time.
|
|
107
|
+
|
|
108
|
+
For each simplification:
|
|
109
|
+
|
|
110
|
+
1. Make the change
|
|
111
|
+
2. Run relevant tests
|
|
112
|
+
3. Keep it only if behavior is preserved
|
|
113
|
+
|
|
114
|
+
Separate refactoring from feature work whenever possible.
|
|
115
|
+
|
|
116
|
+
### Step 4: Verify the Result
|
|
117
|
+
|
|
118
|
+
After simplifying, confirm:
|
|
119
|
+
|
|
120
|
+
- The code is genuinely easier to understand
|
|
121
|
+
- The diff is clean and reviewable
|
|
122
|
+
- Project conventions still match
|
|
123
|
+
- No behavior, error handling, or side effects changed
|
|
124
|
+
|
|
125
|
+
## Guidance for This Repository
|
|
126
|
+
|
|
127
|
+
- Prefer straightforward TypeScript over clever compression
|
|
128
|
+
- Preserve existing runtime behavior, tests, and hooks
|
|
129
|
+
- Favor explicit names and smaller focused helpers when they improve readability
|
|
130
|
+
- Keep refactors tightly scoped to the task or review feedback
|
|
131
|
+
|
|
132
|
+
## Verification Checklist
|
|
133
|
+
|
|
134
|
+
- [ ] Existing tests pass without modification
|
|
135
|
+
- [ ] Build/typecheck/lint still pass
|
|
136
|
+
- [ ] No unrelated files were refactored
|
|
137
|
+
- [ ] No error handling was weakened or removed
|
|
138
|
+
- [ ] The result is simpler to review than the original
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# src/skills/simplify/
|
|
2
|
+
|
|
3
|
+
## Responsibility
|
|
4
|
+
|
|
5
|
+
- Provide a behavior-preserving refactoring skill contract that constrains code cleanup to clarity-focused,
|
|
6
|
+
low-risk changes.
|
|
7
|
+
- Define explicit quality gates (understand-before-edit, behavior parity, incremental simplification, rollback-friendly diffs)
|
|
8
|
+
for any simplification task.
|
|
9
|
+
- Ship only metadata; no local runtime state machine is kept in this directory.
|
|
10
|
+
|
|
11
|
+
## Design
|
|
12
|
+
|
|
13
|
+
- Contract layer: `SKILL.md` is the executable prompt specification with explicit phases:
|
|
14
|
+
- pre-change understanding
|
|
15
|
+
- simplification candidate selection
|
|
16
|
+
- incremental transformation and verification
|
|
17
|
+
- final review checklist.
|
|
18
|
+
- Documentation layer: `README.md` explains intent, source provenance, and plugin install behavior.
|
|
19
|
+
- Policy model is declarative (`description`, allowed usage, checklist) consumed by the OpenCode skill executor,
|
|
20
|
+
without helper scripts or plugin code dependencies.
|
|
21
|
+
|
|
22
|
+
## Flow
|
|
23
|
+
|
|
24
|
+
- Agent discovery resolves `src/skills/simplify` as a custom skill entrypoint, then reads `SKILL.md` at runtime.
|
|
25
|
+
- Runtime behavior is gated by `src/cli/custom-skills.ts` (`allowedAgents: ['reviewer']`) and by skill permissions
|
|
26
|
+
computed in `getSkillPermissionsForAgent()`.
|
|
27
|
+
- In practice the workflow is read-only and context-driven: simplify instructions require understanding of callers,
|
|
28
|
+
edge cases, and tests before mutation, then apply local, scoped refactors with validation.
|
|
29
|
+
- Consumers (Implementer/Reviewer tasks) rely on this contract as operational constraints, not as executable TypeScript.
|
|
30
|
+
|
|
31
|
+
## Integration
|
|
32
|
+
|
|
33
|
+
- Installed by plugin installer (`installCustomSkills`) using `src/cli/install.ts` via `installCustomSkill()`.
|
|
34
|
+
- Permission surface is enforced by hook layer in `src/hooks/filter-available-skills/index.ts` (`permissionRules`).
|
|
35
|
+
- Release integrity: `scripts/verify-release-artifact.ts` checks for `src/skills/simplify/SKILL.md` in package tarballs.
|
|
36
|
+
- Operationally paired with codemap/implementer flows in `src/index.ts` orchestrations for post-feature readability hardening.
|