@rune-kit/rune 2.2.4 → 2.2.6

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.
@@ -0,0 +1,314 @@
1
+ ---
2
+ name: retro
3
+ description: Engineering retrospective. Analyzes commit history, work patterns, and code quality metrics with trend tracking. Per-person breakdowns, shipping streaks, and actionable improvements. Use when asked for "retro", "weekly review", "what did we ship", or "engineering retrospective".
4
+ metadata:
5
+ author: runedev
6
+ version: "0.1.0"
7
+ layer: L2
8
+ model: sonnet
9
+ group: knowledge
10
+ tools: "Read, Bash, Glob, Grep"
11
+ ---
12
+
13
+ # retro
14
+
15
+ ## Purpose
16
+
17
+ Engineering retrospective engine. Analyzes git history, work patterns, and code quality signals to produce actionable retrospectives with per-person breakdowns, shipping streaks, and concrete improvement habits. Fills a gap in the Rune ecosystem — cook builds, review checks, but nothing reflects on HOW the team works.
18
+
19
+ <HARD-GATE>
20
+ Retro is READ-ONLY. It analyzes and reports — it does NOT modify code, create PRs, or change any files except its own output artifacts (.rune/retros/).
21
+ Retro is ENCOURAGING but CANDID. Every critique is anchored in specific commits, not vague impressions.
22
+ </HARD-GATE>
23
+
24
+ ## Triggers
25
+
26
+ - `/rune retro` — default 7-day retrospective
27
+ - `/rune retro 24h` — daily standup review
28
+ - `/rune retro 14d` — sprint retro (2 weeks)
29
+ - `/rune retro 30d` — monthly review
30
+ - `/rune retro compare` — current vs previous period side-by-side
31
+ - Called by `audit` (L2) for engineering health dimension
32
+ - Auto-suggest: end of work week (Friday sessions)
33
+
34
+ ## Calls (outbound)
35
+
36
+ - `scout` (L2): scan codebase for test file counts, project structure
37
+ - `neural-memory` (L3): recall past retro insights for trend comparison
38
+
39
+ ## Called By (inbound)
40
+
41
+ - `audit` (L2): engineering velocity and health dimension
42
+ - `cook` (L1): optional — after completing a multi-phase feature, suggest retro
43
+ - User: `/rune retro` direct invocation
44
+
45
+ ## Data Flow
46
+
47
+ ### Feeds Into →
48
+
49
+ - `plan` (L2): retro insights inform future sprint planning (e.g., "fix ratio too high → allocate debugging time")
50
+ - `journal` (L3): retro findings → ADR entries for team patterns
51
+ - `neural-memory` (external): retro insights → persistent cross-session memory
52
+
53
+ ### Fed By ←
54
+
55
+ - `git` history: commits, authors, timestamps, file changes
56
+ - `.rune/retros/` history: previous retro JSON for trend comparison
57
+ - `neural-memory` (external): past retro insights for pattern recognition
58
+
59
+ ### Feedback Loops ↻
60
+
61
+ - `retro` ↔ `plan`: retro identifies bottlenecks → plan adjusts estimation and phase sizing → next retro measures improvement
62
+
63
+ ## Execution
64
+
65
+ ### Step 1 — Gather Raw Data
66
+
67
+ Run these git commands to collect metrics for the specified time window:
68
+
69
+ ```bash
70
+ # Core metrics (run in parallel)
71
+ git log --since="<window-start>" --format="%H|%an|%ae|%aI|%s" --shortstat
72
+ git log --since="<window-start>" --format="%H" --numstat
73
+ git log --since="<window-start>" --format="%aI" # timestamps for session detection
74
+ git log --since="<window-start>" --format="%an" | sort | uniq -c | sort -rn # per-author
75
+ git shortlog --since="<window-start>" -sn # author leaderboard
76
+ ```
77
+
78
+ **Time window alignment**: For day/week units, align to midnight: `--since="YYYY-MM-DDT00:00:00"`. This prevents partial-day skew.
79
+
80
+ **Identify "You"**: `git config user.name` = current user. All others are teammates.
81
+
82
+ Also gather:
83
+ - Test file count: `find . -name "*.test.*" -o -name "*.spec.*" -o -name "*_test.*" | wc -l`
84
+ - `.rune/retros/` for prior retro history (if exists)
85
+ - TODOS.md for backlog health
86
+
87
+ ### Step 2 — Compute Summary Metrics
88
+
89
+ | Metric | How to compute |
90
+ |--------|---------------|
91
+ | Commits | Count from git log |
92
+ | Contributors | Unique authors |
93
+ | LOC added/removed | Sum from numstat |
94
+ | Test LOC ratio | test files LOC / total LOC changed |
95
+ | Active days | Unique dates with commits |
96
+ | Sessions | Detected via 45-min gap threshold (Step 4) |
97
+ | LOC/session-hour | Total LOC / total session hours |
98
+ | Fix ratio | `fix:` commits / total commits |
99
+
100
+ ### Step 3 — Hourly Activity Histogram
101
+
102
+ Build an ASCII bar chart showing commit distribution by hour (local timezone):
103
+
104
+ ```
105
+ Hour Commits
106
+ 06 ██ 3
107
+ 07 ████ 7
108
+ 08 ██████ 12
109
+ ...
110
+ ```
111
+
112
+ Identify: peak hours, dead zones, bimodal patterns (morning + evening coder).
113
+
114
+ ### Step 4 — Session Detection
115
+
116
+ Group commits into sessions using a **45-minute gap threshold**:
117
+
118
+ - Commits within 45 min of each other = same session
119
+ - Gap > 45 min = new session
120
+
121
+ Classify sessions:
122
+ - **Deep** (50+ min): focused work blocks
123
+ - **Medium** (20-50 min): moderate focus
124
+ - **Micro** (<20 min): quick fixes, drive-bys
125
+
126
+ ### Step 5 — Commit Type Breakdown
127
+
128
+ Parse conventional commit prefixes and show percentage bar:
129
+
130
+ ```
131
+ feat ████████████████ 45%
132
+ fix ████████ 22%
133
+ ref ████ 11%
134
+ test ████ 11%
135
+ docs ██ 5%
136
+ chore██ 6%
137
+ ```
138
+
139
+ **Flag**: if `fix` ratio > 50% → "High fix ratio suggests reactive mode. Consider investing in test coverage."
140
+
141
+ ### Step 6 — Hotspot Analysis
142
+
143
+ Top 10 most-changed files in the window:
144
+
145
+ | File | Changes | Test Coverage |
146
+ |------|---------|--------------|
147
+ | src/auth/login.ts | 8 | ✅ |
148
+ | src/api/users.ts | 6 | ❌ |
149
+
150
+ **Flag**: files with 5+ changes = **churn hotspot** — candidate for refactoring.
151
+ **Flag**: hotspot files without test coverage = **risk**.
152
+
153
+ ### Step 7 — Focus Score & Ship of the Week
154
+
155
+ - **Focus Score** = % of commits in top-changed directory. High focus (>60%) = deep work. Low focus (<30%) = context switching.
156
+ - **Ship of the Week** = highest-LOC commit/PR with feat: prefix. Celebrate it.
157
+
158
+ ### Step 8 — Per-Person Breakdown
159
+
160
+ For each contributor:
161
+
162
+ **Current user (deepest treatment):**
163
+ - Commits, LOC, areas of focus
164
+ - Commit type mix (builder vs fixer vs maintainer)
165
+ - Session patterns (deep vs micro ratio)
166
+ - Test discipline (% of feat commits with corresponding test commits)
167
+ - Biggest ship
168
+
169
+ **Teammates (2-3 sentences each):**
170
+ - Summary of work areas and volume
171
+ - **Specific praise** — anchored in actual commits (e.g., "Your auth refactor in 3 commits was surgically clean")
172
+ - **One growth opportunity** — constructive, based on patterns (e.g., "8 of 12 commits were fixes — consider adding tests alongside features")
173
+
174
+ ### Step 9 — Trend Tracking (if prior retros exist)
175
+
176
+ Read most recent `.rune/retros/*.json`. Compute deltas:
177
+
178
+ | Metric | Previous | Current | Delta |
179
+ |--------|----------|---------|-------|
180
+ | Commits | 45 | 52 | +15% ↑ |
181
+ | Test ratio | 0.18 | 0.24 | +33% ↑ |
182
+ | Fix ratio | 0.55 | 0.38 | -31% ↓ (improving) |
183
+ | Deep sessions | 8 | 12 | +50% ↑ |
184
+
185
+ ### Step 10 — Shipping Streak
186
+
187
+ Query full history for consecutive days with at least 1 commit:
188
+ - **Team streak**: any contributor committed
189
+ - **Personal streak**: current user committed
190
+
191
+ ### Step 11 — Save Retro History
192
+
193
+ Write JSON snapshot to `.rune/retros/{YYYY-MM-DD}.json`:
194
+
195
+ ```json
196
+ {
197
+ "date": "2026-03-20",
198
+ "window": "7d",
199
+ "metrics": {
200
+ "commits": 52, "contributors": 3, "loc_added": 1850,
201
+ "loc_removed": 620, "test_ratio": 0.24, "fix_ratio": 0.38,
202
+ "active_days": 5, "sessions": 14, "deep_sessions": 8
203
+ },
204
+ "authors": ["user1", "user2"],
205
+ "streak": { "team": 12, "personal": 5 },
206
+ "summary": "Shipped auth overhaul + 3 bug fixes. Test ratio improving."
207
+ }
208
+ ```
209
+
210
+ ### Step 12 — Write Narrative Report
211
+
212
+ Structure (~800-1500 words — concise, not a novel):
213
+
214
+ 1. **Tweetable summary** (1 sentence, <280 chars)
215
+ 2. **Summary table** (Step 2 metrics)
216
+ 3. **Time & session patterns** (Steps 3-4)
217
+ 4. **Shipping velocity** (Step 5 commit types)
218
+ 5. **Code quality signals** (Step 6 hotspots, test ratio)
219
+ 6. **Focus & highlights** (Step 7)
220
+ 7. **Your week** (current user deep dive from Step 8)
221
+ 8. **Team breakdown** (Step 8 teammates)
222
+ 9. **Top 3 wins** (specific, anchored in commits)
223
+ 10. **3 things to improve** (specific, actionable)
224
+ 11. **3 habits for next week** (concrete daily practices)
225
+ 12. **Trends** (Step 9, if available)
226
+
227
+ **Tone**: Encouraging but candid. Specific and concrete. Anchored in actual commits, not vague impressions. Every critique paired with a specific suggestion.
228
+
229
+ ## Compare Mode
230
+
231
+ When invoked as `/rune retro compare`:
232
+
233
+ 1. Compute current period metrics (same as above)
234
+ 2. Compute previous same-length period (e.g., if current = 7d, previous = 7d before that)
235
+ 3. Side-by-side delta table
236
+ 4. Highlight biggest improvements and regressions
237
+ 5. Save only current-period snapshot
238
+
239
+ ## Self-Validation
240
+
241
+ ```
242
+ SELF-VALIDATION (run before emitting report):
243
+ - [ ] All metrics computed from actual git data — no assumptions or estimates
244
+ - [ ] Per-person praise is anchored in specific commits (not generic "great work")
245
+ - [ ] Improvement suggestions are actionable (not "write more tests" but "add tests for the 3 hotspot files without coverage")
246
+ - [ ] Retro JSON saved to .rune/retros/ for trend tracking
247
+ - [ ] No code was modified — retro is read-only
248
+ ```
249
+
250
+ ## Constraints
251
+
252
+ 1. MUST NOT modify any code — retro is read-only analysis
253
+ 2. MUST anchor all observations in specific commits — no vague impressions
254
+ 3. MUST include per-person breakdown for teams with 2+ contributors
255
+ 4. MUST save JSON snapshot for trend tracking across retros
256
+ 5. MUST flag churn hotspots (5+ changes to same file)
257
+ 6. MUST flag high fix ratio (>50%) as reactive mode signal
258
+ 7. MUST include actionable habits — "test the hotspots" not "write more tests"
259
+
260
+ ## Sharp Edges
261
+
262
+ | Failure Mode | Severity | Mitigation |
263
+ |---|---|---|
264
+ | Generic praise not anchored in commits | HIGH | Every praise MUST reference a specific commit or PR — "great auth refactor in 3 commits" not "good job this week" |
265
+ | Vague improvement suggestions | HIGH | "Add tests for src/api/users.ts (6 changes, 0 tests)" not "consider writing more tests" |
266
+ | Counting merge commits as real work | MEDIUM | Use `--no-merges` flag to exclude merge commits from metrics |
267
+ | Timezone skew in hourly histogram | MEDIUM | Convert all timestamps to local timezone before bucketing |
268
+ | Retro on empty window (no commits) | LOW | Detect early and report: "No commits in the last {window}. Nothing to retro." |
269
+ | Discouraging tone for struggling weeks | HIGH | Even bad weeks have wins. Find the smallest positive signal and lead with it |
270
+
271
+ ## Output Format
272
+
273
+ ```
274
+ ## Engineering Retro: [date range]
275
+
276
+ > [tweetable summary]
277
+
278
+ ### Summary
279
+ | Metric | Value |
280
+ |--------|-------|
281
+ | Commits | N |
282
+ | ... | ... |
283
+
284
+ ### [remaining sections per Step 12]
285
+
286
+ ### Top 3 Wins
287
+ 1. [specific win anchored in commit]
288
+ 2. [specific win]
289
+ 3. [specific win]
290
+
291
+ ### 3 Things to Improve
292
+ 1. [specific, actionable]
293
+ 2. [specific, actionable]
294
+ 3. [specific, actionable]
295
+
296
+ ### 3 Habits for Next Week
297
+ 1. [concrete daily practice]
298
+ 2. [concrete daily practice]
299
+ 3. [concrete daily practice]
300
+ ```
301
+
302
+ ## Done When
303
+
304
+ - All git metrics gathered for specified time window
305
+ - Summary metrics computed (commits, LOC, test ratio, fix ratio, sessions)
306
+ - Per-person breakdown with specific praise and growth areas
307
+ - Top 3 wins and 3 improvements identified (commit-anchored)
308
+ - Retro JSON saved to `.rune/retros/` for trend tracking
309
+ - Narrative report emitted
310
+ - No code was modified
311
+
312
+ ## Cost Profile
313
+
314
+ ~3000-5000 tokens input (git history parsing), ~2000-4000 tokens output (narrative). Sonnet for analysis quality. Runs infrequently (weekly/sprint cadence).
@@ -3,7 +3,7 @@ name: sentinel
3
3
  description: Automated security gatekeeper. Blocks unsafe code before commit — secret scanning, OWASP top 10, dependency audit, permission checks. A GATE, not a suggestion.
4
4
  metadata:
5
5
  author: runedev
6
- version: "0.2.0"
6
+ version: "0.4.0"
7
7
  layer: L2
8
8
  model: sonnet
9
9
  group: quality
@@ -150,14 +150,43 @@ app.post('/users', async (req, res) => {
150
150
  });
151
151
  ```
152
152
 
153
- ### Step 4 — Permission Check
154
- Use `Grep` to scan for:
153
+ ### Step 4 — Destructive Command Guard
154
+
155
+ Scan for destructive operations in code AND detect real-time destructive commands during agent execution.
156
+
157
+ **4a. Static scan** — Use `Grep` to scan changed files for:
155
158
  - Destructive shell commands in scripts: `rm -rf /`, `DROP TABLE`, `DELETE FROM` without `WHERE`, `TRUNCATE`
156
159
  - File operations using absolute paths outside the project root (e.g., `/etc/`, `/usr/`, `C:\Windows\`)
157
160
  - Direct production database connection strings (e.g., `prod`, `production` in DB host names)
158
161
 
159
162
  Destructive command on production path = **BLOCK**. Suspicious path = **WARN**.
160
163
 
164
+ **4b. Real-Time Command Guard** (advisory for agent workflows)
165
+
166
+ When sentinel is invoked by `cook` or `fix`, include this destructive command pattern table in the report. Any skill executing Bash commands SHOULD check against these patterns before execution:
167
+
168
+ | Pattern | Risk | Action |
169
+ |---------|------|--------|
170
+ | `rm -rf` / `rm -r` / `rm --recursive` | Recursive delete | WARN — confirm target is expected |
171
+ | `DROP TABLE` / `DROP DATABASE` / `TRUNCATE` | Data loss | BLOCK — require explicit confirmation |
172
+ | `git push --force` / `git push -f` | History rewrite | WARN — confirm branch is correct |
173
+ | `git reset --hard` | Uncommitted work loss | WARN — verify no unsaved changes |
174
+ | `git checkout .` / `git restore .` | Working tree wipe | WARN — verify intent |
175
+ | `kubectl delete` / `docker system prune` | Production impact | BLOCK — require namespace/context confirmation |
176
+ | `chmod 777` / `chmod -R 777` | Permission escalation | WARN — almost never correct |
177
+
178
+ **Safe exceptions** (do NOT warn):
179
+ - `rm -rf node_modules`, `.next`, `dist`, `__pycache__`, `.cache`, `build`, `.turbo`, `coverage`, `target`
180
+ - `git push --force-with-lease` (safe force push)
181
+ - `docker rm` on explicitly named test containers
182
+
183
+ **Composable modes** (future — advisory only for now):
184
+ - **Careful mode**: warn before any destructive command (all patterns above)
185
+ - **Freeze mode**: restrict file edits to a specific directory (scope lock)
186
+ - **Guard mode**: careful + freeze combined
187
+
188
+ > Source: garrytan/gstack v0.9.0 (careful/freeze/guard skills) — real-time command safety, composable with edit scope lock.
189
+
161
190
  ### Step 4.5 — Framework-Specific Security Patterns
162
191
 
163
192
  Apply only if the framework is detected in changed files:
@@ -265,6 +294,78 @@ Silent continuation past WARN = VIOLATION.
265
294
  The calling skill (cook) must present WARNs and wait for acknowledgment.
266
295
  ```
267
296
 
297
+ ### Step 5 — Domain Hook Templates
298
+
299
+ Generate domain-specific pre-commit hook scripts when requested. These hooks run as git pre-commit hooks and enforce domain-level quality gates BEFORE code enters the repository.
300
+
301
+ #### Hook Architecture
302
+
303
+ ```
304
+ hooks/
305
+ ├── pre-commit-security.sh # Always — secret scan, OWASP basics (generated by sentinel)
306
+ ├── pre-commit-<domain>.sh # Domain-specific — generated on request
307
+ └── validate-<domain>.py # Complex validation scripts (Python for portability)
308
+ ```
309
+
310
+ #### Hook Generation Rules
311
+
312
+ 1. **Exit 0 if no relevant files staged** — prevents false positives when committing unrelated changes
313
+ 2. **ERRORS block commit** (exit 1) — critical violations that must be fixed
314
+ 3. **WARNINGS alert but allow** (exit 0 with stderr) — non-critical issues the developer should review
315
+ 4. **List specific files and line numbers** — actionable output, not vague warnings
316
+ 5. **Fast execution** (<5 seconds) — hooks that slow down commits get disabled by developers
317
+
318
+ #### Domain Hook Template
319
+
320
+ ```bash
321
+ #!/usr/bin/env bash
322
+ # Pre-commit hook: <domain> quality gate
323
+ # Generated by rune:sentinel — do not edit manually
324
+
325
+ STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM)
326
+ DOMAIN_FILES=$(echo "$STAGED_FILES" | grep -E '<file-pattern>')
327
+
328
+ # Exit early if no relevant files staged
329
+ if [ -z "$DOMAIN_FILES" ]; then
330
+ exit 0
331
+ fi
332
+
333
+ ERRORS=0
334
+ WARNINGS=0
335
+
336
+ for file in $DOMAIN_FILES; do
337
+ # ERROR checks (block commit)
338
+ # <domain-specific-error-patterns>
339
+
340
+ # WARNING checks (alert only)
341
+ # <domain-specific-warning-patterns>
342
+ done
343
+
344
+ if [ $ERRORS -gt 0 ]; then
345
+ echo "❌ $ERRORS error(s) found — commit blocked. Fix before retrying."
346
+ exit 1
347
+ fi
348
+
349
+ if [ $WARNINGS -gt 0 ]; then
350
+ echo "⚠️ $WARNINGS warning(s) found — review recommended."
351
+ fi
352
+
353
+ exit 0
354
+ ```
355
+
356
+ #### Built-in Domain Hook Patterns
357
+
358
+ | Domain | File Pattern | ERROR Checks | WARNING Checks |
359
+ |--------|-------------|-------------|----------------|
360
+ | **Schema/API** | `*.graphql`, `*.proto`, `openapi.*` | Breaking field removal, type changes | Deprecated field usage |
361
+ | **Database** | `migrations/*.sql`, `*.migration.*` | DROP TABLE without backup, DELETE without WHERE | Missing rollback script |
362
+ | **Config** | `*.env*`, `*config*`, `tsconfig*` | Secrets in config, strict mode disabled | New env var without docs |
363
+ | **Dependencies** | `package.json`, `requirements.txt`, `Cargo.toml` | Known vulnerable version pinned | Major version bump without changelog |
364
+ | **Legal/Compliance** | `docs/policies/*`, `PRIVACY*`, `TERMS*` | Placeholder text ([Company Name], [Date]) | Review date >12 months old |
365
+ | **Financial** | `**/invoice*`, `**/billing*`, `**/payment*` | Hardcoded prices/rates, missing decimal precision | Currency without locale formatting |
366
+
367
+ When a pack or skill requests domain hooks (via `sentinel` integration), generate the appropriate hook script using the template above, customized with domain-specific patterns.
368
+
268
369
  ## Output Format
269
370
 
270
371
  ```
@@ -306,6 +407,10 @@ BLOCKED — 2 critical findings must be resolved before commit.
306
407
  | Dependency audit tool missing → silently skipped | LOW | Report INFO "tool not found, skipping" — never skip silently |
307
408
  | Stopping after first BLOCK without aggregating all findings | MEDIUM | Complete ALL steps, aggregate ALL findings, then report — developer needs the full list |
308
409
  | Missing agentic security scan when .rune/ exists | HIGH | Step 4.7 is mandatory when .rune/ directory detected — never skip |
410
+ | Domain hook too slow (>5s) → developers disable it | MEDIUM | Keep hooks fast — grep-based patterns only, no network calls. Complex validation goes in CI, not pre-commit |
411
+ | Domain hook blocks on test fixtures / mock data | MEDIUM | Check file path context — `test/`, `fixtures/`, `__mocks__/` directories get relaxed rules |
412
+ | Agent runs destructive command without checking pattern table | HIGH | Step 4b: real-time command guard patterns MUST be checked before Bash execution. Safe exceptions prevent false positives on `rm -rf node_modules` |
413
+ | False positive on `rm -rf` in build cleanup scripts | MEDIUM | Safe exceptions list (node_modules, dist, .next, etc.) — build cleanup is NOT destructive |
309
414
 
310
415
  ## Done When
311
416
 
@@ -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.2.0"
6
+ version: "1.4.0"
7
7
  layer: L2
8
8
  model: opus
9
9
  group: creation
@@ -97,11 +97,13 @@ Follow `docs/SKILL-TEMPLATE.md` format. Required sections:
97
97
  | Frontmatter | YES | Name, description, metadata |
98
98
  | Purpose | YES | One paragraph, ecosystem role |
99
99
  | Triggers | YES | When to invoke |
100
- | Calls / Called By | YES | Mesh connections |
100
+ | Calls / Called By | YES | Mesh connections (control flow) |
101
+ | Data Flow | YES | Feeds Into / Fed By / Feedback Loops (data flow) |
101
102
  | Workflow | YES | Step-by-step execution |
102
103
  | Output Format | YES | Structured, parseable output |
103
104
  | Constraints | YES | 3-7 MUST/MUST NOT rules |
104
105
  | Sharp Edges | YES | Known failure modes |
106
+ | Self-Validation | YES | Domain-specific QA checklist (per-skill, not centralized) |
105
107
  | Done When | YES | Verifiable completion criteria |
106
108
  | Cost Profile | YES | Token estimate |
107
109
  | Mesh Gates | L1/L2 only | Progression guards |
@@ -277,7 +279,72 @@ Wire the skill into the mesh:
277
279
  1. **Update `docs/ARCHITECTURE.md`** — add to correct layer/group table
278
280
  2. **Update `CLAUDE.md`** — increment skill count, add to layer list
279
281
  3. **Add mesh connections** — update SKILL.md of skills that should call/be called by this one
280
- 4. **Verify no conflicts** — new skill's output format compatible with consumers?
282
+ 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
283
+ 5. **Write Self-Validation** — 3-5 domain-specific checks unique to this skill's output. Ask: "What quality issues can ONLY this skill catch?"
284
+ 6. **Verify no conflicts** — new skill's output format compatible with consumers?
285
+
286
+ ### Phase 6.5 — EXTENSION AUTHORING (if building an extension, not a skill)
287
+
288
+ 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.
289
+
290
+ #### Extension vs Skill vs Pack
291
+
292
+ | Concept | Purpose | Modifies Core? | Self-contained? |
293
+ |---------|---------|----------------|-----------------|
294
+ | **Skill** | Standalone workflow unit (SKILL.md) | N/A — IS core | Yes |
295
+ | **Pack** | Domain bundle of skills (PACK.md) | No — bundles existing | Yes |
296
+ | **Extension** | Augments existing skill with new capability | No — additive only | Yes — own dir with install/uninstall |
297
+
298
+ #### Extension Directory Structure
299
+
300
+ ```
301
+ extensions/<extension-name>/
302
+ ├── EXTENSION.md # Manifest: what it extends, how, dependencies
303
+ ├── install.sh # Unix installer (non-destructive MCP merge)
304
+ ├── install.ps1 # Windows installer
305
+ ├── uninstall.sh # Clean removal
306
+ ├── uninstall.ps1 # Clean removal (Windows)
307
+ ├── skills/
308
+ │ └── <skill-name>/
309
+ │ └── SKILL.md # New skill added by extension
310
+ ├── agents/ # Optional subagent definitions
311
+ │ └── <agent-name>.md
312
+ ├── references/ # Domain knowledge loaded by extension skills
313
+ │ └── <topic>.md
314
+ ├── scripts/ # Executable utilities
315
+ │ └── <script>.py|.sh
316
+ └── docs/
317
+ └── SETUP.md # Extension-specific configuration guide
318
+ ```
319
+
320
+ #### EXTENSION.md Manifest
321
+
322
+ ```yaml
323
+ ---
324
+ name: "<extension-name>"
325
+ extends: "<target-skill-or-pack>"
326
+ description: "What capability this extension adds"
327
+ requires:
328
+ - mcp: "<mcp-server-name>" # Optional: MCP server dependency
329
+ - skill: "<required-skill-name>" # Required core skill
330
+ install_method: "non-destructive" # MUST be non-destructive
331
+ ---
332
+ ```
333
+
334
+ #### Extension Rules
335
+
336
+ 1. **Non-destructive install** — extension MUST NOT modify existing skill files. It adds new files alongside.
337
+ 2. **Self-contained** — removing the extension directory restores the system to its pre-install state.
338
+ 3. **MCP merge** — if the extension adds MCP tools, install script MUST merge into settings.json without overwriting existing entries.
339
+ 4. **Fallback graceful** — if the MCP server or external dependency is unavailable, the extension skill MUST degrade gracefully (report unavailability, don't crash).
340
+ 5. **Cost awareness** — if the extension calls paid APIs, the extension skill MUST warn before expensive operations and track usage.
341
+ 6. **Pre-flight check** — extension skill Step 1 MUST verify dependencies are available before executing.
342
+
343
+ #### When to Build an Extension (vs a Skill or Pack)
344
+
345
+ - Build an **extension** when: the capability requires an external API/MCP, is optional, and augments an existing skill
346
+ - Build a **skill** when: the capability is self-contained and fits a layer in the mesh
347
+ - Build a **pack** when: you're bundling multiple related skills for a domain
281
348
 
282
349
  ### Phase 7 — SHIP
283
350
 
@@ -302,6 +369,8 @@ git commit -m "feat: add [skill-name] — [one-line purpose]"
302
369
  - [ ] At least one observed failure documented
303
370
  - [ ] Anti-rationalization table from real test failures
304
371
  - [ ] Mesh connections bidirectional (calls AND called-by both updated)
372
+ - [ ] Data flow mapped (Feeds Into / Fed By / Feedback Loops)
373
+ - [ ] Self-Validation has 3-5 domain-specific checks (not generic)
305
374
  - [ ] Output format is structured and parseable by other skills
306
375
 
307
376
  **Architecture:**
@@ -311,6 +380,14 @@ git commit -m "feat: add [skill-name] — [one-line purpose]"
311
380
  - [ ] ARCHITECTURE.md updated
312
381
  - [ ] CLAUDE.md updated
313
382
 
383
+ **Extension-specific (if building an extension):**
384
+ - [ ] EXTENSION.md manifest present with extends, requires, install_method
385
+ - [ ] install.sh + install.ps1 tested (non-destructive merge)
386
+ - [ ] uninstall.sh + uninstall.ps1 tested (clean removal)
387
+ - [ ] Extension skill has dependency pre-flight check (Step 1)
388
+ - [ ] Fallback behavior documented when external dependency unavailable
389
+ - [ ] Cost warning present if extension calls paid APIs
390
+
314
391
  ## Adapting Existing Skills
315
392
 
316
393
  When editing, not creating:
@@ -368,6 +445,8 @@ Techniques:
368
445
  ### Mesh Impact
369
446
  - New connections: [count] ([list of skills])
370
447
  - Bidirectional check: PASS | FAIL
448
+ - Data flow mapped: [count] feeds-into, [count] fed-by, [count] feedback loops
449
+ - Self-Validation: [count] domain-specific checks written
371
450
  ```
372
451
 
373
452
  ## Constraints
@@ -393,6 +472,9 @@ Techniques:
393
472
  | Code blocks in SKILL.md bloat every invocation | HIGH | WHY vs HOW split: SKILL.md ≤10-line code blocks, extract rest to references/ |
394
473
  | 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) |
395
474
  | 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 |
475
+ | 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 |
476
+ | 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 |
477
+ | 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 |
396
478
 
397
479
  ## Done When
398
480