@amsterdamdatalabs/enact-extensions 0.1.0 → 0.1.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.
- package/README.md +94 -20
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts +89 -0
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +219 -18
- package/dist/install.js.map +1 -1
- package/dist/validate/index.d.ts +21 -0
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +77 -0
- package/dist/validate/index.js.map +1 -1
- package/extensions/cmux/.agents/plugin.json +37 -0
- package/extensions/cmux/skills/cmux/SKILL.md +82 -0
- package/extensions/cmux/skills/cmux/agents/openai.yaml +4 -0
- package/extensions/cmux/skills/cmux/references/handles-and-identify.md +35 -0
- package/extensions/cmux/skills/cmux/references/panes-surfaces.md +37 -0
- package/extensions/cmux/skills/cmux/references/trigger-flash-and-health.md +23 -0
- package/extensions/cmux/skills/cmux/references/windows-workspaces.md +31 -0
- package/extensions/cmux/skills/cmux-vm-monitor/SKILL.md +122 -0
- package/extensions/cmux/skills/cmux-vm-monitor/agents/openai.yaml +4 -0
- package/extensions/cmux/skills/cmux-vm-monitor/references/cmux-commands.md +66 -0
- package/extensions/cmux/skills/cmux-vm-monitor/scripts/codex_vm_monitor.sh +45 -0
- package/extensions/cmux/skills/cmux-workspace/SKILL.md +93 -0
- package/extensions/dev-state/.agents/plugin.json +35 -0
- package/extensions/dev-state/skills/dev-state-plan-graduation/SKILL.md +194 -0
- package/extensions/dev-state/skills/dev-state-plan-graduation/agents/openai.yaml +4 -0
- package/extensions/dev-state/skills/dev-state-plan-graduation/references/reference.md +130 -0
- package/extensions/devops/.agents/plugin.json +36 -0
- package/extensions/devops/skills/azure-devops-cli/SKILL.md +431 -0
- package/extensions/devops/skills/azure-devops-cli/agents/openai.yaml +4 -0
- package/extensions/devops/skills/ci-pipeline-strategy/SKILL.md +217 -0
- package/extensions/devops/skills/ci-pipeline-strategy/agents/openai.yaml +4 -0
- package/{plugins/net-revenue-management/.codex-plugin → extensions/net-revenue-management/.agents}/plugin.json +10 -6
- package/extensions/plugin-dev/.agents/plugin.json +42 -0
- package/extensions/plugin-dev/.mcp.json +3 -0
- package/extensions/plugin-dev/agents/agent-creator.md +199 -0
- package/extensions/plugin-dev/agents/plugin-validator.md +91 -0
- package/extensions/plugin-dev/agents/skill-reviewer.md +212 -0
- package/extensions/plugin-dev/commands/_archive/create-marketplace.md +427 -0
- package/extensions/plugin-dev/commands/_archive/plugin-dev-guide.md +12 -0
- package/extensions/plugin-dev/commands/create-plugin.md +498 -0
- package/extensions/plugin-dev/commands/start.md +81 -0
- package/extensions/plugin-dev/hooks/hooks.json +3 -0
- package/extensions/plugin-dev/skills/agent-development/SKILL.md +641 -0
- package/extensions/plugin-dev/skills/agent-development/examples/agent-creation-prompt.md +250 -0
- package/extensions/plugin-dev/skills/agent-development/examples/complete-agent-examples.md +461 -0
- package/extensions/plugin-dev/skills/agent-development/references/advanced-agent-fields.md +246 -0
- package/extensions/plugin-dev/skills/agent-development/references/agent-creation-system-prompt.md +216 -0
- package/extensions/plugin-dev/skills/agent-development/references/permission-modes-rules.md +226 -0
- package/extensions/plugin-dev/skills/agent-development/references/system-prompt-design.md +464 -0
- package/extensions/plugin-dev/skills/agent-development/references/triggering-examples.md +474 -0
- package/extensions/plugin-dev/skills/agent-development/scripts/create-agent-skeleton.sh +176 -0
- package/extensions/plugin-dev/skills/agent-development/scripts/test-agent-trigger.sh +227 -0
- package/extensions/plugin-dev/skills/agent-development/scripts/validate-agent.sh +227 -0
- package/extensions/plugin-dev/skills/command-development/SKILL.md +763 -0
- package/extensions/plugin-dev/skills/command-development/examples/plugin-commands.md +612 -0
- package/extensions/plugin-dev/skills/command-development/examples/simple-commands.md +527 -0
- package/extensions/plugin-dev/skills/command-development/references/advanced-workflows.md +762 -0
- package/extensions/plugin-dev/skills/command-development/references/documentation-patterns.md +769 -0
- package/extensions/plugin-dev/skills/command-development/references/frontmatter-reference.md +508 -0
- package/extensions/plugin-dev/skills/command-development/references/interactive-commands.md +966 -0
- package/extensions/plugin-dev/skills/command-development/references/marketplace-considerations.md +943 -0
- package/extensions/plugin-dev/skills/command-development/references/plugin-features-reference.md +637 -0
- package/extensions/plugin-dev/skills/command-development/references/plugin-integration.md +191 -0
- package/extensions/plugin-dev/skills/command-development/references/skill-tool.md +447 -0
- package/extensions/plugin-dev/skills/command-development/references/testing-strategies.md +723 -0
- package/extensions/plugin-dev/skills/command-development/scripts/check-frontmatter.sh +234 -0
- package/extensions/plugin-dev/skills/command-development/scripts/validate-command.sh +160 -0
- package/extensions/plugin-dev/skills/hook-development/SKILL.md +861 -0
- package/extensions/plugin-dev/skills/hook-development/examples/load-context.sh +55 -0
- package/extensions/plugin-dev/skills/hook-development/examples/validate-bash.sh +57 -0
- package/extensions/plugin-dev/skills/hook-development/examples/validate-write.sh +48 -0
- package/extensions/plugin-dev/skills/hook-development/references/advanced.md +871 -0
- package/extensions/plugin-dev/skills/hook-development/references/hook-input-schemas.md +145 -0
- package/extensions/plugin-dev/skills/hook-development/references/migration.md +392 -0
- package/extensions/plugin-dev/skills/hook-development/references/patterns.md +430 -0
- package/extensions/plugin-dev/skills/hook-development/scripts/README.md +181 -0
- package/extensions/plugin-dev/skills/hook-development/scripts/hook-linter.sh +153 -0
- package/extensions/plugin-dev/skills/hook-development/scripts/test-hook.sh +276 -0
- package/extensions/plugin-dev/skills/hook-development/scripts/validate-hook-schema.sh +159 -0
- package/extensions/plugin-dev/skills/mcp-integration/SKILL.md +775 -0
- package/extensions/plugin-dev/skills/mcp-integration/examples/http-server.json +20 -0
- package/extensions/plugin-dev/skills/mcp-integration/examples/sse-server.json +19 -0
- package/extensions/plugin-dev/skills/mcp-integration/examples/stdio-server.json +38 -0
- package/extensions/plugin-dev/skills/mcp-integration/examples/ws-server.json +26 -0
- package/extensions/plugin-dev/skills/mcp-integration/references/authentication.md +601 -0
- package/extensions/plugin-dev/skills/mcp-integration/references/server-discovery.md +190 -0
- package/extensions/plugin-dev/skills/mcp-integration/references/server-types.md +572 -0
- package/extensions/plugin-dev/skills/mcp-integration/references/tool-usage.md +623 -0
- package/extensions/plugin-dev/skills/plugin-dev-guide/SKILL.md +222 -0
- package/extensions/plugin-dev/skills/plugin-structure/SKILL.md +705 -0
- package/extensions/plugin-dev/skills/plugin-structure/examples/advanced-plugin.md +774 -0
- package/extensions/plugin-dev/skills/plugin-structure/examples/minimal-plugin.md +83 -0
- package/extensions/plugin-dev/skills/plugin-structure/examples/standard-plugin.md +611 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/advanced-topics.md +289 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/component-patterns.md +592 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/github-actions.md +233 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/headless-ci-mode.md +193 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/manifest-reference.md +625 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/output-styles.md +116 -0
- package/extensions/plugin-dev/skills/skill-development/SKILL.md +564 -0
- package/extensions/plugin-dev/skills/skill-development/examples/complete-skill.md +465 -0
- package/extensions/plugin-dev/skills/skill-development/examples/frontmatter-templates.md +167 -0
- package/extensions/plugin-dev/skills/skill-development/examples/minimal-skill.md +111 -0
- package/extensions/plugin-dev/skills/skill-development/references/advanced-frontmatter.md +225 -0
- package/extensions/plugin-dev/skills/skill-development/references/commands-vs-skills.md +39 -0
- package/extensions/plugin-dev/skills/skill-development/references/skill-creation-workflow.md +379 -0
- package/extensions/plugin-dev/skills/skill-development/references/skill-creator-original.md +210 -0
- package/package.json +8 -11
- package/scripts/enact-extensions.mjs +751 -16
- package/scripts/hooks/session-start-drift-check.mjs +58 -0
- package/scripts/lib/build-index.mjs +50 -0
- package/scripts/lib/bundle-hash.mjs +137 -0
- package/scripts/lib/hooks.mjs +389 -0
- package/scripts/lib/ledger.mjs +162 -0
- package/scripts/lib/list-bundles.mjs +70 -0
- package/scripts/lib/outdated.mjs +144 -0
- package/scripts/lib/provision-mcp.mjs +369 -0
- package/scripts/lib/resolve-bundle.mjs +121 -0
- package/scripts/lib/run-install.mjs +321 -39
- package/scripts/lib/run-uninstall.mjs +220 -0
- package/scripts/lib/run-update.mjs +152 -0
- package/scripts/lib/run-validate.mjs +12 -18
- package/scripts/lib/serve.mjs +454 -0
- package/scripts/postinstall.mjs +63 -0
- package/scripts/setup-enact-context.sh +2 -2
- package/spec/index.json +59 -0
- package/web/assets/README.md +111 -0
- package/web/assets/logo-full.png +0 -0
- package/web/assets/logo-slim.png +0 -0
- package/web/assets/tokens/base.css +45 -0
- package/web/assets/tokens/colors.css +248 -0
- package/web/assets/tokens/effects.css +24 -0
- package/web/assets/tokens/fonts.css +8 -0
- package/web/assets/tokens/index.css +18 -0
- package/web/assets/tokens/spacing.css +50 -0
- package/web/index.html +1188 -0
- package/.agents/plugins/marketplace.json +0 -20
- package/catalog/enact-context.json +0 -9
- package/catalog/enact-factory.json +0 -7
- package/catalog/enact-operator.json +0 -7
- package/catalog/enact-wiki.json +0 -7
- package/catalog/net-revenue-management.json +0 -8
- package/scripts/rename-supervisor-to-operator.pl +0 -66
- package/scripts/sync-manifests.mjs +0 -23
- package/scripts/validate-catalog.mjs +0 -37
- package/scripts/validate-plugin.mjs +0 -10
- /package/{plugins → extensions}/net-revenue-management/.mcp.json +0 -0
- /package/{plugins → extensions}/net-revenue-management/skills/net-revenue-risks/SKILL.md +0 -0
- /package/{plugins → extensions}/net-revenue-management/skills/net-revenue-scenario/SKILL.md +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Minimal Skill Example
|
|
2
|
+
|
|
3
|
+
A bare-bones skill with just a SKILL.md file.
|
|
4
|
+
|
|
5
|
+
## Directory Structure
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
git-conventions/
|
|
9
|
+
└── SKILL.md
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## File Contents
|
|
13
|
+
|
|
14
|
+
### SKILL.md
|
|
15
|
+
|
|
16
|
+
````markdown
|
|
17
|
+
---
|
|
18
|
+
name: git-conventions
|
|
19
|
+
description: This skill should be used when the user asks about "git commit message format", "conventional commits", "commit conventions", "branch naming", or needs guidance on git workflow standards.
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Git Conventions
|
|
23
|
+
|
|
24
|
+
This skill provides guidance on git commit messages and branch naming conventions.
|
|
25
|
+
|
|
26
|
+
## Commit Message Format
|
|
27
|
+
|
|
28
|
+
Follow the Conventional Commits specification:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
<type>(<scope>): <description>
|
|
32
|
+
|
|
33
|
+
[optional body]
|
|
34
|
+
|
|
35
|
+
[optional footer(s)]
|
|
36
|
+
```
|
|
37
|
+
````
|
|
38
|
+
|
|
39
|
+
### Types
|
|
40
|
+
|
|
41
|
+
- **feat**: New feature
|
|
42
|
+
- **fix**: Bug fix
|
|
43
|
+
- **docs**: Documentation changes
|
|
44
|
+
- **style**: Code style changes (formatting, semicolons)
|
|
45
|
+
- **refactor**: Code refactoring without behavior change
|
|
46
|
+
- **test**: Adding or updating tests
|
|
47
|
+
- **chore**: Maintenance tasks
|
|
48
|
+
|
|
49
|
+
### Examples
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
feat(auth): add OAuth2 login support
|
|
53
|
+
|
|
54
|
+
fix(api): handle null response from external service
|
|
55
|
+
|
|
56
|
+
docs(readme): update installation instructions
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Branch Naming
|
|
60
|
+
|
|
61
|
+
Use descriptive prefixes:
|
|
62
|
+
|
|
63
|
+
- `feature/` - New features
|
|
64
|
+
- `fix/` - Bug fixes
|
|
65
|
+
- `docs/` - Documentation updates
|
|
66
|
+
- `chore/` - Maintenance tasks
|
|
67
|
+
|
|
68
|
+
### Examples
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
feature/user-authentication
|
|
72
|
+
fix/null-pointer-exception
|
|
73
|
+
docs/api-reference
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
````
|
|
77
|
+
|
|
78
|
+
## Usage
|
|
79
|
+
|
|
80
|
+
After installing the plugin containing this skill:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
$ claude
|
|
84
|
+
> What format should I use for commit messages?
|
|
85
|
+
|
|
86
|
+
[Skill loads and provides Conventional Commits guidance]
|
|
87
|
+
````
|
|
88
|
+
|
|
89
|
+
## Key Points
|
|
90
|
+
|
|
91
|
+
1. **Single file**: Only SKILL.md required
|
|
92
|
+
2. **Strong triggers**: Description includes specific phrases users would say
|
|
93
|
+
3. **Third-person description**: "This skill should be used when..."
|
|
94
|
+
4. **Imperative body**: Instructions use "Follow...", "Use...", not "You should..."
|
|
95
|
+
5. **Focused content**: ~300 words, no external resources needed
|
|
96
|
+
|
|
97
|
+
## When to Use This Pattern
|
|
98
|
+
|
|
99
|
+
- Simple domain knowledge
|
|
100
|
+
- Quick reference guides
|
|
101
|
+
- Team conventions and standards
|
|
102
|
+
- Single-topic utilities
|
|
103
|
+
- Learning skill development
|
|
104
|
+
|
|
105
|
+
## Extending This Skill
|
|
106
|
+
|
|
107
|
+
To add more functionality:
|
|
108
|
+
|
|
109
|
+
1. **Add references**: Create `references/` for detailed documentation
|
|
110
|
+
2. **Add examples**: Create `examples/` for working code samples
|
|
111
|
+
3. **Add scripts**: Create `scripts/` for automation utilities
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# Advanced Skill Frontmatter Fields
|
|
2
|
+
|
|
3
|
+
This reference covers frontmatter fields that go beyond the core `name` and `description` requirements. These fields enable model selection, scoped hooks, and context budget optimization.
|
|
4
|
+
|
|
5
|
+
## model
|
|
6
|
+
|
|
7
|
+
Override the model used when a skill is active.
|
|
8
|
+
|
|
9
|
+
### Values
|
|
10
|
+
|
|
11
|
+
| Value | Behavior |
|
|
12
|
+
| ------------- | ----------------------------------------------------- |
|
|
13
|
+
| `inherit` | Use the conversation's current model (default) |
|
|
14
|
+
| `sonnet` | Claude Sonnet — balanced performance and cost |
|
|
15
|
+
| `opus` | Claude Opus — maximum capability, highest cost |
|
|
16
|
+
| `haiku` | Claude Haiku — fastest, lowest cost |
|
|
17
|
+
| Full model ID | Specific version (e.g., `claude-sonnet-4-5-20250929`) |
|
|
18
|
+
|
|
19
|
+
### When to Use Each
|
|
20
|
+
|
|
21
|
+
- **`inherit` (default):** Most skills. Lets the user's model choice apply.
|
|
22
|
+
- **`haiku`:** Fast, cost-sensitive operations — linting, formatting checks, simple lookups. Good for skills that run frequently.
|
|
23
|
+
- **`sonnet`:** Standard workflows — code review, generation, analysis. The balanced default.
|
|
24
|
+
- **`opus`:** Complex reasoning — architectural decisions, security audits, detailed analysis requiring maximum capability.
|
|
25
|
+
- **Full model ID:** Pin to a specific version when skill behavior depends on exact model capabilities.
|
|
26
|
+
|
|
27
|
+
### Example
|
|
28
|
+
|
|
29
|
+
```yaml
|
|
30
|
+
---
|
|
31
|
+
name: quick-lint
|
|
32
|
+
description: This skill should be used for fast code quality checks...
|
|
33
|
+
model: haiku
|
|
34
|
+
---
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Notes
|
|
38
|
+
|
|
39
|
+
- Shorthand names (`sonnet`, `opus`, `haiku`) resolve to the current default version of each family
|
|
40
|
+
- The `model` field is shared with commands (same syntax and behavior)
|
|
41
|
+
- When `context: fork` is set, the model applies to the forked subagent
|
|
42
|
+
|
|
43
|
+
## hooks (Scoped Hooks)
|
|
44
|
+
|
|
45
|
+
Define hooks that activate only when the skill is in use, rather than globally for all tool calls.
|
|
46
|
+
|
|
47
|
+
### Concept
|
|
48
|
+
|
|
49
|
+
Unlike `hooks.json` (which applies globally whenever the plugin is active), scoped hooks in frontmatter are lifecycle-bound to the skill. They activate when the skill loads and deactivate when it completes. This enables skill-specific validation without affecting other workflows.
|
|
50
|
+
|
|
51
|
+
### Format
|
|
52
|
+
|
|
53
|
+
The `hooks` field uses the same event/matcher/hook structure as `hooks.json`:
|
|
54
|
+
|
|
55
|
+
```yaml
|
|
56
|
+
---
|
|
57
|
+
name: validated-writer
|
|
58
|
+
description: Write files with safety validation...
|
|
59
|
+
hooks:
|
|
60
|
+
PreToolUse:
|
|
61
|
+
- matcher: Write
|
|
62
|
+
hooks:
|
|
63
|
+
- type: command
|
|
64
|
+
command: "${CLAUDE_PLUGIN_ROOT}/scripts/validate-write.sh"
|
|
65
|
+
timeout: 10
|
|
66
|
+
PostToolUse:
|
|
67
|
+
- matcher: Write
|
|
68
|
+
hooks:
|
|
69
|
+
- type: command
|
|
70
|
+
command: "${CLAUDE_PLUGIN_ROOT}/scripts/post-write-check.sh"
|
|
71
|
+
---
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Supported Events
|
|
75
|
+
|
|
76
|
+
Scoped hooks support a subset of hook events:
|
|
77
|
+
|
|
78
|
+
| Event | Purpose |
|
|
79
|
+
| ------------- | ------------------------------------------------ |
|
|
80
|
+
| `PreToolUse` | Validate or block tool calls before execution |
|
|
81
|
+
| `PostToolUse` | Run checks after successful tool execution |
|
|
82
|
+
| `Stop` | Verify completion criteria before skill finishes |
|
|
83
|
+
|
|
84
|
+
Other events (`SessionStart`, `UserPromptSubmit`, etc.) are session-level and don't apply to skill scope.
|
|
85
|
+
|
|
86
|
+
### Comparison with hooks.json
|
|
87
|
+
|
|
88
|
+
| Aspect | `hooks.json` | Frontmatter `hooks` |
|
|
89
|
+
| -------- | ------------------------------------------ | --------------------------------------------- |
|
|
90
|
+
| Scope | Global (always active when plugin enabled) | Skill-specific (active only during skill use) |
|
|
91
|
+
| Events | All 11+ hook events | PreToolUse, PostToolUse, Stop |
|
|
92
|
+
| Location | `hooks/hooks.json` file | YAML frontmatter in SKILL.md |
|
|
93
|
+
| Use case | Plugin-wide validation, logging | Skill-specific safety checks |
|
|
94
|
+
|
|
95
|
+
### Use Cases
|
|
96
|
+
|
|
97
|
+
- **Skill-specific validation:** A "database writer" skill that validates SQL before execution
|
|
98
|
+
- **Restricted workflows:** A "deploy" skill that checks branch and test status before allowing Bash commands
|
|
99
|
+
- **Quality gates:** A "code generator" skill that runs linting after every Write operation
|
|
100
|
+
|
|
101
|
+
### Hook Types in Frontmatter
|
|
102
|
+
|
|
103
|
+
Both `command` and `prompt` hook types work in frontmatter:
|
|
104
|
+
|
|
105
|
+
**Command hook** (executes a script):
|
|
106
|
+
|
|
107
|
+
```yaml
|
|
108
|
+
hooks:
|
|
109
|
+
PreToolUse:
|
|
110
|
+
- matcher: Bash
|
|
111
|
+
hooks:
|
|
112
|
+
- type: command
|
|
113
|
+
command: "${CLAUDE_PLUGIN_ROOT}/scripts/check-safety.sh"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Prompt hook** (LLM evaluation — for Stop events):
|
|
117
|
+
|
|
118
|
+
```yaml
|
|
119
|
+
hooks:
|
|
120
|
+
Stop:
|
|
121
|
+
- hooks:
|
|
122
|
+
- type: prompt
|
|
123
|
+
prompt: 'Verify that all generated code has tests. Return {"decision": "stop"} if satisfied or {"decision": "continue", "reason": "missing tests for..."} if not.'
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Skill Visibility Budget
|
|
127
|
+
|
|
128
|
+
Claude Code allocates a character budget for skill descriptions to manage context window usage efficiently.
|
|
129
|
+
|
|
130
|
+
### How It Works
|
|
131
|
+
|
|
132
|
+
1. All installed skills contribute their `description` text to a shared budget
|
|
133
|
+
2. Default budget: approximately 2% of the context window or ~16KB fallback (controlled by `SLASH_COMMAND_TOOL_CHAR_BUDGET`)
|
|
134
|
+
3. When total descriptions exceed the budget, lower-priority skills may be excluded from auto-discovery
|
|
135
|
+
4. Excluded skills are still available via explicit `/skill-name` invocation — they just won't auto-trigger
|
|
136
|
+
|
|
137
|
+
### What Counts Against the Budget
|
|
138
|
+
|
|
139
|
+
- The `description` frontmatter field text
|
|
140
|
+
- Skill name and metadata overhead
|
|
141
|
+
- This applies across ALL installed plugins, not just yours
|
|
142
|
+
|
|
143
|
+
### Optimization Strategies
|
|
144
|
+
|
|
145
|
+
1. **Keep descriptions concise:** Target 100-300 characters for the description field
|
|
146
|
+
2. **Use trigger phrases, not explanations:** "create a hook", "add PreToolUse" is better than "This skill provides comprehensive guidance for creating event-driven automation..."
|
|
147
|
+
3. **Move detail to SKILL.md body:** The body only loads when the skill triggers, not at discovery time
|
|
148
|
+
4. **Progressive disclosure:** Description (always loaded) → SKILL.md body (on trigger) → references (on demand)
|
|
149
|
+
|
|
150
|
+
### Checking Budget Usage
|
|
151
|
+
|
|
152
|
+
- `/context` command shows context usage including excluded skills if over budget
|
|
153
|
+
- Environment variable: `SLASH_COMMAND_TOOL_CHAR_BUDGET=20000` to increase budget
|
|
154
|
+
- Monitor with: `claude --debug` shows skill loading details
|
|
155
|
+
|
|
156
|
+
### Practical Impact
|
|
157
|
+
|
|
158
|
+
For most plugins with 5-15 skills, the default budget is sufficient. Budget becomes a concern when:
|
|
159
|
+
|
|
160
|
+
- Multiple plugins are installed simultaneously (each adding descriptions)
|
|
161
|
+
- Individual skill descriptions exceed 500 characters
|
|
162
|
+
- A plugin has 20+ skills with verbose descriptions
|
|
163
|
+
|
|
164
|
+
## Skill Permission Syntax
|
|
165
|
+
|
|
166
|
+
Skills can be referenced in settings.json allow rules using the `Skill()` syntax:
|
|
167
|
+
|
|
168
|
+
### Exact Match
|
|
169
|
+
|
|
170
|
+
Allow a specific skill to be invoked:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"permissions": {
|
|
175
|
+
"allow": ["Skill(my-skill-name)"]
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Prefix Match with Arguments
|
|
181
|
+
|
|
182
|
+
Allow a skill with any arguments:
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"permissions": {
|
|
187
|
+
"allow": ["Skill(my-skill-name *)"]
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
This enables fine-grained control over which skills can be auto-invoked by Claude vs requiring explicit user invocation. Combine with `disable-model-invocation` frontmatter for maximum control.
|
|
193
|
+
|
|
194
|
+
## Visual Output Generators
|
|
195
|
+
|
|
196
|
+
Skills can bundle scripts that generate visual output (HTML files, charts, interactive visualizations) for rich user experiences.
|
|
197
|
+
|
|
198
|
+
### Pattern
|
|
199
|
+
|
|
200
|
+
1. Bundle a script (Python, Node.js, etc.) in the skill's `scripts/` directory
|
|
201
|
+
2. The script generates an HTML file or other visual output
|
|
202
|
+
3. Claude orchestrates: reads data, runs the script, presents the result
|
|
203
|
+
|
|
204
|
+
### Example Structure
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
visualization-skill/
|
|
208
|
+
├── SKILL.md
|
|
209
|
+
├── scripts/
|
|
210
|
+
│ └── generate-chart.py # Produces HTML output
|
|
211
|
+
└── references/
|
|
212
|
+
└── chart-options.md # Configuration reference
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### SKILL.md Usage
|
|
216
|
+
|
|
217
|
+
```markdown
|
|
218
|
+
To generate the visualization:
|
|
219
|
+
|
|
220
|
+
1. Gather the data from the user's project
|
|
221
|
+
2. Run the script: `python ${CLAUDE_PLUGIN_ROOT}/skills/visualization-skill/scripts/generate-chart.py`
|
|
222
|
+
3. The script outputs an HTML file — inform the user of its location
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Visual output generators combine the power of deterministic scripts with Claude's ability to gather context and present results. The script handles rendering while Claude handles data gathering and user interaction.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Commands vs Skills: When to Use Each
|
|
2
|
+
|
|
3
|
+
## Same Mechanism, Different Complexity
|
|
4
|
+
|
|
5
|
+
Both commands and skills:
|
|
6
|
+
|
|
7
|
+
- Are invoked via the Skill tool
|
|
8
|
+
- Support $ARGUMENTS and `[BANG]` bash execution
|
|
9
|
+
- Support frontmatter (description, allowed-tools, model)
|
|
10
|
+
- Can control invocability (disable-model-invocation)
|
|
11
|
+
|
|
12
|
+
## Decision Matrix
|
|
13
|
+
|
|
14
|
+
| Need | Use | Location |
|
|
15
|
+
| ----------------------- | ------- | ---------------------- |
|
|
16
|
+
| Simple reusable prompt | Command | commands/foo.md |
|
|
17
|
+
| Dynamic arguments only | Command | commands/foo.md |
|
|
18
|
+
| Scripts for validation | Skill | skills/foo/ |
|
|
19
|
+
| Reference documentation | Skill | skills/foo/references/ |
|
|
20
|
+
| Working examples | Skill | skills/foo/examples/ |
|
|
21
|
+
| Progressive disclosure | Skill | skills/foo/ |
|
|
22
|
+
|
|
23
|
+
## Invocation Control
|
|
24
|
+
|
|
25
|
+
| Setting | User (/) | Claude (Skill tool) |
|
|
26
|
+
| ----------------------------------- | -------- | ------------------- |
|
|
27
|
+
| Default | Yes | Yes |
|
|
28
|
+
| disable-model-invocation: true | Yes | No |
|
|
29
|
+
| user-invocable: false (skills only) | No | Yes |
|
|
30
|
+
|
|
31
|
+
## Migration: Command to Skill
|
|
32
|
+
|
|
33
|
+
When a command grows complex:
|
|
34
|
+
|
|
35
|
+
1. Create `skills/name/SKILL.md`
|
|
36
|
+
2. Move command content to SKILL.md body (frontmatter fields like `description`, `allowed-tools`, `model` work identically)
|
|
37
|
+
3. Add `references/` for detailed docs
|
|
38
|
+
4. Add `scripts/` for utilities
|
|
39
|
+
5. Delete original command file
|