@phuc1403/musketeer 0.7.0 → 0.9.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 (84) hide show
  1. package/README.md +49 -49
  2. package/manifest.json +333 -301
  3. package/package.json +1 -1
  4. package/template/.claude/agents/code-reviewer.md +182 -166
  5. package/template/.claude/hooks/git-skill-reminder.cjs +53 -0
  6. package/template/.claude/hooks/inject-design-docs.cjs +13 -13
  7. package/template/.claude/hooks/inject-ubiquitous-language.cjs +52 -0
  8. package/template/.claude/hooks/lib/colors.cjs +180 -122
  9. package/template/.claude/hooks/lib/transcript-parser.cjs +300 -277
  10. package/template/.claude/skills/code-review/SKILL.md +201 -54
  11. package/template/.claude/skills/code-review/references/checklist-workflow.md +96 -0
  12. package/template/.claude/skills/code-review/references/checklists/api.md +52 -52
  13. package/template/.claude/skills/code-review/references/checklists/base.md +100 -100
  14. package/template/.claude/skills/code-review/references/checklists/web-app.md +54 -54
  15. package/template/.claude/skills/code-review/references/code-review-reception.md +113 -0
  16. package/template/.claude/skills/code-review/references/codebase-scan-workflow.md +30 -0
  17. package/template/.claude/skills/code-review/references/edge-case-scouting.md +119 -0
  18. package/template/.claude/skills/code-review/references/input-mode-resolution.md +135 -0
  19. package/template/.claude/skills/code-review/references/parallel-review-workflow.md +76 -0
  20. package/template/.claude/skills/code-review/references/requesting-code-review.md +116 -0
  21. package/template/.claude/skills/code-review/references/spec-compliance-review.md +43 -0
  22. package/template/.claude/skills/code-review/references/task-management-reviews.md +140 -0
  23. package/template/.claude/skills/code-review/references/verification-before-completion.md +139 -0
  24. package/template/.claude/skills/context-map/SKILL.md +1 -1
  25. package/template/.claude/skills/git/SKILL.md +131 -115
  26. package/template/.claude/skills/git/references/branch-management.md +88 -88
  27. package/template/.claude/skills/git/references/commit-standards.md +46 -46
  28. package/template/.claude/skills/git/references/context-efficiency.md +54 -0
  29. package/template/.claude/skills/git/references/gh-cli-guide.md +109 -109
  30. package/template/.claude/skills/git/references/safety-protocols.md +69 -69
  31. package/template/.claude/skills/git/references/workflow-commit.md +58 -58
  32. package/template/.claude/skills/git/references/workflow-merge-pr.md +136 -0
  33. package/template/.claude/skills/git/references/workflow-merge.md +48 -48
  34. package/template/.claude/skills/git/references/workflow-pr.md +58 -58
  35. package/template/.claude/skills/git/references/workflow-push.md +52 -52
  36. package/template/.claude/skills/knowledge-crunching/SKILL.md +56 -92
  37. package/template/.claude/skills/knowledge-crunching/assets/ubiquitous-language.template.md +3 -0
  38. package/template/.claude/skills/skill-creator/LICENSE.txt +201 -201
  39. package/template/.claude/skills/skill-creator/SKILL.md +154 -149
  40. package/template/.claude/skills/skill-creator/agents/analyzer.md +274 -274
  41. package/template/.claude/skills/skill-creator/agents/comparator.md +202 -202
  42. package/template/.claude/skills/skill-creator/agents/grader.md +223 -223
  43. package/template/.claude/skills/skill-creator/assets/eval_review.html +146 -146
  44. package/template/.claude/skills/skill-creator/eval-viewer/generate_review.py +471 -471
  45. package/template/.claude/skills/skill-creator/eval-viewer/viewer.html +1325 -1325
  46. package/template/.claude/skills/skill-creator/references/benchmark-optimization-guide.md +86 -86
  47. package/template/.claude/skills/skill-creator/references/distribution-guide.md +79 -79
  48. package/template/.claude/skills/skill-creator/references/eval-infrastructure-guide.md +129 -129
  49. package/template/.claude/skills/skill-creator/references/eval-schemas.md +121 -121
  50. package/template/.claude/skills/skill-creator/references/mcp-skills-integration.md +71 -71
  51. package/template/.claude/skills/skill-creator/references/metadata-quality-criteria.md +94 -94
  52. package/template/.claude/skills/skill-creator/references/plugin-marketplace-hosting.md +104 -104
  53. package/template/.claude/skills/skill-creator/references/plugin-marketplace-overview.md +89 -89
  54. package/template/.claude/skills/skill-creator/references/plugin-marketplace-schema.md +93 -93
  55. package/template/.claude/skills/skill-creator/references/plugin-marketplace-sources.md +103 -103
  56. package/template/.claude/skills/skill-creator/references/plugin-marketplace-troubleshooting.md +76 -76
  57. package/template/.claude/skills/skill-creator/references/script-quality-criteria.md +106 -106
  58. package/template/.claude/skills/skill-creator/references/skill-anatomy-and-requirements.md +77 -77
  59. package/template/.claude/skills/skill-creator/references/skill-creation-workflow.md +152 -151
  60. package/template/.claude/skills/skill-creator/references/skill-design-patterns.md +75 -75
  61. package/template/.claude/skills/skill-creator/references/skillmark-benchmark-criteria.md +102 -102
  62. package/template/.claude/skills/skill-creator/references/structure-organization-criteria.md +114 -114
  63. package/template/.claude/skills/skill-creator/references/testing-and-iteration.md +78 -78
  64. package/template/.claude/skills/skill-creator/references/token-efficiency-criteria.md +74 -74
  65. package/template/.claude/skills/skill-creator/references/troubleshooting-guide.md +81 -81
  66. package/template/.claude/skills/skill-creator/references/validation-checklist.md +83 -83
  67. package/template/.claude/skills/skill-creator/references/writing-effective-instructions.md +88 -88
  68. package/template/.claude/skills/skill-creator/references/yaml-frontmatter-reference.md +92 -92
  69. package/template/.claude/skills/skill-creator/scripts/aggregate_benchmark.py +401 -401
  70. package/template/.claude/skills/skill-creator/scripts/encoding_utils.py +36 -36
  71. package/template/.claude/skills/skill-creator/scripts/generate_report.py +326 -326
  72. package/template/.claude/skills/skill-creator/scripts/improve_description.py +248 -248
  73. package/template/.claude/skills/skill-creator/scripts/init_skill.py +360 -360
  74. package/template/.claude/skills/skill-creator/scripts/package_skill.py +143 -143
  75. package/template/.claude/skills/skill-creator/scripts/quick_validate.py +110 -110
  76. package/template/.claude/skills/skill-creator/scripts/run_eval.py +310 -310
  77. package/template/.claude/skills/skill-creator/scripts/run_loop.py +332 -332
  78. package/template/.claude/skills/skill-creator/scripts/utils.py +47 -47
  79. package/template/.claude/statusline.cjs +0 -0
  80. package/template/.claude/hooks/inject-context.cjs +0 -52
  81. package/template/.claude/skills/code-review/references/adversarial-review.md +0 -223
  82. package/template/.claude/skills/knowledge-crunching/assets/context.template.md +0 -59
  83. package/template/.claude/skills/knowledge-crunching/references/crunching-dialogue.md +0 -113
  84. /package/template/.claude/hooks/{usage-context-awareness.cjs → usage-quota-cache-refresh.cjs} +0 -0
@@ -1,74 +1,74 @@
1
- # Token Efficiency Criteria
2
-
3
- Skills use progressive disclosure to minimize context window usage.
4
-
5
- ## Three-Level Loading
6
-
7
- 1. **Metadata** - Always loaded (~200 chars)
8
- 2. **SKILL.md body** - Loaded when skill triggers (<300 lines)
9
- 3. **Bundled resources** - Loaded as needed (unlimited for scripts)
10
-
11
- ## Size Limits
12
-
13
- | Resource | Limit | Notes |
14
- |----------|-------|-------|
15
- | Description | <200 chars | In YAML frontmatter |
16
- | SKILL.md | <300 lines | Core instructions only |
17
- | Each reference file | <300 lines | Split if larger |
18
- | Scripts | No limit | Executed, not loaded into context |
19
-
20
- ## SKILL.md Content Strategy
21
-
22
- **Include in SKILL.md:**
23
- - Purpose (2-3 sentences)
24
- - When to use (trigger conditions)
25
- - Quick reference for common workflows
26
- - Pointers to resources (scripts, references, assets)
27
-
28
- **Move to references/:**
29
- - Detailed documentation
30
- - Database schemas
31
- - API specs
32
- - Step-by-step guides
33
- - Examples and templates
34
- - Best practices
35
-
36
- ## No Duplication Rule
37
-
38
- Information lives in ONE place:
39
- - Either in SKILL.md
40
- - Or in references/
41
-
42
- **Bad:** Schema overview in SKILL.md + detailed schema in references/schema.md
43
- **Good:** Brief mention in SKILL.md + full schema only in references/schema.md
44
-
45
- ## Splitting Large Files
46
-
47
- If reference exceeds 300 lines, split by logical boundaries:
48
-
49
- ```
50
- references/
51
- ├── api-endpoints-auth.md # Auth endpoints
52
- ├── api-endpoints-users.md # User endpoints
53
- ├── api-endpoints-payments.md # Payment endpoints
54
- ```
55
-
56
- Include grep patterns in SKILL.md for discoverability:
57
-
58
- ```markdown
59
- ## API Documentation
60
- - Auth: `references/api-endpoints-auth.md`
61
- - Users: `references/api-endpoints-users.md`
62
- - Payments: `references/api-endpoints-payments.md`
63
- ```
64
-
65
- ## Scripts: Best Token Efficiency
66
-
67
- Scripts execute without loading into context.
68
-
69
- **When to use scripts:**
70
- - Repetitive code patterns
71
- - Deterministic operations
72
- - Complex transformations
73
-
74
- **Example:** PDF rotation via `scripts/rotate_pdf.py` vs rewriting rotation code each time.
1
+ # Token Efficiency Criteria
2
+
3
+ Skills use progressive disclosure to minimize context window usage.
4
+
5
+ ## Three-Level Loading
6
+
7
+ 1. **Metadata** - Always loaded (~200 chars)
8
+ 2. **SKILL.md body** - Loaded when skill triggers (<300 lines)
9
+ 3. **Bundled resources** - Loaded as needed (unlimited for scripts)
10
+
11
+ ## Size Limits
12
+
13
+ | Resource | Limit | Notes |
14
+ |----------|-------|-------|
15
+ | Description | <200 chars | In YAML frontmatter |
16
+ | SKILL.md | <300 lines | Core instructions only |
17
+ | Each reference file | <300 lines | Split if larger |
18
+ | Scripts | No limit | Executed, not loaded into context |
19
+
20
+ ## SKILL.md Content Strategy
21
+
22
+ **Include in SKILL.md:**
23
+ - Purpose (2-3 sentences)
24
+ - When to use (trigger conditions)
25
+ - Quick reference for common workflows
26
+ - Pointers to resources (scripts, references, assets)
27
+
28
+ **Move to references/:**
29
+ - Detailed documentation
30
+ - Database schemas
31
+ - API specs
32
+ - Step-by-step guides
33
+ - Examples and templates
34
+ - Best practices
35
+
36
+ ## No Duplication Rule
37
+
38
+ Information lives in ONE place:
39
+ - Either in SKILL.md
40
+ - Or in references/
41
+
42
+ **Bad:** Schema overview in SKILL.md + detailed schema in references/schema.md
43
+ **Good:** Brief mention in SKILL.md + full schema only in references/schema.md
44
+
45
+ ## Splitting Large Files
46
+
47
+ If reference exceeds 300 lines, split by logical boundaries:
48
+
49
+ ```
50
+ references/
51
+ ├── api-endpoints-auth.md # Auth endpoints
52
+ ├── api-endpoints-users.md # User endpoints
53
+ ├── api-endpoints-payments.md # Payment endpoints
54
+ ```
55
+
56
+ Include grep patterns in SKILL.md for discoverability:
57
+
58
+ ```markdown
59
+ ## API Documentation
60
+ - Auth: `references/api-endpoints-auth.md`
61
+ - Users: `references/api-endpoints-users.md`
62
+ - Payments: `references/api-endpoints-payments.md`
63
+ ```
64
+
65
+ ## Scripts: Best Token Efficiency
66
+
67
+ Scripts execute without loading into context.
68
+
69
+ **When to use scripts:**
70
+ - Repetitive code patterns
71
+ - Deterministic operations
72
+ - Complex transformations
73
+
74
+ **Example:** PDF rotation via `scripts/rotate_pdf.py` vs rewriting rotation code each time.
@@ -1,81 +1,81 @@
1
- # Troubleshooting Guide
2
-
3
- ## Skill Won't Upload
4
-
5
- **Error: "Could not find SKILL.md in uploaded folder"**
6
- - Rename to exactly `SKILL.md` (case-sensitive). Verify with `ls -la`.
7
-
8
- **Error: "Invalid frontmatter"**
9
- - Ensure `---` delimiters on both sides
10
- - Check for unclosed quotes in YAML
11
- - Validate YAML syntax
12
-
13
- **Error: "Invalid skill name"**
14
- - Use either `skill-name` or `namespace:skill-name`
15
- - Namespace and skill id must be kebab-case (no spaces, no capitals)
16
- - Wrong: `My Cool Skill` → Correct: `ck:my-cool-skill`
17
-
18
- ## Skill Doesn't Trigger
19
-
20
- **Symptom:** Skill never loads automatically.
21
-
22
- **Checklist:**
23
- - Is description too generic? ("Helps with projects" won't work)
24
- - Does it include trigger phrases users would actually say?
25
- - Does it mention relevant file types if applicable?
26
-
27
- **Debug:** Ask Claude "When would you use the [skill-name] skill?" — adjust description based on response.
28
-
29
- ## Skill Triggers Too Often
30
-
31
- **Solutions:**
32
-
33
- 1. **Add negative triggers:**
34
- ```yaml
35
- description: Advanced data analysis for CSV files. Use for statistical
36
- modeling, regression. Do NOT use for simple data exploration.
37
- ```
38
-
39
- 2. **Be more specific:**
40
- ```yaml
41
- # Bad: "Processes documents"
42
- # Good: "Processes PDF legal documents for contract review"
43
- ```
44
-
45
- 3. **Clarify scope:**
46
- ```yaml
47
- description: PayFlow payment processing for e-commerce. Use specifically
48
- for online payment workflows, not general financial queries.
49
- ```
50
-
51
- ## MCP Connection Issues
52
-
53
- **Symptom:** Skill loads but MCP calls fail.
54
-
55
- 1. Verify MCP server is connected (Settings > Extensions)
56
- 2. Check API keys valid and not expired
57
- 3. Test MCP independently: "Use [Service] MCP to fetch my projects"
58
- 4. Verify skill references correct MCP tool names (case-sensitive)
59
-
60
- ## Instructions Not Followed
61
-
62
- **Common causes and fixes:**
63
-
64
- | Cause | Fix |
65
- |---|---|
66
- | Instructions too verbose | Use bullet points, move details to references/ |
67
- | Critical info buried | Put at top, use `## CRITICAL` headers |
68
- | Ambiguous language | Replace "validate properly" with specific checklist |
69
- | Model skipping steps | Add "Do not skip validation steps" explicitly |
70
-
71
- **Advanced:** For critical validations, bundle a script that performs checks programmatically. Code is deterministic; language interpretation isn't.
72
-
73
- ## Large Context Issues
74
-
75
- **Symptom:** Skill seems slow or responses degraded.
76
-
77
- **Solutions:**
78
- 1. Move detailed docs to `references/` — keep SKILL.md under 300 lines
79
- 2. Link to references instead of inlining content
80
- 3. Evaluate if too many skills enabled simultaneously (>20-50 may degrade)
81
- 4. Consider skill "packs" for related capabilities
1
+ # Troubleshooting Guide
2
+
3
+ ## Skill Won't Upload
4
+
5
+ **Error: "Could not find SKILL.md in uploaded folder"**
6
+ - Rename to exactly `SKILL.md` (case-sensitive). Verify with `ls -la`.
7
+
8
+ **Error: "Invalid frontmatter"**
9
+ - Ensure `---` delimiters on both sides
10
+ - Check for unclosed quotes in YAML
11
+ - Validate YAML syntax
12
+
13
+ **Error: "Invalid skill name"**
14
+ - Use either `skill-name` or `namespace:skill-name`
15
+ - Namespace and skill id must be kebab-case (no spaces, no capitals)
16
+ - Wrong: `My Cool Skill` → Correct: `ck:my-cool-skill`
17
+
18
+ ## Skill Doesn't Trigger
19
+
20
+ **Symptom:** Skill never loads automatically.
21
+
22
+ **Checklist:**
23
+ - Is description too generic? ("Helps with projects" won't work)
24
+ - Does it include trigger phrases users would actually say?
25
+ - Does it mention relevant file types if applicable?
26
+
27
+ **Debug:** Ask Claude "When would you use the [skill-name] skill?" — adjust description based on response.
28
+
29
+ ## Skill Triggers Too Often
30
+
31
+ **Solutions:**
32
+
33
+ 1. **Add negative triggers:**
34
+ ```yaml
35
+ description: Advanced data analysis for CSV files. Use for statistical
36
+ modeling, regression. Do NOT use for simple data exploration.
37
+ ```
38
+
39
+ 2. **Be more specific:**
40
+ ```yaml
41
+ # Bad: "Processes documents"
42
+ # Good: "Processes PDF legal documents for contract review"
43
+ ```
44
+
45
+ 3. **Clarify scope:**
46
+ ```yaml
47
+ description: PayFlow payment processing for e-commerce. Use specifically
48
+ for online payment workflows, not general financial queries.
49
+ ```
50
+
51
+ ## MCP Connection Issues
52
+
53
+ **Symptom:** Skill loads but MCP calls fail.
54
+
55
+ 1. Verify MCP server is connected (Settings > Extensions)
56
+ 2. Check API keys valid and not expired
57
+ 3. Test MCP independently: "Use [Service] MCP to fetch my projects"
58
+ 4. Verify skill references correct MCP tool names (case-sensitive)
59
+
60
+ ## Instructions Not Followed
61
+
62
+ **Common causes and fixes:**
63
+
64
+ | Cause | Fix |
65
+ |---|---|
66
+ | Instructions too verbose | Use bullet points, move details to references/ |
67
+ | Critical info buried | Put at top, use `## CRITICAL` headers |
68
+ | Ambiguous language | Replace "validate properly" with specific checklist |
69
+ | Model skipping steps | Add "Do not skip validation steps" explicitly |
70
+
71
+ **Advanced:** For critical validations, bundle a script that performs checks programmatically. Code is deterministic; language interpretation isn't.
72
+
73
+ ## Large Context Issues
74
+
75
+ **Symptom:** Skill seems slow or responses degraded.
76
+
77
+ **Solutions:**
78
+ 1. Move detailed docs to `references/` — keep SKILL.md under 300 lines
79
+ 2. Link to references instead of inlining content
80
+ 3. Evaluate if too many skills enabled simultaneously (>20-50 may degrade)
81
+ 4. Consider skill "packs" for related capabilities
@@ -1,83 +1,83 @@
1
- # Skill Validation Checklist
2
-
3
- Quick validation before packaging. Run `scripts/package_skill.py` for automated checks.
4
-
5
- ## Critical (Must Pass)
6
-
7
- ### Metadata
8
- - [ ] `name`: namespaced `namespace:skill-name` (or `skill-name` for legacy), descriptive
9
- - [ ] `description`: under 200 characters, specific triggers, not generic
10
-
11
- ### Size Limits
12
- - [ ] SKILL.md: under 300 lines
13
- - [ ] Each reference file: under 300 lines
14
- - [ ] No info duplication between SKILL.md and references
15
-
16
- ### Structure
17
- - [ ] SKILL.md exists with valid YAML frontmatter
18
- - [ ] Unused example files deleted
19
- - [ ] File names: kebab-case, self-documenting
20
-
21
- ## Scripts (If Applicable)
22
-
23
- - [ ] Tests exist and pass
24
- - [ ] Cross-platform (Node.js/Python preferred)
25
- - [ ] Env vars: respects hierarchy `process.env` > `$HOME/.claude/skills/${SKILL}/.env` (global) > `$HOME/.claude/skills/.env` (global) > `$HOME/.claude/.env` (global) > `./.claude/skills/${SKILL}/.env` (cwd) > `./.claude/skills/.env` (cwd) > `./.claude/.env` (cwd)
26
- - [ ] Dependencies documented (requirements.txt, .env.example)
27
- - [ ] Manually tested with real use cases
28
-
29
- ## Quality
30
-
31
- ### Writing Style
32
- - [ ] Imperative form: "To accomplish X, do Y"
33
- - [ ] Third-person metadata: "This skill should be used when..."
34
- - [ ] Concise, no fluff
35
-
36
- ### Practical Utility
37
- - [ ] Teaches *how* to do tasks, not *what* tools are
38
- - [ ] Based on real workflows
39
- - [ ] Includes concrete trigger phrases/examples
40
-
41
- ## Integration
42
-
43
- - [ ] No duplication with existing skills
44
- - [ ] Related topics consolidated (e.g., cloudflare + docker → devops)
45
- - [ ] Composable with other skills
46
-
47
- ## Automated Validation
48
-
49
- Run packaging script to validate:
50
-
51
- ```bash
52
- scripts/package_skill.py <path/to/skill-folder>
53
- ```
54
-
55
- Checks performed:
56
- - YAML frontmatter format
57
- - Required fields present
58
- - Description length (<200 chars)
59
- - Directory structure
60
- - File organization
61
-
62
- Fix all errors before distributing.
63
-
64
- ## Subagent Delegation Enforcement
65
-
66
- When a skill requires subagent delegation (via Task tool):
67
-
68
- 1. **Use MUST language** - "Use subagent" is weak; "MUST spawn subagent" is enforceable
69
- 2. **Include Task pattern** - Show exact syntax: `Task(subagent_type="X", prompt="Y", description="Z")`
70
- 3. **Add validation rule** - "If Task tool calls = 0 at end, workflow is INCOMPLETE"
71
- 4. **Mark requirements clearly** - Use table with "MUST spawn" column
72
- 5. **Forbid direct implementation** - "DO NOT implement X yourself - DELEGATE to subagent"
73
-
74
- **Anti-pattern (weak):**
75
- ```
76
- - Use `tester` agent for testing
77
- ```
78
-
79
- **Correct pattern (enforceable):**
80
- ```
81
- - **MUST** spawn `tester` subagent: `Task(subagent_type="tester", prompt="Run tests", description="Test")`
82
- - DO NOT run tests yourself - DELEGATE
83
- ```
1
+ # Skill Validation Checklist
2
+
3
+ Quick validation before packaging. Run `scripts/package_skill.py` for automated checks.
4
+
5
+ ## Critical (Must Pass)
6
+
7
+ ### Metadata
8
+ - [ ] `name`: namespaced `namespace:skill-name` (or `skill-name` for legacy), descriptive
9
+ - [ ] `description`: under 200 characters, specific triggers, not generic
10
+
11
+ ### Size Limits
12
+ - [ ] SKILL.md: under 300 lines
13
+ - [ ] Each reference file: under 300 lines
14
+ - [ ] No info duplication between SKILL.md and references
15
+
16
+ ### Structure
17
+ - [ ] SKILL.md exists with valid YAML frontmatter
18
+ - [ ] Unused example files deleted
19
+ - [ ] File names: kebab-case, self-documenting
20
+
21
+ ## Scripts (If Applicable)
22
+
23
+ - [ ] Tests exist and pass
24
+ - [ ] Cross-platform (Node.js/Python preferred)
25
+ - [ ] Env vars: respects hierarchy `process.env` > `$HOME/.claude/skills/${SKILL}/.env` (global) > `$HOME/.claude/skills/.env` (global) > `$HOME/.claude/.env` (global) > `./.claude/skills/${SKILL}/.env` (cwd) > `./.claude/skills/.env` (cwd) > `./.claude/.env` (cwd)
26
+ - [ ] Dependencies documented (requirements.txt, .env.example)
27
+ - [ ] Manually tested with real use cases
28
+
29
+ ## Quality
30
+
31
+ ### Writing Style
32
+ - [ ] Imperative form: "To accomplish X, do Y"
33
+ - [ ] Third-person metadata: "This skill should be used when..."
34
+ - [ ] Concise, no fluff
35
+
36
+ ### Practical Utility
37
+ - [ ] Teaches *how* to do tasks, not *what* tools are
38
+ - [ ] Based on real workflows
39
+ - [ ] Includes concrete trigger phrases/examples
40
+
41
+ ## Integration
42
+
43
+ - [ ] No duplication with existing skills
44
+ - [ ] Related topics consolidated (e.g., cloudflare + docker → devops)
45
+ - [ ] Composable with other skills
46
+
47
+ ## Automated Validation
48
+
49
+ Run packaging script to validate:
50
+
51
+ ```bash
52
+ scripts/package_skill.py <path/to/skill-folder>
53
+ ```
54
+
55
+ Checks performed:
56
+ - YAML frontmatter format
57
+ - Required fields present
58
+ - Description length (<200 chars)
59
+ - Directory structure
60
+ - File organization
61
+
62
+ Fix all errors before distributing.
63
+
64
+ ## Subagent Delegation Enforcement
65
+
66
+ When a skill requires subagent delegation (via Task tool):
67
+
68
+ 1. **Use MUST language** - "Use subagent" is weak; "MUST spawn subagent" is enforceable
69
+ 2. **Include Task pattern** - Show exact syntax: `Task(subagent_type="X", prompt="Y", description="Z")`
70
+ 3. **Add validation rule** - "If Task tool calls = 0 at end, workflow is INCOMPLETE"
71
+ 4. **Mark requirements clearly** - Use table with "MUST spawn" column
72
+ 5. **Forbid direct implementation** - "DO NOT implement X yourself - DELEGATE to subagent"
73
+
74
+ **Anti-pattern (weak):**
75
+ ```
76
+ - Use `code-reviewer` agent for review
77
+ ```
78
+
79
+ **Correct pattern (enforceable):**
80
+ ```
81
+ - **MUST** spawn `code-reviewer` subagent: `Task(subagent_type="code-reviewer", prompt="Review the diff", description="Review")`
82
+ - DO NOT review it yourself - DELEGATE
83
+ ```
@@ -1,88 +1,88 @@
1
- # Writing Effective Instructions
2
-
3
- ## Writing Style
4
-
5
- Write entirely in **imperative/infinitive form** (verb-first). Use objective, instructional language.
6
-
7
- - **Good:** "To accomplish X, do Y" / "Run `script.py` to validate"
8
- - **Bad:** "You should do X" / "If you need to do X"
9
-
10
- ## Recommended SKILL.md Structure
11
-
12
- ```markdown
13
- ---
14
- name: your-skill # optional namespace: ck:your-skill
15
- description: [What + When + Key capabilities]
16
- ---
17
- # Skill Name
18
- ## Instructions
19
- ### Step 1: [First Major Step]
20
- Clear explanation. Example with expected output.
21
- ### Step 2: [Next Step]
22
- (Continue as needed)
23
- ## Examples
24
- ### Example 1: [Common scenario]
25
- **User says:** "[trigger phrase]"
26
- **Actions:** 1. Do X 2. Do Y
27
- **Result:** [Expected outcome]
28
- ## Troubleshooting
29
- **Error:** [Message] → **Solution:** [Fix]
30
- ```
31
-
32
- ## Be Specific and Actionable
33
-
34
- **Good:**
35
- ```markdown
36
- Run `python scripts/validate.py --input {filename}` to check format.
37
- If validation fails, common issues:
38
- - Missing required fields (add to CSV)
39
- - Invalid date formats (use YYYY-MM-DD)
40
- ```
41
-
42
- **Bad:**
43
- ```markdown
44
- Validate the data before proceeding.
45
- ```
46
-
47
- ## Include Error Handling
48
-
49
- ```markdown
50
- ## Common Issues
51
- ### MCP Connection Failed
52
- If "Connection refused":
53
- 1. Verify MCP server running: Settings > Extensions
54
- 2. Confirm API key valid
55
- 3. Reconnect: Settings > Extensions > [Service] > Reconnect
56
- ```
57
-
58
- ## Reference Bundled Resources Clearly
59
-
60
- ```markdown
61
- Before writing queries, consult `references/api-patterns.md` for:
62
- - Rate limiting guidance
63
- - Pagination patterns
64
- - Error codes and handling
65
- ```
66
-
67
- ## Use Progressive Disclosure
68
-
69
- Keep SKILL.md focused on core instructions (<300 lines). Move to `references/`:
70
- - Detailed API documentation
71
- - Database schemas
72
- - Extended examples
73
- - Domain-specific rules
74
- - Troubleshooting guides
75
-
76
- ## Critical Instructions
77
-
78
- Put at the top of SKILL.md. Use headers like `## CRITICAL` or `## IMPORTANT`.
79
- Repeat key points if they're frequently missed.
80
-
81
- **Advanced technique:** For critical validations, bundle a script that performs checks programmatically rather than relying on language instructions alone. Code is deterministic; language interpretation isn't.
82
-
83
- ## What NOT to Include
84
-
85
- - General knowledge Claude already has
86
- - Tool documentation (teach workflows, not what tools do)
87
- - Verbose explanations (sacrifice grammar for concision)
88
- - Duplicated content between SKILL.md and references
1
+ # Writing Effective Instructions
2
+
3
+ ## Writing Style
4
+
5
+ Write entirely in **imperative/infinitive form** (verb-first). Use objective, instructional language.
6
+
7
+ - **Good:** "To accomplish X, do Y" / "Run `script.py` to validate"
8
+ - **Bad:** "You should do X" / "If you need to do X"
9
+
10
+ ## Recommended SKILL.md Structure
11
+
12
+ ```markdown
13
+ ---
14
+ name: your-skill # optional namespace: ck:your-skill
15
+ description: [What + When + Key capabilities]
16
+ ---
17
+ # Skill Name
18
+ ## Instructions
19
+ ### Step 1: [First Major Step]
20
+ Clear explanation. Example with expected output.
21
+ ### Step 2: [Next Step]
22
+ (Continue as needed)
23
+ ## Examples
24
+ ### Example 1: [Common scenario]
25
+ **User says:** "[trigger phrase]"
26
+ **Actions:** 1. Do X 2. Do Y
27
+ **Result:** [Expected outcome]
28
+ ## Troubleshooting
29
+ **Error:** [Message] → **Solution:** [Fix]
30
+ ```
31
+
32
+ ## Be Specific and Actionable
33
+
34
+ **Good:**
35
+ ```markdown
36
+ Run `python scripts/validate.py --input {filename}` to check format.
37
+ If validation fails, common issues:
38
+ - Missing required fields (add to CSV)
39
+ - Invalid date formats (use YYYY-MM-DD)
40
+ ```
41
+
42
+ **Bad:**
43
+ ```markdown
44
+ Validate the data before proceeding.
45
+ ```
46
+
47
+ ## Include Error Handling
48
+
49
+ ```markdown
50
+ ## Common Issues
51
+ ### MCP Connection Failed
52
+ If "Connection refused":
53
+ 1. Verify MCP server running: Settings > Extensions
54
+ 2. Confirm API key valid
55
+ 3. Reconnect: Settings > Extensions > [Service] > Reconnect
56
+ ```
57
+
58
+ ## Reference Bundled Resources Clearly
59
+
60
+ ```markdown
61
+ Before writing queries, consult `references/api-patterns.md` for:
62
+ - Rate limiting guidance
63
+ - Pagination patterns
64
+ - Error codes and handling
65
+ ```
66
+
67
+ ## Use Progressive Disclosure
68
+
69
+ Keep SKILL.md focused on core instructions (<300 lines). Move to `references/`:
70
+ - Detailed API documentation
71
+ - Database schemas
72
+ - Extended examples
73
+ - Domain-specific rules
74
+ - Troubleshooting guides
75
+
76
+ ## Critical Instructions
77
+
78
+ Put at the top of SKILL.md. Use headers like `## CRITICAL` or `## IMPORTANT`.
79
+ Repeat key points if they're frequently missed.
80
+
81
+ **Advanced technique:** For critical validations, bundle a script that performs checks programmatically rather than relying on language instructions alone. Code is deterministic; language interpretation isn't.
82
+
83
+ ## What NOT to Include
84
+
85
+ - General knowledge Claude already has
86
+ - Tool documentation (teach workflows, not what tools do)
87
+ - Verbose explanations (sacrifice grammar for concision)
88
+ - Duplicated content between SKILL.md and references