@codihaus/claude-skills 1.0.0

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 (46) hide show
  1. package/README.md +167 -0
  2. package/bin/cli.js +58 -0
  3. package/package.json +46 -0
  4. package/skills/_quality-attributes.md +392 -0
  5. package/skills/_registry.md +189 -0
  6. package/skills/debrief/SKILL.md +647 -0
  7. package/skills/debrief/references/change-request-template.md +124 -0
  8. package/skills/debrief/references/file-patterns.md +173 -0
  9. package/skills/debrief/references/group-codes.md +72 -0
  10. package/skills/debrief/references/research-queries.md +106 -0
  11. package/skills/debrief/references/use-case-template.md +141 -0
  12. package/skills/debrief/scripts/generate_questionnaire.py +195 -0
  13. package/skills/dev-arch/SKILL.md +747 -0
  14. package/skills/dev-changelog/SKILL.md +378 -0
  15. package/skills/dev-coding/SKILL.md +470 -0
  16. package/skills/dev-coding-backend/SKILL.md +361 -0
  17. package/skills/dev-coding-frontend/SKILL.md +534 -0
  18. package/skills/dev-coding-frontend/references/nextjs.md +477 -0
  19. package/skills/dev-review/SKILL.md +548 -0
  20. package/skills/dev-scout/SKILL.md +723 -0
  21. package/skills/dev-scout/references/feature-patterns.md +210 -0
  22. package/skills/dev-scout/references/file-patterns.md +252 -0
  23. package/skills/dev-scout/references/tech-detection.md +211 -0
  24. package/skills/dev-scout/scripts/scout-analyze.sh +280 -0
  25. package/skills/dev-specs/SKILL.md +577 -0
  26. package/skills/dev-specs/references/checklist.md +176 -0
  27. package/skills/dev-specs/references/spec-templates.md +460 -0
  28. package/skills/dev-test/SKILL.md +364 -0
  29. package/skills/utils/diagram/SKILL.md +205 -0
  30. package/skills/utils/diagram/references/common-errors.md +305 -0
  31. package/skills/utils/diagram/references/diagram-types.md +636 -0
  32. package/skills/utils/docs-graph/SKILL.md +204 -0
  33. package/skills/utils/gemini/SKILL.md +292 -0
  34. package/skills/utils/gemini/scripts/gemini-scan.py +340 -0
  35. package/skills/utils/gemini/scripts/setup.sh +169 -0
  36. package/src/commands/add.js +64 -0
  37. package/src/commands/doctor.js +179 -0
  38. package/src/commands/init.js +251 -0
  39. package/src/commands/list.js +88 -0
  40. package/src/commands/remove.js +60 -0
  41. package/src/commands/update.js +72 -0
  42. package/src/index.js +26 -0
  43. package/src/utils/config.js +272 -0
  44. package/src/utils/deps.js +599 -0
  45. package/src/utils/skills.js +253 -0
  46. package/templates/CLAUDE.md.template +58 -0
@@ -0,0 +1,204 @@
1
+ ---
2
+ name: utils/docs-graph
3
+ description: View and query the documentation knowledge graph
4
+ version: 1.2.0
5
+ ---
6
+
7
+ # /utils/docs-graph - Documentation Graph Viewer
8
+
9
+ > **Skill Awareness**: See `skills/_registry.md` for all available skills.
10
+ > - **Auto-updated**: By Claude Code hook on Write/Edit to plans/
11
+ > - **Called by**: `/dev-specs`, `/debrief`, `/dev-arch` for relationships
12
+ > - **Note**: Utility skill, typically called by other skills
13
+
14
+ View and query relationships between planning documents.
15
+
16
+ ## When to Use
17
+
18
+ - See overview of all plans and their relationships
19
+ - Find related documents before making changes
20
+ - Check impact of changes (what links to this?)
21
+ - Verify graph is up-to-date
22
+
23
+ ## Usage
24
+
25
+ ```
26
+ /utils/docs-graph # Show graph summary
27
+ /utils/docs-graph auth # Show nodes related to "auth"
28
+ /utils/docs-graph --regenerate # Force regenerate graph
29
+ /utils/docs-graph --check # Verify all links resolve
30
+ ```
31
+
32
+ ## How It Works
33
+
34
+ The graph is automatically updated via Claude Code hooks whenever files in `plans/` are created or modified. This skill provides on-demand viewing and querying.
35
+
36
+ ### Automatic Updates
37
+
38
+ PostToolUse hook triggers on Write/Edit to plans/:
39
+ 1. Hook detects file path contains `plans/`
40
+ 2. Runs `python3 scripts/graph.py --check-path <path>`
41
+ 3. Graph files updated before next Claude action
42
+
43
+ ### Graph Files
44
+
45
+ ```
46
+ plans/
47
+ ├── docs-graph.json # Machine-readable graph data
48
+ └── docs-graph.md # Mermaid visualization
49
+ ```
50
+
51
+ ## Workflow
52
+
53
+ ### Phase 1: Load Graph
54
+
55
+ 1. Check if `plans/docs-graph.json` exists
56
+ 2. If not, run `python3 scripts/graph.py` to generate
57
+ 3. Read graph data
58
+
59
+ ### Phase 2: Display or Query
60
+
61
+ **Summary mode (default):**
62
+ - Show node count by type
63
+ - Show edge count
64
+ - Display mermaid diagram from docs-graph.md
65
+ - List any errors
66
+
67
+ **Query mode (with argument):**
68
+ - Filter nodes matching query
69
+ - Show incoming links (what references this)
70
+ - Show outgoing links (what this references)
71
+
72
+ **Regenerate mode (--regenerate):**
73
+ - Force full rescan of plans/
74
+ - Update docs-graph.json and docs-graph.md
75
+ - Show diff if changes detected
76
+
77
+ **Check mode (--check):**
78
+ - Verify all wikilinks resolve to existing nodes
79
+ - Report broken links
80
+ - Suggest fixes
81
+
82
+ ### Phase 3: Output
83
+
84
+ Display results with:
85
+ - Mermaid diagram (if summary)
86
+ - Table of matching nodes (if query)
87
+ - Broken link report (if check)
88
+
89
+ ## Wikilink Convention
90
+
91
+ Documents use `[[wikilinks]]` to reference each other:
92
+
93
+ ```markdown
94
+ # UC-AUTH-001: Login
95
+
96
+ > **Feature**: [[feature-auth]]
97
+ > **Related**: [[uc-auth-002]], [[uc-auth-003]]
98
+ > **Spec**: [[spec-auth-001]]
99
+ ```
100
+
101
+ **Link ID format:**
102
+ - Use cases: `[[uc-auth-001]]` (lowercase, no slug)
103
+ - Features: `[[feature-auth]]`
104
+ - Specs: `[[spec-auth-001]]`
105
+ - Change requests: `[[cr-001]]`
106
+
107
+ ## Node Types
108
+
109
+ | Type | Source | Shape (Mermaid) |
110
+ |------|--------|-----------------|
111
+ | brd | `brd/README.md` | Stadium `[[]]` |
112
+ | use-case | `brd/use-cases/**/*.md` | Rectangle `[]` |
113
+ | change-request | `brd/changes/*.md` | Hexagon `{{}}` |
114
+ | feature | `features/*/README.md` | Pill `([])` |
115
+ | spec | `features/*/specs/**/*.md` | Parallelogram `[//]` |
116
+ | scout | `**/scout.md` | Cylinder `[()]` |
117
+
118
+ ## Example Output
119
+
120
+ ### Summary
121
+
122
+ ```
123
+ Documentation Graph Summary
124
+ ===========================
125
+ Nodes: 12 | Edges: 18
126
+
127
+ By Type:
128
+ use-case: 5
129
+ feature: 2
130
+ spec: 4
131
+ brd: 1
132
+
133
+ View full graph: plans/docs-graph.md
134
+ ```
135
+
136
+ ### Query: `/utils/docs-graph auth`
137
+
138
+ ```
139
+ Nodes matching "auth": 4
140
+
141
+ uc-auth-001 (use-case) - Login
142
+ ← feature-auth, spec-auth-001
143
+ → feature-auth
144
+
145
+ uc-auth-002 (use-case) - Signup
146
+ ← feature-auth
147
+ → uc-auth-001, feature-auth
148
+
149
+ feature-auth (feature) - Authentication
150
+ ← uc-auth-001, uc-auth-002, uc-auth-003
151
+ → (none)
152
+
153
+ spec-auth-001 (spec) - Login Spec
154
+ ← (none)
155
+ → uc-auth-001
156
+ ```
157
+
158
+ ### Check: `/utils/docs-graph --check`
159
+
160
+ ```
161
+ Link Check Results
162
+ ==================
163
+ ✓ 16 valid links
164
+ ✗ 2 broken links
165
+
166
+ Broken:
167
+ plans/brd/use-cases/auth/UC-AUTH-001-login.md:5
168
+ [[uc-auth-004]] - node not found
169
+
170
+ plans/features/auth/specs/UC-AUTH-001/README.md:12
171
+ [[feature-billing]] - node not found
172
+
173
+ Suggestions:
174
+ - uc-auth-004: Did you mean uc-auth-003?
175
+ - feature-billing: Create plans/features/billing/README.md
176
+ ```
177
+
178
+ ## Tools Used
179
+
180
+ | Tool | Purpose |
181
+ |------|---------|
182
+ | `Bash` | Run graph.py script |
183
+ | `Read` | Read docs-graph.json, docs-graph.md |
184
+ | `Glob` | Find plan files |
185
+
186
+ ## Integration
187
+
188
+ | Skill | Relationship |
189
+ |-------|--------------|
190
+ | `/debrief` | Creates use cases with wikilinks |
191
+ | `/dev-specs` | Creates specs linking to use cases |
192
+ | `/dev-scout` | Creates scout.md for features |
193
+
194
+ ## Troubleshooting
195
+
196
+ **Graph not updating:**
197
+ - Check hook is in `.claude/settings.local.json`
198
+ - Verify `jq` is installed
199
+ - Run `/utils/docs-graph --regenerate` to force update
200
+
201
+ **Broken links:**
202
+ - Run `/utils/docs-graph --check` to find issues
203
+ - Update wikilinks to match node IDs
204
+ - Node IDs are lowercase, no slug (e.g., `uc-auth-001` not `UC-AUTH-001-login`)
@@ -0,0 +1,292 @@
1
+ ---
2
+ name: utils/gemini
3
+ description: Large context processing using Gemini Flash for codebase scanning and summarization
4
+ version: 1.0.0
5
+ ---
6
+
7
+ # /utils/gemini - Large Context Processing
8
+
9
+ > **Skill Awareness**: See `skills/_registry.md` for all available skills.
10
+ > - **Called by**: `/dev-scout` for large codebases
11
+ > - **Purpose**: Use Gemini Flash (1M context) for tasks Claude's context can't fit
12
+ > - **Note**: Utility skill, typically called by other skills
13
+
14
+ Use Gemini Flash for large context tasks like scanning entire codebases.
15
+
16
+ ## Why Gemini?
17
+
18
+ | Model | Context | Best For | Cost |
19
+ |-------|---------|----------|------|
20
+ | Claude | 200K | Reasoning, writing, precision | Higher |
21
+ | Gemini Flash | 1M+ | Scanning, summarization, bulk reading | Lower |
22
+
23
+ **Use case**: Codebase has 500+ files. Claude can't fit it all. Gemini scans and summarizes, Claude uses the summary.
24
+
25
+ ## Setup
26
+
27
+ ### Prerequisites
28
+
29
+ 1. **Google AI API Key**
30
+ - Go to: https://aistudio.google.com/app/apikey
31
+ - Create an API key
32
+ - Copy the key
33
+
34
+ 2. **Set Environment Variable**
35
+ ```bash
36
+ # Add to ~/.bashrc or ~/.zshrc
37
+ export GEMINI_API_KEY="your-api-key-here"
38
+
39
+ # Or create .env in project root
40
+ echo "GEMINI_API_KEY=your-api-key-here" >> .env
41
+ ```
42
+
43
+ 3. **Install Python Dependencies**
44
+ ```bash
45
+ pip install google-generativeai
46
+ ```
47
+
48
+ ### Quick Setup Script
49
+
50
+ Run from this skill's folder:
51
+
52
+ ```bash
53
+ # Interactive setup
54
+ ./scripts/setup.sh
55
+ ```
56
+
57
+ This will:
58
+ - Check for existing API key
59
+ - Guide you to get one if missing
60
+ - Test the connection
61
+ - Verify everything works
62
+
63
+ ## Usage
64
+
65
+ ### Direct Script Usage
66
+
67
+ ```bash
68
+ # Scan entire codebase
69
+ python scripts/gemini-scan.py --path /path/to/project --output summary.md
70
+
71
+ # Scan specific directory
72
+ python scripts/gemini-scan.py --path /path/to/project/src --output src-summary.md
73
+
74
+ # Custom prompt
75
+ python scripts/gemini-scan.py --path /path/to/project --prompt "List all API endpoints" --output apis.md
76
+ ```
77
+
78
+ ### From Claude Code
79
+
80
+ When `/dev-scout` detects a large codebase:
81
+
82
+ ```
83
+ 1. Scout detects 500+ files
84
+ → "Large codebase. Using Gemini for initial scan."
85
+
86
+ 2. Run Gemini scan
87
+ → Bash: python skills/utils/gemini/scripts/gemini-scan.py \
88
+ --path . \
89
+ --output plans/scout/gemini-summary.md
90
+
91
+ 3. Read Gemini output
92
+ → Read: plans/scout/gemini-summary.md
93
+
94
+ 4. Claude refines and creates final scout.md
95
+ → Uses Gemini summary as input
96
+ → Adds analysis, recommendations
97
+ → Creates structured scout output
98
+ ```
99
+
100
+ ## Script: gemini-scan.py
101
+
102
+ Located at: `scripts/gemini-scan.py`
103
+
104
+ ### Features
105
+
106
+ - Scans directory recursively
107
+ - Respects .gitignore
108
+ - Outputs structured markdown
109
+ - Configurable file types
110
+ - Progress indicator
111
+
112
+ ### Arguments
113
+
114
+ | Arg | Description | Default |
115
+ |-----|-------------|---------|
116
+ | `--path` | Directory to scan | Current dir |
117
+ | `--output` | Output file path | stdout |
118
+ | `--prompt` | Custom prompt | Default scan prompt |
119
+ | `--extensions` | File types to include | Common code files |
120
+ | `--max-files` | Max files to process | 1000 |
121
+ | `--ignore` | Additional ignore patterns | None |
122
+
123
+ ### Default Scan Prompt
124
+
125
+ ```
126
+ Analyze this codebase and provide:
127
+
128
+ 1. **Project Overview**
129
+ - What does this project do?
130
+ - Main technologies used
131
+ - Project structure
132
+
133
+ 2. **File Organization**
134
+ - Key directories and their purposes
135
+ - Entry points
136
+ - Configuration files
137
+
138
+ 3. **Patterns Detected**
139
+ - Architecture patterns (MVC, component-based, etc.)
140
+ - Coding conventions
141
+ - Common utilities
142
+
143
+ 4. **Key Files**
144
+ - Most important files (entry points, configs)
145
+ - Core business logic locations
146
+ - API/route definitions
147
+
148
+ 5. **Dependencies**
149
+ - External packages
150
+ - Internal module dependencies
151
+
152
+ Be concise but comprehensive. Use markdown formatting.
153
+ ```
154
+
155
+ ## Output Format
156
+
157
+ Gemini outputs structured markdown:
158
+
159
+ ```markdown
160
+ # Codebase Summary
161
+
162
+ ## Project Overview
163
+ {description}
164
+
165
+ ## Technologies
166
+ - Framework: Next.js 14
167
+ - Database: PostgreSQL with Prisma
168
+ - Auth: NextAuth.js
169
+ - Styling: Tailwind CSS
170
+
171
+ ## Structure
172
+ ```
173
+ src/
174
+ ├── app/ # Next.js App Router pages
175
+ ├── components/ # React components
176
+ ├── lib/ # Utilities and helpers
177
+ └── prisma/ # Database schema
178
+ ```
179
+
180
+ ## Key Files
181
+ | File | Purpose |
182
+ |------|---------|
183
+ | src/app/layout.tsx | Root layout |
184
+ | src/lib/auth.ts | Authentication logic |
185
+ | prisma/schema.prisma | Database schema |
186
+
187
+ ## Patterns
188
+ - Component-based architecture
189
+ - Server Components with Client islands
190
+ - API routes for backend logic
191
+
192
+ ## Recommendations for Scout
193
+ - Focus on src/app/ for routes
194
+ - Check src/components/ui/ for base components
195
+ - Review prisma/schema.prisma for data model
196
+ ```
197
+
198
+ ## Integration with /dev-scout
199
+
200
+ In `dev-scout/SKILL.md`, add:
201
+
202
+ ```markdown
203
+ ### Step 0.5: Large Codebase Check
204
+
205
+ After counting files:
206
+
207
+ 1. If 500+ files → Use Gemini
208
+ ```bash
209
+ python skills/utils/gemini/scripts/gemini-scan.py \
210
+ --path . \
211
+ --output plans/scout/gemini-summary.md
212
+ ```
213
+
214
+ 2. Read Gemini summary
215
+ → Use as foundation for scout
216
+
217
+ 3. Deep dive key areas only
218
+ → Gemini identified important files
219
+ → Claude focuses on those
220
+ ```
221
+
222
+ ## Troubleshooting
223
+
224
+ ### API Key Not Found
225
+
226
+ ```
227
+ Error: GEMINI_API_KEY not set
228
+ ```
229
+
230
+ **Fix:**
231
+ ```bash
232
+ export GEMINI_API_KEY="your-key"
233
+ # Or add to .env file
234
+ ```
235
+
236
+ ### Rate Limit
237
+
238
+ ```
239
+ Error: Rate limit exceeded
240
+ ```
241
+
242
+ **Fix:**
243
+ - Wait a few seconds and retry
244
+ - Free tier has limits, consider paid tier for heavy use
245
+
246
+ ### Context Too Large
247
+
248
+ ```
249
+ Error: Input too large for model
250
+ ```
251
+
252
+ **Fix:**
253
+ - Use `--max-files` to limit files
254
+ - Use `--ignore` to skip directories
255
+ - Split scan into multiple runs
256
+
257
+ ## Cost Considerations
258
+
259
+ Gemini Flash pricing (as of 2024):
260
+ - Input: ~$0.075 per 1M tokens
261
+ - Output: ~$0.30 per 1M tokens
262
+
263
+ **Typical codebase scan (500 files):**
264
+ - ~100K tokens input
265
+ - ~5K tokens output
266
+ - Cost: ~$0.01-0.02 per scan
267
+
268
+ Very affordable for occasional use.
269
+
270
+ ## Security Notes
271
+
272
+ - API key should be in environment, not code
273
+ - Don't commit .env files
274
+ - Add to .gitignore: `.env`, `*.env.local`
275
+ - Gemini processes code - consider sensitivity
276
+
277
+ ## Future: MCP Server
278
+
279
+ If needed, this can be upgraded to an MCP server for tighter integration:
280
+
281
+ ```
282
+ skills/utils/gemini/
283
+ ├── SKILL.md
284
+ ├── scripts/
285
+ │ ├── setup.sh
286
+ │ └── gemini-scan.py
287
+ └── mcp-server/ # Future
288
+ ├── index.ts
289
+ └── package.json
290
+ ```
291
+
292
+ For now, the Python script approach is simpler and works well.