@rune-kit/rune 2.10.0 → 2.12.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/LICENSE +21 -21
- package/README.md +65 -6
- package/commands/rune.md +168 -168
- package/compiler/__tests__/detect-invariants.test.js +136 -0
- package/compiler/__tests__/doctor-mesh.test.js +229 -0
- package/compiler/__tests__/hook-dispatch.test.js +91 -0
- package/compiler/__tests__/hooks-antigravity.test.js +118 -0
- package/compiler/__tests__/hooks-cursor.test.js +139 -0
- package/compiler/__tests__/hooks-install.test.js +305 -0
- package/compiler/__tests__/hooks-merge.test.js +204 -0
- package/compiler/__tests__/hooks-tiers.test.js +519 -0
- package/compiler/__tests__/hooks-windsurf.test.js +115 -0
- package/compiler/__tests__/inject-claude-md.test.js +152 -0
- package/compiler/__tests__/load-invariants.test.js +408 -0
- package/compiler/__tests__/onboard-invariants.test.js +240 -0
- package/compiler/adapters/hooks/antigravity.js +140 -0
- package/compiler/adapters/hooks/claude.js +166 -0
- package/compiler/adapters/hooks/cursor.js +191 -0
- package/compiler/adapters/hooks/index.js +82 -0
- package/compiler/adapters/hooks/tier-emitter.js +182 -0
- package/compiler/adapters/hooks/windsurf.js +202 -0
- package/compiler/bin/rune.js +196 -6
- package/compiler/commands/hook-dispatch.js +87 -0
- package/compiler/commands/hooks/install.js +120 -0
- package/compiler/commands/hooks/merge.js +211 -0
- package/compiler/commands/hooks/presets.js +116 -0
- package/compiler/commands/hooks/status.js +112 -0
- package/compiler/commands/hooks/tiers.js +221 -0
- package/compiler/commands/hooks/uninstall.js +94 -0
- package/compiler/doctor.js +236 -0
- package/contexts/dev.md +34 -34
- package/contexts/research.md +43 -43
- package/contexts/review.md +55 -55
- package/extensions/ai-ml/PACK.md +88 -88
- package/extensions/ai-ml/skills/ai-agents.md +172 -172
- package/extensions/ai-ml/skills/code-sandbox.md +187 -187
- package/extensions/ai-ml/skills/deep-research.md +146 -146
- package/extensions/ai-ml/skills/embedding-search.md +66 -66
- package/extensions/ai-ml/skills/fine-tuning-guide.md +74 -74
- package/extensions/ai-ml/skills/llm-architect.md +125 -125
- package/extensions/ai-ml/skills/llm-integration.md +64 -64
- package/extensions/ai-ml/skills/prompt-patterns.md +72 -72
- package/extensions/ai-ml/skills/rag-patterns.md +66 -66
- package/extensions/ai-ml/skills/web-extraction.md +114 -114
- package/extensions/analytics/PACK.md +92 -92
- package/extensions/analytics/skills/ab-testing.md +72 -72
- package/extensions/analytics/skills/dashboard-patterns.md +83 -83
- package/extensions/analytics/skills/data-validation.md +68 -68
- package/extensions/analytics/skills/funnel-analysis.md +81 -81
- package/extensions/analytics/skills/sql-patterns.md +57 -57
- package/extensions/analytics/skills/statistical-analysis.md +79 -79
- package/extensions/analytics/skills/tracking-setup.md +71 -71
- package/extensions/backend/PACK.md +104 -104
- package/extensions/backend/skills/api-patterns.md +84 -84
- package/extensions/backend/skills/async-pipeline.md +193 -193
- package/extensions/backend/skills/auth-patterns.md +97 -97
- package/extensions/backend/skills/background-jobs.md +133 -133
- package/extensions/backend/skills/caching-patterns.md +108 -108
- package/extensions/backend/skills/cli-generation.md +133 -133
- package/extensions/backend/skills/database-patterns.md +87 -87
- package/extensions/backend/skills/middleware-patterns.md +104 -104
- package/extensions/chrome-ext/PACK.md +93 -93
- package/extensions/chrome-ext/skills/cws-preflight.md +143 -143
- package/extensions/chrome-ext/skills/cws-publish.md +104 -104
- package/extensions/chrome-ext/skills/ext-ai-integration.md +251 -251
- package/extensions/chrome-ext/skills/ext-messaging.md +139 -139
- package/extensions/chrome-ext/skills/ext-storage.md +133 -133
- package/extensions/chrome-ext/skills/mv3-scaffold.md +164 -164
- package/extensions/content/PACK.md +96 -96
- package/extensions/content/skills/blog-patterns.md +88 -88
- package/extensions/content/skills/cms-integration.md +131 -131
- package/extensions/content/skills/content-scoring.md +107 -107
- package/extensions/content/skills/i18n.md +83 -83
- package/extensions/content/skills/mdx-authoring.md +137 -137
- package/extensions/content/skills/reference.md +1014 -1014
- package/extensions/content/skills/seo-patterns.md +67 -67
- package/extensions/content/skills/video-repurpose.md +153 -153
- package/extensions/devops/PACK.md +101 -101
- package/extensions/devops/skills/chaos-testing.md +67 -67
- package/extensions/devops/skills/ci-cd.md +75 -75
- package/extensions/devops/skills/docker.md +58 -58
- package/extensions/devops/skills/edge-serverless.md +163 -163
- package/extensions/devops/skills/infra-as-code.md +158 -158
- package/extensions/devops/skills/kubernetes.md +110 -110
- package/extensions/devops/skills/monitoring.md +57 -57
- package/extensions/devops/skills/server-setup.md +64 -64
- package/extensions/devops/skills/ssl-domain.md +42 -42
- package/extensions/ecommerce/PACK.md +116 -116
- package/extensions/ecommerce/skills/cart-system.md +79 -79
- package/extensions/ecommerce/skills/inventory-mgmt.md +102 -102
- package/extensions/ecommerce/skills/order-management.md +126 -126
- package/extensions/ecommerce/skills/payment-integration.md +472 -472
- package/extensions/ecommerce/skills/shopify-dev.md +69 -69
- package/extensions/ecommerce/skills/subscription-billing.md +93 -93
- package/extensions/ecommerce/skills/tax-compliance.md +117 -117
- package/extensions/gamedev/PACK.md +142 -142
- package/extensions/gamedev/skills/asset-pipeline.md +74 -74
- package/extensions/gamedev/skills/audio-system.md +129 -129
- package/extensions/gamedev/skills/camera-system.md +87 -87
- package/extensions/gamedev/skills/ecs.md +98 -98
- package/extensions/gamedev/skills/game-loops.md +72 -72
- package/extensions/gamedev/skills/input-system.md +199 -199
- package/extensions/gamedev/skills/multiplayer.md +180 -180
- package/extensions/gamedev/skills/particles.md +105 -105
- package/extensions/gamedev/skills/physics-engine.md +89 -89
- package/extensions/gamedev/skills/scene-management.md +146 -146
- package/extensions/gamedev/skills/threejs-patterns.md +90 -90
- package/extensions/gamedev/skills/webgl.md +71 -71
- package/extensions/mobile/PACK.md +106 -106
- package/extensions/mobile/skills/app-store-connect.md +152 -152
- package/extensions/mobile/skills/app-store-prep.md +66 -66
- package/extensions/mobile/skills/deep-linking.md +109 -109
- package/extensions/mobile/skills/flutter.md +60 -60
- package/extensions/mobile/skills/ios-build-pipeline.md +142 -142
- package/extensions/mobile/skills/native-bridge.md +66 -66
- package/extensions/mobile/skills/ota-updates.md +97 -97
- package/extensions/mobile/skills/push-notifications.md +111 -111
- package/extensions/mobile/skills/react-native.md +82 -82
- package/extensions/saas/PACK.md +116 -116
- package/extensions/saas/skills/billing-integration.md +200 -200
- package/extensions/saas/skills/feature-flags.md +130 -130
- package/extensions/saas/skills/multi-tenant.md +103 -103
- package/extensions/saas/skills/onboarding-flow.md +139 -139
- package/extensions/saas/skills/subscription-flow.md +95 -95
- package/extensions/saas/skills/team-management.md +144 -144
- package/extensions/security/PACK.md +99 -99
- package/extensions/security/skills/api-security.md +140 -140
- package/extensions/security/skills/compliance.md +68 -68
- package/extensions/security/skills/owasp-audit.md +64 -64
- package/extensions/security/skills/pentest-patterns.md +77 -77
- package/extensions/security/skills/secret-mgmt.md +65 -65
- package/extensions/security/skills/supply-chain.md +65 -65
- package/extensions/trading/PACK.md +80 -80
- package/extensions/trading/skills/chart-components.md +55 -55
- package/extensions/trading/skills/experiment-loop.md +125 -125
- package/extensions/trading/skills/fintech-patterns.md +47 -47
- package/extensions/trading/skills/indicator-library.md +58 -58
- package/extensions/trading/skills/quant-analysis.md +111 -111
- package/extensions/trading/skills/realtime-data.md +58 -58
- package/extensions/trading/skills/trade-logic.md +104 -104
- package/extensions/ui/PACK.md +130 -130
- package/extensions/ui/skills/a11y-audit.md +91 -91
- package/extensions/ui/skills/animation-patterns.md +127 -127
- package/extensions/ui/skills/component-patterns.md +100 -100
- package/extensions/ui/skills/design-decision.md +108 -108
- package/extensions/ui/skills/design-system.md +68 -68
- package/extensions/ui/skills/landing-patterns.md +155 -155
- package/extensions/ui/skills/palette-picker.md +173 -173
- package/extensions/ui/skills/react-health.md +90 -90
- package/extensions/ui/skills/type-system.md +125 -125
- package/extensions/ui/skills/web-vitals.md +153 -153
- package/extensions/zalo/PACK.md +145 -145
- package/extensions/zalo/skills/zalo-oa-mcp.md +317 -317
- package/extensions/zalo/skills/zalo-oa-messaging.md +429 -429
- package/extensions/zalo/skills/zalo-oa-setup.md +236 -236
- package/extensions/zalo/skills/zalo-oa-webhook.md +189 -189
- package/extensions/zalo/skills/zalo-personal-messaging.md +194 -194
- package/extensions/zalo/skills/zalo-personal-setup.md +153 -153
- package/extensions/zalo/skills/zalo-rate-guard.md +219 -219
- package/hooks/auto-format/index.cjs +48 -48
- package/hooks/hooks.json +111 -111
- package/hooks/post-session-reflect/index.cjs +189 -189
- package/hooks/pre-compact/index.cjs +95 -95
- package/hooks/run-hook.cmd +1 -1
- package/hooks/secrets-scan/index.cjs +100 -100
- package/hooks/session-start/index.cjs +71 -71
- package/hooks/typecheck/index.cjs +65 -65
- package/package.json +63 -63
- package/references/ui-pro-max-data/LICENSE-UI-PRO-MAX +21 -21
- package/references/ui-pro-max-data/charts.csv +26 -26
- package/references/ui-pro-max-data/colors.csv +161 -161
- package/references/ui-pro-max-data/styles.csv +68 -68
- package/references/ui-pro-max-data/typography.csv +74 -74
- package/references/ui-pro-max-data/ui-reasoning.csv +162 -162
- package/references/ui-pro-max-data/ux-guidelines.csv +99 -99
- package/skills/adversary/SKILL.md +283 -283
- package/skills/asset-creator/SKILL.md +157 -157
- package/skills/audit/SKILL.md +147 -2
- package/skills/autopsy/SKILL.md +335 -335
- package/skills/ba/SKILL.md +85 -1
- package/skills/brainstorm/SKILL.md +380 -342
- package/skills/browser-pilot/SKILL.md +169 -168
- package/skills/constraint-check/SKILL.md +165 -165
- package/skills/context-engine/SKILL.md +408 -404
- package/skills/cook/SKILL.md +917 -863
- package/skills/db/SKILL.md +273 -273
- package/skills/debug/SKILL.md +465 -465
- package/skills/dependency-doctor/SKILL.md +265 -235
- package/skills/deploy/SKILL.md +274 -231
- package/skills/design/DESIGN-REFERENCE.md +365 -365
- package/skills/design/SKILL.md +590 -589
- package/skills/doc-processor/SKILL.md +254 -254
- package/skills/docs/SKILL.md +374 -374
- package/skills/docs-seeker/SKILL.md +178 -177
- package/skills/fix/SKILL.md +332 -330
- package/skills/git/SKILL.md +339 -339
- package/skills/hallucination-guard/SKILL.md +220 -219
- package/skills/incident/SKILL.md +254 -253
- package/skills/integrity-check/SKILL.md +169 -169
- package/skills/journal/SKILL.md +241 -240
- package/skills/launch/SKILL.md +344 -344
- package/skills/logic-guardian/SKILL.md +269 -251
- package/skills/marketing/SKILL.md +351 -289
- package/skills/mcp-builder/SKILL.md +425 -425
- package/skills/neural-memory/SKILL.md +359 -362
- package/skills/onboard/SKILL.md +432 -403
- package/skills/onboard/references/invariants-template.md +76 -0
- package/skills/onboard/scripts/detect-invariants.js +439 -0
- package/skills/onboard/scripts/inject-claude-md.js +150 -0
- package/skills/onboard/scripts/onboard-invariants.js +194 -0
- package/skills/perf/SKILL.md +347 -346
- package/skills/plan/SKILL.md +435 -428
- package/skills/preflight/SKILL.md +415 -415
- package/skills/problem-solver/SKILL.md +380 -284
- package/skills/rescue/SKILL.md +474 -474
- package/skills/research/SKILL.md +4 -0
- package/skills/retro/SKILL.md +3 -1
- package/skills/review/SKILL.md +614 -588
- package/skills/review-intake/SKILL.md +249 -249
- package/skills/safeguard/SKILL.md +200 -200
- package/skills/sast/SKILL.md +190 -190
- package/skills/scaffold/SKILL.md +328 -287
- package/skills/scope-guard/SKILL.md +183 -180
- package/skills/scout/SKILL.md +269 -263
- package/skills/sentinel/SKILL.md +384 -381
- package/skills/sentinel-env/SKILL.md +254 -254
- package/skills/sequential-thinking/SKILL.md +234 -234
- package/skills/session-bridge/SKILL.md +595 -543
- package/skills/session-bridge/scripts/load-invariants.js +397 -0
- package/skills/skill-forge/SKILL.md +581 -581
- package/skills/skill-router/SKILL.md +3 -0
- package/skills/slides/SKILL.md +19 -0
- package/skills/surgeon/SKILL.md +215 -215
- package/skills/team/SKILL.md +557 -537
- package/skills/test/SKILL.md +620 -614
- package/skills/trend-scout/SKILL.md +145 -145
- package/skills/verification/SKILL.md +334 -326
- package/skills/video-creator/SKILL.md +201 -201
- package/skills/watchdog/SKILL.md +168 -168
- package/skills/worktree/SKILL.md +140 -140
|
@@ -1,581 +1,581 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: skill-forge
|
|
3
|
-
description: Use when creating new Rune skills, editing existing skills, or verifying skill quality before deployment. Applies TDD discipline to skill authoring — test before write, verify before ship.
|
|
4
|
-
metadata:
|
|
5
|
-
author: runedev
|
|
6
|
-
version: "1.7.0"
|
|
7
|
-
layer: L2
|
|
8
|
-
model: opus
|
|
9
|
-
group: creation
|
|
10
|
-
tools: "Read, Write, Edit, Bash, Glob, Grep"
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# skill-forge
|
|
14
|
-
|
|
15
|
-
## Purpose
|
|
16
|
-
|
|
17
|
-
The skill that builds skills. Applies Test-Driven Development to skill authoring: write a pressure test first, watch agents fail without the skill, write the skill to fix those failures, then close loopholes until bulletproof. Ensures every Rune skill is battle-tested before it enters the mesh.
|
|
18
|
-
|
|
19
|
-
## Triggers
|
|
20
|
-
|
|
21
|
-
- `/rune skill-forge` — manual invocation to create or edit a skill
|
|
22
|
-
- Auto-trigger: when user says "create a skill", "new skill", "add skill to rune"
|
|
23
|
-
- Auto-trigger: when editing any `skills/*/SKILL.md` file
|
|
24
|
-
|
|
25
|
-
## Calls (outbound)
|
|
26
|
-
|
|
27
|
-
- `scout` (L3): scan existing skills for patterns and naming conventions
|
|
28
|
-
- `plan` (L2): structure complex skills with multiple phases
|
|
29
|
-
- `hallucination-guard` (L3): verify referenced skills/tools actually exist
|
|
30
|
-
- `verification` (L3): validate SKILL.md format compliance
|
|
31
|
-
- `journal` (L3): record skill creation decisions in ADR
|
|
32
|
-
|
|
33
|
-
## Called By (inbound)
|
|
34
|
-
|
|
35
|
-
- `cook` (L1): when the feature being built IS a new skill
|
|
36
|
-
- `scaffold` (L1): when scaffolded project includes custom skills
|
|
37
|
-
|
|
38
|
-
## References
|
|
39
|
-
|
|
40
|
-
- `references/claude-skill-reference.md` — Claude Code skill system: frontmatter fields, variables, shell injection, invocation control matrix, skill type patterns (task/research/knowledge/dynamic), file structure, and quality checklist. Load when creating or editing any skill.
|
|
41
|
-
|
|
42
|
-
## Workflow
|
|
43
|
-
|
|
44
|
-
### Phase 1 — DISCOVER
|
|
45
|
-
|
|
46
|
-
Before writing anything, understand the landscape:
|
|
47
|
-
|
|
48
|
-
1. **Scan existing skills** via `scout` — is this already covered?
|
|
49
|
-
2. **Check for overlap** — will this duplicate or conflict with existing skills?
|
|
50
|
-
3. **Identify layer** — L1 (orchestrator), L2 (workflow hub), L3 (utility)?
|
|
51
|
-
4. **Identify mesh connections** — what calls this? What does this call?
|
|
52
|
-
|
|
53
|
-
<HARD-GATE>
|
|
54
|
-
If a skill with >70% overlap already exists → extend it, don't create new.
|
|
55
|
-
The mesh grows stronger by deepening connections, not by adding nodes.
|
|
56
|
-
</HARD-GATE>
|
|
57
|
-
|
|
58
|
-
### Phase 2 — RED (Baseline Test)
|
|
59
|
-
|
|
60
|
-
**Write the test BEFORE writing the skill.**
|
|
61
|
-
|
|
62
|
-
Create a pressure scenario that exposes the problem the skill solves:
|
|
63
|
-
|
|
64
|
-
```markdown
|
|
65
|
-
## Pressure Scenario: [skill-name]
|
|
66
|
-
|
|
67
|
-
### Setup
|
|
68
|
-
[Describe the situation an agent faces]
|
|
69
|
-
|
|
70
|
-
### Pressures (combine 2-3)
|
|
71
|
-
- Time pressure: "This is urgent, just do it"
|
|
72
|
-
- Sunk cost: "I already wrote 200 lines, can't restart"
|
|
73
|
-
- Complexity: "Too many moving parts to follow process"
|
|
74
|
-
- Authority: "Senior dev says skip testing"
|
|
75
|
-
- Exhaustion: "We're 50 tool calls deep"
|
|
76
|
-
|
|
77
|
-
### Expected Failure (without skill)
|
|
78
|
-
[What the agent will probably do wrong]
|
|
79
|
-
|
|
80
|
-
### Success Criteria (with skill)
|
|
81
|
-
[What the agent should do instead]
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Run the scenario with a subagent WITHOUT the skill. Document:
|
|
85
|
-
- **Exact behavior** — what did the agent do?
|
|
86
|
-
- **Rationalizations** — verbatim excuses for skipping discipline
|
|
87
|
-
- **Failure point** — where exactly did it go wrong?
|
|
88
|
-
|
|
89
|
-
<HARD-GATE>
|
|
90
|
-
You MUST observe at least one failure before writing the skill.
|
|
91
|
-
No failure observed = you don't understand the problem well enough to write the solution.
|
|
92
|
-
</HARD-GATE>
|
|
93
|
-
|
|
94
|
-
### Phase 3 — GREEN (Write Minimal Skill)
|
|
95
|
-
|
|
96
|
-
Write the SKILL.md addressing ONLY the failures observed in Phase 2.
|
|
97
|
-
|
|
98
|
-
Follow `docs/SKILL-TEMPLATE.md` format. Required sections:
|
|
99
|
-
|
|
100
|
-
| Section | Required | Purpose |
|
|
101
|
-
|---|---|---|
|
|
102
|
-
| Frontmatter | YES | Name, description, metadata |
|
|
103
|
-
| Purpose | YES | One paragraph, ecosystem role |
|
|
104
|
-
| Triggers | YES | When to invoke |
|
|
105
|
-
| Calls / Called By | YES | Mesh connections (control flow) |
|
|
106
|
-
| Data Flow | YES | Feeds Into / Fed By / Feedback Loops (data flow) |
|
|
107
|
-
| Workflow | YES | Step-by-step execution |
|
|
108
|
-
| Output Format | YES | Structured, parseable output |
|
|
109
|
-
| Constraints | YES | 3-7 MUST/MUST NOT rules |
|
|
110
|
-
| Sharp Edges | YES | Known failure modes |
|
|
111
|
-
| Self-Validation | YES | Domain-specific QA checklist (per-skill, not centralized) |
|
|
112
|
-
| Done When | YES | Verifiable completion criteria |
|
|
113
|
-
| Cost Profile | YES | Token estimate |
|
|
114
|
-
| Mesh Gates | L1/L2 only | Progression guards |
|
|
115
|
-
|
|
116
|
-
#### SKILL.md Anatomy — WHY vs HOW Split
|
|
117
|
-
|
|
118
|
-
A skill file answers WHY and WHEN — not HOW. Code examples, syntax references, and implementation patterns belong in separate files:
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
skills/[name]/
|
|
122
|
-
├── SKILL.md ← WHY: purpose, triggers, constraints, sharp edges (~150-300 lines)
|
|
123
|
-
├── references/ ← HOW: code patterns, syntax tables, API examples
|
|
124
|
-
│ ├── patterns.md ← Implementation patterns with code blocks
|
|
125
|
-
│ └── gotchas.md ← Language/framework-specific pitfalls
|
|
126
|
-
└── scripts/ ← WHAT: deterministic operations (shell, node)
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
**Rules:**
|
|
130
|
-
1. SKILL.md MUST NOT contain code blocks longer than 10 lines — move to `references/`
|
|
131
|
-
2. One excellent inline example (≤10 lines) is OK for clarity — more than that is a smell
|
|
132
|
-
3. Format templates (Output Format section) are NOT code — they stay in SKILL.md
|
|
133
|
-
4. Pressure test scenarios (Phase 2) are NOT code — they stay in SKILL.md
|
|
134
|
-
5. If a skill has >3 code blocks → create `references/` and extract them
|
|
135
|
-
|
|
136
|
-
**Why this matters:** Code blocks in SKILL.md inflate context tokens on EVERY invocation. References are loaded only when needed. A 500-line SKILL.md with 200 lines of code examples should be a 300-line SKILL.md + a 200-line references file.
|
|
137
|
-
|
|
138
|
-
<HARD-GATE>
|
|
139
|
-
Code blocks in SKILL.md > 10 lines = review failure.
|
|
140
|
-
Extract to references/ or scripts/. No exceptions.
|
|
141
|
-
</HARD-GATE>
|
|
142
|
-
|
|
143
|
-
#### Frontmatter Rules
|
|
144
|
-
|
|
145
|
-
```yaml
|
|
146
|
-
---
|
|
147
|
-
name: kebab-case-max-64-chars # letters, numbers, hyphens only
|
|
148
|
-
description: Use when [specific triggers]. [Symptoms that signal this skill applies].
|
|
149
|
-
metadata:
|
|
150
|
-
layer: L1|L2|L3
|
|
151
|
-
model: haiku|sonnet|opus # haiku=scan, sonnet=code, opus=architecture
|
|
152
|
-
group: [see template]
|
|
153
|
-
---
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
**Description rules (CSO Discipline):**
|
|
157
|
-
- MUST start with "Use when..."
|
|
158
|
-
- MUST describe triggering conditions, NOT workflow
|
|
159
|
-
- MUST be third person
|
|
160
|
-
- MUST NOT summarize what the skill does internally
|
|
161
|
-
- AI reads description → decides whether to invoke → if description contains workflow summary, AI skips reading the full SKILL.md content (it thinks it already knows)
|
|
162
|
-
- Test: if you can execute the skill from the description alone, the description leaks too much
|
|
163
|
-
|
|
164
|
-
Bad: "Analyzes code quality through 6-step process: scan files, check patterns, run linters, compare metrics, generate report, suggest fixes"
|
|
165
|
-
Good: "Use when code changes need quality review before commit. Symptoms: PR ready, refactor complete, pre-release check."
|
|
166
|
-
|
|
167
|
-
```yaml
|
|
168
|
-
# BAD: Summarizes workflow — agent reads description, skips full content
|
|
169
|
-
description: TDD workflow that writes tests first, then code, then refactors
|
|
170
|
-
|
|
171
|
-
# GOOD: Only triggers — agent must read full content to know workflow
|
|
172
|
-
description: Use when implementing any feature or bugfix, before writing code
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
**Why this matters:** When description summarizes the workflow, agents take the shortcut — they follow the description and skip the full SKILL.md. Tested and confirmed.
|
|
176
|
-
|
|
177
|
-
#### Writing Constraints
|
|
178
|
-
|
|
179
|
-
Every constraint MUST block a specific failure mode observed in Phase 2:
|
|
180
|
-
|
|
181
|
-
```markdown
|
|
182
|
-
# BAD: Generic rule
|
|
183
|
-
1. MUST write good code
|
|
184
|
-
|
|
185
|
-
# GOOD: Blocks specific failure with consequence
|
|
186
|
-
1. MUST run tests after each fix — batch-and-pray causes cascading regressions
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
#### Anti-Rationalization Table
|
|
190
|
-
|
|
191
|
-
Capture every excuse from Phase 2 baseline testing:
|
|
192
|
-
|
|
193
|
-
```markdown
|
|
194
|
-
| Excuse | Reality |
|
|
195
|
-
|--------|---------|
|
|
196
|
-
| "[verbatim excuse from test]" | [why it's wrong + what to do instead] |
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
### Phase 4 — VERIFY (Green Check)
|
|
200
|
-
|
|
201
|
-
Run the SAME pressure scenario from Phase 2, now WITH the skill loaded.
|
|
202
|
-
|
|
203
|
-
Check:
|
|
204
|
-
- Does the agent follow the skill's workflow?
|
|
205
|
-
- Are all constraints respected under pressure?
|
|
206
|
-
- Does the output match the defined format?
|
|
207
|
-
|
|
208
|
-
<HARD-GATE>
|
|
209
|
-
If agent still fails with skill loaded → skill is insufficient.
|
|
210
|
-
Go back to Phase 3, strengthen the weak section. Do NOT ship.
|
|
211
|
-
</HARD-GATE>
|
|
212
|
-
|
|
213
|
-
### Phase 5 — REFACTOR (Close Loopholes)
|
|
214
|
-
|
|
215
|
-
Run additional pressure scenarios with varied pressures. For each new failure:
|
|
216
|
-
|
|
217
|
-
1. Identify the rationalization
|
|
218
|
-
2. Add it to the anti-rationalization table
|
|
219
|
-
3. Add explicit constraint or sharp edge
|
|
220
|
-
4. Re-run verification
|
|
221
|
-
|
|
222
|
-
Repeat until no new failures emerge in 2 consecutive test runs.
|
|
223
|
-
|
|
224
|
-
#### Pressure Types for Test Scenarios
|
|
225
|
-
|
|
226
|
-
Best tests combine 3+ pressures simultaneously:
|
|
227
|
-
|
|
228
|
-
| Pressure | Example Scenario |
|
|
229
|
-
|----------|------------------|
|
|
230
|
-
| Time | "Emergency deployment, deadline in 30 min" |
|
|
231
|
-
| Sunk cost | "Already wrote 200 lines, can't restart" |
|
|
232
|
-
| Authority | "Senior dev says skip testing" |
|
|
233
|
-
| Economic | "Customer churning, ship now or lose $50k MRR" |
|
|
234
|
-
| Exhaustion | "50 tool calls deep, context filling up" |
|
|
235
|
-
| Social | "Looking dogmatic by insisting on process" |
|
|
236
|
-
| Pragmatic | "Being practical vs being pedantic" |
|
|
237
|
-
|
|
238
|
-
#### Scenario Quality Requirements
|
|
239
|
-
|
|
240
|
-
1. **Concrete A/B/C options** — force explicit choice (no "I'd ask the user" escape hatch)
|
|
241
|
-
2. **Real constraints** — specific times, actual consequences, named files
|
|
242
|
-
3. **Real file paths** — `/tmp/payment-system` not "a project"
|
|
243
|
-
4. **"Make agent ACT"** — "What do you do?" not "What should you do?"
|
|
244
|
-
5. **No easy outs** — every option has a cost
|
|
245
|
-
|
|
246
|
-
#### Meta-Testing (When GREEN Isn't Working)
|
|
247
|
-
|
|
248
|
-
If the agent keeps failing even WITH the skill loaded, ask: "How could that skill have been written differently to make the correct option crystal clear?"
|
|
249
|
-
|
|
250
|
-
Three possible responses:
|
|
251
|
-
1. "Skill was clear, I chose to ignore it" → foundational principle needed (stronger HARD-GATE)
|
|
252
|
-
2. "Skill should have said X explicitly" → add that exact phrasing verbatim
|
|
253
|
-
3. "I didn't see section Y" → reorganize for discoverability (move up, add header)
|
|
254
|
-
|
|
255
|
-
#### Bulletproof Criteria
|
|
256
|
-
|
|
257
|
-
A skill is bulletproof when:
|
|
258
|
-
- Agent chooses correct option under maximum pressure (3+ pressures combined)
|
|
259
|
-
- Agent CITES skill sections as justification for its choice
|
|
260
|
-
- Agent ACKNOWLEDGES the temptation but follows the rule anyway
|
|
261
|
-
|
|
262
|
-
#### Persuasion Principles for Skill Language
|
|
263
|
-
|
|
264
|
-
Research (Meincke et al., 2025, 28,000 conversations) shows 33% → 72% compliance with these techniques:
|
|
265
|
-
|
|
266
|
-
| Principle | Application | Use For |
|
|
267
|
-
|-----------|-------------|---------|
|
|
268
|
-
| Authority | "YOU MUST", imperative language | Eliminates decision fatigue, safety-critical rules |
|
|
269
|
-
| Commitment | Explicit announcements + tracked choices | Creates accountability trail |
|
|
270
|
-
| Scarcity | Time-bound requirements, "before proceeding" | Triggers immediate action |
|
|
271
|
-
| Social Proof | "Every time", universal statements | Documents what prevents failures |
|
|
272
|
-
| Unity | "We're building quality" language | Shared identity, quality goals |
|
|
273
|
-
|
|
274
|
-
**Prohibited in skills:**
|
|
275
|
-
- **Liking** ("Great job following the process!") → creates sycophancy
|
|
276
|
-
- **Reciprocity** ("I helped you, now follow the rules") → feels manipulative
|
|
277
|
-
|
|
278
|
-
**Ethical test**: Would this serve the user's genuine interests if they fully understood the technique?
|
|
279
|
-
|
|
280
|
-
### Phase 5.5 — SECURITY MODEL
|
|
281
|
-
|
|
282
|
-
Every skill that touches external systems, user data, or destructive operations MUST define an explicit Security Model section. This is a contract — not aspirational, but testable.
|
|
283
|
-
|
|
284
|
-
**Add to SKILL.md after Sharp Edges:**
|
|
285
|
-
|
|
286
|
-
```markdown
|
|
287
|
-
## Security Model
|
|
288
|
-
|
|
289
|
-
### Trust Boundaries
|
|
290
|
-
- [What this skill reads] — e.g., "Reads .env files, user source code, git history"
|
|
291
|
-
- [What this skill writes] — e.g., "Writes to .rune/ only, never modifies source code"
|
|
292
|
-
- [What this skill executes] — e.g., "Runs npm test, never runs arbitrary shell commands"
|
|
293
|
-
|
|
294
|
-
### This Skill Will NEVER
|
|
295
|
-
- [Explicit denial 1] — e.g., "Execute user-provided strings as shell commands"
|
|
296
|
-
- [Explicit denial 2] — e.g., "Read or log credential files (.env, secrets.json)"
|
|
297
|
-
- [Explicit denial 3] — e.g., "Send data to external endpoints"
|
|
298
|
-
|
|
299
|
-
### Threat Surface
|
|
300
|
-
| Threat | Mitigated By |
|
|
301
|
-
|--------|-------------|
|
|
302
|
-
| Prompt injection via user input | Input validated before processing |
|
|
303
|
-
| Credential exposure in output | Secrets pattern detection before emit |
|
|
304
|
-
| Destructive operation on wrong target | Confirmation gate before delete/overwrite |
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
**When to require Security Model:**
|
|
308
|
-
- Skill uses `Bash` tool → REQUIRED (can execute arbitrary commands)
|
|
309
|
-
- Skill reads `.env` or credentials → REQUIRED
|
|
310
|
-
- Skill writes/deletes files outside `.rune/` → REQUIRED
|
|
311
|
-
- Skill calls external APIs or MCP tools → REQUIRED
|
|
312
|
-
- Skill is read-only analysis (review, audit, scout) → OPTIONAL but recommended
|
|
313
|
-
|
|
314
|
-
**Eval integration**: Phase 7 evals for skills with Security Model MUST include:
|
|
315
|
-
- E05: Attempt to make skill execute unintended command
|
|
316
|
-
- E06: Attempt to make skill expose credentials in output
|
|
317
|
-
- E07: Attempt to make skill write outside its declared boundary
|
|
318
|
-
|
|
319
|
-
If Security Model is required but missing → Phase 7 EVAL HARD-GATE blocks ship.
|
|
320
|
-
|
|
321
|
-
### Phase 6 — INTEGRATE
|
|
322
|
-
|
|
323
|
-
Wire the skill into the mesh:
|
|
324
|
-
|
|
325
|
-
1. **Update `docs/ARCHITECTURE.md`** — add to correct layer/group table
|
|
326
|
-
2. **Update `CLAUDE.md`** — increment skill count, add to layer list
|
|
327
|
-
3. **Add mesh connections** — update SKILL.md of skills that should call/be called by this one
|
|
328
|
-
4. **Map data flow** — identify which skills consume this skill's output (Feeds Into) and which skills' outputs this skill needs (Fed By). Look for feedback loops where two skills refine each other's work
|
|
329
|
-
5. **Write Self-Validation** — 3-5 domain-specific checks unique to this skill's output. Ask: "What quality issues can ONLY this skill catch?"
|
|
330
|
-
6. **Verify no conflicts** — new skill's output format compatible with consumers?
|
|
331
|
-
|
|
332
|
-
### Phase 6.5 — EXTENSION AUTHORING (if building an extension, not a skill)
|
|
333
|
-
|
|
334
|
-
Extensions augment existing skills with optional capabilities. Unlike skills (standalone workflow units) or packs (domain bundles), extensions ADD features to skills that already exist — without modifying the core skill file.
|
|
335
|
-
|
|
336
|
-
#### Extension vs Skill vs Pack
|
|
337
|
-
|
|
338
|
-
| Concept | Purpose | Modifies Core? | Self-contained? |
|
|
339
|
-
|---------|---------|----------------|-----------------|
|
|
340
|
-
| **Skill** | Standalone workflow unit (SKILL.md) | N/A — IS core | Yes |
|
|
341
|
-
| **Pack** | Domain bundle of skills (PACK.md) | No — bundles existing | Yes |
|
|
342
|
-
| **Extension** | Augments existing skill with new capability | No — additive only | Yes — own dir with install/uninstall |
|
|
343
|
-
|
|
344
|
-
#### Extension Directory Structure
|
|
345
|
-
|
|
346
|
-
```
|
|
347
|
-
extensions/<extension-name>/
|
|
348
|
-
├── EXTENSION.md # Manifest: what it extends, how, dependencies
|
|
349
|
-
├── install.sh # Unix installer (non-destructive MCP merge)
|
|
350
|
-
├── install.ps1 # Windows installer
|
|
351
|
-
├── uninstall.sh # Clean removal
|
|
352
|
-
├── uninstall.ps1 # Clean removal (Windows)
|
|
353
|
-
├── skills/
|
|
354
|
-
│ └── <skill-name>/
|
|
355
|
-
│ └── SKILL.md # New skill added by extension
|
|
356
|
-
├── agents/ # Optional subagent definitions
|
|
357
|
-
│ └── <agent-name>.md
|
|
358
|
-
├── references/ # Domain knowledge loaded by extension skills
|
|
359
|
-
│ └── <topic>.md
|
|
360
|
-
├── scripts/ # Executable utilities
|
|
361
|
-
│ └── <script>.py|.sh
|
|
362
|
-
└── docs/
|
|
363
|
-
└── SETUP.md # Extension-specific configuration guide
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
#### EXTENSION.md Manifest
|
|
367
|
-
|
|
368
|
-
```yaml
|
|
369
|
-
---
|
|
370
|
-
name: "<extension-name>"
|
|
371
|
-
extends: "<target-skill-or-pack>"
|
|
372
|
-
description: "What capability this extension adds"
|
|
373
|
-
requires:
|
|
374
|
-
- mcp: "<mcp-server-name>" # Optional: MCP server dependency
|
|
375
|
-
- skill: "<required-skill-name>" # Required core skill
|
|
376
|
-
install_method: "non-destructive" # MUST be non-destructive
|
|
377
|
-
---
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
#### Extension Rules
|
|
381
|
-
|
|
382
|
-
1. **Non-destructive install** — extension MUST NOT modify existing skill files. It adds new files alongside.
|
|
383
|
-
2. **Self-contained** — removing the extension directory restores the system to its pre-install state.
|
|
384
|
-
3. **MCP merge** — if the extension adds MCP tools, install script MUST merge into settings.json without overwriting existing entries.
|
|
385
|
-
4. **Fallback graceful** — if the MCP server or external dependency is unavailable, the extension skill MUST degrade gracefully (report unavailability, don't crash).
|
|
386
|
-
5. **Cost awareness** — if the extension calls paid APIs, the extension skill MUST warn before expensive operations and track usage.
|
|
387
|
-
6. **Pre-flight check** — extension skill Step 1 MUST verify dependencies are available before executing.
|
|
388
|
-
|
|
389
|
-
#### When to Build an Extension (vs a Skill or Pack)
|
|
390
|
-
|
|
391
|
-
- Build an **extension** when: the capability requires an external API/MCP, is optional, and augments an existing skill
|
|
392
|
-
- Build a **skill** when: the capability is self-contained and fits a layer in the mesh
|
|
393
|
-
- Build a **pack** when: you're bundling multiple related skills for a domain
|
|
394
|
-
|
|
395
|
-
### Phase 7 — EVAL (Behavior Tests)
|
|
396
|
-
|
|
397
|
-
Before shipping, write **Eval Scenarios** — behavior tests for the SKILL.md itself. These are "unit tests for skill files, not code."
|
|
398
|
-
|
|
399
|
-
Save evals to `skills/<name>/evals.md`. Minimum 4 evals per skill:
|
|
400
|
-
|
|
401
|
-
| Eval ID | Category | Required? |
|
|
402
|
-
|---------|----------|-----------|
|
|
403
|
-
| E01 | Happy path — core workflow | YES |
|
|
404
|
-
| E02 | Edge case — unusual/empty input | YES |
|
|
405
|
-
| E03 | Adversarial — pressure scenario | YES |
|
|
406
|
-
| E04 | Jailbreak/injection attempt | YES for security-critical skills |
|
|
407
|
-
|
|
408
|
-
Each eval follows the format defined in `rune:test` → "Skill Behavior Tests" section:
|
|
409
|
-
- **Prompt**: exact situation the agent faces
|
|
410
|
-
- **Expected Reasoning**: step-by-step reasoning agent SHOULD follow
|
|
411
|
-
- **Must Include**: what the output MUST contain or do
|
|
412
|
-
- **Must NOT**: anti-patterns the output MUST NOT produce
|
|
413
|
-
|
|
414
|
-
Run each eval with a subagent. An eval FAILS if the agent produces a Must NOT output.
|
|
415
|
-
|
|
416
|
-
**Pre-ship gate**: At least E01–E03 must PASS before committing. Security-critical skills (touching auth/secrets/destructive ops) require 8+ evals including jailbreak and credential-leak scenarios.
|
|
417
|
-
|
|
418
|
-
Also run the **Skill Content Security Guard** (sentinel Step 3.5) on the new SKILL.md content before commit — blocks destructive ops, prompt injection, and jailbreak patterns embedded in skill instructions.
|
|
419
|
-
|
|
420
|
-
<HARD-GATE>
|
|
421
|
-
No evals.md → skill is behavior-untested. Do NOT ship untested skills.
|
|
422
|
-
Eval file with 0 passing evals = same as no evals.
|
|
423
|
-
</HARD-GATE>
|
|
424
|
-
|
|
425
|
-
### Phase 8 — SHIP
|
|
426
|
-
|
|
427
|
-
```bash
|
|
428
|
-
git add skills/[skill-name]/SKILL.md
|
|
429
|
-
git add skills/[skill-name]/evals.md
|
|
430
|
-
git add docs/ARCHITECTURE.md CLAUDE.md
|
|
431
|
-
# Add any updated existing skills
|
|
432
|
-
git commit -m "feat: add [skill-name] — [one-line purpose]"
|
|
433
|
-
```
|
|
434
|
-
|
|
435
|
-
## Skill Quality Checklist
|
|
436
|
-
|
|
437
|
-
**Format:**
|
|
438
|
-
- [ ] Name is kebab-case, max 64 chars, letters/numbers/hyphens only
|
|
439
|
-
- [ ] Description starts with "Use when...", does NOT summarize workflow
|
|
440
|
-
- [ ] All template sections present
|
|
441
|
-
- [ ] Constraints are specific (not generic "write good code")
|
|
442
|
-
- [ ] Sharp edges have severity + mitigation
|
|
443
|
-
|
|
444
|
-
**Content:**
|
|
445
|
-
- [ ] Baseline test run BEFORE skill was written
|
|
446
|
-
- [ ] At least one observed failure documented
|
|
447
|
-
- [ ] Anti-rationalization table from real test failures
|
|
448
|
-
- [ ] Mesh connections bidirectional (calls AND called-by both updated)
|
|
449
|
-
- [ ] Data flow mapped (Feeds Into / Fed By / Feedback Loops)
|
|
450
|
-
- [ ] Self-Validation has 3-5 domain-specific checks (not generic)
|
|
451
|
-
- [ ] Output format is structured and parseable by other skills
|
|
452
|
-
- [ ] `evals.md` written with at least 3 passing eval scenarios (E01 happy-path, E02 edge-case, E03 adversarial)
|
|
453
|
-
- [ ] Skill Content Security Guard passed (sentinel Step 3.5 — no destructive ops or injection patterns in SKILL.md)
|
|
454
|
-
|
|
455
|
-
**Architecture:**
|
|
456
|
-
- [ ] Layer assignment correct (L1=orchestrate, L2=workflow, L3=utility)
|
|
457
|
-
- [ ] Model assignment correct (haiku=scan, sonnet=code, opus=architect)
|
|
458
|
-
- [ ] No >70% overlap with existing skills
|
|
459
|
-
- [ ] ARCHITECTURE.md updated
|
|
460
|
-
- [ ] CLAUDE.md updated
|
|
461
|
-
|
|
462
|
-
**Extension-specific (if building an extension):**
|
|
463
|
-
- [ ] EXTENSION.md manifest present with extends, requires, install_method
|
|
464
|
-
- [ ] install.sh + install.ps1 tested (non-destructive merge)
|
|
465
|
-
- [ ] uninstall.sh + uninstall.ps1 tested (clean removal)
|
|
466
|
-
- [ ] Extension skill has dependency pre-flight check (Step 1)
|
|
467
|
-
- [ ] Fallback behavior documented when external dependency unavailable
|
|
468
|
-
- [ ] Cost warning present if extension calls paid APIs
|
|
469
|
-
|
|
470
|
-
## Adapting Existing Skills
|
|
471
|
-
|
|
472
|
-
When editing, not creating:
|
|
473
|
-
|
|
474
|
-
<HARD-GATE>
|
|
475
|
-
Same TDD cycle applies to edits.
|
|
476
|
-
1. Write a test that exposes the gap in the current skill
|
|
477
|
-
2. Run baseline — confirm the skill fails on this scenario
|
|
478
|
-
3. Edit the skill to address the gap
|
|
479
|
-
4. Verify the edit fixes the gap WITHOUT breaking existing behavior
|
|
480
|
-
</HARD-GATE>
|
|
481
|
-
|
|
482
|
-
"Just adding a section" is not an excuse to skip testing.
|
|
483
|
-
|
|
484
|
-
## Token Efficiency Guidelines
|
|
485
|
-
|
|
486
|
-
Skills are loaded into context when invoked. Every word costs tokens.
|
|
487
|
-
|
|
488
|
-
| Skill Type | Target | Notes |
|
|
489
|
-
|---|---|---|
|
|
490
|
-
| L3 utility (haiku) | <300 words | Runs frequently, keep lean |
|
|
491
|
-
| L2 workflow hub | <500 words | Moderate frequency |
|
|
492
|
-
| L1 orchestrator | <800 words | Runs once per workflow |
|
|
493
|
-
| Reference sections | Extract to separate file | >100 lines → own file |
|
|
494
|
-
|
|
495
|
-
Techniques:
|
|
496
|
-
- Reference `--help` instead of documenting all flags
|
|
497
|
-
- Cross-reference other skills instead of repeating content
|
|
498
|
-
- One excellent example > three mediocre ones
|
|
499
|
-
- Inline code only if <50 lines, otherwise separate file
|
|
500
|
-
|
|
501
|
-
## Output Format
|
|
502
|
-
|
|
503
|
-
```
|
|
504
|
-
## Skill Forge Report
|
|
505
|
-
- **Skill**: [name] (L[layer])
|
|
506
|
-
- **Action**: CREATE | EDIT
|
|
507
|
-
- **Status**: SHIPPED | NEEDS_WORK | BLOCKED
|
|
508
|
-
|
|
509
|
-
### Baseline Test
|
|
510
|
-
- Scenario: [test scenario description]
|
|
511
|
-
- Result WITHOUT skill: [observed failure]
|
|
512
|
-
- Result WITH skill: [observed success or remaining gap]
|
|
513
|
-
|
|
514
|
-
### Quality Checklist
|
|
515
|
-
- Format: [pass/fail count]
|
|
516
|
-
- Content: [pass/fail count]
|
|
517
|
-
- Architecture: [pass/fail count]
|
|
518
|
-
|
|
519
|
-
### Files Created/Modified
|
|
520
|
-
- skills/[name]/SKILL.md — [created | modified]
|
|
521
|
-
- docs/ARCHITECTURE.md — [updated | skipped]
|
|
522
|
-
- CLAUDE.md — [updated | skipped]
|
|
523
|
-
|
|
524
|
-
### Mesh Impact
|
|
525
|
-
- New connections: [count] ([list of skills])
|
|
526
|
-
- Bidirectional check: PASS | FAIL
|
|
527
|
-
- Data flow mapped: [count] feeds-into, [count] fed-by, [count] feedback loops
|
|
528
|
-
- Self-Validation: [count] domain-specific checks written
|
|
529
|
-
```
|
|
530
|
-
|
|
531
|
-
## Constraints
|
|
532
|
-
|
|
533
|
-
1. MUST run baseline test BEFORE writing skill — no skill without observed failure
|
|
534
|
-
2. MUST verify skill fixes the observed failures — green check required before ship
|
|
535
|
-
3. MUST NOT create skill with >70% overlap with existing — extend instead
|
|
536
|
-
4. MUST follow SKILL-TEMPLATE.md format — all required sections present
|
|
537
|
-
5. MUST update ARCHITECTURE.md and CLAUDE.md on every new skill
|
|
538
|
-
6. MUST NOT ship skill that fails its own pressure test
|
|
539
|
-
7. MUST write description as triggers only — never summarize workflow in description
|
|
540
|
-
|
|
541
|
-
## Sharp Edges
|
|
542
|
-
|
|
543
|
-
| Failure Mode | Severity | Mitigation |
|
|
544
|
-
|---|---|---|
|
|
545
|
-
| Writing skill without baseline test | CRITICAL | Phase 2 HARD-GATE: must observe failure first |
|
|
546
|
-
| Description summarizes workflow → agents skip content | HIGH | Phase 3 description rules: "Use when..." triggers only |
|
|
547
|
-
| New skill duplicates existing skill | HIGH | Phase 1 HARD-GATE: >70% overlap → extend, don't create |
|
|
548
|
-
| Skill passes test but breaks mesh connections | MEDIUM | Phase 6 integration: verify output compatibility |
|
|
549
|
-
| Editing skill without testing the edit | MEDIUM | Adapting section: same TDD cycle for edits |
|
|
550
|
-
| Overly verbose skill burns context tokens | MEDIUM | Token efficiency guidelines: layer-based word targets |
|
|
551
|
-
| Code blocks in SKILL.md bloat every invocation | HIGH | WHY vs HOW split: SKILL.md ≤10-line code blocks, extract rest to references/ |
|
|
552
|
-
| Writing skill without TDD (no observed failures first) | CRITICAL | Skill TDD: RED (run scenario WITHOUT skill → document failures) → GREEN (write skill targeting failures) → REFACTOR (find bypasses → add blocks) |
|
|
553
|
-
| Description leaks workflow → agent skips full content | HIGH | CSO Discipline: description = triggers only. Test: can you execute from description alone? If yes, it leaks too much |
|
|
554
|
-
| Self-Validation copies completion-gate checks | HIGH | Self-Validation is DOMAIN-specific: "assertions per test", "dependency ordering". NOT generic: "tests pass", "build succeeds" — those belong to completion-gate |
|
|
555
|
-
| Data Flow confused with Calls | MEDIUM | Calls = runtime invocation (skill A calls skill B). Feeds Into = artifact persistence (skill A writes .rune/X.md, skill B reads it later). If it's a direct function call → Calls. If it's via files/context → Data Flow |
|
|
556
|
-
| Feedback Loop missing one direction | MEDIUM | Every Feedback Loop ↻ must document BOTH directions: what A sends to B AND what B sends back to A. One-way = Feeds Into, not a loop |
|
|
557
|
-
|
|
558
|
-
## Done When
|
|
559
|
-
|
|
560
|
-
- Baseline test documented with observed failures (TDD RED phase)
|
|
561
|
-
- SKILL.md follows template format completely
|
|
562
|
-
- Skill passes pressure test (agent complies with skill loaded)
|
|
563
|
-
- No new failures in 2 consecutive varied-pressure test runs
|
|
564
|
-
- Mesh connections wired (ARCHITECTURE.md, CLAUDE.md, related skills)
|
|
565
|
-
- Git committed with conventional commit message
|
|
566
|
-
|
|
567
|
-
## Returns
|
|
568
|
-
|
|
569
|
-
| Artifact | Format | Location |
|
|
570
|
-
|----------|--------|----------|
|
|
571
|
-
| New or updated skill file | Markdown (SKILL.md) | `skills/<name>/SKILL.md` |
|
|
572
|
-
| Eval scenarios | Markdown | `skills/<name>/evals.md` |
|
|
573
|
-
| Reference files (if needed) | Markdown | `skills/<name>/references/` |
|
|
574
|
-
| Architecture docs update | Markdown | `docs/ARCHITECTURE.md` |
|
|
575
|
-
| Skill Forge Report | Markdown | inline |
|
|
576
|
-
|
|
577
|
-
## Cost Profile
|
|
578
|
-
|
|
579
|
-
~3000-8000 tokens per skill creation (opus for Phase 2-5 reasoning, haiku for scout/verification). Most cost is in the iterative test-refine loop (Phase 4-5). Budget 2-4 test iterations per skill.
|
|
580
|
-
|
|
581
|
-
**Scope guardrail:** skill-forge authors and tests skill files — it does not implement the features those skills describe.
|
|
1
|
+
---
|
|
2
|
+
name: skill-forge
|
|
3
|
+
description: Use when creating new Rune skills, editing existing skills, or verifying skill quality before deployment. Applies TDD discipline to skill authoring — test before write, verify before ship.
|
|
4
|
+
metadata:
|
|
5
|
+
author: runedev
|
|
6
|
+
version: "1.7.0"
|
|
7
|
+
layer: L2
|
|
8
|
+
model: opus
|
|
9
|
+
group: creation
|
|
10
|
+
tools: "Read, Write, Edit, Bash, Glob, Grep"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# skill-forge
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
The skill that builds skills. Applies Test-Driven Development to skill authoring: write a pressure test first, watch agents fail without the skill, write the skill to fix those failures, then close loopholes until bulletproof. Ensures every Rune skill is battle-tested before it enters the mesh.
|
|
18
|
+
|
|
19
|
+
## Triggers
|
|
20
|
+
|
|
21
|
+
- `/rune skill-forge` — manual invocation to create or edit a skill
|
|
22
|
+
- Auto-trigger: when user says "create a skill", "new skill", "add skill to rune"
|
|
23
|
+
- Auto-trigger: when editing any `skills/*/SKILL.md` file
|
|
24
|
+
|
|
25
|
+
## Calls (outbound)
|
|
26
|
+
|
|
27
|
+
- `scout` (L3): scan existing skills for patterns and naming conventions
|
|
28
|
+
- `plan` (L2): structure complex skills with multiple phases
|
|
29
|
+
- `hallucination-guard` (L3): verify referenced skills/tools actually exist
|
|
30
|
+
- `verification` (L3): validate SKILL.md format compliance
|
|
31
|
+
- `journal` (L3): record skill creation decisions in ADR
|
|
32
|
+
|
|
33
|
+
## Called By (inbound)
|
|
34
|
+
|
|
35
|
+
- `cook` (L1): when the feature being built IS a new skill
|
|
36
|
+
- `scaffold` (L1): when scaffolded project includes custom skills
|
|
37
|
+
|
|
38
|
+
## References
|
|
39
|
+
|
|
40
|
+
- `references/claude-skill-reference.md` — Claude Code skill system: frontmatter fields, variables, shell injection, invocation control matrix, skill type patterns (task/research/knowledge/dynamic), file structure, and quality checklist. Load when creating or editing any skill.
|
|
41
|
+
|
|
42
|
+
## Workflow
|
|
43
|
+
|
|
44
|
+
### Phase 1 — DISCOVER
|
|
45
|
+
|
|
46
|
+
Before writing anything, understand the landscape:
|
|
47
|
+
|
|
48
|
+
1. **Scan existing skills** via `scout` — is this already covered?
|
|
49
|
+
2. **Check for overlap** — will this duplicate or conflict with existing skills?
|
|
50
|
+
3. **Identify layer** — L1 (orchestrator), L2 (workflow hub), L3 (utility)?
|
|
51
|
+
4. **Identify mesh connections** — what calls this? What does this call?
|
|
52
|
+
|
|
53
|
+
<HARD-GATE>
|
|
54
|
+
If a skill with >70% overlap already exists → extend it, don't create new.
|
|
55
|
+
The mesh grows stronger by deepening connections, not by adding nodes.
|
|
56
|
+
</HARD-GATE>
|
|
57
|
+
|
|
58
|
+
### Phase 2 — RED (Baseline Test)
|
|
59
|
+
|
|
60
|
+
**Write the test BEFORE writing the skill.**
|
|
61
|
+
|
|
62
|
+
Create a pressure scenario that exposes the problem the skill solves:
|
|
63
|
+
|
|
64
|
+
```markdown
|
|
65
|
+
## Pressure Scenario: [skill-name]
|
|
66
|
+
|
|
67
|
+
### Setup
|
|
68
|
+
[Describe the situation an agent faces]
|
|
69
|
+
|
|
70
|
+
### Pressures (combine 2-3)
|
|
71
|
+
- Time pressure: "This is urgent, just do it"
|
|
72
|
+
- Sunk cost: "I already wrote 200 lines, can't restart"
|
|
73
|
+
- Complexity: "Too many moving parts to follow process"
|
|
74
|
+
- Authority: "Senior dev says skip testing"
|
|
75
|
+
- Exhaustion: "We're 50 tool calls deep"
|
|
76
|
+
|
|
77
|
+
### Expected Failure (without skill)
|
|
78
|
+
[What the agent will probably do wrong]
|
|
79
|
+
|
|
80
|
+
### Success Criteria (with skill)
|
|
81
|
+
[What the agent should do instead]
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Run the scenario with a subagent WITHOUT the skill. Document:
|
|
85
|
+
- **Exact behavior** — what did the agent do?
|
|
86
|
+
- **Rationalizations** — verbatim excuses for skipping discipline
|
|
87
|
+
- **Failure point** — where exactly did it go wrong?
|
|
88
|
+
|
|
89
|
+
<HARD-GATE>
|
|
90
|
+
You MUST observe at least one failure before writing the skill.
|
|
91
|
+
No failure observed = you don't understand the problem well enough to write the solution.
|
|
92
|
+
</HARD-GATE>
|
|
93
|
+
|
|
94
|
+
### Phase 3 — GREEN (Write Minimal Skill)
|
|
95
|
+
|
|
96
|
+
Write the SKILL.md addressing ONLY the failures observed in Phase 2.
|
|
97
|
+
|
|
98
|
+
Follow `docs/SKILL-TEMPLATE.md` format. Required sections:
|
|
99
|
+
|
|
100
|
+
| Section | Required | Purpose |
|
|
101
|
+
|---|---|---|
|
|
102
|
+
| Frontmatter | YES | Name, description, metadata |
|
|
103
|
+
| Purpose | YES | One paragraph, ecosystem role |
|
|
104
|
+
| Triggers | YES | When to invoke |
|
|
105
|
+
| Calls / Called By | YES | Mesh connections (control flow) |
|
|
106
|
+
| Data Flow | YES | Feeds Into / Fed By / Feedback Loops (data flow) |
|
|
107
|
+
| Workflow | YES | Step-by-step execution |
|
|
108
|
+
| Output Format | YES | Structured, parseable output |
|
|
109
|
+
| Constraints | YES | 3-7 MUST/MUST NOT rules |
|
|
110
|
+
| Sharp Edges | YES | Known failure modes |
|
|
111
|
+
| Self-Validation | YES | Domain-specific QA checklist (per-skill, not centralized) |
|
|
112
|
+
| Done When | YES | Verifiable completion criteria |
|
|
113
|
+
| Cost Profile | YES | Token estimate |
|
|
114
|
+
| Mesh Gates | L1/L2 only | Progression guards |
|
|
115
|
+
|
|
116
|
+
#### SKILL.md Anatomy — WHY vs HOW Split
|
|
117
|
+
|
|
118
|
+
A skill file answers WHY and WHEN — not HOW. Code examples, syntax references, and implementation patterns belong in separate files:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
skills/[name]/
|
|
122
|
+
├── SKILL.md ← WHY: purpose, triggers, constraints, sharp edges (~150-300 lines)
|
|
123
|
+
├── references/ ← HOW: code patterns, syntax tables, API examples
|
|
124
|
+
│ ├── patterns.md ← Implementation patterns with code blocks
|
|
125
|
+
│ └── gotchas.md ← Language/framework-specific pitfalls
|
|
126
|
+
└── scripts/ ← WHAT: deterministic operations (shell, node)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Rules:**
|
|
130
|
+
1. SKILL.md MUST NOT contain code blocks longer than 10 lines — move to `references/`
|
|
131
|
+
2. One excellent inline example (≤10 lines) is OK for clarity — more than that is a smell
|
|
132
|
+
3. Format templates (Output Format section) are NOT code — they stay in SKILL.md
|
|
133
|
+
4. Pressure test scenarios (Phase 2) are NOT code — they stay in SKILL.md
|
|
134
|
+
5. If a skill has >3 code blocks → create `references/` and extract them
|
|
135
|
+
|
|
136
|
+
**Why this matters:** Code blocks in SKILL.md inflate context tokens on EVERY invocation. References are loaded only when needed. A 500-line SKILL.md with 200 lines of code examples should be a 300-line SKILL.md + a 200-line references file.
|
|
137
|
+
|
|
138
|
+
<HARD-GATE>
|
|
139
|
+
Code blocks in SKILL.md > 10 lines = review failure.
|
|
140
|
+
Extract to references/ or scripts/. No exceptions.
|
|
141
|
+
</HARD-GATE>
|
|
142
|
+
|
|
143
|
+
#### Frontmatter Rules
|
|
144
|
+
|
|
145
|
+
```yaml
|
|
146
|
+
---
|
|
147
|
+
name: kebab-case-max-64-chars # letters, numbers, hyphens only
|
|
148
|
+
description: Use when [specific triggers]. [Symptoms that signal this skill applies].
|
|
149
|
+
metadata:
|
|
150
|
+
layer: L1|L2|L3
|
|
151
|
+
model: haiku|sonnet|opus # haiku=scan, sonnet=code, opus=architecture
|
|
152
|
+
group: [see template]
|
|
153
|
+
---
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Description rules (CSO Discipline):**
|
|
157
|
+
- MUST start with "Use when..."
|
|
158
|
+
- MUST describe triggering conditions, NOT workflow
|
|
159
|
+
- MUST be third person
|
|
160
|
+
- MUST NOT summarize what the skill does internally
|
|
161
|
+
- AI reads description → decides whether to invoke → if description contains workflow summary, AI skips reading the full SKILL.md content (it thinks it already knows)
|
|
162
|
+
- Test: if you can execute the skill from the description alone, the description leaks too much
|
|
163
|
+
|
|
164
|
+
Bad: "Analyzes code quality through 6-step process: scan files, check patterns, run linters, compare metrics, generate report, suggest fixes"
|
|
165
|
+
Good: "Use when code changes need quality review before commit. Symptoms: PR ready, refactor complete, pre-release check."
|
|
166
|
+
|
|
167
|
+
```yaml
|
|
168
|
+
# BAD: Summarizes workflow — agent reads description, skips full content
|
|
169
|
+
description: TDD workflow that writes tests first, then code, then refactors
|
|
170
|
+
|
|
171
|
+
# GOOD: Only triggers — agent must read full content to know workflow
|
|
172
|
+
description: Use when implementing any feature or bugfix, before writing code
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Why this matters:** When description summarizes the workflow, agents take the shortcut — they follow the description and skip the full SKILL.md. Tested and confirmed.
|
|
176
|
+
|
|
177
|
+
#### Writing Constraints
|
|
178
|
+
|
|
179
|
+
Every constraint MUST block a specific failure mode observed in Phase 2:
|
|
180
|
+
|
|
181
|
+
```markdown
|
|
182
|
+
# BAD: Generic rule
|
|
183
|
+
1. MUST write good code
|
|
184
|
+
|
|
185
|
+
# GOOD: Blocks specific failure with consequence
|
|
186
|
+
1. MUST run tests after each fix — batch-and-pray causes cascading regressions
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
#### Anti-Rationalization Table
|
|
190
|
+
|
|
191
|
+
Capture every excuse from Phase 2 baseline testing:
|
|
192
|
+
|
|
193
|
+
```markdown
|
|
194
|
+
| Excuse | Reality |
|
|
195
|
+
|--------|---------|
|
|
196
|
+
| "[verbatim excuse from test]" | [why it's wrong + what to do instead] |
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Phase 4 — VERIFY (Green Check)
|
|
200
|
+
|
|
201
|
+
Run the SAME pressure scenario from Phase 2, now WITH the skill loaded.
|
|
202
|
+
|
|
203
|
+
Check:
|
|
204
|
+
- Does the agent follow the skill's workflow?
|
|
205
|
+
- Are all constraints respected under pressure?
|
|
206
|
+
- Does the output match the defined format?
|
|
207
|
+
|
|
208
|
+
<HARD-GATE>
|
|
209
|
+
If agent still fails with skill loaded → skill is insufficient.
|
|
210
|
+
Go back to Phase 3, strengthen the weak section. Do NOT ship.
|
|
211
|
+
</HARD-GATE>
|
|
212
|
+
|
|
213
|
+
### Phase 5 — REFACTOR (Close Loopholes)
|
|
214
|
+
|
|
215
|
+
Run additional pressure scenarios with varied pressures. For each new failure:
|
|
216
|
+
|
|
217
|
+
1. Identify the rationalization
|
|
218
|
+
2. Add it to the anti-rationalization table
|
|
219
|
+
3. Add explicit constraint or sharp edge
|
|
220
|
+
4. Re-run verification
|
|
221
|
+
|
|
222
|
+
Repeat until no new failures emerge in 2 consecutive test runs.
|
|
223
|
+
|
|
224
|
+
#### Pressure Types for Test Scenarios
|
|
225
|
+
|
|
226
|
+
Best tests combine 3+ pressures simultaneously:
|
|
227
|
+
|
|
228
|
+
| Pressure | Example Scenario |
|
|
229
|
+
|----------|------------------|
|
|
230
|
+
| Time | "Emergency deployment, deadline in 30 min" |
|
|
231
|
+
| Sunk cost | "Already wrote 200 lines, can't restart" |
|
|
232
|
+
| Authority | "Senior dev says skip testing" |
|
|
233
|
+
| Economic | "Customer churning, ship now or lose $50k MRR" |
|
|
234
|
+
| Exhaustion | "50 tool calls deep, context filling up" |
|
|
235
|
+
| Social | "Looking dogmatic by insisting on process" |
|
|
236
|
+
| Pragmatic | "Being practical vs being pedantic" |
|
|
237
|
+
|
|
238
|
+
#### Scenario Quality Requirements
|
|
239
|
+
|
|
240
|
+
1. **Concrete A/B/C options** — force explicit choice (no "I'd ask the user" escape hatch)
|
|
241
|
+
2. **Real constraints** — specific times, actual consequences, named files
|
|
242
|
+
3. **Real file paths** — `/tmp/payment-system` not "a project"
|
|
243
|
+
4. **"Make agent ACT"** — "What do you do?" not "What should you do?"
|
|
244
|
+
5. **No easy outs** — every option has a cost
|
|
245
|
+
|
|
246
|
+
#### Meta-Testing (When GREEN Isn't Working)
|
|
247
|
+
|
|
248
|
+
If the agent keeps failing even WITH the skill loaded, ask: "How could that skill have been written differently to make the correct option crystal clear?"
|
|
249
|
+
|
|
250
|
+
Three possible responses:
|
|
251
|
+
1. "Skill was clear, I chose to ignore it" → foundational principle needed (stronger HARD-GATE)
|
|
252
|
+
2. "Skill should have said X explicitly" → add that exact phrasing verbatim
|
|
253
|
+
3. "I didn't see section Y" → reorganize for discoverability (move up, add header)
|
|
254
|
+
|
|
255
|
+
#### Bulletproof Criteria
|
|
256
|
+
|
|
257
|
+
A skill is bulletproof when:
|
|
258
|
+
- Agent chooses correct option under maximum pressure (3+ pressures combined)
|
|
259
|
+
- Agent CITES skill sections as justification for its choice
|
|
260
|
+
- Agent ACKNOWLEDGES the temptation but follows the rule anyway
|
|
261
|
+
|
|
262
|
+
#### Persuasion Principles for Skill Language
|
|
263
|
+
|
|
264
|
+
Research (Meincke et al., 2025, 28,000 conversations) shows 33% → 72% compliance with these techniques:
|
|
265
|
+
|
|
266
|
+
| Principle | Application | Use For |
|
|
267
|
+
|-----------|-------------|---------|
|
|
268
|
+
| Authority | "YOU MUST", imperative language | Eliminates decision fatigue, safety-critical rules |
|
|
269
|
+
| Commitment | Explicit announcements + tracked choices | Creates accountability trail |
|
|
270
|
+
| Scarcity | Time-bound requirements, "before proceeding" | Triggers immediate action |
|
|
271
|
+
| Social Proof | "Every time", universal statements | Documents what prevents failures |
|
|
272
|
+
| Unity | "We're building quality" language | Shared identity, quality goals |
|
|
273
|
+
|
|
274
|
+
**Prohibited in skills:**
|
|
275
|
+
- **Liking** ("Great job following the process!") → creates sycophancy
|
|
276
|
+
- **Reciprocity** ("I helped you, now follow the rules") → feels manipulative
|
|
277
|
+
|
|
278
|
+
**Ethical test**: Would this serve the user's genuine interests if they fully understood the technique?
|
|
279
|
+
|
|
280
|
+
### Phase 5.5 — SECURITY MODEL
|
|
281
|
+
|
|
282
|
+
Every skill that touches external systems, user data, or destructive operations MUST define an explicit Security Model section. This is a contract — not aspirational, but testable.
|
|
283
|
+
|
|
284
|
+
**Add to SKILL.md after Sharp Edges:**
|
|
285
|
+
|
|
286
|
+
```markdown
|
|
287
|
+
## Security Model
|
|
288
|
+
|
|
289
|
+
### Trust Boundaries
|
|
290
|
+
- [What this skill reads] — e.g., "Reads .env files, user source code, git history"
|
|
291
|
+
- [What this skill writes] — e.g., "Writes to .rune/ only, never modifies source code"
|
|
292
|
+
- [What this skill executes] — e.g., "Runs npm test, never runs arbitrary shell commands"
|
|
293
|
+
|
|
294
|
+
### This Skill Will NEVER
|
|
295
|
+
- [Explicit denial 1] — e.g., "Execute user-provided strings as shell commands"
|
|
296
|
+
- [Explicit denial 2] — e.g., "Read or log credential files (.env, secrets.json)"
|
|
297
|
+
- [Explicit denial 3] — e.g., "Send data to external endpoints"
|
|
298
|
+
|
|
299
|
+
### Threat Surface
|
|
300
|
+
| Threat | Mitigated By |
|
|
301
|
+
|--------|-------------|
|
|
302
|
+
| Prompt injection via user input | Input validated before processing |
|
|
303
|
+
| Credential exposure in output | Secrets pattern detection before emit |
|
|
304
|
+
| Destructive operation on wrong target | Confirmation gate before delete/overwrite |
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
**When to require Security Model:**
|
|
308
|
+
- Skill uses `Bash` tool → REQUIRED (can execute arbitrary commands)
|
|
309
|
+
- Skill reads `.env` or credentials → REQUIRED
|
|
310
|
+
- Skill writes/deletes files outside `.rune/` → REQUIRED
|
|
311
|
+
- Skill calls external APIs or MCP tools → REQUIRED
|
|
312
|
+
- Skill is read-only analysis (review, audit, scout) → OPTIONAL but recommended
|
|
313
|
+
|
|
314
|
+
**Eval integration**: Phase 7 evals for skills with Security Model MUST include:
|
|
315
|
+
- E05: Attempt to make skill execute unintended command
|
|
316
|
+
- E06: Attempt to make skill expose credentials in output
|
|
317
|
+
- E07: Attempt to make skill write outside its declared boundary
|
|
318
|
+
|
|
319
|
+
If Security Model is required but missing → Phase 7 EVAL HARD-GATE blocks ship.
|
|
320
|
+
|
|
321
|
+
### Phase 6 — INTEGRATE
|
|
322
|
+
|
|
323
|
+
Wire the skill into the mesh:
|
|
324
|
+
|
|
325
|
+
1. **Update `docs/ARCHITECTURE.md`** — add to correct layer/group table
|
|
326
|
+
2. **Update `CLAUDE.md`** — increment skill count, add to layer list
|
|
327
|
+
3. **Add mesh connections** — update SKILL.md of skills that should call/be called by this one
|
|
328
|
+
4. **Map data flow** — identify which skills consume this skill's output (Feeds Into) and which skills' outputs this skill needs (Fed By). Look for feedback loops where two skills refine each other's work
|
|
329
|
+
5. **Write Self-Validation** — 3-5 domain-specific checks unique to this skill's output. Ask: "What quality issues can ONLY this skill catch?"
|
|
330
|
+
6. **Verify no conflicts** — new skill's output format compatible with consumers?
|
|
331
|
+
|
|
332
|
+
### Phase 6.5 — EXTENSION AUTHORING (if building an extension, not a skill)
|
|
333
|
+
|
|
334
|
+
Extensions augment existing skills with optional capabilities. Unlike skills (standalone workflow units) or packs (domain bundles), extensions ADD features to skills that already exist — without modifying the core skill file.
|
|
335
|
+
|
|
336
|
+
#### Extension vs Skill vs Pack
|
|
337
|
+
|
|
338
|
+
| Concept | Purpose | Modifies Core? | Self-contained? |
|
|
339
|
+
|---------|---------|----------------|-----------------|
|
|
340
|
+
| **Skill** | Standalone workflow unit (SKILL.md) | N/A — IS core | Yes |
|
|
341
|
+
| **Pack** | Domain bundle of skills (PACK.md) | No — bundles existing | Yes |
|
|
342
|
+
| **Extension** | Augments existing skill with new capability | No — additive only | Yes — own dir with install/uninstall |
|
|
343
|
+
|
|
344
|
+
#### Extension Directory Structure
|
|
345
|
+
|
|
346
|
+
```
|
|
347
|
+
extensions/<extension-name>/
|
|
348
|
+
├── EXTENSION.md # Manifest: what it extends, how, dependencies
|
|
349
|
+
├── install.sh # Unix installer (non-destructive MCP merge)
|
|
350
|
+
├── install.ps1 # Windows installer
|
|
351
|
+
├── uninstall.sh # Clean removal
|
|
352
|
+
├── uninstall.ps1 # Clean removal (Windows)
|
|
353
|
+
├── skills/
|
|
354
|
+
│ └── <skill-name>/
|
|
355
|
+
│ └── SKILL.md # New skill added by extension
|
|
356
|
+
├── agents/ # Optional subagent definitions
|
|
357
|
+
│ └── <agent-name>.md
|
|
358
|
+
├── references/ # Domain knowledge loaded by extension skills
|
|
359
|
+
│ └── <topic>.md
|
|
360
|
+
├── scripts/ # Executable utilities
|
|
361
|
+
│ └── <script>.py|.sh
|
|
362
|
+
└── docs/
|
|
363
|
+
└── SETUP.md # Extension-specific configuration guide
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
#### EXTENSION.md Manifest
|
|
367
|
+
|
|
368
|
+
```yaml
|
|
369
|
+
---
|
|
370
|
+
name: "<extension-name>"
|
|
371
|
+
extends: "<target-skill-or-pack>"
|
|
372
|
+
description: "What capability this extension adds"
|
|
373
|
+
requires:
|
|
374
|
+
- mcp: "<mcp-server-name>" # Optional: MCP server dependency
|
|
375
|
+
- skill: "<required-skill-name>" # Required core skill
|
|
376
|
+
install_method: "non-destructive" # MUST be non-destructive
|
|
377
|
+
---
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
#### Extension Rules
|
|
381
|
+
|
|
382
|
+
1. **Non-destructive install** — extension MUST NOT modify existing skill files. It adds new files alongside.
|
|
383
|
+
2. **Self-contained** — removing the extension directory restores the system to its pre-install state.
|
|
384
|
+
3. **MCP merge** — if the extension adds MCP tools, install script MUST merge into settings.json without overwriting existing entries.
|
|
385
|
+
4. **Fallback graceful** — if the MCP server or external dependency is unavailable, the extension skill MUST degrade gracefully (report unavailability, don't crash).
|
|
386
|
+
5. **Cost awareness** — if the extension calls paid APIs, the extension skill MUST warn before expensive operations and track usage.
|
|
387
|
+
6. **Pre-flight check** — extension skill Step 1 MUST verify dependencies are available before executing.
|
|
388
|
+
|
|
389
|
+
#### When to Build an Extension (vs a Skill or Pack)
|
|
390
|
+
|
|
391
|
+
- Build an **extension** when: the capability requires an external API/MCP, is optional, and augments an existing skill
|
|
392
|
+
- Build a **skill** when: the capability is self-contained and fits a layer in the mesh
|
|
393
|
+
- Build a **pack** when: you're bundling multiple related skills for a domain
|
|
394
|
+
|
|
395
|
+
### Phase 7 — EVAL (Behavior Tests)
|
|
396
|
+
|
|
397
|
+
Before shipping, write **Eval Scenarios** — behavior tests for the SKILL.md itself. These are "unit tests for skill files, not code."
|
|
398
|
+
|
|
399
|
+
Save evals to `skills/<name>/evals.md`. Minimum 4 evals per skill:
|
|
400
|
+
|
|
401
|
+
| Eval ID | Category | Required? |
|
|
402
|
+
|---------|----------|-----------|
|
|
403
|
+
| E01 | Happy path — core workflow | YES |
|
|
404
|
+
| E02 | Edge case — unusual/empty input | YES |
|
|
405
|
+
| E03 | Adversarial — pressure scenario | YES |
|
|
406
|
+
| E04 | Jailbreak/injection attempt | YES for security-critical skills |
|
|
407
|
+
|
|
408
|
+
Each eval follows the format defined in `rune:test` → "Skill Behavior Tests" section:
|
|
409
|
+
- **Prompt**: exact situation the agent faces
|
|
410
|
+
- **Expected Reasoning**: step-by-step reasoning agent SHOULD follow
|
|
411
|
+
- **Must Include**: what the output MUST contain or do
|
|
412
|
+
- **Must NOT**: anti-patterns the output MUST NOT produce
|
|
413
|
+
|
|
414
|
+
Run each eval with a subagent. An eval FAILS if the agent produces a Must NOT output.
|
|
415
|
+
|
|
416
|
+
**Pre-ship gate**: At least E01–E03 must PASS before committing. Security-critical skills (touching auth/secrets/destructive ops) require 8+ evals including jailbreak and credential-leak scenarios.
|
|
417
|
+
|
|
418
|
+
Also run the **Skill Content Security Guard** (sentinel Step 3.5) on the new SKILL.md content before commit — blocks destructive ops, prompt injection, and jailbreak patterns embedded in skill instructions.
|
|
419
|
+
|
|
420
|
+
<HARD-GATE>
|
|
421
|
+
No evals.md → skill is behavior-untested. Do NOT ship untested skills.
|
|
422
|
+
Eval file with 0 passing evals = same as no evals.
|
|
423
|
+
</HARD-GATE>
|
|
424
|
+
|
|
425
|
+
### Phase 8 — SHIP
|
|
426
|
+
|
|
427
|
+
```bash
|
|
428
|
+
git add skills/[skill-name]/SKILL.md
|
|
429
|
+
git add skills/[skill-name]/evals.md
|
|
430
|
+
git add docs/ARCHITECTURE.md CLAUDE.md
|
|
431
|
+
# Add any updated existing skills
|
|
432
|
+
git commit -m "feat: add [skill-name] — [one-line purpose]"
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
## Skill Quality Checklist
|
|
436
|
+
|
|
437
|
+
**Format:**
|
|
438
|
+
- [ ] Name is kebab-case, max 64 chars, letters/numbers/hyphens only
|
|
439
|
+
- [ ] Description starts with "Use when...", does NOT summarize workflow
|
|
440
|
+
- [ ] All template sections present
|
|
441
|
+
- [ ] Constraints are specific (not generic "write good code")
|
|
442
|
+
- [ ] Sharp edges have severity + mitigation
|
|
443
|
+
|
|
444
|
+
**Content:**
|
|
445
|
+
- [ ] Baseline test run BEFORE skill was written
|
|
446
|
+
- [ ] At least one observed failure documented
|
|
447
|
+
- [ ] Anti-rationalization table from real test failures
|
|
448
|
+
- [ ] Mesh connections bidirectional (calls AND called-by both updated)
|
|
449
|
+
- [ ] Data flow mapped (Feeds Into / Fed By / Feedback Loops)
|
|
450
|
+
- [ ] Self-Validation has 3-5 domain-specific checks (not generic)
|
|
451
|
+
- [ ] Output format is structured and parseable by other skills
|
|
452
|
+
- [ ] `evals.md` written with at least 3 passing eval scenarios (E01 happy-path, E02 edge-case, E03 adversarial)
|
|
453
|
+
- [ ] Skill Content Security Guard passed (sentinel Step 3.5 — no destructive ops or injection patterns in SKILL.md)
|
|
454
|
+
|
|
455
|
+
**Architecture:**
|
|
456
|
+
- [ ] Layer assignment correct (L1=orchestrate, L2=workflow, L3=utility)
|
|
457
|
+
- [ ] Model assignment correct (haiku=scan, sonnet=code, opus=architect)
|
|
458
|
+
- [ ] No >70% overlap with existing skills
|
|
459
|
+
- [ ] ARCHITECTURE.md updated
|
|
460
|
+
- [ ] CLAUDE.md updated
|
|
461
|
+
|
|
462
|
+
**Extension-specific (if building an extension):**
|
|
463
|
+
- [ ] EXTENSION.md manifest present with extends, requires, install_method
|
|
464
|
+
- [ ] install.sh + install.ps1 tested (non-destructive merge)
|
|
465
|
+
- [ ] uninstall.sh + uninstall.ps1 tested (clean removal)
|
|
466
|
+
- [ ] Extension skill has dependency pre-flight check (Step 1)
|
|
467
|
+
- [ ] Fallback behavior documented when external dependency unavailable
|
|
468
|
+
- [ ] Cost warning present if extension calls paid APIs
|
|
469
|
+
|
|
470
|
+
## Adapting Existing Skills
|
|
471
|
+
|
|
472
|
+
When editing, not creating:
|
|
473
|
+
|
|
474
|
+
<HARD-GATE>
|
|
475
|
+
Same TDD cycle applies to edits.
|
|
476
|
+
1. Write a test that exposes the gap in the current skill
|
|
477
|
+
2. Run baseline — confirm the skill fails on this scenario
|
|
478
|
+
3. Edit the skill to address the gap
|
|
479
|
+
4. Verify the edit fixes the gap WITHOUT breaking existing behavior
|
|
480
|
+
</HARD-GATE>
|
|
481
|
+
|
|
482
|
+
"Just adding a section" is not an excuse to skip testing.
|
|
483
|
+
|
|
484
|
+
## Token Efficiency Guidelines
|
|
485
|
+
|
|
486
|
+
Skills are loaded into context when invoked. Every word costs tokens.
|
|
487
|
+
|
|
488
|
+
| Skill Type | Target | Notes |
|
|
489
|
+
|---|---|---|
|
|
490
|
+
| L3 utility (haiku) | <300 words | Runs frequently, keep lean |
|
|
491
|
+
| L2 workflow hub | <500 words | Moderate frequency |
|
|
492
|
+
| L1 orchestrator | <800 words | Runs once per workflow |
|
|
493
|
+
| Reference sections | Extract to separate file | >100 lines → own file |
|
|
494
|
+
|
|
495
|
+
Techniques:
|
|
496
|
+
- Reference `--help` instead of documenting all flags
|
|
497
|
+
- Cross-reference other skills instead of repeating content
|
|
498
|
+
- One excellent example > three mediocre ones
|
|
499
|
+
- Inline code only if <50 lines, otherwise separate file
|
|
500
|
+
|
|
501
|
+
## Output Format
|
|
502
|
+
|
|
503
|
+
```
|
|
504
|
+
## Skill Forge Report
|
|
505
|
+
- **Skill**: [name] (L[layer])
|
|
506
|
+
- **Action**: CREATE | EDIT
|
|
507
|
+
- **Status**: SHIPPED | NEEDS_WORK | BLOCKED
|
|
508
|
+
|
|
509
|
+
### Baseline Test
|
|
510
|
+
- Scenario: [test scenario description]
|
|
511
|
+
- Result WITHOUT skill: [observed failure]
|
|
512
|
+
- Result WITH skill: [observed success or remaining gap]
|
|
513
|
+
|
|
514
|
+
### Quality Checklist
|
|
515
|
+
- Format: [pass/fail count]
|
|
516
|
+
- Content: [pass/fail count]
|
|
517
|
+
- Architecture: [pass/fail count]
|
|
518
|
+
|
|
519
|
+
### Files Created/Modified
|
|
520
|
+
- skills/[name]/SKILL.md — [created | modified]
|
|
521
|
+
- docs/ARCHITECTURE.md — [updated | skipped]
|
|
522
|
+
- CLAUDE.md — [updated | skipped]
|
|
523
|
+
|
|
524
|
+
### Mesh Impact
|
|
525
|
+
- New connections: [count] ([list of skills])
|
|
526
|
+
- Bidirectional check: PASS | FAIL
|
|
527
|
+
- Data flow mapped: [count] feeds-into, [count] fed-by, [count] feedback loops
|
|
528
|
+
- Self-Validation: [count] domain-specific checks written
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
## Constraints
|
|
532
|
+
|
|
533
|
+
1. MUST run baseline test BEFORE writing skill — no skill without observed failure
|
|
534
|
+
2. MUST verify skill fixes the observed failures — green check required before ship
|
|
535
|
+
3. MUST NOT create skill with >70% overlap with existing — extend instead
|
|
536
|
+
4. MUST follow SKILL-TEMPLATE.md format — all required sections present
|
|
537
|
+
5. MUST update ARCHITECTURE.md and CLAUDE.md on every new skill
|
|
538
|
+
6. MUST NOT ship skill that fails its own pressure test
|
|
539
|
+
7. MUST write description as triggers only — never summarize workflow in description
|
|
540
|
+
|
|
541
|
+
## Sharp Edges
|
|
542
|
+
|
|
543
|
+
| Failure Mode | Severity | Mitigation |
|
|
544
|
+
|---|---|---|
|
|
545
|
+
| Writing skill without baseline test | CRITICAL | Phase 2 HARD-GATE: must observe failure first |
|
|
546
|
+
| Description summarizes workflow → agents skip content | HIGH | Phase 3 description rules: "Use when..." triggers only |
|
|
547
|
+
| New skill duplicates existing skill | HIGH | Phase 1 HARD-GATE: >70% overlap → extend, don't create |
|
|
548
|
+
| Skill passes test but breaks mesh connections | MEDIUM | Phase 6 integration: verify output compatibility |
|
|
549
|
+
| Editing skill without testing the edit | MEDIUM | Adapting section: same TDD cycle for edits |
|
|
550
|
+
| Overly verbose skill burns context tokens | MEDIUM | Token efficiency guidelines: layer-based word targets |
|
|
551
|
+
| Code blocks in SKILL.md bloat every invocation | HIGH | WHY vs HOW split: SKILL.md ≤10-line code blocks, extract rest to references/ |
|
|
552
|
+
| Writing skill without TDD (no observed failures first) | CRITICAL | Skill TDD: RED (run scenario WITHOUT skill → document failures) → GREEN (write skill targeting failures) → REFACTOR (find bypasses → add blocks) |
|
|
553
|
+
| Description leaks workflow → agent skips full content | HIGH | CSO Discipline: description = triggers only. Test: can you execute from description alone? If yes, it leaks too much |
|
|
554
|
+
| Self-Validation copies completion-gate checks | HIGH | Self-Validation is DOMAIN-specific: "assertions per test", "dependency ordering". NOT generic: "tests pass", "build succeeds" — those belong to completion-gate |
|
|
555
|
+
| Data Flow confused with Calls | MEDIUM | Calls = runtime invocation (skill A calls skill B). Feeds Into = artifact persistence (skill A writes .rune/X.md, skill B reads it later). If it's a direct function call → Calls. If it's via files/context → Data Flow |
|
|
556
|
+
| Feedback Loop missing one direction | MEDIUM | Every Feedback Loop ↻ must document BOTH directions: what A sends to B AND what B sends back to A. One-way = Feeds Into, not a loop |
|
|
557
|
+
|
|
558
|
+
## Done When
|
|
559
|
+
|
|
560
|
+
- Baseline test documented with observed failures (TDD RED phase)
|
|
561
|
+
- SKILL.md follows template format completely
|
|
562
|
+
- Skill passes pressure test (agent complies with skill loaded)
|
|
563
|
+
- No new failures in 2 consecutive varied-pressure test runs
|
|
564
|
+
- Mesh connections wired (ARCHITECTURE.md, CLAUDE.md, related skills)
|
|
565
|
+
- Git committed with conventional commit message
|
|
566
|
+
|
|
567
|
+
## Returns
|
|
568
|
+
|
|
569
|
+
| Artifact | Format | Location |
|
|
570
|
+
|----------|--------|----------|
|
|
571
|
+
| New or updated skill file | Markdown (SKILL.md) | `skills/<name>/SKILL.md` |
|
|
572
|
+
| Eval scenarios | Markdown | `skills/<name>/evals.md` |
|
|
573
|
+
| Reference files (if needed) | Markdown | `skills/<name>/references/` |
|
|
574
|
+
| Architecture docs update | Markdown | `docs/ARCHITECTURE.md` |
|
|
575
|
+
| Skill Forge Report | Markdown | inline |
|
|
576
|
+
|
|
577
|
+
## Cost Profile
|
|
578
|
+
|
|
579
|
+
~3000-8000 tokens per skill creation (opus for Phase 2-5 reasoning, haiku for scout/verification). Most cost is in the iterative test-refine loop (Phase 4-5). Budget 2-4 test iterations per skill.
|
|
580
|
+
|
|
581
|
+
**Scope guardrail:** skill-forge authors and tests skill files — it does not implement the features those skills describe.
|