@codihaus/claude-skills 1.6.7 → 1.6.9

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.
@@ -69,250 +69,75 @@ Reviews can be based on:
69
69
  - Clean separation of concerns
70
70
  ```
71
71
 
72
- ## Workflow
72
+ ## Expected Outcome
73
+
74
+ Review report with verdict and categorized issues.
75
+
76
+ **Report includes:**
77
+ - Verdict (Approve/Request Changes/Needs Discussion)
78
+ - Issues found (by severity: critical/important/suggestion)
79
+ - Issues by file
80
+ - Positives (acknowledge good work)
81
+ - Spec compliance (if UC provided)
82
+
83
+ ## Success Criteria
84
+
85
+ - Security risks identified
86
+ - Quality issues found
87
+ - Spec compliance verified
88
+ - Conventions checked
89
+ - Constructive feedback with suggested fixes
90
+ - Clear verdict given
91
+
92
+ ## Review Focus Areas
93
+
94
+ ### Security
95
+ - Input validation (sanitized, injection prevented, XSS prevented)
96
+ - Authentication (required where needed, tokens validated, sessions secure)
97
+ - Authorization (permissions checked, data access restricted, admin protected)
98
+ - Data protection (passwords hashed, sensitive data not logged, no secrets in code)
99
+ - API security (rate limiting, CORS, no sensitive data in URLs)
100
+
101
+ ### Quality
102
+ - Error handling (caught, user-friendly messages, logged, not swallowed)
103
+ - Performance (no N+1 queries, pagination on lists, async heavy ops, no memory leaks)
104
+ - Maintainability (readable, functions not too long, no magic values, DRY)
105
+ - Testing (new code tested, edge cases covered, meaningful tests)
106
+
107
+ ### Conventions
108
+ - Naming (variables, files, components per scout)
109
+ - Structure (correct location, follows patterns, organized imports)
110
+ - Style (matches configs, consistent, no linting errors)
111
+ - Git (proper commit format, no unrelated changes, no debug code)
73
112
 
74
- ### Phase 1: Gather Context
75
-
76
- ```
77
- 1. Get changes to review
78
- → git diff (uncommitted)
79
- → git diff --staged (staged only)
80
- → Read specific files
81
-
82
- 2. Read project conventions
83
- → plans/scout/README.md (Conventions section)
84
- → CLAUDE.md
85
- → .eslintrc, tsconfig.json
86
-
87
- 3. Read stack.md and stack knowledge
88
- → plans/scout/stack.md
89
- → Check "Stack Knowledge References" section
90
- → Read each referenced knowledge/stacks/*.md file
91
- → Use "For /dev-review" sections for review checklists
92
-
93
- Examples:
94
- - Directus project → Read knowledge/stacks/directus/_index.md
95
- - Nuxt project → Read knowledge/stacks/nuxt/_index.md
96
- - Next.js project → Read knowledge/stacks/nextjs/_index.md
97
-
98
- 4. Read related spec (if UC provided)
99
- → plans/features/{feature}/specs/{UC}/README.md
100
- ```
101
-
102
- ### Phase 1.5: Load Quality Attributes
103
-
104
- Load ALL levels from `_quality-attributes.md` for comprehensive verification:
105
-
106
- ```
107
- 1. Architecture Level
108
- → Were architecture decisions followed?
109
- → Any deviations from architecture.md?
110
-
111
- 2. Specification Level
112
- → Does implementation match spec?
113
- → API patterns correct?
114
-
115
- 3. Implementation Level
116
- → Code quality checks
117
- → Security, performance, reliability
118
-
119
- 4. Review Level (meta)
120
- → Can a new developer understand this?
121
- → Would you want to maintain this?
122
- ```
123
-
124
- ### Phase 2: Analyze Changes
125
-
126
- For each changed file:
127
-
128
- ```
129
- 1. Understand the change
130
- - What was added/modified/removed?
131
- - What is the intent?
132
-
133
- 2. Check against spec (if available)
134
- - Does implementation match spec?
135
- - Any missing requirements?
136
-
137
- 3. Check against architecture (if exists)
138
- - Does it follow architecture.md patterns?
139
- - Any undocumented architecture decisions?
140
-
141
- 4. Run through quality attribute checklists
142
- - Scalability
143
- - Maintainability
144
- - Performance
145
- - Security
146
- - Reliability
147
- - Testability
148
- ```
149
-
150
- ### Phase 3: Security Review
151
-
152
- ```markdown
153
- ## Security Checklist
154
-
155
- [ ] **Input Validation**
156
- - User input sanitized?
157
- - SQL/NoSQL injection prevented?
158
- - XSS prevented (HTML escaped)?
159
-
160
- [ ] **Authentication**
161
- - Auth required where needed?
162
- - Token validated correctly?
163
- - Session handled securely?
164
-
165
- [ ] **Authorization**
166
- - Permissions checked?
167
- - Can't access others' data?
168
- - Admin functions protected?
169
-
170
- [ ] **Data Protection**
171
- - Passwords hashed?
172
- - Sensitive data not logged?
173
- - No secrets in code?
174
-
175
- [ ] **API Security**
176
- - Rate limiting present?
177
- - CORS configured?
178
- - No sensitive data in URLs?
179
- ```
180
-
181
- **Common Security Issues:**
182
-
183
- ```typescript
184
- // BAD: SQL injection
185
- const query = `SELECT * FROM users WHERE id = ${userId}`;
186
-
187
- // GOOD: Parameterized
188
- const query = `SELECT * FROM users WHERE id = $1`;
189
- await db.query(query, [userId]);
190
-
191
- // BAD: XSS vulnerable
192
- element.innerHTML = userInput;
193
-
194
- // GOOD: Escaped
195
- element.textContent = userInput;
196
-
197
- // BAD: Hardcoded secret
198
- const apiKey = "sk-1234567890";
199
-
200
- // GOOD: Environment variable
201
- const apiKey = process.env.API_KEY;
202
- ```
203
-
204
- ### Phase 4: Quality Review
205
-
206
- ```markdown
207
- ## Quality Checklist
208
-
209
- [ ] **Error Handling**
210
- - Errors caught and handled?
211
- - User-friendly error messages?
212
- - Errors logged for debugging?
213
- - No swallowed errors?
214
-
215
- [ ] **Performance**
216
- - No N+1 queries?
217
- - Large lists paginated?
218
- - Heavy operations async?
219
- - No memory leaks?
220
-
221
- [ ] **Maintainability**
222
- - Code readable?
223
- - Functions not too long?
224
- - No magic numbers/strings?
225
- - DRY (no unnecessary duplication)?
226
-
227
- [ ] **Testing**
228
- - New code has tests?
229
- - Edge cases covered?
230
- - Tests actually test something?
231
- ```
232
-
233
- **Common Quality Issues:**
234
-
235
- ```typescript
236
- // BAD: N+1 query
237
- const posts = await getPosts();
238
- for (const post of posts) {
239
- post.author = await getUser(post.authorId); // Query per post!
240
- }
241
-
242
- // GOOD: Batch query
243
- const posts = await getPosts({ include: { author: true } });
244
-
245
- // BAD: Swallowed error
246
- try {
247
- await doSomething();
248
- } catch (e) {
249
- // Nothing - error disappears!
250
- }
251
-
252
- // GOOD: Handle or rethrow
253
- try {
254
- await doSomething();
255
- } catch (e) {
256
- logger.error('Failed to do something', e);
257
- throw new AppError('Operation failed', e);
258
- }
259
-
260
- // BAD: Magic number
261
- if (retries > 3) { ... }
262
-
263
- // GOOD: Named constant
264
- const MAX_RETRIES = 3;
265
- if (retries > MAX_RETRIES) { ... }
266
- ```
267
-
268
- ### Phase 5: Convention Review
269
-
270
- ```markdown
271
- ## Convention Checklist (from scout)
272
-
273
- [ ] **Naming**
274
- - Variables: {convention from scout}
275
- - Files: {convention from scout}
276
- - Components: {convention from scout}
277
-
278
- [ ] **Structure**
279
- - File in correct location?
280
- - Follows project patterns?
281
- - Imports organized?
282
-
283
- [ ] **Style**
284
- - Matches .prettierrc / .eslintrc?
285
- - Consistent with codebase?
286
- - No linting errors?
287
-
288
- [ ] **Git**
289
- - Commit message format correct?
290
- - No unrelated changes?
291
- - No debug code / console.log?
292
- ```
293
-
294
- ### Phase 6: Spec Compliance (if UC provided)
295
-
296
- ```markdown
297
- ## Spec Compliance
113
+ ### Spec Compliance
114
+ - Requirements met (all implemented)
115
+ - Requirements not met (missing items)
116
+ - Not in spec (unauthorized additions)
298
117
 
299
- ### Requirements Met
300
- - [x] Login endpoint created
301
- - [x] Returns token on success
302
- - [x] Returns error on invalid credentials
118
+ ### Stack-Specific
119
+ Read stack knowledge files (knowledge/stacks/) for stack-specific review checklists.
303
120
 
304
- ### Requirements Not Met
305
- - [ ] Rate limiting not implemented (spec said 5 attempts/min)
121
+ Examples:
122
+ - Directus: Check for proper collection usage, field types, permissions
123
+ - Nuxt: Check for composables, server routes, nitro patterns
124
+ - Next.js: Check for App Router patterns, server components, actions
306
125
 
307
- ### Not in Spec
308
- - Added "remember me" checkbox (is this approved?)
309
- ```
126
+ ## Context Sources
310
127
 
311
- ### Phase 7: Generate Review
128
+ **Read to understand what was changed:**
129
+ - git diff (uncommitted or staged)
130
+ - Specific files (if provided)
312
131
 
313
- Compile findings into review output format.
132
+ **Read to understand standards:**
133
+ - tech-context.md - Project conventions
134
+ - stack knowledge files - Stack-specific patterns
135
+ - architecture.md - Architecture decisions
136
+ - spec - Requirements (if UC provided)
137
+ - _quality-attributes.md - ALL levels (Architecture, Specification, Implementation, Review)
138
+ - Config files (.eslintrc, tsconfig.json)
314
139
 
315
- **Severity Levels:**
140
+ ## Severity Levels
316
141
 
317
142
  | Level | Icon | Meaning | Action |
318
143
  |-------|------|---------|--------|
@@ -321,7 +146,7 @@ Compile findings into review output format.
321
146
  | Suggestion | 🔵 | Style, improvements | Nice to have |
322
147
  | Positive | ✅ | Good practice noted | Encouragement |
323
148
 
324
- **Review Verdicts:**
149
+ ## Verdicts
325
150
 
326
151
  | Verdict | When |
327
152
  |---------|------|
@@ -74,74 +74,101 @@ Discover and document **how the codebase works** - patterns, rules, and team con
74
74
  - Tech stack info (already documented)
75
75
  - Code conventions (already documented)
76
76
 
77
- ## Discovery Method
77
+ ## Expected Outcome
78
78
 
79
- ### Project-Level (Full Discovery)
79
+ ### Project-Level: `tech-context.md` (~150-200 lines)
80
80
 
81
- **Medium Mode:**
82
- 1. Read project docs (CLAUDE.md, README, CONTRIBUTING)
83
- 2. Detect tech stack (package.json, configs)
84
- 3. Sample 2-3 files per category to discover patterns
85
- 4. Read configs for conventions
81
+ Answers the question: **How does this project work?**
82
+
83
+ **Captures (stable patterns):**
84
+ - How we make API calls (wrapper, pattern, error handling)
85
+ - How we access data (ORM, queries, abstractions)
86
+ - How we structure code (folders, naming, organization)
87
+ - What our conventions are (naming, formatting, git workflow)
88
+ - Tech stack choices (framework, libraries, tools)
89
+
90
+ **Does NOT capture (volatile):**
91
+ - File trees (use Glob fresh)
92
+ - Component/route lists (discover when needed)
93
+ - File counts (meaningless)
94
+ - Exhaustive inventories (stale immediately)
95
+
96
+ ### Feature-Level: `codebase-context.md`
97
+
98
+ Answers the question: **How does THIS feature work?**
99
+
100
+ **Prerequisite:** MUST have `tech-context.md` first (patterns already documented)
101
+
102
+ **Captures:**
103
+ - How this feature implements the patterns (not the patterns themselves)
104
+ - Where the key files are (entry points, core logic)
105
+ - How to extend this feature
106
+ - Feature-specific gotchas
107
+
108
+ **Does NOT repeat:**
109
+ - Project-wide patterns (already in tech-context.md)
110
+ - Tech stack info (already documented)
111
+ - Code conventions (already documented)
112
+
113
+ ## Success Criteria
114
+
115
+ - New engineer can follow patterns from output
116
+ - Patterns shown with examples, not theory
117
+ - Rules captured, not procedures
118
+ - No file inventories or counts
119
+ - Feature scout reuses patterns from tech-context.md
120
+ - ~150-200 lines for tech-context.md
121
+
122
+ ## Discovery Approach
123
+
124
+ ### Project-Level
125
+
126
+ **Medium Mode (default):**
127
+ - Read project docs (CLAUDE.md, README, configs)
128
+ - Detect tech stack from package.json, configs
129
+ - Sample 2-3 files per category to discover patterns
130
+ - Extract conventions from configs
86
131
 
87
132
  **Deep Mode:**
88
- Medium + deeper pattern analysis:
89
- 1. API pattern deep dive
90
- 2. Data access pattern
91
- 3. Code convention detection (from configs + sampling)
92
- 4. Git & team process
93
-
94
- ### Feature-Level (Reuse Patterns)
95
-
96
- **IMPORTANT:** Feature scout is lightweight - it READS patterns from tech-context.md, not rediscover them.
97
-
98
- 1. **Check prerequisite:** `tech-context.md` exists?
99
- - No Run project-level scout first
100
- - Yes Continue
101
-
102
- 2. **Read patterns:** Load `tech-context.md`
103
- - Now you know: API pattern, data access, conventions
104
- - Don't rediscover these
105
-
106
- 3. **Focus on feature:**
107
- - Find files for this feature (Glob/Grep)
108
- - Read 2-3 key files to understand flow
109
- - Identify entry points
110
- - Note integration points
111
-
112
- 4. **Document:**
113
- - How THIS feature implements the patterns
114
- - Where the code lives
115
- - How to extend it
116
- - Feature-specific gotchas
117
-
118
- **Don't:**
119
- - ❌ Rediscover API pattern (already in tech-context.md)
120
- - ❌ Re-document tech stack (already documented)
121
- - ❌ Repeat code conventions (already known)
122
-
123
- ### Strategy
124
- - **Small (<100 files):** Sequential discovery
125
- - **Medium (100-500):** Parallel by concern (API, data, UI, conventions)
126
- - **Large (500+):** Use `/utils/gemini` first, then focused Claude analysis
133
+ - All of Medium +
134
+ - Deeper pattern analysis (API, data access)
135
+ - Code convention detection
136
+ - Git & team process
137
+
138
+ ### Feature-Level
139
+
140
+ **Lightweight approach - reads patterns, not rediscovering:**
141
+
142
+ 1. **Check prerequisite:** tech-context.md exists? If not, run project-level first
143
+ 2. **Read patterns:** Load tech-context.md (now you know API pattern, data access, conventions)
144
+ 3. **Focus on feature:** Find files (Glob/Grep), read 2-3 key files, identify entry points
145
+ 4. **Document:** How THIS feature uses the patterns, where code lives, how to extend
127
146
 
128
147
  ## Pattern Discovery Rules
129
148
 
130
- 1. **Sample, don't exhaustive:** Read 2-3 representative files, not all
131
- 2. **Find abstractions:** Wrappers, base classes, shared utilities
132
- 3. **Capture with example:** Show the pattern, not document everything
133
- 4. **Ask "what's the rule?"** not "what files exist?"
149
+ 1. **Sample, don't exhaust** - Read 2-3 representative files, not all
150
+ 2. **Find abstractions** - Wrappers, base classes, shared utilities
151
+ 3. **Capture with example** - Show the pattern in action
152
+ 4. **Ask "what's the rule?"** - Not "what files exist?"
134
153
 
135
- ## Key Checks
154
+ ## Strategy by Codebase Size
136
155
 
137
- **Pre-flight:**
138
- - If feature-level scout requested, check if `tech-context.md` exists
139
- - If not, run project-level scout first
156
+ | Size | Strategy |
157
+ |------|----------|
158
+ | Small (<100 files) | Sequential discovery |
159
+ | Medium (100-500) | Parallel by concern (API, data, UI, conventions) |
160
+ | Large (500+) | Use `/utils/gemini` first, then focused Claude analysis |
140
161
 
141
- **Existing Scout:**
162
+ ## Version Management
163
+
164
+ **When tech-context.md exists:**
142
165
  - Move current to `history/tech-context-{date}.md`
143
166
  - Note what changed (pattern changes, not file changes)
144
167
 
168
+ **When feature scout requested:**
169
+ - Check tech-context.md exists first
170
+ - If not, run project-level scout first
171
+
145
172
  ## Output Template
146
173
 
147
174
  See `references/output-template.md` for structure.
@@ -65,50 +65,94 @@ plans/features/{feature}/
65
65
  └── UC-XXX-001-slug.md # Lean spec per UC (~150 lines)
66
66
  ```
67
67
 
68
- ## Workflow
69
-
70
- ### Phase 0: Check & Prepare
71
- 1. Verify BRD exists
72
- 2. Verify feature folder exists
73
- 3. Check `tech-context.md` exists (run scout if not)
74
- 4. Check `codebase-context.md` exists (run feature scout if not)
75
- 5. Read docs-graph.json for dependencies
76
-
77
- ### Phase 1: Gather Context
78
- 1. Read BRD use cases for feature
79
- 2. Read `tech-context.md` (HOW to implement)
80
- 3. Read `codebase-context.md` (existing implementation)
81
- 4. Read architecture.md (patterns - call `/dev-arch` if missing)
82
- 5. Read quality attributes (Specification Level)
83
- 6. Ask user: scope, additional context, testing approach
84
-
85
- ### Phase 2: Analyze Impact
86
- For each UC:
87
- - What's new? (files to create)
88
- - What changes? (files to modify)
89
- - What's shared? (reusable across UCs)
90
- - Dependencies? (what must exist first)
68
+ ## Expected Outcome
91
69
 
92
- ### Phase 3: Generate Shared Specs
93
- Create `specs/shared/`:
94
- - `data-model.md` - Schema changes, entities
95
- - `patterns.md` - Pattern references (not pseudocode)
96
- - `security.md` - Auth, validation rules
70
+ **Lean specs** (~150 lines per UC) that define **WHAT to build**, not HOW.
71
+
72
+ **Output structure:**
73
+ ```
74
+ plans/features/{feature}/
75
+ ├── codebase-context.md # From /dev-scout
76
+ └── specs/
77
+ ├── README.md # Index, implementation order
78
+ ├── shared/ # Shared across UCs
79
+ │ ├── data-model.md
80
+ │ ├── patterns.md
81
+ │ └── security.md
82
+ └── UC-XXX-001-slug.md # Lean spec per UC
83
+ ```
97
84
 
98
- ### Phase 4: Generate UC Specs (Lean Format)
99
- For each UC, create `specs/UC-XXX-NNN-slug.md` (~150 lines):
100
- - Context & links
85
+ **Each UC spec includes:**
101
86
  - Requirements (bulleted, testable)
102
87
  - Technical constraints (stack-aware from tech-context.md)
103
- - Acceptance criteria (testable)
104
- - Files to modify
88
+ - Acceptance criteria (testable outcomes)
89
+ - Files to modify (where to work)
105
90
  - API contract (if applicable)
106
- - Test checklist
107
- - Dependencies
91
+ - Dependencies (what must exist first)
108
92
  - Implementation notes (DO/DON'T)
109
93
 
110
- ### Phase 5: Generate Index
111
- Create `specs/README.md` with implementation order and dependencies.
94
+ **Each UC spec does NOT include:**
95
+ - Pseudocode (gets stale)
96
+ - Detailed implementation steps
97
+ - Code examples (reference existing patterns instead)
98
+
99
+ ## Success Criteria
100
+
101
+ - Engineer knows WHAT to build
102
+ - Engineer knows WHERE to build it (file checklist)
103
+ - Engineer can verify success (acceptance criteria)
104
+ - Specs reference existing patterns, don't rewrite them
105
+ - Stack-aware (uses tech-context.md patterns)
106
+ - ~150 lines per UC spec max
107
+
108
+ ## Prerequisites
109
+
110
+ Auto-checked and resolved:
111
+ 1. `plans/brd/` exists with use cases
112
+ 2. `plans/features/{feature}/` exists
113
+ 3. `plans/brd/tech-context.md` exists (auto-runs project scout if missing)
114
+ 4. `plans/features/{feature}/codebase-context.md` exists (auto-runs feature scout if missing)
115
+
116
+ ## Context Sources
117
+
118
+ **Read these to understand HOW:**
119
+ - `tech-context.md` - Project patterns (API, data, structure)
120
+ - `codebase-context.md` - Feature-specific implementation
121
+ - `architecture.md` - Architecture decisions (call `/dev-arch` if missing)
122
+ - `_quality-attributes.md` - Specification Level checklist
123
+
124
+ **Read these to understand WHAT:**
125
+ - `plans/brd/use-cases/{feature}/*.md` - Business requirements
126
+ - `plans/docs-graph.json` - Dependencies between UCs
127
+
128
+ ## User Questions
129
+
130
+ Ask via `AskUserQuestion`:
131
+ 1. **Scope:** Backend only | Frontend only | Full-stack | API/Service | Mobile
132
+ 2. **Additional Context:** API specs | DB schema | Design files | Docs
133
+ 3. **Testing:** Unit only | Unit + Integration | Unit + Integration + E2E | No tests
134
+
135
+ ## Impact Analysis
136
+
137
+ For each UC, identify:
138
+ - What's new? (files to create)
139
+ - What changes? (files to modify)
140
+ - What's shared? (reusable across UCs → specs/shared/)
141
+ - Dependencies? (what must exist first)
142
+
143
+ ## Shared Specs
144
+
145
+ Create `specs/shared/` for cross-UC concerns:
146
+ - `data-model.md` - Schema changes, entities, relationships
147
+ - `patterns.md` - Pattern references (not pseudocode)
148
+ - `security.md` - Auth, permissions, validation rules
149
+
150
+ ## Index Generation
151
+
152
+ Create `specs/README.md` with:
153
+ - Implementation order
154
+ - Dependencies between specs
155
+ - Quick reference to all UCs
112
156
 
113
157
  ## Stack Awareness
114
158