@grimoire-cc/cli 0.6.3 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/commands/logs.d.ts.map +1 -1
  2. package/dist/commands/logs.js +2 -2
  3. package/dist/commands/logs.js.map +1 -1
  4. package/dist/static/log-viewer.html +946 -690
  5. package/dist/static/static/log-viewer.html +946 -690
  6. package/package.json +1 -1
  7. package/packs/dev-pack/agents/gr.code-reviewer.md +286 -0
  8. package/packs/dev-pack/agents/gr.tdd-specialist.md +44 -0
  9. package/packs/dev-pack/grimoire.json +55 -0
  10. package/packs/dev-pack/skills/gr.tdd-specialist/SKILL.md +247 -0
  11. package/packs/dev-pack/skills/gr.tdd-specialist/reference/anti-patterns.md +166 -0
  12. package/packs/dev-pack/skills/gr.tdd-specialist/reference/language-frameworks.md +388 -0
  13. package/packs/dev-pack/skills/gr.tdd-specialist/reference/tdd-workflow-patterns.md +135 -0
  14. package/packs/docs-pack/grimoire.json +30 -0
  15. package/packs/docs-pack/skills/gr.business-logic-docs/SKILL.md +278 -0
  16. package/packs/docs-pack/skills/gr.business-logic-docs/references/audit-checklist.md +48 -0
  17. package/packs/docs-pack/skills/gr.business-logic-docs/references/tier2-template.md +129 -0
  18. package/packs/essentials-pack/agents/gr.fact-checker.md +202 -0
  19. package/packs/essentials-pack/grimoire.json +12 -0
  20. package/packs/meta-pack/grimoire.json +72 -0
  21. package/packs/meta-pack/skills/gr.context-file-guide/SKILL.md +201 -0
  22. package/packs/meta-pack/skills/gr.context-file-guide/scripts/validate-context-file.sh +29 -0
  23. package/packs/meta-pack/skills/gr.readme-guide/SKILL.md +362 -0
  24. package/packs/meta-pack/skills/gr.skill-developer/SKILL.md +321 -0
  25. package/packs/meta-pack/skills/gr.skill-developer/examples/brand-guidelines.md +94 -0
  26. package/packs/meta-pack/skills/gr.skill-developer/examples/financial-analysis.md +85 -0
  27. package/packs/meta-pack/skills/gr.skill-developer/reference/best-practices.md +410 -0
  28. package/packs/meta-pack/skills/gr.skill-developer/reference/file-organization.md +452 -0
  29. package/packs/meta-pack/skills/gr.skill-developer/reference/patterns.md +459 -0
  30. package/packs/meta-pack/skills/gr.skill-developer/reference/yaml-spec.md +214 -0
  31. package/packs/meta-pack/skills/gr.skill-developer/scripts/create-skill.sh +210 -0
  32. package/packs/meta-pack/skills/gr.skill-developer/scripts/validate-skill.py +520 -0
  33. package/packs/meta-pack/skills/gr.skill-developer/templates/basic-skill.md +94 -0
  34. package/packs/meta-pack/skills/gr.skill-developer/templates/domain-skill.md +108 -0
@@ -0,0 +1,452 @@
1
+ # Skill File Organization Guide
2
+
3
+ This guide provides comprehensive recommendations for organizing skill files to maximize performance, maintainability, and compliance with official Anthropic requirements.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Core Principles](#core-principles)
8
+ - [Progressive Disclosure Architecture](#progressive-disclosure-architecture)
9
+ - [Size Constraints](#size-constraints)
10
+ - [Reference File Standards](#reference-file-standards)
11
+ - [Linking Requirements](#linking-requirements)
12
+ - [Table of Contents Requirements](#table-of-contents-requirements)
13
+ - [File Size Optimization](#file-size-optimization)
14
+ - [Well-Organized Examples](#well-organized-examples)
15
+ - [Anti-Patterns](#anti-patterns)
16
+
17
+ ## Core Principles
18
+
19
+ Effective skill organization follows these key principles:
20
+
21
+ 1. **Progressive Disclosure**: Core content in SKILL.md, detailed content in supporting files
22
+ 2. **Lazy Loading**: Files don't consume context until Claude accesses them
23
+ 3. **Flat Hierarchy**: Keep references one level deep from SKILL.md
24
+ 4. **Size Compliance**: Stay under official limits for performance
25
+ 5. **Discoverability**: Clear file names and organization
26
+
27
+ ## Progressive Disclosure Architecture
28
+
29
+ ### How It Works
30
+
31
+ Progressive disclosure allows skills to contain extensive reference material without impacting context:
32
+
33
+ - **Level 1 (Metadata)**: ~100 tokens per skill loaded at startup
34
+ - **Level 2 (SKILL.md)**: Loaded when skill activates (up to 500 lines)
35
+ - **Level 3 (Supporting Files)**: Loaded only when Claude needs them
36
+
37
+ ### Key Insight
38
+
39
+ **Files don't consume context until accessed** - you can include dozens of reference files without penalty. The skill acts like a table of contents, pointing Claude to detailed materials as needed.
40
+
41
+ ### What Belongs Where
42
+
43
+ **SKILL.md should contain:**
44
+ - Overview and capabilities
45
+ - How to use instructions
46
+ - When to activate (trigger keywords)
47
+ - Common use cases
48
+ - Links to detailed reference materials
49
+ - Essential examples
50
+
51
+ **Supporting files should contain:**
52
+ - Detailed specifications
53
+ - Complete API references
54
+ - Extended examples
55
+ - Technical deep-dives
56
+ - Complex workflows
57
+ - Large data tables
58
+
59
+ ## Size Constraints
60
+
61
+ ### Official Anthropic Requirements
62
+
63
+ **SKILL.md Body**
64
+ - Maximum: **500 lines** (excluding YAML frontmatter)
65
+ - Enforced: Validation script blocks if exceeded
66
+ - Rationale: Optimal context window usage
67
+
68
+ **Total Skill Bundle**
69
+ - Maximum: **8MB** (all files combined)
70
+ - Enforced: Validation script blocks if exceeded
71
+ - Includes: SKILL.md + all supporting files + scripts
72
+
73
+ **Skills Per Request**
74
+ - Maximum: **8 skills** can be active per request
75
+ - Context: Claude Code loads skills based on relevance
76
+
77
+ ### Why These Limits Matter
78
+
79
+ - **Performance**: Smaller files load faster into context
80
+ - **Cost**: Fewer tokens consumed per activation
81
+ - **Maintainability**: Easier to update and navigate
82
+ - **Compliance**: Required by Anthropic platform
83
+
84
+ ## Reference File Standards
85
+
86
+ ### Naming Conventions
87
+
88
+ Use descriptive, hyphenated names:
89
+
90
+ ```text
91
+ ✅ GOOD:
92
+ reference/api-specification.md
93
+ reference/calculation-formulas.md
94
+ reference/error-codes.md
95
+
96
+ ❌ BAD:
97
+ reference/spec.md (too generic)
98
+ reference/api_spec.md (underscores instead of hyphens)
99
+ reference/APISpecification.md (camelCase)
100
+ ```
101
+
102
+ ### Directory Structure
103
+
104
+ Keep structure flat and organized:
105
+
106
+ ```text
107
+ .claude/skills/your-skill/
108
+ ├── SKILL.md # Main skill file (<500 lines)
109
+ ├── reference/ # Detailed specifications
110
+ │ ├── api-specification.md
111
+ │ ├── data-formats.md
112
+ │ └── error-handling.md
113
+ ├── examples/ # Complete examples
114
+ │ ├── basic-usage.md
115
+ │ └── advanced-workflow.md
116
+ ├── templates/ # Reusable templates
117
+ │ └── report-template.md
118
+ └── scripts/ # Automation (optional)
119
+ └── process-data.py
120
+ ```
121
+
122
+ ### Single File vs. Multiple Files
123
+
124
+ **Use a single reference file when:**
125
+ - Content is tightly related (<200 lines)
126
+ - Splitting would create artificial boundaries
127
+ - Users typically need all information together
128
+
129
+ **Use multiple reference files when:**
130
+ - Content has distinct topics
131
+ - Individual files would be >100 lines each
132
+ - Users may need only specific sections
133
+ - Improves navigation and maintenance
134
+
135
+ ## Linking Requirements
136
+
137
+ ### One Level Deep Rule
138
+
139
+ **All reference files must link directly from SKILL.md** - do not nest references within other references.
140
+
141
+ #### ✅ CORRECT: One Level Deep
142
+
143
+ **SKILL.md:**
144
+ ```markdown
145
+ For detailed API specifications, see [reference/api-specification.md](reference/api-specification.md).
146
+
147
+ For error handling guidelines, see [reference/error-handling.md](reference/error-handling.md).
148
+ ```
149
+
150
+ **reference/api-specification.md:**
151
+ ```markdown
152
+ # API Specification
153
+
154
+ ## Endpoints
155
+
156
+ ### POST /api/process
157
+ ...
158
+ ```
159
+
160
+ **reference/error-handling.md:**
161
+ ```markdown
162
+ # Error Handling Guidelines
163
+
164
+ ## Error Codes
165
+ ...
166
+ ```
167
+
168
+ #### ❌ INCORRECT: Nested References
169
+
170
+ **SKILL.md:**
171
+ ```markdown
172
+ For API information, see [reference/api-overview.md](reference/api-overview.md).
173
+ ```
174
+
175
+ **reference/api-overview.md:**
176
+ ```markdown
177
+ # API Overview
178
+
179
+ For detailed endpoint specifications, see [reference/endpoints/post-endpoints.md](reference/endpoints/post-endpoints.md).
180
+ ```
181
+
182
+ **Why this is wrong:** The user would need to read api-overview.md first, then follow a nested link. Claude should be able to read any reference file directly from SKILL.md.
183
+
184
+ ### Why One Level Deep?
185
+
186
+ 1. **Ensures complete reads**: Claude reads full files when accessing from SKILL.md
187
+ 2. **Avoids fragmentation**: User doesn't navigate multiple levels
188
+ 3. **Improves discoverability**: All references visible from main file
189
+ 4. **Simplifies maintenance**: Clear file relationships
190
+
191
+ ### Proper Linking Format
192
+
193
+ Use relative paths with descriptive link text:
194
+
195
+ ```markdown
196
+ ✅ GOOD:
197
+ See [API Specification](reference/api-specification.md) for complete endpoint details.
198
+
199
+ For calculation formulas, refer to [reference/formulas.md](reference/formulas.md).
200
+
201
+ ❌ BAD:
202
+ See api-specification.md (not a clickable link)
203
+ See [here](reference/api-specification.md) (non-descriptive)
204
+ See [API](../reference/api-specification.md) (unnecessary path navigation)
205
+ ```
206
+
207
+ ## Table of Contents Requirements
208
+
209
+ ### When Required
210
+
211
+ **Reference files exceeding 100 lines must include a table of contents at the top.**
212
+
213
+ ### Why This Matters
214
+
215
+ Even when Claude previews a file with partial reads, the table of contents ensures Claude can see the full scope of available information.
216
+
217
+ ### Format
218
+
219
+ Place TOC immediately after the file title:
220
+
221
+ ```markdown
222
+ # API Specification
223
+
224
+ ## Table of Contents
225
+
226
+ - [Authentication](#authentication)
227
+ - [Endpoints](#endpoints)
228
+ - [POST /api/process](#post-apiprocess)
229
+ - [GET /api/status](#get-apistatus)
230
+ - [Error Codes](#error-codes)
231
+ - [Rate Limiting](#rate-limiting)
232
+ - [Examples](#examples)
233
+
234
+ ## Authentication
235
+
236
+ ...
237
+ ```
238
+
239
+ ### Best Practices
240
+
241
+ - Use descriptive section names
242
+ - Link to section anchors (GitHub-style)
243
+ - Keep TOC concise (one level of nesting max)
244
+ - Update TOC when adding/removing sections
245
+
246
+ ## File Size Optimization
247
+
248
+ ### Strategies to Stay Under Limits
249
+
250
+ #### 1. Split Large Sections
251
+
252
+ Instead of one large reference file, split by topic:
253
+
254
+ ```text
255
+ Before (800 lines):
256
+ reference/complete-guide.md
257
+
258
+ After:
259
+ reference/getting-started.md (150 lines)
260
+ reference/advanced-usage.md (180 lines)
261
+ reference/api-reference.md (220 lines)
262
+ reference/troubleshooting.md (150 lines)
263
+ ```
264
+
265
+ #### 2. Remove Redundancy
266
+
267
+ - Don't repeat information from SKILL.md in reference files
268
+ - Link between files instead of duplicating content
269
+ - Use templates for repetitive structures
270
+
271
+ #### 3. Move Examples to Dedicated Files
272
+
273
+ ```text
274
+ examples/
275
+ ├── basic-usage.md # Simple examples
276
+ ├── advanced-workflow.md # Complex examples
277
+ └── integration-patterns.md # Real-world scenarios
278
+ ```
279
+
280
+ #### 4. Use External Scripts
281
+
282
+ Move complex logic to Python/Bash scripts instead of documenting in markdown:
283
+
284
+ ```text
285
+ scripts/
286
+ └── calculate-ratios.py # Actual calculation logic
287
+
288
+ reference/
289
+ └── calculations.md # High-level explanation + script usage
290
+ ```
291
+
292
+ #### 5. Compress Tables and Data
293
+
294
+ Instead of large markdown tables, consider:
295
+ - CSV files referenced by scripts
296
+ - JSON data files
297
+ - External databases (when appropriate)
298
+
299
+ ### Checking Your Size
300
+
301
+ Use the validation script to check current size:
302
+
303
+ ```bash
304
+ cd ~/.claude/skills/skill-developer
305
+ python scripts/validate-skill.py ~/.claude/skills/your-skill/SKILL.md
306
+ ```
307
+
308
+ Output shows:
309
+ - Line count for SKILL.md body
310
+ - Total bundle size
311
+ - Largest files
312
+ - Recommendations
313
+
314
+ ## Well-Organized Examples
315
+
316
+ ### Example 1: Financial Analysis Skill
317
+
318
+ ```text
319
+ .claude/skills/financial-analysis/
320
+ ├── SKILL.md (287 lines) # Core skill definition
321
+ ├── reference/
322
+ │ ├── ratio-formulas.md (156 lines, has TOC)
323
+ │ ├── industry-standards.md (98 lines)
324
+ │ └── data-sources.md (45 lines)
325
+ ├── examples/
326
+ │ ├── quarterly-analysis.md
327
+ │ └── peer-comparison.md
328
+ └── scripts/
329
+ └── calculate-ratios.py
330
+
331
+ Total size: 1.2MB
332
+ ```
333
+
334
+ **Why this works:**
335
+ - SKILL.md under 500 lines
336
+ - Reference files split by topic
337
+ - File >100 lines has TOC
338
+ - All references one level from SKILL.md
339
+ - Total bundle well under 8MB
340
+
341
+ ### Example 2: API Documentation Skill
342
+
343
+ ```text
344
+ .claude/skills/api-docs/
345
+ ├── SKILL.md (421 lines)
346
+ ├── reference/
347
+ │ ├── authentication.md (87 lines)
348
+ │ ├── endpoints.md (234 lines, has TOC)
349
+ │ ├── error-codes.md (112 lines, has TOC)
350
+ │ └── rate-limiting.md (56 lines)
351
+ └── examples/
352
+ ├── basic-requests.md
353
+ └── advanced-patterns.md
354
+
355
+ Total size: 892KB
356
+ ```
357
+
358
+ **Why this works:**
359
+ - Clear separation of concerns
360
+ - Large files have TOCs
361
+ - Flat reference structure
362
+ - Size well within limits
363
+
364
+ ## Anti-Patterns
365
+
366
+ ### ❌ Anti-Pattern 1: Monolithic SKILL.md
367
+
368
+ ```text
369
+ .claude/skills/bad-example/
370
+ └── SKILL.md (1,247 lines) # Way over 500-line limit
371
+ ```
372
+
373
+ **Problem**: Exceeds size limit, hard to maintain, poor context efficiency
374
+
375
+ **Solution**: Split into SKILL.md + reference files
376
+
377
+ ### ❌ Anti-Pattern 2: Nested References
378
+
379
+ ```text
380
+ .claude/skills/bad-example/
381
+ ├── SKILL.md
382
+ └── reference/
383
+ ├── overview.md → links to detailed/
384
+ └── detailed/
385
+ ├── section1.md
386
+ └── section2.md
387
+ ```
388
+
389
+ **Problem**: Violates "one level deep" rule
390
+
391
+ **Solution**: Flatten to reference/*.md, all linked from SKILL.md
392
+
393
+ ### ❌ Anti-Pattern 3: Missing TOCs
394
+
395
+ ```text
396
+ reference/
397
+ └── massive-api-spec.md (847 lines, NO TOC)
398
+ ```
399
+
400
+ **Problem**: Claude can't see full scope in partial read
401
+
402
+ **Solution**: Add comprehensive TOC at top of file
403
+
404
+ ### ❌ Anti-Pattern 4: Unclear File Names
405
+
406
+ ```text
407
+ reference/
408
+ ├── stuff.md
409
+ ├── misc.md
410
+ └── notes.md
411
+ ```
412
+
413
+ **Problem**: Non-descriptive, hard to know what to read
414
+
415
+ **Solution**: Use descriptive names (api-specification.md, data-formats.md)
416
+
417
+ ### ❌ Anti-Pattern 5: Bloated Bundle
418
+
419
+ ```text
420
+ .claude/skills/bad-example/
421
+ ├── SKILL.md
422
+ ├── reference/ (47 files, 12MB total)
423
+ └── examples/ (hundreds of examples)
424
+ ```
425
+
426
+ **Problem**: Exceeds 8MB limit
427
+
428
+ **Solution**: Remove redundancy, consolidate files, use external resources
429
+
430
+ ## Summary Checklist
431
+
432
+ When organizing your skill, verify:
433
+
434
+ - [ ] SKILL.md body is under 500 lines
435
+ - [ ] Total skill bundle is under 8MB
436
+ - [ ] All references link directly from SKILL.md (one level deep)
437
+ - [ ] Reference files >100 lines have table of contents
438
+ - [ ] File names are descriptive and use hyphens
439
+ - [ ] Directory structure is flat and logical
440
+ - [ ] No redundant content across files
441
+ - [ ] Validation script passes without errors
442
+
443
+ ## Validation
444
+
445
+ Always validate your skill organization:
446
+
447
+ ```bash
448
+ python ~/.claude/skills/skill-developer/scripts/validate-skill.py \
449
+ ~/.claude/skills/your-skill/SKILL.md
450
+ ```
451
+
452
+ The script will check all requirements and provide actionable feedback for any violations.