safeword 0.8.4 → 0.8.6
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/dist/{check-OUVIK2O6.js → check-I2J6THGQ.js} +3 -3
- package/dist/{chunk-QYCKBF57.js → chunk-DES5CSPH.js} +2 -2
- package/dist/{chunk-SIK3BC7F.js → chunk-DXT6TWW4.js} +33 -8
- package/dist/{chunk-SIK3BC7F.js.map → chunk-DXT6TWW4.js.map} +1 -1
- package/dist/{chunk-TP334635.js → chunk-VXKJ5ZIV.js} +2 -2
- package/dist/cli.js +6 -6
- package/dist/{diff-ASRWAPYJ.js → diff-4YFDNEZB.js} +3 -3
- package/dist/{reset-4G5DEEMY.js → reset-QVERBAQJ.js} +3 -3
- package/dist/{setup-URK77YMR.js → setup-ZSMZ7HZG.js} +3 -3
- package/dist/sync-VQW5DSTV.js +9 -0
- package/dist/{upgrade-IDR2ZALG.js → upgrade-WILVVHUY.js} +4 -4
- package/package.json +1 -1
- package/templates/cursor/rules/safeword-brainstorming.mdc +198 -0
- package/templates/cursor/rules/safeword-debugging.mdc +202 -0
- package/templates/cursor/rules/safeword-enforcing-tdd.mdc +207 -0
- package/templates/cursor/rules/safeword-quality-reviewer.mdc +158 -0
- package/templates/cursor/rules/safeword-refactoring.mdc +175 -0
- package/templates/cursor/rules/safeword-writing-plans.mdc +218 -0
- package/templates/skills/safeword-brainstorming/SKILL.md +210 -0
- package/templates/skills/{safeword-systematic-debugger → safeword-debugging}/SKILL.md +1 -71
- package/templates/skills/{safeword-tdd-enforcer → safeword-enforcing-tdd}/SKILL.md +17 -17
- package/templates/skills/safeword-quality-reviewer/SKILL.md +17 -67
- package/templates/skills/safeword-writing-plans/SKILL.md +219 -0
- package/dist/sync-AOKWEHCY.js +0 -9
- /package/dist/{check-OUVIK2O6.js.map → check-I2J6THGQ.js.map} +0 -0
- /package/dist/{chunk-QYCKBF57.js.map → chunk-DES5CSPH.js.map} +0 -0
- /package/dist/{chunk-TP334635.js.map → chunk-VXKJ5ZIV.js.map} +0 -0
- /package/dist/{diff-ASRWAPYJ.js.map → diff-4YFDNEZB.js.map} +0 -0
- /package/dist/{reset-4G5DEEMY.js.map → reset-QVERBAQJ.js.map} +0 -0
- /package/dist/{setup-URK77YMR.js.map → setup-ZSMZ7HZG.js.map} +0 -0
- /package/dist/{sync-AOKWEHCY.js.map → sync-VQW5DSTV.js.map} +0 -0
- /package/dist/{upgrade-IDR2ZALG.js.map → upgrade-WILVVHUY.js.map} +0 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainstorming
|
|
3
|
+
description: Use before implementation when refining rough ideas into specs. Guides collaborative design through Socratic questioning, alternative exploration, and incremental validation. Triggers: 'brainstorm', 'design', 'explore options', 'figure out', 'think through', 'what approach'.
|
|
4
|
+
allowed-tools: '*'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Brainstorming Ideas Into Specs
|
|
8
|
+
|
|
9
|
+
Turn rough ideas into validated specs through Socratic dialogue.
|
|
10
|
+
|
|
11
|
+
**Iron Law:** ONE QUESTION AT A TIME. EXPLORE ALTERNATIVES BEFORE DECIDING.
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
Answer IN ORDER. Stop at first match:
|
|
16
|
+
|
|
17
|
+
1. Rough idea needs refinement? → Use this skill
|
|
18
|
+
2. Multiple approaches possible? → Use this skill
|
|
19
|
+
3. Unclear requirements? → Use this skill
|
|
20
|
+
4. Clear task, obvious approach? → Skip (use enforcing-tdd directly)
|
|
21
|
+
5. Pure research/investigation? → Skip
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Phase 1: CONTEXT
|
|
26
|
+
|
|
27
|
+
**Purpose:** Understand what exists before asking questions.
|
|
28
|
+
|
|
29
|
+
**Protocol:**
|
|
30
|
+
|
|
31
|
+
1. Check project state (files, recent commits, existing specs)
|
|
32
|
+
2. Review relevant docs in `.safeword/planning/`
|
|
33
|
+
3. Identify constraints and patterns already established
|
|
34
|
+
|
|
35
|
+
**Exit Criteria:**
|
|
36
|
+
|
|
37
|
+
- [ ] Reviewed relevant codebase areas
|
|
38
|
+
- [ ] Checked existing specs/designs
|
|
39
|
+
- [ ] Ready to ask informed questions
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Phase 2: QUESTION
|
|
44
|
+
|
|
45
|
+
**Iron Law:** ONE QUESTION PER MESSAGE
|
|
46
|
+
|
|
47
|
+
**Protocol:**
|
|
48
|
+
|
|
49
|
+
1. Ask one focused question
|
|
50
|
+
2. Prefer multiple choice (2-4 options) when possible
|
|
51
|
+
3. Open-ended is fine for exploratory topics
|
|
52
|
+
4. Focus on: purpose, constraints, success criteria, scope
|
|
53
|
+
|
|
54
|
+
**Question Types (in order of preference):**
|
|
55
|
+
|
|
56
|
+
| Type | When | Example |
|
|
57
|
+
| --------------- | ----------------------- | ---------------------------------------------------- |
|
|
58
|
+
| Multiple choice | Clear options exist | "Should this be (A) real-time or (B) polling-based?" |
|
|
59
|
+
| Yes/No | Binary decision | "Do we need offline support?" |
|
|
60
|
+
| Bounded open | Need specifics | "What's the max number of items to display?" |
|
|
61
|
+
| Open-ended | Exploring problem space | "What problem are you trying to solve?" |
|
|
62
|
+
|
|
63
|
+
**Exit Criteria:**
|
|
64
|
+
|
|
65
|
+
- [ ] Understand the core problem/goal
|
|
66
|
+
- [ ] Know key constraints
|
|
67
|
+
- [ ] Have success criteria
|
|
68
|
+
- [ ] Scope boundaries are clear
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Phase 3: ALTERNATIVES
|
|
73
|
+
|
|
74
|
+
**Iron Law:** ALWAYS PRESENT 2-3 OPTIONS BEFORE DECIDING
|
|
75
|
+
|
|
76
|
+
**Protocol:**
|
|
77
|
+
|
|
78
|
+
1. Present 2-3 approaches with trade-offs
|
|
79
|
+
2. Lead with your recommendation and why
|
|
80
|
+
3. Be explicit about what each gives up
|
|
81
|
+
4. Let user choose (or suggest hybrid)
|
|
82
|
+
|
|
83
|
+
**Format:**
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
I'd recommend Option A because [reason].
|
|
87
|
+
|
|
88
|
+
**Option A: [Name]**
|
|
89
|
+
- Approach: [how it works]
|
|
90
|
+
- Pros: [benefits]
|
|
91
|
+
- Cons: [drawbacks]
|
|
92
|
+
|
|
93
|
+
**Option B: [Name]**
|
|
94
|
+
- Approach: [how it works]
|
|
95
|
+
- Pros: [benefits]
|
|
96
|
+
- Cons: [drawbacks]
|
|
97
|
+
|
|
98
|
+
**Option C: [Name]** (if applicable)
|
|
99
|
+
- Approach: [how it works]
|
|
100
|
+
- Pros: [benefits]
|
|
101
|
+
- Cons: [drawbacks]
|
|
102
|
+
|
|
103
|
+
Which direction feels right?
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Exit Criteria:**
|
|
107
|
+
|
|
108
|
+
- [ ] Presented 2-3 viable approaches
|
|
109
|
+
- [ ] Gave clear recommendation with reasoning
|
|
110
|
+
- [ ] User selected approach (or hybrid)
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Phase 4: DESIGN
|
|
115
|
+
|
|
116
|
+
**Iron Law:** PRESENT IN 200-300 WORD SECTIONS. VALIDATE EACH.
|
|
117
|
+
|
|
118
|
+
**Protocol:**
|
|
119
|
+
|
|
120
|
+
1. Present design incrementally (not all at once)
|
|
121
|
+
2. After each section: "Does this look right so far?"
|
|
122
|
+
3. Cover: architecture, components, data flow, error handling
|
|
123
|
+
4. Apply YAGNI ruthlessly - remove anything "just in case"
|
|
124
|
+
5. Go back and clarify when something doesn't fit
|
|
125
|
+
|
|
126
|
+
**Sections (present one at a time):**
|
|
127
|
+
|
|
128
|
+
1. **Overview** - What we're building, high-level approach
|
|
129
|
+
2. **Components** - Key pieces and responsibilities
|
|
130
|
+
3. **Data Flow** - How data moves through system
|
|
131
|
+
4. **Edge Cases** - Error handling, boundaries
|
|
132
|
+
5. **Out of Scope** - What we're explicitly NOT doing
|
|
133
|
+
|
|
134
|
+
**Exit Criteria:**
|
|
135
|
+
|
|
136
|
+
- [ ] Each section validated by user
|
|
137
|
+
- [ ] Design is complete and coherent
|
|
138
|
+
- [ ] YAGNI applied (no speculative features)
|
|
139
|
+
- [ ] Ready to create spec
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Phase 5: SPEC
|
|
144
|
+
|
|
145
|
+
**Purpose:** Convert validated design into structured spec.
|
|
146
|
+
|
|
147
|
+
**Protocol:**
|
|
148
|
+
|
|
149
|
+
1. Determine level (L0/L1/L2) using triage questions
|
|
150
|
+
2. Create spec using appropriate template
|
|
151
|
+
3. Commit the spec
|
|
152
|
+
|
|
153
|
+
**Triage:**
|
|
154
|
+
|
|
155
|
+
| Question | If Yes → |
|
|
156
|
+
| ---------------------------------------- | ---------------------------- |
|
|
157
|
+
| User-facing feature with business value? | **L2** → Feature Spec |
|
|
158
|
+
| Bug, improvement, internal, or refactor? | **L1** → Task Spec |
|
|
159
|
+
| Typo, config, or trivial change? | **L0** → Task Spec (minimal) |
|
|
160
|
+
|
|
161
|
+
**Output Locations:**
|
|
162
|
+
|
|
163
|
+
- L2: `.safeword/planning/specs/feature-[slug].md`
|
|
164
|
+
- L1/L0: `.safeword/planning/specs/task-[slug].md`
|
|
165
|
+
- L2 Test Defs: `.safeword/planning/test-definitions/feature-[slug].md`
|
|
166
|
+
|
|
167
|
+
**Exit Criteria:**
|
|
168
|
+
|
|
169
|
+
- [ ] Spec created in correct location
|
|
170
|
+
- [ ] L2: Test definitions created
|
|
171
|
+
- [ ] Spec committed to git
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Phase 6: HANDOFF
|
|
176
|
+
|
|
177
|
+
**Protocol:**
|
|
178
|
+
|
|
179
|
+
1. Summarize what was created
|
|
180
|
+
2. Ask: "Ready to start implementation with TDD?"
|
|
181
|
+
3. If yes → Invoke enforcing-tdd skill
|
|
182
|
+
|
|
183
|
+
**Exit Criteria:**
|
|
184
|
+
|
|
185
|
+
- [ ] User confirmed spec is complete
|
|
186
|
+
- [ ] Handed off to enforcing-tdd (if continuing)
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Key Principles
|
|
191
|
+
|
|
192
|
+
| Principle | Why |
|
|
193
|
+
| ----------------------------- | --------------------------------------- |
|
|
194
|
+
| One question at a time | Prevents overwhelm, gets better answers |
|
|
195
|
+
| Multiple choice preferred | Faster to answer, reduces ambiguity |
|
|
196
|
+
| Alternatives before decisions | Avoids premature commitment |
|
|
197
|
+
| Incremental validation | Catches misunderstandings early |
|
|
198
|
+
| YAGNI ruthlessly | Scope creep kills projects |
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Anti-Patterns
|
|
203
|
+
|
|
204
|
+
| Don't | Do |
|
|
205
|
+
| ------------------------------ | -------------------------------- |
|
|
206
|
+
| Dump full design at once | Present in 200-300 word sections |
|
|
207
|
+
| Ask 5 questions in one message | Ask ONE question |
|
|
208
|
+
| Skip alternatives | Always present 2-3 options |
|
|
209
|
+
| Accept vague requirements | Probe until concrete |
|
|
210
|
+
| Add "nice to have" features | Put them in "Out of Scope" |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: debugging
|
|
3
3
|
description: Four-phase debugging framework that ensures root cause identification before fixes. Use when encountering bugs, test failures, unexpected behavior, or when previous fix attempts failed. Enforces investigate-first discipline ('debug this', 'fix this error', 'test is failing', 'not working').
|
|
4
4
|
allowed-tools: '*'
|
|
5
5
|
---
|
|
@@ -26,33 +26,6 @@ Answer IN ORDER. Stop at first match:
|
|
|
26
26
|
- "Quick fix" seems obvious (red flag)
|
|
27
27
|
- Already tried 1+ fixes that didn't work
|
|
28
28
|
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## Work Log
|
|
32
|
-
|
|
33
|
-
**Think hard. Keep notes.**
|
|
34
|
-
|
|
35
|
-
Before starting Phase 1, create or open a work log:
|
|
36
|
-
|
|
37
|
-
**Location:** `.safeword/logs/{artifact-type}-{slug}.md`
|
|
38
|
-
|
|
39
|
-
| Working on... | Log file name |
|
|
40
|
-
| --------------------- | ------------------------ |
|
|
41
|
-
| Ticket `001-fix-auth` | `ticket-001-fix-auth.md` |
|
|
42
|
-
| Spec `task-add-cache` | `spec-task-add-cache.md` |
|
|
43
|
-
|
|
44
|
-
**One artifact = one log.** If log exists, append a new session.
|
|
45
|
-
|
|
46
|
-
**Especially important for debugging:**
|
|
47
|
-
|
|
48
|
-
1. **Re-read the log** before each hypothesis
|
|
49
|
-
2. **Log what you tried** and why it didn't work
|
|
50
|
-
3. **Note dead ends** - debugging often revisits same paths
|
|
51
|
-
|
|
52
|
-
**Template:** @./.safeword/templates/work-log-template.md
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
29
|
## The Four Phases
|
|
57
30
|
|
|
58
31
|
Complete each phase before proceeding.
|
|
@@ -220,32 +193,6 @@ If you catch yourself thinking:
|
|
|
220
193
|
|
|
221
194
|
**ALL mean: STOP. Return to Phase 1.**
|
|
222
195
|
|
|
223
|
-
## Finding Test Pollution
|
|
224
|
-
|
|
225
|
-
When tests pass individually but fail together (test isolation problem, tests affect each other, tests leave files behind), use bisection:
|
|
226
|
-
|
|
227
|
-
```bash
|
|
228
|
-
./.safeword/scripts/bisect-test-pollution.sh '.git' '*.test.ts' src
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
See: @./.safeword/scripts/bisect-test-pollution.sh
|
|
232
|
-
|
|
233
|
-
## Debug Logging
|
|
234
|
-
|
|
235
|
-
When adding diagnostic logging:
|
|
236
|
-
|
|
237
|
-
```javascript
|
|
238
|
-
// ❌ BAD
|
|
239
|
-
console.log('here');
|
|
240
|
-
console.log(data);
|
|
241
|
-
|
|
242
|
-
// ✅ GOOD
|
|
243
|
-
console.log('validateUser', { expected: 'admin', actual: user.role });
|
|
244
|
-
console.log('processOrder', JSON.stringify({ input, output }, null, 2));
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
Log **expected vs actual**. Remove after fixing.
|
|
248
|
-
|
|
249
196
|
## Quick Reference
|
|
250
197
|
|
|
251
198
|
| Phase | Key Question | Success Criteria |
|
|
@@ -254,20 +201,3 @@ Log **expected vs actual**. Remove after fixing.
|
|
|
254
201
|
| 2. Pattern | "What's different from working code?" | Identified key differences |
|
|
255
202
|
| 3. Hypothesis | "Is my theory correct?" | Confirmed or formed new theory |
|
|
256
203
|
| 4. Implementation | "Does the fix work?" | Test passes, issue resolved |
|
|
257
|
-
|
|
258
|
-
## Finding Zombie Process Spawners
|
|
259
|
-
|
|
260
|
-
When tests leave processes behind (playwright browsers not cleaned up, port stays in use, zombie node processes, chromium accumulating), use bisection to find the culprit:
|
|
261
|
-
|
|
262
|
-
```bash
|
|
263
|
-
./.safeword/scripts/bisect-zombie-processes.sh 'chromium' '*.test.ts' tests
|
|
264
|
-
./.safeword/scripts/bisect-zombie-processes.sh 'playwright' '*.spec.ts' e2e
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
See: @./.safeword/scripts/bisect-zombie-processes.sh
|
|
268
|
-
|
|
269
|
-
## Related Resources
|
|
270
|
-
|
|
271
|
-
- Process cleanup guide: @./.safeword/guides/zombie-process-cleanup.md
|
|
272
|
-
- Debug logging style: @./.safeword/guides/code-philosophy.md
|
|
273
|
-
- TDD for fix verification: @./.safeword/guides/testing-guide.md
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: tdd
|
|
3
|
-
description: Use when implementing features, fixing bugs, or
|
|
2
|
+
name: enforcing-tdd
|
|
3
|
+
description: Use when implementing features, fixing bugs, or making code changes. Ensures scope is defined before coding, then enforces RED → GREEN → REFACTOR test discipline. Triggers: 'implement', 'add', 'build', 'create', 'fix', 'change', 'feature', 'bug'.
|
|
4
4
|
allowed-tools: '*'
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -17,7 +17,7 @@ Answer IN ORDER. Stop at first match:
|
|
|
17
17
|
1. Implementing new feature? → Use this skill
|
|
18
18
|
2. Fixing bug? → Use this skill
|
|
19
19
|
3. Adding enhancement? → Use this skill
|
|
20
|
-
4. Refactoring
|
|
20
|
+
4. Refactoring? → Use this skill
|
|
21
21
|
5. Research/investigation only? → Skip this skill
|
|
22
22
|
|
|
23
23
|
---
|
|
@@ -160,15 +160,15 @@ Claim: "All tests pass" "Tests pass" (no output shown)
|
|
|
160
160
|
|
|
161
161
|
**Red Flags → STOP:**
|
|
162
162
|
|
|
163
|
-
| Flag | Action
|
|
164
|
-
| --------------------------- |
|
|
165
|
-
| "should", "probably" claims | Run command, show output first
|
|
166
|
-
| "Done!" before verification | Run command, show output first
|
|
167
|
-
| "Just in case" code | Delete it
|
|
168
|
-
| Multiple functions | Delete extras
|
|
169
|
-
| Refactoring | Stop - that's Phase 3
|
|
170
|
-
| Test still fails | Debug (→
|
|
171
|
-
| Hardcoded value | Implement real logic (see below)
|
|
163
|
+
| Flag | Action |
|
|
164
|
+
| --------------------------- | ---------------------------------- |
|
|
165
|
+
| "should", "probably" claims | Run command, show output first |
|
|
166
|
+
| "Done!" before verification | Run command, show output first |
|
|
167
|
+
| "Just in case" code | Delete it |
|
|
168
|
+
| Multiple functions | Delete extras |
|
|
169
|
+
| Refactoring | Stop - that's Phase 3 |
|
|
170
|
+
| Test still fails | Debug (→ debugging skill if stuck) |
|
|
171
|
+
| Hardcoded value | Implement real logic (see below) |
|
|
172
172
|
|
|
173
173
|
### Anti-Pattern: Mock Implementations
|
|
174
174
|
|
|
@@ -253,11 +253,11 @@ Phase 0: L0 → create minimal spec → Phase 1: no new test (existing tests cov
|
|
|
253
253
|
|
|
254
254
|
## Integration
|
|
255
255
|
|
|
256
|
-
| Scenario | Handoff
|
|
257
|
-
| ----------------------- |
|
|
258
|
-
| Test fails unexpectedly | →
|
|
259
|
-
| Review needed | → quality-reviewer
|
|
260
|
-
| Scope expanding | → Update spec first
|
|
256
|
+
| Scenario | Handoff |
|
|
257
|
+
| ----------------------- | ------------------- |
|
|
258
|
+
| Test fails unexpectedly | → debugging skill |
|
|
259
|
+
| Review needed | → quality-reviewer |
|
|
260
|
+
| Scope expanding | → Update spec first |
|
|
261
261
|
|
|
262
262
|
---
|
|
263
263
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: quality-reviewer
|
|
3
|
-
description: Deep code
|
|
3
|
+
description: Deep code review with web research to verify against latest ecosystem. Use when user says 'double check against latest', 'verify versions', 'check security', 'review against docs', or needs deep analysis beyond automatic quality hook.
|
|
4
4
|
allowed-tools: '*'
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ allowed-tools: '*'
|
|
|
8
8
|
|
|
9
9
|
Deep quality review with web research to verify code against the latest ecosystem state.
|
|
10
10
|
|
|
11
|
-
**Primary differentiator**: Web research
|
|
11
|
+
**Primary differentiator**: Web research to verify against current versions, documentation, and best practices.
|
|
12
12
|
|
|
13
13
|
**Triggers**:
|
|
14
14
|
|
|
@@ -16,7 +16,6 @@ Deep quality review with web research to verify code against the latest ecosyste
|
|
|
16
16
|
- **Deep dive needed**: User wants analysis beyond automatic hook (performance, architecture alternatives, trade-offs)
|
|
17
17
|
- **No SAFEWORD.md/CLAUDE.md**: Projects without context files (automatic hook won't run, manual review needed)
|
|
18
18
|
- **Pre-change review**: User wants review before making changes (automatic hook only triggers after changes)
|
|
19
|
-
- **Model-invoked**: Claude determines web research would be valuable
|
|
20
19
|
|
|
21
20
|
**Relationship to automatic quality hook**:
|
|
22
21
|
|
|
@@ -43,7 +42,6 @@ Read relevant standards:
|
|
|
43
42
|
|
|
44
43
|
- `CLAUDE.md` or `SAFEWORD.md` - Project-specific guidelines
|
|
45
44
|
- `ARCHITECTURE.md` - Architectural principles
|
|
46
|
-
- `@./.safeword/guides/code-philosophy.md` - Core coding principles
|
|
47
45
|
|
|
48
46
|
### 3. Evaluate Correctness
|
|
49
47
|
|
|
@@ -92,14 +90,12 @@ Read relevant standards:
|
|
|
92
90
|
- Are we using libraries correctly?
|
|
93
91
|
- Are we following official documentation?
|
|
94
92
|
|
|
95
|
-
### 7. Verify Latest Versions
|
|
93
|
+
### 7. Verify Latest Versions - PRIMARY VALUE
|
|
96
94
|
|
|
97
95
|
**CRITICAL**: This is your main differentiator from automatic hook. ALWAYS check versions.
|
|
98
96
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
WebSearch: "[library name] security vulnerabilities"
|
|
102
|
-
```
|
|
97
|
+
Search for: "[library name] latest stable version 2025"
|
|
98
|
+
Search for: "[library name] security vulnerabilities"
|
|
103
99
|
|
|
104
100
|
**Flag if outdated:**
|
|
105
101
|
|
|
@@ -110,25 +106,17 @@ WebSearch: "[library name] security vulnerabilities"
|
|
|
110
106
|
|
|
111
107
|
**Common libraries**: React, TypeScript, Vite, Next.js, Node.js, Vitest, Playwright, Jest, esbuild
|
|
112
108
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
### 8. Verify Latest Documentation ⭐ **PRIMARY VALUE**
|
|
109
|
+
### 8. Verify Latest Documentation - PRIMARY VALUE
|
|
116
110
|
|
|
117
111
|
**CRITICAL**: This is your main differentiator from automatic hook. ALWAYS verify against current docs.
|
|
118
112
|
|
|
119
|
-
|
|
120
|
-
WebFetch: https://react.dev (for React)
|
|
121
|
-
WebFetch: https://vitejs.dev (for Vite)
|
|
122
|
-
WebFetch: https://www.electronjs.org/docs (for Electron)
|
|
123
|
-
```
|
|
113
|
+
Fetch and check official documentation sites for the libraries in use.
|
|
124
114
|
|
|
125
115
|
**Look for:**
|
|
126
116
|
|
|
127
117
|
- Are we using deprecated APIs?
|
|
128
118
|
- Are there newer, better patterns?
|
|
129
|
-
- Did the library's recommendations change
|
|
130
|
-
|
|
131
|
-
**Cache results**: If you checked docs recently in this session, don't re-fetch.
|
|
119
|
+
- Did the library's recommendations change recently?
|
|
132
120
|
|
|
133
121
|
## Output Format
|
|
134
122
|
|
|
@@ -147,8 +135,8 @@ WebFetch: https://www.electronjs.org/docs (for Electron)
|
|
|
147
135
|
**Anti-Bloat:** [✓/⚠️/❌] [Brief assessment]
|
|
148
136
|
**Elegance:** [✓/⚠️/❌] [Brief assessment]
|
|
149
137
|
**Standards:** [✓/⚠️/❌] [Brief assessment]
|
|
150
|
-
**Versions:** [✓/⚠️/❌] [Latest version check
|
|
151
|
-
**Documentation:** [✓/⚠️/❌] [Current docs check
|
|
138
|
+
**Versions:** [✓/⚠️/❌] [Latest version check]
|
|
139
|
+
**Documentation:** [✓/⚠️/❌] [Current docs check]
|
|
152
140
|
|
|
153
141
|
**Verdict:** [APPROVE / REQUEST CHANGES / NEEDS DISCUSSION]
|
|
154
142
|
|
|
@@ -156,52 +144,14 @@ WebFetch: https://www.electronjs.org/docs (for Electron)
|
|
|
156
144
|
**Suggested improvements:** [List or "None"]
|
|
157
145
|
```
|
|
158
146
|
|
|
159
|
-
Use structured format for "double check"/"critique". Use brief format for specific questions.
|
|
160
|
-
|
|
161
|
-
## Example: Full Review
|
|
162
|
-
|
|
163
|
-
```markdown
|
|
164
|
-
## Quality Review
|
|
165
|
-
|
|
166
|
-
**Correctness:** ✓ Logic sound, edge cases covered, error handling adequate
|
|
167
|
-
**Anti-Bloat:** ✓ Minimal dependencies, appropriate abstractions
|
|
168
|
-
**Elegance:** ✓ Clear code, good naming, well-structured
|
|
169
|
-
**Standards:** ✓ Follows CLAUDE.md patterns
|
|
170
|
-
**Versions:** ✓ React 19.0.0 (latest stable), TypeScript 5.7.2 (latest)
|
|
171
|
-
**Documentation:** ✓ Using current React patterns per https://react.dev
|
|
172
|
-
|
|
173
|
-
**Verdict:** APPROVE - Production ready
|
|
174
|
-
|
|
175
|
-
**Critical issues:** None
|
|
176
|
-
**Suggested improvements:** None
|
|
177
|
-
```
|
|
178
|
-
|
|
179
147
|
## Critical Reminders
|
|
180
148
|
|
|
181
|
-
1. **Primary value: Web research** -
|
|
149
|
+
1. **Primary value: Web research** - Verify against current ecosystem (versions, docs, security)
|
|
182
150
|
2. **Complement automatic hook** - Hook does fast check with existing knowledge, you do deep dive with web research
|
|
183
151
|
3. **Explicit triggers matter** - "double check against latest docs", "verify versions", "check security" = invoke web research
|
|
184
|
-
4. **
|
|
185
|
-
5. **Always
|
|
186
|
-
6. **
|
|
187
|
-
7. **
|
|
188
|
-
8. **
|
|
189
|
-
9. **
|
|
190
|
-
10. **Separate critical vs nice-to-have** - User needs to know what's blocking vs optional
|
|
191
|
-
|
|
192
|
-
## Non-Obvious Edge Cases
|
|
193
|
-
|
|
194
|
-
**User requests review after automatic hook ran:**
|
|
195
|
-
|
|
196
|
-
- Acknowledge hook ran: "The automatic quality hook already did a fast check. I'll now do deeper analysis with web research..."
|
|
197
|
-
- Focus on what automatic hook doesn't do: fetch latest docs, verify versions, security checks, performance analysis
|
|
198
|
-
|
|
199
|
-
**WebSearch/WebFetch fails:**
|
|
200
|
-
|
|
201
|
-
- Continue review without version/docs checks
|
|
202
|
-
- Note: "Couldn't verify latest versions/docs, skipping that check"
|
|
203
|
-
|
|
204
|
-
**Project has no CLAUDE.md/SAFEWORD.md:**
|
|
205
|
-
|
|
206
|
-
- Use `@./.safeword/guides/code-philosophy.md` as fallback
|
|
207
|
-
- Note: "No project-specific standards found, using general best practices"
|
|
152
|
+
4. **Always check latest docs** - Verify patterns are current, not outdated
|
|
153
|
+
5. **Always verify versions** - Flag outdated dependencies
|
|
154
|
+
6. **Be thorough but concise** - Cover all areas but keep explanations brief
|
|
155
|
+
7. **Provide actionable feedback** - Specific line numbers, concrete suggestions
|
|
156
|
+
8. **Clear verdict** - Always end with APPROVE/REQUEST CHANGES/NEEDS DISCUSSION
|
|
157
|
+
9. **Separate critical vs nice-to-have** - User needs to know what's blocking vs optional
|