@cleocode/skills 2.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.
- package/dispatch-config.json +404 -0
- package/index.d.ts +178 -0
- package/index.js +405 -0
- package/package.json +14 -0
- package/profiles/core.json +7 -0
- package/profiles/full.json +10 -0
- package/profiles/minimal.json +7 -0
- package/profiles/recommended.json +7 -0
- package/provider-skills-map.json +97 -0
- package/skills/_shared/cleo-style-guide.md +84 -0
- package/skills/_shared/manifest-operations.md +810 -0
- package/skills/_shared/placeholders.json +433 -0
- package/skills/_shared/skill-chaining-patterns.md +237 -0
- package/skills/_shared/subagent-protocol-base.md +223 -0
- package/skills/_shared/task-system-integration.md +232 -0
- package/skills/_shared/testing-framework-config.md +110 -0
- package/skills/ct-cleo/SKILL.md +490 -0
- package/skills/ct-cleo/references/anti-patterns.md +19 -0
- package/skills/ct-cleo/references/loom-lifecycle.md +136 -0
- package/skills/ct-cleo/references/orchestrator-constraints.md +55 -0
- package/skills/ct-cleo/references/session-protocol.md +162 -0
- package/skills/ct-codebase-mapper/SKILL.md +82 -0
- package/skills/ct-contribution/SKILL.md +521 -0
- package/skills/ct-contribution/templates/contribution-init.json +21 -0
- package/skills/ct-dev-workflow/SKILL.md +423 -0
- package/skills/ct-docs-lookup/SKILL.md +66 -0
- package/skills/ct-docs-review/SKILL.md +175 -0
- package/skills/ct-docs-write/SKILL.md +108 -0
- package/skills/ct-documentor/SKILL.md +231 -0
- package/skills/ct-epic-architect/SKILL.md +305 -0
- package/skills/ct-epic-architect/references/bug-epic-example.md +172 -0
- package/skills/ct-epic-architect/references/commands.md +201 -0
- package/skills/ct-epic-architect/references/feature-epic-example.md +210 -0
- package/skills/ct-epic-architect/references/migration-epic-example.md +244 -0
- package/skills/ct-epic-architect/references/output-format.md +92 -0
- package/skills/ct-epic-architect/references/patterns.md +284 -0
- package/skills/ct-epic-architect/references/refactor-epic-example.md +412 -0
- package/skills/ct-epic-architect/references/research-epic-example.md +226 -0
- package/skills/ct-epic-architect/references/shell-escaping.md +86 -0
- package/skills/ct-epic-architect/references/skill-aware-execution.md +195 -0
- package/skills/ct-grade/SKILL.md +230 -0
- package/skills/ct-grade/agents/analysis-reporter.md +203 -0
- package/skills/ct-grade/agents/blind-comparator.md +157 -0
- package/skills/ct-grade/agents/scenario-runner.md +134 -0
- package/skills/ct-grade/eval-viewer/__pycache__/generate_grade_review.cpython-314.pyc +0 -0
- package/skills/ct-grade/eval-viewer/generate_grade_review.py +1138 -0
- package/skills/ct-grade/eval-viewer/generate_grade_viewer.py +544 -0
- package/skills/ct-grade/eval-viewer/generate_review.py +283 -0
- package/skills/ct-grade/eval-viewer/grade-review.html +1574 -0
- package/skills/ct-grade/eval-viewer/viewer.html +219 -0
- package/skills/ct-grade/evals/evals.json +94 -0
- package/skills/ct-grade/references/ab-test-methodology.md +150 -0
- package/skills/ct-grade/references/domains.md +137 -0
- package/skills/ct-grade/references/grade-spec.md +236 -0
- package/skills/ct-grade/references/scenario-playbook.md +234 -0
- package/skills/ct-grade/references/token-tracking.md +120 -0
- package/skills/ct-grade/scripts/__pycache__/audit_analyzer.cpython-314.pyc +0 -0
- package/skills/ct-grade/scripts/__pycache__/run_ab_test.cpython-314.pyc +0 -0
- package/skills/ct-grade/scripts/__pycache__/run_all.cpython-314.pyc +0 -0
- package/skills/ct-grade/scripts/__pycache__/token_tracker.cpython-314.pyc +0 -0
- package/skills/ct-grade/scripts/audit_analyzer.py +279 -0
- package/skills/ct-grade/scripts/generate_report.py +283 -0
- package/skills/ct-grade/scripts/run_ab_test.py +504 -0
- package/skills/ct-grade/scripts/run_all.py +287 -0
- package/skills/ct-grade/scripts/setup_run.py +183 -0
- package/skills/ct-grade/scripts/token_tracker.py +630 -0
- package/skills/ct-grade-v2-1/SKILL.md +237 -0
- package/skills/ct-grade-v2-1/agents/analysis-reporter.md +203 -0
- package/skills/ct-grade-v2-1/agents/blind-comparator.md +157 -0
- package/skills/ct-grade-v2-1/agents/scenario-runner.md +179 -0
- package/skills/ct-grade-v2-1/evals/evals.json +74 -0
- package/skills/ct-grade-v2-1/grade-viewer/__pycache__/build_op_stats.cpython-314.pyc +0 -0
- package/skills/ct-grade-v2-1/grade-viewer/__pycache__/generate_grade_review.cpython-314.pyc +0 -0
- package/skills/ct-grade-v2-1/grade-viewer/build_op_stats.py +174 -0
- package/skills/ct-grade-v2-1/grade-viewer/eval-analysis.json +41 -0
- package/skills/ct-grade-v2-1/grade-viewer/eval-report.md +34 -0
- package/skills/ct-grade-v2-1/grade-viewer/generate_grade_review.py +1023 -0
- package/skills/ct-grade-v2-1/grade-viewer/generate_grade_viewer.py +548 -0
- package/skills/ct-grade-v2-1/grade-viewer/grade-review-eval.html +613 -0
- package/skills/ct-grade-v2-1/grade-viewer/grade-review.html +1532 -0
- package/skills/ct-grade-v2-1/grade-viewer/viewer.html +620 -0
- package/skills/ct-grade-v2-1/manifest-entry.json +31 -0
- package/skills/ct-grade-v2-1/references/ab-testing.md +233 -0
- package/skills/ct-grade-v2-1/references/domains-ssot.md +156 -0
- package/skills/ct-grade-v2-1/references/grade-spec-v2.md +167 -0
- package/skills/ct-grade-v2-1/references/playbook-v2.md +393 -0
- package/skills/ct-grade-v2-1/references/token-tracking.md +202 -0
- package/skills/ct-grade-v2-1/scripts/generate_report.py +419 -0
- package/skills/ct-grade-v2-1/scripts/run_ab_test.py +493 -0
- package/skills/ct-grade-v2-1/scripts/run_scenario.py +396 -0
- package/skills/ct-grade-v2-1/scripts/setup_run.py +207 -0
- package/skills/ct-grade-v2-1/scripts/token_tracker.py +175 -0
- package/skills/ct-memory/SKILL.md +84 -0
- package/skills/ct-orchestrator/INSTALL.md +61 -0
- package/skills/ct-orchestrator/README.md +69 -0
- package/skills/ct-orchestrator/SKILL.md +380 -0
- package/skills/ct-orchestrator/manifest-entry.json +19 -0
- package/skills/ct-orchestrator/orchestrator-prompt.txt +17 -0
- package/skills/ct-orchestrator/references/SUBAGENT-PROTOCOL-BLOCK.md +66 -0
- package/skills/ct-orchestrator/references/autonomous-operation.md +167 -0
- package/skills/ct-orchestrator/references/lifecycle-gates.md +98 -0
- package/skills/ct-orchestrator/references/orchestrator-compliance.md +271 -0
- package/skills/ct-orchestrator/references/orchestrator-handoffs.md +85 -0
- package/skills/ct-orchestrator/references/orchestrator-patterns.md +164 -0
- package/skills/ct-orchestrator/references/orchestrator-recovery.md +113 -0
- package/skills/ct-orchestrator/references/orchestrator-spawning.md +271 -0
- package/skills/ct-orchestrator/references/orchestrator-tokens.md +180 -0
- package/skills/ct-research-agent/SKILL.md +226 -0
- package/skills/ct-skill-creator/.cleo/.context-state.json +13 -0
- package/skills/ct-skill-creator/.cleo/logs/cleo.2026-03-07.1.log +24 -0
- package/skills/ct-skill-creator/.cleo/tasks.db +0 -0
- package/skills/ct-skill-creator/SKILL.md +356 -0
- package/skills/ct-skill-creator/agents/analyzer.md +276 -0
- package/skills/ct-skill-creator/agents/comparator.md +204 -0
- package/skills/ct-skill-creator/agents/grader.md +225 -0
- package/skills/ct-skill-creator/assets/eval_review.html +146 -0
- package/skills/ct-skill-creator/eval-viewer/__pycache__/generate_review.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/eval-viewer/generate_review.py +471 -0
- package/skills/ct-skill-creator/eval-viewer/viewer.html +1325 -0
- package/skills/ct-skill-creator/manifest-entry.json +17 -0
- package/skills/ct-skill-creator/references/dynamic-context.md +228 -0
- package/skills/ct-skill-creator/references/frontmatter.md +83 -0
- package/skills/ct-skill-creator/references/invocation-control.md +165 -0
- package/skills/ct-skill-creator/references/output-patterns.md +86 -0
- package/skills/ct-skill-creator/references/provider-deployment.md +175 -0
- package/skills/ct-skill-creator/references/schemas.md +430 -0
- package/skills/ct-skill-creator/references/workflows.md +28 -0
- package/skills/ct-skill-creator/scripts/__init__.py +1 -0
- package/skills/ct-skill-creator/scripts/__pycache__/__init__.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/aggregate_benchmark.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/generate_report.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/improve_description.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/init_skill.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/quick_validate.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/run_eval.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/run_loop.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/utils.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/skills/ct-skill-creator/scripts/generate_report.py +326 -0
- package/skills/ct-skill-creator/scripts/improve_description.py +247 -0
- package/skills/ct-skill-creator/scripts/init_skill.py +306 -0
- package/skills/ct-skill-creator/scripts/package_skill.py +110 -0
- package/skills/ct-skill-creator/scripts/quick_validate.py +97 -0
- package/skills/ct-skill-creator/scripts/run_eval.py +310 -0
- package/skills/ct-skill-creator/scripts/run_loop.py +328 -0
- package/skills/ct-skill-creator/scripts/utils.py +47 -0
- package/skills/ct-skill-validator/SKILL.md +178 -0
- package/skills/ct-skill-validator/agents/ecosystem-checker.md +151 -0
- package/skills/ct-skill-validator/assets/valid-skill-example.md +13 -0
- package/skills/ct-skill-validator/evals/eval_set.json +14 -0
- package/skills/ct-skill-validator/evals/evals.json +52 -0
- package/skills/ct-skill-validator/manifest-entry.json +20 -0
- package/skills/ct-skill-validator/references/cleo-ecosystem-rules.md +163 -0
- package/skills/ct-skill-validator/references/validation-rules.md +168 -0
- package/skills/ct-skill-validator/scripts/__init__.py +0 -0
- package/skills/ct-skill-validator/scripts/__pycache__/audit_body.cpython-314.pyc +0 -0
- package/skills/ct-skill-validator/scripts/__pycache__/check_ecosystem.cpython-314.pyc +0 -0
- package/skills/ct-skill-validator/scripts/__pycache__/generate_validation_report.cpython-314.pyc +0 -0
- package/skills/ct-skill-validator/scripts/__pycache__/validate.cpython-314.pyc +0 -0
- package/skills/ct-skill-validator/scripts/audit_body.py +242 -0
- package/skills/ct-skill-validator/scripts/check_ecosystem.py +169 -0
- package/skills/ct-skill-validator/scripts/check_manifest.py +172 -0
- package/skills/ct-skill-validator/scripts/generate_validation_report.py +442 -0
- package/skills/ct-skill-validator/scripts/validate.py +422 -0
- package/skills/ct-spec-writer/SKILL.md +189 -0
- package/skills/ct-stickynote/README.md +14 -0
- package/skills/ct-stickynote/SKILL.md +46 -0
- package/skills/ct-task-executor/SKILL.md +296 -0
- package/skills/ct-validator/SKILL.md +216 -0
- package/skills/manifest.json +469 -0
- package/skills.json +281 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ct-skill-creator",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Guide for creating effective CLEO skills with the full v2 standard.",
|
|
5
|
+
"path": "packages/ct-skills/skills/ct-skill-creator",
|
|
6
|
+
"status": "active",
|
|
7
|
+
"tier": 3,
|
|
8
|
+
"core": false,
|
|
9
|
+
"category": "meta",
|
|
10
|
+
"protocol": null,
|
|
11
|
+
"dependencies": [],
|
|
12
|
+
"sharedResources": [],
|
|
13
|
+
"compatibility": ["claude-code", "cursor", "windsurf", "gemini-cli"],
|
|
14
|
+
"token_budget": 12000,
|
|
15
|
+
"capabilities": ["skill-creation", "eval-loop", "description-optimization", "quality-eval"],
|
|
16
|
+
"constraints": ["requires-claude-api-for-eval-loop"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# Dynamic Context Injection
|
|
2
|
+
|
|
3
|
+
Skills can inject dynamic runtime information into SKILL.md content before Claude sees it. Three mechanisms are available: shell pre-processing, argument substitution, and session variables.
|
|
4
|
+
|
|
5
|
+
## Shell Pre-Processing
|
|
6
|
+
|
|
7
|
+
Embed shell command output directly into skill content using backtick-bang syntax.
|
|
8
|
+
|
|
9
|
+
**Syntax**: `` !`command` ``
|
|
10
|
+
|
|
11
|
+
The command runs before Claude sees the skill content. The entire `` !`command` `` expression is replaced with the command's stdout output.
|
|
12
|
+
|
|
13
|
+
**Examples**:
|
|
14
|
+
|
|
15
|
+
```markdown
|
|
16
|
+
## Current Repository State
|
|
17
|
+
|
|
18
|
+
Recent commits:
|
|
19
|
+
!`git log --oneline -5`
|
|
20
|
+
|
|
21
|
+
Current branch: !`git branch --show-current`
|
|
22
|
+
|
|
23
|
+
Last tag: !`git describe --tags --abbrev=0 2>/dev/null || echo "no tags"`
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
After pre-processing, Claude sees:
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
## Current Repository State
|
|
30
|
+
|
|
31
|
+
Recent commits:
|
|
32
|
+
a1b2c3d fix: resolve auth timeout
|
|
33
|
+
d4e5f6g feat: add user dashboard
|
|
34
|
+
7h8i9j0 refactor: extract validation
|
|
35
|
+
k1l2m3n docs: update API reference
|
|
36
|
+
o4p5q6r test: add integration tests
|
|
37
|
+
|
|
38
|
+
Current branch: feature/user-dashboard
|
|
39
|
+
|
|
40
|
+
Last tag: v2.3.1
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Complex commands** work as expected -- pipes, subshells, and multi-command expressions:
|
|
44
|
+
|
|
45
|
+
```markdown
|
|
46
|
+
Node version: !`node --version`
|
|
47
|
+
Package name: !`cat package.json | python3 -c "import sys,json; print(json.load(sys.stdin)['name'])"`
|
|
48
|
+
File count: !`find src -name '*.ts' | wc -l`
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Failure behavior**: If a command fails (non-zero exit code), the expression is replaced with an empty string. The skill still loads -- failed commands do not block skill execution. Use fallback patterns like `command || echo "fallback"` to handle expected failures gracefully:
|
|
52
|
+
|
|
53
|
+
```markdown
|
|
54
|
+
Python version: !`python3 --version 2>/dev/null || echo "Python not installed"`
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Argument Substitution
|
|
58
|
+
|
|
59
|
+
When users invoke a skill with arguments (e.g., `/my-skill arg1 arg2`), the arguments are available through substitution variables in the skill body.
|
|
60
|
+
|
|
61
|
+
### Full Argument String
|
|
62
|
+
|
|
63
|
+
`$ARGUMENTS` -- all arguments as a single string, exactly as the user typed them.
|
|
64
|
+
|
|
65
|
+
```markdown
|
|
66
|
+
## Task
|
|
67
|
+
|
|
68
|
+
Analyze the following: $ARGUMENTS
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
If the user types `/analyze-code src/auth.ts --depth 3`, Claude sees:
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
## Task
|
|
75
|
+
|
|
76
|
+
Analyze the following: src/auth.ts --depth 3
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Indexed Access
|
|
80
|
+
|
|
81
|
+
Access individual arguments by zero-based index:
|
|
82
|
+
|
|
83
|
+
| Variable | Equivalent | Value (for `/skill foo bar baz`) |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| `$ARGUMENTS[0]` | `$1` | `foo` |
|
|
86
|
+
| `$ARGUMENTS[1]` | `$2` | `bar` |
|
|
87
|
+
| `$ARGUMENTS[2]` | `$3` | `baz` |
|
|
88
|
+
| `$ARGUMENTS` | (all) | `foo bar baz` |
|
|
89
|
+
|
|
90
|
+
The `$1`, `$2`, `$3` shorthand forms are interchangeable with `$ARGUMENTS[0]`, `$ARGUMENTS[1]`, `$ARGUMENTS[2]`.
|
|
91
|
+
|
|
92
|
+
### Worked Example
|
|
93
|
+
|
|
94
|
+
Given the invocation `/deploy-check production api-gateway`:
|
|
95
|
+
|
|
96
|
+
```markdown
|
|
97
|
+
## Deployment Check
|
|
98
|
+
|
|
99
|
+
**Environment**: $1
|
|
100
|
+
**Service**: $2
|
|
101
|
+
|
|
102
|
+
Run the following verification:
|
|
103
|
+
|
|
104
|
+
1. Check that $ARGUMENTS[0] cluster is healthy
|
|
105
|
+
2. Verify $ARGUMENTS[1] pods are running
|
|
106
|
+
3. Full command context: deploying $ARGUMENTS
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Claude sees:
|
|
110
|
+
|
|
111
|
+
```markdown
|
|
112
|
+
## Deployment Check
|
|
113
|
+
|
|
114
|
+
**Environment**: production
|
|
115
|
+
**Service**: api-gateway
|
|
116
|
+
|
|
117
|
+
Run the following verification:
|
|
118
|
+
|
|
119
|
+
1. Check that production cluster is healthy
|
|
120
|
+
2. Verify api-gateway pods are running
|
|
121
|
+
3. Full command context: deploying production api-gateway
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Missing Arguments
|
|
125
|
+
|
|
126
|
+
If a user provides fewer arguments than the skill references, unreferenced `$ARGUMENTS[N]` variables are replaced with empty strings. Design skills defensively by placing critical instructions outside of argument-dependent sections, or by documenting required arguments in `argument-hint`.
|
|
127
|
+
|
|
128
|
+
## Session Variables
|
|
129
|
+
|
|
130
|
+
Two environment variables are available for runtime context:
|
|
131
|
+
|
|
132
|
+
### CLAUDE_SESSION_ID
|
|
133
|
+
|
|
134
|
+
`${CLAUDE_SESSION_ID}` -- a unique identifier for the current Claude session. Useful for correlating logs, creating session-specific output files, or tracking work across multiple skill invocations within the same session.
|
|
135
|
+
|
|
136
|
+
```markdown
|
|
137
|
+
## Logging
|
|
138
|
+
|
|
139
|
+
Write analysis results to `/tmp/analysis-${CLAUDE_SESSION_ID}.json` for later review.
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### CLAUDE_SKILL_DIR
|
|
143
|
+
|
|
144
|
+
`${CLAUDE_SKILL_DIR}` -- the absolute filesystem path to the skill's root directory. This is the directory containing SKILL.md.
|
|
145
|
+
|
|
146
|
+
This variable is critical for skills that bundle scripts, references, or assets. Without it, bundled scripts would need hardcoded absolute paths -- which break when the skill is installed in different locations (global vs. project, different providers, different machines).
|
|
147
|
+
|
|
148
|
+
**The portable bundled-script pattern**:
|
|
149
|
+
|
|
150
|
+
```markdown
|
|
151
|
+
## Analysis
|
|
152
|
+
|
|
153
|
+
Run the analysis script on the target file:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
python3 ${CLAUDE_SKILL_DIR}/scripts/analyze.py "$1"
|
|
157
|
+
```
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
This works regardless of where the skill is installed:
|
|
161
|
+
- Global install: `${CLAUDE_SKILL_DIR}` = `/home/user/.claude/skills/my-skill`
|
|
162
|
+
- Project install: `${CLAUDE_SKILL_DIR}` = `/projects/myapp/.claude/skills/my-skill`
|
|
163
|
+
- Symlinked: `${CLAUDE_SKILL_DIR}` resolves through the symlink to the actual directory
|
|
164
|
+
|
|
165
|
+
Without `${CLAUDE_SKILL_DIR}`, you would need to hardcode paths like `/home/user/.claude/skills/my-skill/scripts/analyze.py`, which breaks for every other user and installation location.
|
|
166
|
+
|
|
167
|
+
**Referencing bundled resources**:
|
|
168
|
+
|
|
169
|
+
```markdown
|
|
170
|
+
For the full API schema, read: ${CLAUDE_SKILL_DIR}/references/api-schema.md
|
|
171
|
+
|
|
172
|
+
For brand assets, copy from: ${CLAUDE_SKILL_DIR}/assets/logo.png
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Combining All Features
|
|
176
|
+
|
|
177
|
+
A realistic skill body demonstrating all three injection mechanisms together:
|
|
178
|
+
|
|
179
|
+
```markdown
|
|
180
|
+
---
|
|
181
|
+
name: pr-review
|
|
182
|
+
description: "Automated pull request code review with project-aware analysis. Use when reviewing PRs, checking code quality, or preparing review comments."
|
|
183
|
+
argument-hint: "<pr-number>"
|
|
184
|
+
allowed-tools:
|
|
185
|
+
- Read
|
|
186
|
+
- Bash(gh pr *)
|
|
187
|
+
- Bash(git *)
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
# PR Review
|
|
191
|
+
|
|
192
|
+
## Project Context
|
|
193
|
+
|
|
194
|
+
**Repository**: !`git remote get-url origin | sed 's/.*github.com[:/]//' | sed 's/.git$//'`
|
|
195
|
+
**Default branch**: !`git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main"`
|
|
196
|
+
**Test framework**: !`[ -f vitest.config.ts ] && echo "Vitest" || ([ -f jest.config.js ] && echo "Jest" || echo "unknown")`
|
|
197
|
+
|
|
198
|
+
## Review Target
|
|
199
|
+
|
|
200
|
+
Fetch and review PR #$1:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
gh pr diff $ARGUMENTS[0] > /tmp/pr-${CLAUDE_SESSION_ID}.diff
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Review Checklist
|
|
207
|
+
|
|
208
|
+
Load the project's review standards:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
cat ${CLAUDE_SKILL_DIR}/references/review-checklist.md
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Run the automated checks:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
python3 ${CLAUDE_SKILL_DIR}/scripts/lint_diff.py /tmp/pr-${CLAUDE_SESSION_ID}.diff
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Output
|
|
221
|
+
|
|
222
|
+
Write the review to `/tmp/review-$1-${CLAUDE_SESSION_ID}.md` using the template at `${CLAUDE_SKILL_DIR}/assets/review-template.md`.
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
In this example:
|
|
226
|
+
- **Shell pre-processing** (`!`...``) injects the repository name, default branch, and test framework at load time
|
|
227
|
+
- **Argument substitution** (`$1`, `$ARGUMENTS[0]`) passes the PR number into commands and filenames
|
|
228
|
+
- **Session variables** (`${CLAUDE_SESSION_ID}`, `${CLAUDE_SKILL_DIR}`) create unique temp files and locate bundled scripts portably
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# SKILL.md Frontmatter Schema
|
|
2
|
+
|
|
3
|
+
## Required Fields
|
|
4
|
+
|
|
5
|
+
```yaml
|
|
6
|
+
name: string # hyphen-case, max 64 chars, must match directory name
|
|
7
|
+
description: string # max 1024 chars, no < or >, use quoted strings not >-/| multiline
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Optional Fields
|
|
11
|
+
|
|
12
|
+
```yaml
|
|
13
|
+
argument-hint: string # max 100 chars; shown in /name autocomplete
|
|
14
|
+
disable-model-invocation: bool # true = user-only invoke; description removed from context
|
|
15
|
+
user-invocable: bool # false = hidden from /menu; Claude still sees description
|
|
16
|
+
allowed-tools: string | list # pre-approved tools; Bash(pattern) for restricted bash
|
|
17
|
+
model: string # model ID override for this skill
|
|
18
|
+
context: "fork" # isolated subagent; no conversation history
|
|
19
|
+
agent: string # Explore | Plan | general-purpose | <custom>
|
|
20
|
+
hooks: dict # PreToolUse | PostToolUse | Stop handlers
|
|
21
|
+
license: string # e.g. MIT
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## FORBIDDEN in SKILL.md (belongs in manifest.json)
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
version, tier, core, category, protocol, dependencies, sharedResources,
|
|
28
|
+
compatibility, token_budget, capabilities, constraints, metadata, tags, triggers
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Copy-Paste Template
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
---
|
|
35
|
+
name: skill-name
|
|
36
|
+
description: "What this skill does and WHEN to use it. Max 1024 chars. Third person."
|
|
37
|
+
# argument-hint: "[optional-arg]"
|
|
38
|
+
# disable-model-invocation: true
|
|
39
|
+
# user-invocable: false
|
|
40
|
+
# allowed-tools: Read, Grep, Glob
|
|
41
|
+
# model: claude-sonnet-4-6
|
|
42
|
+
# context: fork
|
|
43
|
+
# agent: Explore
|
|
44
|
+
# hooks:
|
|
45
|
+
# PreToolUse:
|
|
46
|
+
# - matcher: Bash
|
|
47
|
+
# command: "echo 'invoked' >> /tmp/audit.log"
|
|
48
|
+
# license: MIT
|
|
49
|
+
---
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Invocation Matrix
|
|
53
|
+
|
|
54
|
+
| Config | User /slash | Claude auto | Description in ctx |
|
|
55
|
+
|--------|------------|-------------|-------------------|
|
|
56
|
+
| (default) | Yes | Yes | Yes |
|
|
57
|
+
| `disable-model-invocation: true` | Yes | No | No |
|
|
58
|
+
| `user-invocable: false` | No | Yes | Yes |
|
|
59
|
+
| Both above | No | No | No |
|
|
60
|
+
|
|
61
|
+
## YAML Pitfalls
|
|
62
|
+
|
|
63
|
+
**Use quoted strings for description** — `>-` and `|` fold/preserve newlines unexpectedly:
|
|
64
|
+
```yaml
|
|
65
|
+
# BAD
|
|
66
|
+
description: >-
|
|
67
|
+
Deploy applications to staging
|
|
68
|
+
with pre-flight checks.
|
|
69
|
+
|
|
70
|
+
# GOOD
|
|
71
|
+
description: "Deploy applications to staging with pre-flight checks."
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Booleans must be unquoted:**
|
|
75
|
+
```yaml
|
|
76
|
+
disable-model-invocation: true # correct
|
|
77
|
+
disable-model-invocation: "true" # wrong — this is a string
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Quote strings with special chars** (`:` followed by space, `#`, `>`):
|
|
81
|
+
```yaml
|
|
82
|
+
description: "Note: handles edge cases" # needs quotes due to colon
|
|
83
|
+
```
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Invocation Control
|
|
2
|
+
|
|
3
|
+
This reference covers how to control when and how skills are triggered, including the interaction between `disable-model-invocation`, `user-invocable`, `allowed-tools`, and context budgets.
|
|
4
|
+
|
|
5
|
+
## Invocation Matrix
|
|
6
|
+
|
|
7
|
+
The combination of `disable-model-invocation` and `user-invocable` determines how a skill can be triggered:
|
|
8
|
+
|
|
9
|
+
| Frontmatter | User `/slash` invoke | Claude auto-trigger | Description in context | Body loaded |
|
|
10
|
+
|---|---|---|---|---|
|
|
11
|
+
| (defaults -- neither set) | Yes | Yes | Always | When invoked |
|
|
12
|
+
| `disable-model-invocation: true` | Yes | No | Never | When user invokes |
|
|
13
|
+
| `user-invocable: false` | No | Yes | Always | When Claude auto-triggers |
|
|
14
|
+
| Both set (`true` + `false`) | Error | Error | -- | Invalid combination |
|
|
15
|
+
|
|
16
|
+
Key observations:
|
|
17
|
+
- **Default behavior** is the most common: the skill appears in the slash menu, Claude can auto-trigger it, and the description is always in context for trigger evaluation.
|
|
18
|
+
- `disable-model-invocation: true` completely hides the skill from Claude. It cannot see the description, cannot reason about it, and cannot trigger it.
|
|
19
|
+
- `user-invocable: false` removes the slash command but keeps the description visible to Claude, allowing autonomous triggering.
|
|
20
|
+
- Setting both is contradictory (hidden from users AND hidden from Claude) and should not be done.
|
|
21
|
+
|
|
22
|
+
## disable-model-invocation: true
|
|
23
|
+
|
|
24
|
+
Use this for skills that perform side effects requiring explicit user intent. When set, the skill's description is removed from Claude's context entirely -- Claude does not know the skill exists.
|
|
25
|
+
|
|
26
|
+
**When to use**:
|
|
27
|
+
- Deployment workflows (staging, production pushes)
|
|
28
|
+
- Git operations with external effects (force push, tag creation)
|
|
29
|
+
- Communication actions (sending emails, Slack messages, creating PRs)
|
|
30
|
+
- Database mutations (migrations, data backfixes)
|
|
31
|
+
- Billing or payment operations
|
|
32
|
+
- Any destructive or hard-to-reverse operation
|
|
33
|
+
|
|
34
|
+
**Example**:
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
---
|
|
38
|
+
name: deploy-production
|
|
39
|
+
description: "Deploy the current branch to production with rolling updates, health checks, and automatic rollback on failure. Use for production deployments only."
|
|
40
|
+
disable-model-invocation: true
|
|
41
|
+
argument-hint: "<service-name> [--canary] [--skip-tests]"
|
|
42
|
+
allowed-tools:
|
|
43
|
+
- Bash(kubectl *)
|
|
44
|
+
- Bash(helm *)
|
|
45
|
+
---
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The user must explicitly type `/deploy-production api-gateway` to trigger this skill. Claude will never suggest or auto-trigger it, because Claude cannot see that it exists.
|
|
49
|
+
|
|
50
|
+
## user-invocable: false
|
|
51
|
+
|
|
52
|
+
Use this for background knowledge that Claude should apply autonomously. The skill has no slash command, but Claude reads the description and auto-loads the body when the conversation context matches.
|
|
53
|
+
|
|
54
|
+
**When to use**:
|
|
55
|
+
- Project coding standards and conventions
|
|
56
|
+
- API schemas and domain models that inform code generation
|
|
57
|
+
- Style guides that should be applied to all generated content
|
|
58
|
+
- Security policies and compliance rules
|
|
59
|
+
- Architecture patterns specific to the project
|
|
60
|
+
|
|
61
|
+
**Example**:
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
---
|
|
65
|
+
name: project-conventions
|
|
66
|
+
description: "Project coding conventions including naming standards, import ordering, error handling patterns, and test structure. Apply these conventions when generating or modifying code in this project."
|
|
67
|
+
user-invocable: false
|
|
68
|
+
---
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Claude sees the description, recognizes that a code generation task matches, and loads the skill body automatically. No `/project-conventions` slash command exists.
|
|
72
|
+
|
|
73
|
+
## allowed-tools
|
|
74
|
+
|
|
75
|
+
Pre-approves specific tools for use during skill execution, bypassing per-use permission prompts. Reduces friction without giving blanket permissions.
|
|
76
|
+
|
|
77
|
+
### String Format
|
|
78
|
+
|
|
79
|
+
Comma-separated list of tool names:
|
|
80
|
+
|
|
81
|
+
```yaml
|
|
82
|
+
allowed-tools: "Read, Write, Edit, Bash(python3 *)"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### List Format
|
|
86
|
+
|
|
87
|
+
YAML list for clearer multi-tool specifications:
|
|
88
|
+
|
|
89
|
+
```yaml
|
|
90
|
+
allowed-tools:
|
|
91
|
+
- Read
|
|
92
|
+
- Write
|
|
93
|
+
- Edit
|
|
94
|
+
- Grep
|
|
95
|
+
- Glob
|
|
96
|
+
- Bash(npm test *)
|
|
97
|
+
- Bash(npx vitest *)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Bash Pattern Restriction
|
|
101
|
+
|
|
102
|
+
`Bash(pattern)` pre-approves only bash commands matching the glob pattern. The pattern is matched against the full command string.
|
|
103
|
+
|
|
104
|
+
```yaml
|
|
105
|
+
# Only allow git and npm commands
|
|
106
|
+
allowed-tools:
|
|
107
|
+
- Bash(git *)
|
|
108
|
+
- Bash(npm *)
|
|
109
|
+
|
|
110
|
+
# Only allow Python scripts in the skill's scripts directory
|
|
111
|
+
allowed-tools:
|
|
112
|
+
- Bash(python3 ${CLAUDE_SKILL_DIR}/scripts/*)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Without a pattern, bare `Bash` pre-approves all bash commands -- use with caution.
|
|
116
|
+
|
|
117
|
+
## Context Budget
|
|
118
|
+
|
|
119
|
+
Skills consume context window space at two levels, and understanding the budget is critical for designing skills that coexist well.
|
|
120
|
+
|
|
121
|
+
### Description Budget
|
|
122
|
+
|
|
123
|
+
Every trigger-eligible skill's `description` field is loaded into Claude's context at all times. Each description consumes roughly 100-200 tokens. With 15 skills, that is 1,500-3,000 tokens of always-on context.
|
|
124
|
+
|
|
125
|
+
Implication: keep descriptions concise and trigger-focused. Every word costs tokens across every single conversation.
|
|
126
|
+
|
|
127
|
+
### Body Budget
|
|
128
|
+
|
|
129
|
+
When a skill is triggered, its body (everything below the frontmatter) is loaded into context. The body is capped at 2% of the context window, which is approximately 16,000 characters by default.
|
|
130
|
+
|
|
131
|
+
This cap can be overridden via the `SLASH_COMMAND_TOOL_CHAR_BUDGET` environment variable:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Increase body budget to 32k chars
|
|
135
|
+
export SLASH_COMMAND_TOOL_CHAR_BUDGET=32000
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Practical limit**: keep skill bodies under 500 lines. Use the progressive disclosure pattern -- put core workflow in SKILL.md and detailed reference material in `references/` files that Claude loads on demand.
|
|
139
|
+
|
|
140
|
+
### Budget-Aware Design
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
Always loaded (~200 tokens each):
|
|
144
|
+
skill-1 description
|
|
145
|
+
skill-2 description
|
|
146
|
+
...
|
|
147
|
+
skill-N description
|
|
148
|
+
|
|
149
|
+
Loaded on trigger (~2% of context):
|
|
150
|
+
SKILL.md body
|
|
151
|
+
|
|
152
|
+
Loaded on demand (no fixed limit):
|
|
153
|
+
references/detail-a.md
|
|
154
|
+
references/detail-b.md
|
|
155
|
+
scripts/tool.py (executed, not loaded)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Skill Types Summary
|
|
159
|
+
|
|
160
|
+
| Type | Frontmatter | Use Case |
|
|
161
|
+
|---|---|---|
|
|
162
|
+
| **Task** | (defaults) | Interactive workflows users invoke by name -- code analysis, deployment, file processing |
|
|
163
|
+
| **Background** | `user-invocable: false` | Domain knowledge Claude applies autonomously -- coding standards, schemas, policies |
|
|
164
|
+
| **Protected** | `disable-model-invocation: true` | Side-effect workflows requiring explicit user intent -- deploys, sends, mutations |
|
|
165
|
+
| **Subagent** | `context: fork` | Self-contained tasks that run in isolation -- research, analysis, generation from scratch |
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Output Patterns
|
|
2
|
+
|
|
3
|
+
Use these patterns when skills need to produce consistent, high-quality output.
|
|
4
|
+
|
|
5
|
+
## Template Pattern
|
|
6
|
+
|
|
7
|
+
Provide templates for output format. Match the level of strictness to your needs.
|
|
8
|
+
|
|
9
|
+
**For strict requirements (like API responses or data formats):**
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
## Report structure
|
|
13
|
+
|
|
14
|
+
ALWAYS use this exact template structure:
|
|
15
|
+
|
|
16
|
+
# [Analysis Title]
|
|
17
|
+
|
|
18
|
+
## Executive summary
|
|
19
|
+
[One-paragraph overview of key findings]
|
|
20
|
+
|
|
21
|
+
## Key findings
|
|
22
|
+
- Finding 1 with supporting data
|
|
23
|
+
- Finding 2 with supporting data
|
|
24
|
+
- Finding 3 with supporting data
|
|
25
|
+
|
|
26
|
+
## Recommendations
|
|
27
|
+
1. Specific actionable recommendation
|
|
28
|
+
2. Specific actionable recommendation
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**For flexible guidance (when adaptation is useful):**
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
## Report structure
|
|
35
|
+
|
|
36
|
+
Here is a sensible default format, but use your best judgment:
|
|
37
|
+
|
|
38
|
+
# [Analysis Title]
|
|
39
|
+
|
|
40
|
+
## Executive summary
|
|
41
|
+
[Overview]
|
|
42
|
+
|
|
43
|
+
## Key findings
|
|
44
|
+
[Adapt sections based on what you discover]
|
|
45
|
+
|
|
46
|
+
## Recommendations
|
|
47
|
+
[Tailor to the specific context]
|
|
48
|
+
|
|
49
|
+
Adjust sections as needed for the specific analysis type.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Examples Pattern
|
|
53
|
+
|
|
54
|
+
For skills where output quality depends on seeing examples, provide input/output pairs:
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
## Commit message format
|
|
58
|
+
|
|
59
|
+
Generate commit messages following these examples:
|
|
60
|
+
|
|
61
|
+
**Example 1:**
|
|
62
|
+
Input: Added user authentication with JWT tokens
|
|
63
|
+
Output:
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
feat(auth): implement JWT-based authentication
|
|
67
|
+
|
|
68
|
+
Add login endpoint and token validation middleware
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Example 2:**
|
|
73
|
+
Input: Fixed bug where dates displayed incorrectly in reports
|
|
74
|
+
Output:
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
fix(reports): correct date formatting in timezone conversion
|
|
78
|
+
|
|
79
|
+
Use UTC timestamps consistently across report generation
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Follow this style: type(scope): brief description, then detailed explanation.
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Examples help Claude understand the desired style and level of detail more clearly than descriptions alone.
|