@rune-kit/rune 2.3.1 → 2.3.2
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
CHANGED
|
@@ -32,7 +32,7 @@ Mesh: A ↔ B ↔ C (B fails = A reaches C via D→E)
|
|
|
32
32
|
D ↔ E ↔ F
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
## What's New (v2.3.
|
|
35
|
+
## What's New (v2.3.2)
|
|
36
36
|
|
|
37
37
|
- **UI/UX Pro Max Integration** — 161 palettes, 84 styles, 73 font pairings, 161 reasoning rules from [UI/UX Pro Max](https://github.com/nextlevelbuilder/ui-ux-pro-max-skill) (MIT, 42.8k★) meshed into `design` skill + `@rune/ui` pack
|
|
38
38
|
- **11 Core Skill Enrichments** — deviation rules, repair operators, evidence quality gate, decision classification, debug knowledge base, CSO discipline, YAGNI pushback, formal pause/resume
|
package/docs/index.html
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
<canvas id="mesh-canvas"></canvas>
|
|
63
63
|
</div>
|
|
64
64
|
<div class="hero-content">
|
|
65
|
-
<p class="hero-badge">v2.3.
|
|
65
|
+
<p class="hero-badge">v2.3.2 — 59 skills • 8 platforms • MIT</p>
|
|
66
66
|
<h1>Less skills.<br><span class="accent">Deeper connections.</span></h1>
|
|
67
67
|
<p class="hero-sub">A mesh ecosystem for AI coding assistants. Skills call each other bidirectionally, forming resilient workflows that adapt when things go wrong.</p>
|
|
68
68
|
<div class="hero-actions">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rune-kit/rune",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "59-skill mesh for AI coding assistants — 5-layer architecture, 200+ connections, 8 platforms (Claude Code, Cursor, Windsurf, Antigravity, Codex, OpenCode, OpenClaw, Generic)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/skills/db/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: db
|
|
|
3
3
|
description: Database workflow specialist. Generates migration files with rollback scripts, detects breaking schema changes, and validates query parameterization.
|
|
4
4
|
metadata:
|
|
5
5
|
author: runedev
|
|
6
|
-
version: "0.
|
|
6
|
+
version: "0.2.0"
|
|
7
7
|
layer: L2
|
|
8
8
|
model: sonnet
|
|
9
9
|
group: development
|
|
@@ -35,6 +35,10 @@ Database workflow specialist. Handles the parts of database work that cause prod
|
|
|
35
35
|
- `deploy` (L2): pre-deploy migration safety check
|
|
36
36
|
- `audit` (L2): database health dimension
|
|
37
37
|
|
|
38
|
+
## References
|
|
39
|
+
|
|
40
|
+
- `references/scaling-reference.md` — Index strategies, query optimization, N+1 prevention, connection pooling, read replicas, partitioning, sharding, denormalization. Load when scaling, performance, or indexing context detected.
|
|
41
|
+
|
|
38
42
|
## Executable Steps
|
|
39
43
|
|
|
40
44
|
### Step 1 — Discovery
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# Database Scaling Reference
|
|
2
|
+
|
|
3
|
+
> Loaded by `db` skill when scaling, indexing, or performance optimization context is detected.
|
|
4
|
+
> Source patterns: production-proven PostgreSQL scaling strategies.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Indexing Strategy
|
|
9
|
+
|
|
10
|
+
### Index Type Selection
|
|
11
|
+
|
|
12
|
+
| Type | Use Case | Example |
|
|
13
|
+
|------|----------|---------|
|
|
14
|
+
| **B-tree** (default) | Equality, range, sorting | `WHERE id = 1`, `ORDER BY date` |
|
|
15
|
+
| **GIN** | Arrays, JSONB, full-text search | `WHERE tags @> ARRAY['a']` |
|
|
16
|
+
| **GiST** | Geometric, spatial, nearest-neighbor | PostGIS, `ORDER BY location <->` |
|
|
17
|
+
| **BRIN** | Large tables with natural ordering | Time-series > 100GB |
|
|
18
|
+
|
|
19
|
+
### Compound Index Rules
|
|
20
|
+
|
|
21
|
+
Order columns: **equality → range → sort**
|
|
22
|
+
|
|
23
|
+
```sql
|
|
24
|
+
-- Query: WHERE customer_id = X AND status IN (...) AND created_at > Y ORDER BY id
|
|
25
|
+
CREATE INDEX idx_orders ON orders(customer_id, status, created_at, id);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Partial Indexes (index what you query)
|
|
29
|
+
|
|
30
|
+
```sql
|
|
31
|
+
-- Only index active users (90% smaller, 90% faster writes)
|
|
32
|
+
CREATE INDEX idx_active_users ON users(email) WHERE status = 'active';
|
|
33
|
+
|
|
34
|
+
-- Only index pending orders
|
|
35
|
+
CREATE INDEX idx_pending_orders ON orders(customer_id) WHERE status = 'pending';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Covering Indexes (avoid heap lookups)
|
|
39
|
+
|
|
40
|
+
```sql
|
|
41
|
+
-- Query only needs total and date — include them in index
|
|
42
|
+
CREATE INDEX idx_orders_covering ON orders(customer_id)
|
|
43
|
+
INCLUDE (total, created_at);
|
|
44
|
+
|
|
45
|
+
-- Index-only scan — no heap access needed
|
|
46
|
+
SELECT total, created_at FROM orders WHERE customer_id = 123;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Index Anti-Patterns
|
|
50
|
+
|
|
51
|
+
- Indexing every column (slows writes, wastes storage)
|
|
52
|
+
- Indexing low-cardinality columns alone (status with 3 values → useless)
|
|
53
|
+
- Missing indexes on foreign keys (kills JOIN performance)
|
|
54
|
+
- Unused indexes (check `pg_stat_user_indexes` for `idx_scan = 0`)
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Query Optimization
|
|
59
|
+
|
|
60
|
+
### EXPLAIN ANALYZE — Always Profile
|
|
61
|
+
|
|
62
|
+
```sql
|
|
63
|
+
EXPLAIN (ANALYZE, BUFFERS, TIMING ON)
|
|
64
|
+
SELECT * FROM orders WHERE customer_id = 123 AND created_at > NOW() - INTERVAL '30d';
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Red flags in output:**
|
|
68
|
+
- `Seq Scan` on large table → missing index
|
|
69
|
+
- `Filter` removes most rows → index should be more selective
|
|
70
|
+
- `Sort` with high cost → add index that matches ORDER BY
|
|
71
|
+
- `Nested Loop` with large outer table → consider hash/merge join
|
|
72
|
+
|
|
73
|
+
### pg_stat_statements — Find Problem Queries
|
|
74
|
+
|
|
75
|
+
```sql
|
|
76
|
+
-- Top 10 slowest queries by total time
|
|
77
|
+
SELECT query, calls, total_exec_time / 1000 AS total_sec,
|
|
78
|
+
mean_exec_time AS avg_ms,
|
|
79
|
+
100.0 * shared_blks_hit / NULLIF(shared_blks_hit + shared_blks_read, 0) AS cache_pct
|
|
80
|
+
FROM pg_stat_statements
|
|
81
|
+
ORDER BY total_exec_time DESC LIMIT 10;
|
|
82
|
+
|
|
83
|
+
-- N+1 detector: queries called many times with low individual cost
|
|
84
|
+
SELECT query, calls, mean_exec_time AS avg_ms
|
|
85
|
+
FROM pg_stat_statements
|
|
86
|
+
WHERE calls > 1000 AND mean_exec_time < 5
|
|
87
|
+
ORDER BY calls DESC LIMIT 10;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## N+1 Query Prevention
|
|
93
|
+
|
|
94
|
+
### Prisma
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
// BAD: 1 + N queries
|
|
98
|
+
const users = await prisma.user.findMany();
|
|
99
|
+
for (const u of users) {
|
|
100
|
+
u.posts = await prisma.post.findMany({ where: { authorId: u.id } });
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// GOOD: 2 queries (parallel fetch)
|
|
104
|
+
const users = await prisma.user.findMany({ include: { posts: true } });
|
|
105
|
+
|
|
106
|
+
// GOOD: Single query (database JOIN)
|
|
107
|
+
const users = await prisma.user.findMany({
|
|
108
|
+
relationLoadStrategy: 'join',
|
|
109
|
+
include: { posts: { select: { id: true, title: true } } }
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Drizzle (no N+1 by design)
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
const results = await db.select().from(users)
|
|
117
|
+
.leftJoin(posts, eq(users.id, posts.userId));
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Detection
|
|
121
|
+
|
|
122
|
+
Enable query logging — look for **query count = 1 + N** where N = row count.
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
// Prisma query logging
|
|
126
|
+
const prisma = new PrismaClient({ log: [{ emit: 'event', level: 'query' }] });
|
|
127
|
+
prisma.$on('query', (e) => {
|
|
128
|
+
if (e.duration > 100) console.warn(`SLOW: ${e.duration}ms — ${e.query}`);
|
|
129
|
+
});
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Connection Pooling
|
|
135
|
+
|
|
136
|
+
### Sizing Formula
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
pool_size = (CPU cores × 2) + effective_spindle_count
|
|
140
|
+
|
|
141
|
+
4-core → 9 connections
|
|
142
|
+
8-core → 17 connections
|
|
143
|
+
16-core → 33 connections
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### PgBouncer Configuration
|
|
147
|
+
|
|
148
|
+
```ini
|
|
149
|
+
[pgbouncer]
|
|
150
|
+
pool_mode = transaction # Release after each transaction
|
|
151
|
+
default_pool_size = 25 # Per database/user pair
|
|
152
|
+
min_pool_size = 10 # Keep warm
|
|
153
|
+
reserve_pool_size = 5 # Overflow buffer
|
|
154
|
+
max_client_connections = 1000 # Total client limit
|
|
155
|
+
server_idle_timeout = 600 # Close idle server connections (10min)
|
|
156
|
+
query_wait_timeout = 120 # Max wait for available connection
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Warning signs:** Pool utilization > 80%, rising wait times, connection timeouts.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Read Replicas
|
|
164
|
+
|
|
165
|
+
### When to Add
|
|
166
|
+
|
|
167
|
+
- Read:write ratio exceeds **10:1**
|
|
168
|
+
- Primary CPU consistently > 70% from read queries
|
|
169
|
+
- Analytics queries competing with transactional reads
|
|
170
|
+
|
|
171
|
+
### Routing Pattern
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
const primaryPool = new Pool({ host: 'primary.db.com' });
|
|
175
|
+
const replicaPool = new Pool({ host: 'replica.db.com' });
|
|
176
|
+
|
|
177
|
+
async function query(sql: string, params: unknown[], opts?: { write?: boolean }) {
|
|
178
|
+
const pool = opts?.write ? primaryPool : replicaPool;
|
|
179
|
+
return pool.query(sql, params);
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Replication Lag
|
|
184
|
+
|
|
185
|
+
- Typical: 5-50ms for well-tuned async replication
|
|
186
|
+
- **Read-your-writes consistency**: After a write, read from primary for that user's session
|
|
187
|
+
- **Analytics queries**: Always safe on replicas (stale data acceptable)
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Partitioning
|
|
192
|
+
|
|
193
|
+
### When to Partition
|
|
194
|
+
|
|
195
|
+
- Table exceeds **100GB** or **100M+ rows**
|
|
196
|
+
- Queries always filter on a specific column (date, tenant)
|
|
197
|
+
- Need fast deletion of old data (`DROP` partition vs `DELETE`)
|
|
198
|
+
|
|
199
|
+
### Range Partitioning (time-series)
|
|
200
|
+
|
|
201
|
+
```sql
|
|
202
|
+
CREATE TABLE events (
|
|
203
|
+
id BIGSERIAL, created_at TIMESTAMPTZ NOT NULL, data JSONB
|
|
204
|
+
) PARTITION BY RANGE (created_at);
|
|
205
|
+
|
|
206
|
+
CREATE TABLE events_2025_01 PARTITION OF events
|
|
207
|
+
FOR VALUES FROM ('2025-01-01') TO ('2025-02-01');
|
|
208
|
+
|
|
209
|
+
-- Delete old data instantly
|
|
210
|
+
DROP TABLE events_2024_01; -- 0.01s vs DELETE minutes
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Hash Partitioning (even distribution)
|
|
214
|
+
|
|
215
|
+
```sql
|
|
216
|
+
CREATE TABLE orders (id BIGSERIAL, customer_id INT, data JSONB)
|
|
217
|
+
PARTITION BY HASH (customer_id);
|
|
218
|
+
|
|
219
|
+
CREATE TABLE orders_0 PARTITION OF orders FOR VALUES WITH (MODULUS 4, REMAINDER 0);
|
|
220
|
+
CREATE TABLE orders_1 PARTITION OF orders FOR VALUES WITH (MODULUS 4, REMAINDER 1);
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
**Rule:** Keep partition count under 500 — query planning overhead grows with partition count.
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Sharding Decision Matrix
|
|
228
|
+
|
|
229
|
+
### When to Shard (Last Resort)
|
|
230
|
+
|
|
231
|
+
| Strategy | Pros | Cons |
|
|
232
|
+
|----------|------|------|
|
|
233
|
+
| **Hash-based** | Even distribution | No range queries on shard key |
|
|
234
|
+
| **Range-based** | Range queries work | Hot shards if distribution skewed |
|
|
235
|
+
| **Tenant-based** | Strong isolation | Uneven if tenants vary in size |
|
|
236
|
+
|
|
237
|
+
### Before Sharding, Try These First
|
|
238
|
+
|
|
239
|
+
1. Add proper indexes
|
|
240
|
+
2. Fix N+1 queries
|
|
241
|
+
3. Add read replicas
|
|
242
|
+
4. Add caching layer
|
|
243
|
+
5. Partition large tables
|
|
244
|
+
6. Vertical scaling (bigger instance)
|
|
245
|
+
7. Archive old data
|
|
246
|
+
8. Optimize queries with EXPLAIN ANALYZE
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Denormalization Decision Matrix
|
|
251
|
+
|
|
252
|
+
| Scenario | Keep Normalized | Denormalize |
|
|
253
|
+
|----------|----------------|-------------|
|
|
254
|
+
| High write volume | Yes | No |
|
|
255
|
+
| High read volume, slow joins | No | Yes |
|
|
256
|
+
| Data consistency critical | Yes | No |
|
|
257
|
+
| Analytics / reporting | No | Yes (materialized views) |
|
|
258
|
+
|
|
259
|
+
### Materialized Views
|
|
260
|
+
|
|
261
|
+
```sql
|
|
262
|
+
CREATE MATERIALIZED VIEW order_stats AS
|
|
263
|
+
SELECT customer_id, COUNT(*) AS order_count, SUM(total) AS total_spent
|
|
264
|
+
FROM orders GROUP BY customer_id;
|
|
265
|
+
|
|
266
|
+
-- Refresh periodically (CONCURRENTLY allows reads during refresh)
|
|
267
|
+
REFRESH MATERIALIZED VIEW CONCURRENTLY order_stats;
|
|
268
|
+
CREATE UNIQUE INDEX ON order_stats(customer_id);
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**Rule:** Start normalized. Denormalize specific queries only when EXPLAIN shows expensive joins that caching can't solve.
|
|
@@ -3,7 +3,7 @@ name: skill-forge
|
|
|
3
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
4
|
metadata:
|
|
5
5
|
author: runedev
|
|
6
|
-
version: "1.
|
|
6
|
+
version: "1.6.0"
|
|
7
7
|
layer: L2
|
|
8
8
|
model: opus
|
|
9
9
|
group: creation
|
|
@@ -34,6 +34,10 @@ The skill that builds skills. Applies Test-Driven Development to skill authoring
|
|
|
34
34
|
|
|
35
35
|
- `cook` (L1): when the feature being built IS a new skill
|
|
36
36
|
|
|
37
|
+
## References
|
|
38
|
+
|
|
39
|
+
- `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.
|
|
40
|
+
|
|
37
41
|
## Workflow
|
|
38
42
|
|
|
39
43
|
### Phase 1 — DISCOVER
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Claude Code Skill System Reference
|
|
2
|
+
|
|
3
|
+
> Loaded by `skill-forge` when creating or editing skills. Covers frontmatter fields, variables, shell injection, invocation control, and skill type patterns.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Frontmatter Fields
|
|
8
|
+
|
|
9
|
+
### Required
|
|
10
|
+
|
|
11
|
+
| Field | Type | Description |
|
|
12
|
+
|-------|------|-------------|
|
|
13
|
+
| `name` | string | Kebab-case identifier. Becomes the `/slash-command`. Must match directory name. |
|
|
14
|
+
| `description` | string | What the skill does. Claude uses this for auto-activation matching. Include action verbs and trigger phrases. |
|
|
15
|
+
|
|
16
|
+
### Optional
|
|
17
|
+
|
|
18
|
+
| Field | Type | Default | Description |
|
|
19
|
+
|-------|------|---------|-------------|
|
|
20
|
+
| `argument-hint` | string | — | Shown in autocomplete after command name. Use `[brackets]`. |
|
|
21
|
+
| `user-invocable` | boolean | `true` | If `false`, no slash command — auto-activate only. |
|
|
22
|
+
| `auto-activate` | boolean | `true` | If `false`, slash command only — never auto-activates. |
|
|
23
|
+
| `allowed-tools` | string[] | all | Whitelist of tools the skill can use. |
|
|
24
|
+
| `disallowed-tools` | string[] | none | Blacklist of tools. |
|
|
25
|
+
|
|
26
|
+
### Invocation Control Matrix
|
|
27
|
+
|
|
28
|
+
| `user-invocable` | `auto-activate` | Behavior |
|
|
29
|
+
|-------------------|-----------------|----------|
|
|
30
|
+
| `true` (default) | `true` (default) | Full access: slash command + auto-activates |
|
|
31
|
+
| `true` | `false` | Slash command only, never auto-activates |
|
|
32
|
+
| `false` | `true` | Auto-activate only, no slash command |
|
|
33
|
+
| `false` | `false` | Never runs — avoid this combination |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Variables
|
|
38
|
+
|
|
39
|
+
Replaced at invocation time before Claude sees the content.
|
|
40
|
+
|
|
41
|
+
| Variable | Description |
|
|
42
|
+
|----------|-------------|
|
|
43
|
+
| `$ARGUMENTS` | Everything after `/command`. Empty if no arguments. |
|
|
44
|
+
| `$0` | Alias for `$ARGUMENTS` |
|
|
45
|
+
| `${CLAUDE_SKILL_DIR}` | Absolute path to skill directory. Use for referencing supporting files. |
|
|
46
|
+
| `${CLAUDE_SESSION_ID}` | Unique ID for current Claude Code session. |
|
|
47
|
+
|
|
48
|
+
**Usage in SKILL.md:**
|
|
49
|
+
```markdown
|
|
50
|
+
The user wants: $ARGUMENTS
|
|
51
|
+
Read `${CLAUDE_SKILL_DIR}/reference.md` for details.
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Shell Injection
|
|
57
|
+
|
|
58
|
+
Embed live command output using `` !`command` `` syntax:
|
|
59
|
+
|
|
60
|
+
```markdown
|
|
61
|
+
Current branch: !`git branch --show-current`
|
|
62
|
+
Node version: !`node --version`
|
|
63
|
+
Changed files: !`git diff main --name-only`
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**How it works:**
|
|
67
|
+
- Commands execute when skill activates (not at definition time)
|
|
68
|
+
- Output replaces the `` !`command` `` inline
|
|
69
|
+
- Commands run in current working directory
|
|
70
|
+
- Keep commands fast — slow commands delay skill activation
|
|
71
|
+
- Don't use for side effects — skill content is for context, not execution
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Skill Type Patterns
|
|
76
|
+
|
|
77
|
+
### Task Skill (side effects)
|
|
78
|
+
|
|
79
|
+
Performs actions — deploy, commit, publish. Use `auto-activate: false` for destructive operations.
|
|
80
|
+
|
|
81
|
+
```yaml
|
|
82
|
+
---
|
|
83
|
+
name: deploy
|
|
84
|
+
description: Deploy application to production or staging. Use when user wants to deploy, ship, release.
|
|
85
|
+
argument-hint: [environment: staging|production]
|
|
86
|
+
auto-activate: false
|
|
87
|
+
---
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Research Skill (information gathering)
|
|
91
|
+
|
|
92
|
+
Gathers and synthesizes information. Uses Agent subagents for parallel research.
|
|
93
|
+
|
|
94
|
+
```yaml
|
|
95
|
+
---
|
|
96
|
+
name: deep-research
|
|
97
|
+
description: Perform deep research on a topic using web search and analysis.
|
|
98
|
+
argument-hint: [topic or question to research]
|
|
99
|
+
---
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Knowledge Skill (pure reference)
|
|
103
|
+
|
|
104
|
+
Provides reference context. Auto-activates when relevant, no slash command needed.
|
|
105
|
+
|
|
106
|
+
```yaml
|
|
107
|
+
---
|
|
108
|
+
name: api-conventions
|
|
109
|
+
description: API design conventions for this project. Use when writing API endpoints or reviewing API code.
|
|
110
|
+
user-invocable: false
|
|
111
|
+
---
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Dynamic Context Skill (live state)
|
|
115
|
+
|
|
116
|
+
Uses shell injection to inject current project state.
|
|
117
|
+
|
|
118
|
+
```markdown
|
|
119
|
+
Branch: !`git branch --show-current`
|
|
120
|
+
Changed files: !`git diff main --name-only`
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## File Structure & Loading
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
skills/my-skill/
|
|
129
|
+
├── SKILL.md # Required — loaded on activation
|
|
130
|
+
├── reference.md # Optional — read on-demand via ${CLAUDE_SKILL_DIR}
|
|
131
|
+
├── examples.md # Optional — read on-demand
|
|
132
|
+
└── scripts/ # Optional — bundled scripts, never auto-loaded
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Loading behavior:**
|
|
136
|
+
- **SKILL.md**: Always loaded when skill activates
|
|
137
|
+
- **Supporting `.md` files**: NOT auto-loaded. Only read when SKILL.md references them via `${CLAUDE_SKILL_DIR}`
|
|
138
|
+
- **Scripts**: Available on disk, never auto-loaded
|
|
139
|
+
|
|
140
|
+
This means: keep SKILL.md focused (under 300 lines), put detailed references in separate files that load lazily.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Skill Quality Checklist
|
|
145
|
+
|
|
146
|
+
1. **Name**: kebab-case, matches directory name
|
|
147
|
+
2. **Description**: includes trigger phrases Claude can match against
|
|
148
|
+
3. **SKILL.md under 300 lines**: move details to reference files
|
|
149
|
+
4. **Supporting files referenced via `${CLAUDE_SKILL_DIR}`**: never hardcode paths
|
|
150
|
+
5. **`$ARGUMENTS` used for user input**: contains everything after slash command
|
|
151
|
+
6. **One skill per concern**: don't bundle unrelated functionality
|
|
152
|
+
7. **Templates are minimal**: show patterns, not complete applications
|
|
153
|
+
8. **Tool restrictions only when safety-critical**: don't over-constrain
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Anti-Patterns
|
|
158
|
+
|
|
159
|
+
| Don't | Do Instead |
|
|
160
|
+
|-------|-----------|
|
|
161
|
+
| Giant monolith SKILL.md (>300 lines) | Split into supporting reference files |
|
|
162
|
+
| Vague description ("Helps with stuff") | Action-oriented with trigger phrases |
|
|
163
|
+
| Hardcoded paths to supporting files | Use `${CLAUDE_SKILL_DIR}` |
|
|
164
|
+
| Over-engineering frontmatter | Most skills only need name + description |
|
|
165
|
+
| Duplicating built-in Claude behavior | Only create skills for project-specific patterns |
|
|
166
|
+
| Missing argument-hint | Users won't know what to type after `/command` |
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Rune-Specific Conventions
|
|
171
|
+
|
|
172
|
+
When creating Rune skills (vs generic Claude Code skills):
|
|
173
|
+
|
|
174
|
+
| Field | Rune Convention |
|
|
175
|
+
|-------|----------------|
|
|
176
|
+
| Frontmatter | Add `metadata:` block with author, version, layer, model, group, tools |
|
|
177
|
+
| Layer | L0 (router), L1 (orchestrator), L2 (workflow), L3 (utility), L4 (extension pack) |
|
|
178
|
+
| Connections | Document `Calls` (outbound) and `Called By` (inbound) sections |
|
|
179
|
+
| Model | haiku (scan), sonnet (code), opus (architecture) |
|
|
180
|
+
| Version | semver — bump on enrichment |
|
|
181
|
+
| References | Store in `references/` subdirectory |
|
|
182
|
+
| Cross-references | Use `rune:skill-name` syntax |
|