@rune-kit/rune 2.7.0 → 2.10.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.
Files changed (123) hide show
  1. package/README.md +78 -41
  2. package/agents/adversary.md +27 -0
  3. package/agents/architect.md +19 -29
  4. package/agents/asset-creator.md +18 -4
  5. package/agents/audit.md +25 -4
  6. package/agents/autopsy.md +19 -4
  7. package/agents/ba.md +35 -0
  8. package/agents/brainstorm.md +31 -4
  9. package/agents/browser-pilot.md +21 -4
  10. package/agents/coder.md +21 -29
  11. package/agents/completion-gate.md +20 -4
  12. package/agents/constraint-check.md +18 -4
  13. package/agents/context-engine.md +22 -4
  14. package/agents/context-pack.md +32 -0
  15. package/agents/cook.md +41 -4
  16. package/agents/db.md +19 -4
  17. package/agents/debug.md +33 -4
  18. package/agents/dependency-doctor.md +20 -4
  19. package/agents/deploy.md +27 -4
  20. package/agents/design.md +22 -4
  21. package/agents/doc-processor.md +27 -0
  22. package/agents/docs-seeker.md +19 -4
  23. package/agents/docs.md +31 -0
  24. package/agents/fix.md +37 -4
  25. package/agents/git.md +29 -0
  26. package/agents/hallucination-guard.md +20 -4
  27. package/agents/incident.md +21 -4
  28. package/agents/integrity-check.md +18 -4
  29. package/agents/journal.md +19 -4
  30. package/agents/launch.md +32 -4
  31. package/agents/logic-guardian.md +26 -11
  32. package/agents/marketing.md +23 -4
  33. package/agents/mcp-builder.md +26 -0
  34. package/agents/neural-memory.md +30 -0
  35. package/agents/onboard.md +22 -4
  36. package/agents/perf.md +21 -4
  37. package/agents/plan.md +29 -4
  38. package/agents/preflight.md +22 -4
  39. package/agents/problem-solver.md +20 -4
  40. package/agents/rescue.md +23 -4
  41. package/agents/research.md +19 -4
  42. package/agents/researcher.md +19 -29
  43. package/agents/retro.md +32 -0
  44. package/agents/review-intake.md +20 -4
  45. package/agents/review.md +32 -4
  46. package/agents/reviewer.md +20 -28
  47. package/agents/safeguard.md +19 -4
  48. package/agents/sast.md +18 -4
  49. package/agents/scaffold.md +41 -0
  50. package/agents/scanner.md +19 -28
  51. package/agents/scope-guard.md +18 -4
  52. package/agents/scout.md +23 -4
  53. package/agents/sentinel-env.md +26 -0
  54. package/agents/sentinel.md +33 -4
  55. package/agents/sequential-thinking.md +20 -4
  56. package/agents/session-bridge.md +24 -4
  57. package/agents/skill-forge.md +22 -4
  58. package/agents/skill-router.md +26 -4
  59. package/agents/slides.md +24 -0
  60. package/agents/surgeon.md +19 -4
  61. package/agents/team.md +30 -4
  62. package/agents/test.md +36 -4
  63. package/agents/trend-scout.md +17 -4
  64. package/agents/verification.md +20 -4
  65. package/agents/video-creator.md +20 -4
  66. package/agents/watchdog.md +19 -4
  67. package/agents/worktree.md +17 -4
  68. package/compiler/__tests__/analytics.test.js +370 -0
  69. package/compiler/adapters/openclaw.js +2 -2
  70. package/compiler/analytics.js +385 -0
  71. package/compiler/bin/rune.js +68 -2
  72. package/compiler/dashboard.js +883 -0
  73. package/compiler/transforms/branding.js +1 -1
  74. package/extensions/ui/skills/animation-patterns.md +21 -0
  75. package/extensions/ui/skills/component-patterns.md +25 -0
  76. package/extensions/ui/skills/landing-patterns.md +1 -1
  77. package/hooks/context-watch/index.cjs +95 -68
  78. package/hooks/metrics-collector/index.cjs +86 -42
  79. package/hooks/post-session-reflect/index.cjs +41 -5
  80. package/hooks/session-start/index.cjs +8 -2
  81. package/package.json +2 -2
  82. package/skills/audit/SKILL.md +1 -0
  83. package/skills/autopsy/SKILL.md +78 -2
  84. package/skills/autopsy/references/repo-analysis-patterns.md +113 -0
  85. package/skills/ba/SKILL.md +72 -2
  86. package/skills/brainstorm/SKILL.md +1 -0
  87. package/skills/completion-gate/SKILL.md +26 -3
  88. package/skills/context-engine/SKILL.md +49 -1
  89. package/skills/cook/SKILL.md +72 -3
  90. package/skills/cook/references/output-format.md +33 -0
  91. package/skills/db/SKILL.md +1 -0
  92. package/skills/debug/SKILL.md +57 -1
  93. package/skills/deploy/SKILL.md +1 -1
  94. package/skills/design/SKILL.md +110 -3
  95. package/skills/docs/SKILL.md +2 -1
  96. package/skills/fix/SKILL.md +47 -1
  97. package/skills/graft/SKILL.md +352 -0
  98. package/skills/graft/references/challenge-framework.md +98 -0
  99. package/skills/graft/references/mode-decision.md +44 -0
  100. package/skills/incident/SKILL.md +2 -0
  101. package/skills/journal/SKILL.md +2 -0
  102. package/skills/launch/SKILL.md +2 -0
  103. package/skills/marketing/SKILL.md +46 -2
  104. package/skills/mcp-builder/SKILL.md +3 -1
  105. package/skills/mcp-builder/references/auto-discovery-pattern.md +169 -0
  106. package/skills/plan/SKILL.md +60 -4
  107. package/skills/plan/references/feature-map.md +84 -0
  108. package/skills/preflight/SKILL.md +20 -1
  109. package/skills/rescue/SKILL.md +25 -1
  110. package/skills/research/SKILL.md +24 -1
  111. package/skills/retro/SKILL.md +2 -0
  112. package/skills/review/SKILL.md +55 -2
  113. package/skills/scaffold/SKILL.md +1 -0
  114. package/skills/scope-guard/SKILL.md +35 -17
  115. package/skills/scout/SKILL.md +22 -1
  116. package/skills/sentinel/SKILL.md +29 -1
  117. package/skills/sentinel-env/SKILL.md +0 -2
  118. package/skills/session-bridge/SKILL.md +155 -9
  119. package/skills/skill-forge/SKILL.md +43 -1
  120. package/skills/skill-router/{skill.md → SKILL.md} +27 -2
  121. package/skills/team/SKILL.md +24 -1
  122. package/skills/test/SKILL.md +29 -2
  123. package/skills/verification/SKILL.md +1 -2
@@ -3,7 +3,7 @@ name: preflight
3
3
  description: Pre-commit quality gate that catches "almost right" code. Goes beyond linting — checks logic correctness, error handling, regressions, and completeness.
4
4
  metadata:
5
5
  author: runedev
6
- version: "0.7.0"
6
+ version: "0.8.0"
7
7
  layer: L2
8
8
  model: sonnet
9
9
  group: quality
@@ -208,6 +208,7 @@ If a domain hook flags BLOCK, the overall preflight verdict is BLOCK regardless
208
208
  | `openapi.*`, `*.graphql`, `*.proto` | API Contract | Breaking changes flagged, version bumped, deprecated fields documented |
209
209
  | `docs/policies/*`, `PRIVACY*`, `TERMS*` | Legal/Compliance | No placeholder text, review date current, practice matches policy |
210
210
  | `**/billing*`, `**/payment*`, `**/invoice*` | Financial | Decimal precision correct, currency locale-aware, no hardcoded rates |
211
+ | `*.tsx`, `*.jsx`, `*.svelte`, `*.vue`, `components/*` | UI/Frontend | Design token compliance, animation a11y, touch targets, visual hierarchy |
211
212
  | `skills/*/SKILL.md`, `extensions/*/PACK.md` | Rune Skill | Frontmatter valid, all required sections present, word count within layer budget |
212
213
  | `*.test.*`, `*.spec.*`, `__tests__/*` | Test Quality | No `.skip`/`.only` left in, assertions present (not empty tests), no hardcoded timeouts |
213
214
 
@@ -221,6 +222,24 @@ For each detected domain, run its checks on the relevant files in the diff:
221
222
  4. **Classify** findings: BLOCK (data loss risk, breaking contract) or WARN (best practice, incomplete)
222
223
  5. **Append** to preflight report under `### Domain Quality` section
223
224
 
225
+ #### UI/Frontend Domain Checks
226
+
227
+ When UI/Frontend hook is triggered, run these checks on all `.tsx`/`.jsx`/`.svelte`/`.vue` files in the diff:
228
+
229
+ | Check | What to Scan | Severity |
230
+ |-------|-------------|----------|
231
+ | **Design token compliance** | Hardcoded colors (`#fff`, `rgb(`, `hsl(`) instead of CSS variables or Tailwind tokens | WARN: "Hardcoded color at {file}:{line} — use design token" |
232
+ | **UI-SPEC drift** | If `.rune/ui-spec.md` exists, compare component decisions (card style, form layout, nav type) against spec | BLOCK: "Component at {file} uses bordered cards but UI-SPEC locks elevated cards" |
233
+ | **Animation accessibility** | Animations/transitions without `prefers-reduced-motion` guard | WARN: "Animation at {file}:{line} missing reduced-motion check" |
234
+ | **Touch target size** | Interactive elements with explicit small sizing (`w-5 h-5`, `p-0.5` on buttons/links) < 44×44px | WARN: "Touch target too small at {file}:{line}" |
235
+ | **Missing states** | Components fetching data without loading/error/empty states | WARN: "Async component at {file} missing [loading|error|empty] state" |
236
+ | **Icon accessibility** | Decorative icons without `aria-hidden="true"`, functional icons without `aria-label` | WARN: "Icon at {file}:{line} missing aria attribute" |
237
+ | **Inline styles** | `style={{` or `style=` attribute usage instead of classes/tokens | WARN: "Inline style at {file}:{line} — use CSS class or Tailwind" |
238
+ | **Font loading** | Custom font imports without `font-display: swap` or Next.js font optimization | WARN: "Font at {file} may cause layout shift — add font-display: swap" |
239
+ | **Placeholder content** | Strings like "Lorem ipsum", "TODO", "placeholder", "test text" in JSX/template | BLOCK: "Placeholder content at {file}:{line} — replace before shipping" |
240
+
241
+ **Skip if**: Diff contains only test files, config files, or non-UI code (detected by absence of JSX/template syntax).
242
+
224
243
  #### Pack Integration
225
244
 
226
245
  When a domain pack is installed (e.g., `@rune-pro/finance`, `@rune-pro/legal`), preflight checks the pack's **Hard-Stop Thresholds** table and applies matching rules to staged files. This means:
@@ -5,7 +5,7 @@ context: fork
5
5
  agent: general-purpose
6
6
  metadata:
7
7
  author: runedev
8
- version: "0.3.0"
8
+ version: "0.4.0"
9
9
  layer: L1
10
10
  model: sonnet
11
11
  group: orchestrator
@@ -34,6 +34,7 @@ Legacy refactoring orchestrator for safely modernizing messy codebases. Rescue r
34
34
  - `autopsy` (L2): Phase 0 RECON — full codebase health assessment
35
35
  - `safeguard` (L2): Phase 1 SAFETY NET — characterization tests and protective measures
36
36
  - `surgeon` (L2): Phase 2-N SURGERY — incremental refactoring (1 module per session)
37
+ - `retro` (L2): post-rescue retrospective — capture lessons learned
37
38
  - `journal` (L3): state tracking across rescue sessions
38
39
  - `plan` (L2): create refactoring plan based on autopsy findings
39
40
  - `review` (L2): verify each surgery phase
@@ -424,6 +425,29 @@ Rollback point: git tag rune-rescue-baseline (set in Phase 0)
424
425
  | Health score comparison | Inline (Rescue Report) | Baseline vs final autopsy scores |
425
426
  | Rescue Report | Markdown (inline) | Emitted at session end (per module and final) |
426
427
 
428
+ ## Document Ownership
429
+
430
+ | Scope | Access | Files |
431
+ |-------|--------|-------|
432
+ | **Owns** (read + write) | `RESCUE-STATE.md`, `.rune/rescue-*.md`, git tags (`rune-rescue-*`), refactored source files (one module per session) |
433
+ | **Reads** (never writes) | `CLAUDE.md`, autopsy reports, safeguard test files, `.rune/contract.md` |
434
+ | **Never modifies** | Test files written by `safeguard` (characterization tests are the safety net — rescue reads them, never edits), `compiler/**`, `SKILL.md` files |
435
+
436
+ Rescue delegates to `surgeon` for actual code changes and `safeguard` for test creation. Rescue owns the orchestration state, not the artifacts.
437
+
438
+ ## Anti-Patterns
439
+
440
+ Common legacy refactoring failures. These turn "rescue" into "make it worse."
441
+
442
+ | Anti-Pattern | Why It Fails | Correct Approach |
443
+ |---|---|---|
444
+ | **Big bang refactor** — rewriting everything at once | No rollback path. One bug = entire refactor is broken | One module per session. Commit + verify after each module |
445
+ | **Surgery without safety net** — refactoring before characterization tests exist | No way to verify behavior is preserved. "It compiles" ≠ "it works" | HARD-GATE: safeguard tests must pass BEFORE any surgery begins |
446
+ | **Coupled module surgery** — refactoring two interdependent modules simultaneously | Changes in module A break module B mid-surgery. Neither is stable | One module per session. Stabilize A completely before touching B |
447
+ | **Ignoring the autopsy** — starting refactoring without understanding current health | Fixes symptoms not causes. Wastes effort on low-impact modules | Phase 0 autopsy is mandatory. Surgery queue ordered by impact, not convenience |
448
+ | **Prototype patterns in production** — replacing legacy code with quick-and-dirty rewrites | Creates new legacy. The "rescue" becomes the next rescue target | Apply proven refactoring patterns from autopsy recommendations. Clean code, not fast code |
449
+ | **No rollback point** — surgery without a tagged baseline | If surgery goes wrong, no safe state to return to | `git tag rune-rescue-baseline` before ANY code changes |
450
+
427
451
  ## Sharp Edges
428
452
 
429
453
  Known failure modes for this skill. Check these before declaring done.
@@ -3,7 +3,7 @@ name: research
3
3
  description: Web search and external knowledge lookup. Gathers data on technologies, libraries, best practices, and competitor solutions.
4
4
  metadata:
5
5
  author: runedev
6
- version: "0.3.0"
6
+ version: "0.4.0"
7
7
  layer: L3
8
8
  model: haiku
9
9
  group: knowledge
@@ -67,6 +67,29 @@ Call `WebSearch` for each query. Collect result titles, URLs, and snippets. Iden
67
67
  - **Diversity: never select 3+ URLs from the same domain** — spread across source types
68
68
 
69
69
 
70
+ ### Step 2b — Diminishing Returns Detection
71
+
72
+ After each WebSearch call, evaluate whether additional searches are productive:
73
+
74
+ **Track across search results**:
75
+ - **Entity set**: Extract key entities from each result set (library names, API names, version numbers, technique names, company names)
76
+ - **New entity ratio**: `new_entities_in_this_search / total_entities_found_so_far`
77
+ - **Result overlap**: How many URLs from this search were already seen in previous searches
78
+
79
+ | Signal | Threshold | Action |
80
+ |--------|-----------|--------|
81
+ | New entity ratio < 10% | Last search added almost nothing new | Skip remaining queries, proceed to Step 3 with existing results |
82
+ | Result overlap > 60% | Most URLs already fetched or seen | Skip this query's results entirely |
83
+ | All 3 queries return same top 3 URLs | Search space is exhausted | Proceed directly to Step 3 — more queries won't help |
84
+
85
+ **Report when triggered**:
86
+ ```
87
+ Note: Research saturation reached after [N] searches — [M] unique entities found.
88
+ Additional queries showed <10% new information. Proceeding with synthesis.
89
+ ```
90
+
91
+ **Why**: Research skills commonly waste 2-3 WebFetch calls on pages that repeat information already gathered. Saturation detection saves tool calls and context tokens while preserving research quality — the first 3 sources typically contain 90%+ of available information.
92
+
70
93
  ### Step 3 — Deep Dive
71
94
 
72
95
  Call `WebFetch` on the top 3-5 URLs identified in Step 2. Hard limit: **max 5 WebFetch calls** per research invocation. For each fetched page:
@@ -41,6 +41,8 @@ Retro is ENCOURAGING but CANDID. Every critique is anchored in specific commits,
41
41
 
42
42
  - `audit` (L2): engineering velocity and health dimension
43
43
  - `cook` (L1): optional — after completing a multi-phase feature, suggest retro
44
+ - `rescue` (L1): post-rescue retrospective
45
+ - `launch` (L1): post-launch retrospective
44
46
  - User: `/rune retro` direct invocation
45
47
 
46
48
  ## Data Flow
@@ -3,13 +3,13 @@ name: review
3
3
  description: Code quality review — patterns, security, performance, correctness. Finds bugs, suggests improvements, triggers fix for issues found. Escalates to opus for security-critical code.
4
4
  metadata:
5
5
  author: runedev
6
- version: "0.6.0"
6
+ version: "0.8.0"
7
7
  layer: L2
8
8
  model: sonnet
9
9
  group: development
10
10
  tools: "Read, Glob, Grep"
11
11
  emit: review.complete, review.issues
12
- listen: code.changed
12
+ listen: code.changed, docs.updated
13
13
  ---
14
14
 
15
15
  # review
@@ -204,6 +204,36 @@ Identify gaps in test coverage.
204
204
  - If untested code found: call `rune:test` with specific instructions on what to test
205
205
  - Flag as HIGH if business logic is untested, MEDIUM if utility code is untested
206
206
 
207
+ #### Per-Function Test Gap Analysis
208
+
209
+ Go beyond "test file exists" — check coverage at function granularity:
210
+
211
+ 1. **Extract changed functions** — from the diff, list every function/method that was added or modified (name + file:line)
212
+ 2. **Map to test assertions** — for each changed function, Grep the test file for its name. Count distinct test cases (look for `it(`, `test(`, `describe(` blocks that reference the function)
213
+ 3. **Classify gap severity**:
214
+
215
+ | Function Type | 0 tests | 1 test | 2+ tests |
216
+ |--------------|---------|--------|----------|
217
+ | Business logic (money, auth, state) | BLOCK | WARN: "only happy path" | PASS |
218
+ | Data transform (parse, format, map) | HIGH | PASS | PASS |
219
+ | Event handler (onClick, onSubmit) | MEDIUM | PASS | PASS |
220
+ | Pure utility (string, math, date) | MEDIUM | PASS | PASS |
221
+
222
+ 4. **Output per-function table** in review report:
223
+
224
+ ```
225
+ ### Test Gap Analysis
226
+ | Function | File | Tests Found | Verdict |
227
+ |----------|------|-------------|---------|
228
+ | calculateTotal | src/billing.ts:42 | 3 (happy, zero, overflow) | PASS |
229
+ | processRefund | src/billing.ts:89 | 0 | BLOCK — business logic untested |
230
+ | formatCurrency | src/utils.ts:12 | 1 | PASS |
231
+ ```
232
+
233
+ 5. **Flag untested edge cases** — for functions with only 1 test, check if the test covers: empty/null input, boundary values, error path. If only happy path → WARN: "only happy path tested for {function}"
234
+
235
+ **Skip if**: Diff only touches config, docs, styles, or test files themselves.
236
+
207
237
  ### Step 5.5: Two-Stage Review Gate
208
238
 
209
239
  Separate spec compliance from code quality. Most reviews conflate both — this gate forces the distinction.
@@ -503,6 +533,29 @@ When `cook` or `ship` checks review status: compare review commit hash with curr
503
533
  | Composite quality score | Markdown table | inline (when `mode: "scored"`) |
504
534
  | Blast radius assessment | Markdown table | inline |
505
535
 
536
+ ## Chain Metadata
537
+
538
+ Append to Code Review Report when invoked standalone. Suppress when called as sub-skill inside an L1 orchestrator (cook, team, etc.) — the orchestrator emits a consolidated block. See `docs/references/chain-metadata.md`.
539
+
540
+ ```yaml
541
+ chain_metadata:
542
+ skill: "rune:review"
543
+ version: "0.8.0"
544
+ status: "[DONE | DONE_WITH_CONCERNS]"
545
+ domain: "[area reviewed]"
546
+ files_changed: [] # review doesn't change files
547
+ exports:
548
+ findings_count: { critical: [N], high: [N], medium: [N], low: [N] }
549
+ findings:
550
+ - { severity: "[level]", file: "[path]", line: [N], message: "[issue]" }
551
+ verdict: "[APPROVE | REQUEST_CHANGES | NEEDS_DISCUSSION]"
552
+ quality_score: [0-100] # when mode: "scored"
553
+ suggested_next:
554
+ - skill: "rune:fix"
555
+ reason: "[grounded in findings — e.g., '2 HIGH findings in api/users.ts need remediation']"
556
+ consumes: ["findings"]
557
+ ```
558
+
506
559
  ## Sharp Edges
507
560
 
508
561
  | Failure Mode | Severity | Mitigation |
@@ -33,6 +33,7 @@ Generated projects MUST build and pass tests. A scaffold that produces broken co
33
33
  - `research` (L3): Phase 2 — best practices, starter templates, library comparison
34
34
  - `plan` (L2): Phase 3 — architecture and implementation plan
35
35
  - `design` (L2): Phase 4 — design system (frontend projects only)
36
+ - `skill-forge` (L2): when scaffolded project includes custom skills or plugin structure
36
37
  - `fix` (L2): Phase 5 — code generation (implements the plan)
37
38
  - `team` (L1): Phase 5 — parallel implementation when 3+ independent modules
38
39
  - `test` (L2): Phase 6 — test suite generation
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: scope-guard
3
- description: "Detects scope creep. Auto-triggered by L1 orchestrators when files exceed the original plan. Compares current git changes against plan, flags out-of-scope files, reports IN_SCOPE or CREEP_DETECTED."
3
+ description: "Detects scope creep by quantifying drift percentage. Auto-triggered by L1 orchestrators when files exceed the original plan. Compares git changes against plan, classifies drift into 4 tiers: ON_TRACK, MINOR_DRIFT, SIGNIFICANT_DRIFT, OUT_OF_CONTROL."
4
4
  user-invocable: false
5
5
  metadata:
6
6
  author: runedev
7
- version: "0.3.0"
7
+ version: "0.4.0"
8
8
  layer: L3
9
9
  model: haiku
10
10
  group: monitoring
@@ -73,13 +73,28 @@ Rules for OUT_OF_SCOPE (counts as creep):
73
73
  - New dependencies added without a planned feature requiring them
74
74
  - Documentation files for unplanned features
75
75
 
76
- ### Step 4: Flag Creep
76
+ ### Step 4: Quantify Drift
77
77
 
78
- If any OUT_OF_SCOPE files are detected:
79
- - List each out-of-scope file with the reason it is flagged
80
- - Classify as: `MINOR CREEP` (1-2 unplanned files) or `SIGNIFICANT CREEP` (3+ unplanned files)
78
+ Compute **Drift Percentage** the ratio of out-of-scope changes to total changes:
81
79
 
82
- If zero OUT_OF_SCOPE files: status is `IN_SCOPE`.
80
+ ```
81
+ drift_pct = (out_of_scope_files / total_files_changed) × 100
82
+ ```
83
+
84
+ Classify drift into a 4-tier system:
85
+
86
+ | Drift % | Level | Status | Action |
87
+ |---------|-------|--------|--------|
88
+ | **< 10%** | ON TRACK | `ON_TRACK` | No action needed. Proceed normally. |
89
+ | **10-25%** | MINOR DRIFT | `MINOR_DRIFT` | Flag out-of-scope files. Suggest trim or acknowledge as intentional. Continue. |
90
+ | **25-50%** | SIGNIFICANT DRIFT | `SIGNIFICANT_DRIFT` | **Pause recommended.** Present drift report to user. Re-scope before continuing. |
91
+ | **> 50%** | OUT OF CONTROL | `OUT_OF_CONTROL` | **Block.** More unplanned work than planned. Escalate to orchestrator. Require re-alignment before ANY further work. |
92
+
93
+ **Edge case**: If total planned files = 0 (no plan loaded), use file count thresholds instead:
94
+ - 0 out-of-scope → ON_TRACK
95
+ - 1-2 out-of-scope → MINOR_DRIFT
96
+ - 3-5 out-of-scope → SIGNIFICANT_DRIFT
97
+ - 6+ out-of-scope → OUT_OF_CONTROL
83
98
 
84
99
  ### Step 5: Report
85
100
 
@@ -91,7 +106,8 @@ Output the following structure:
91
106
  - **Planned files**: [count from plan]
92
107
  - **Actual files changed**: [count from git diff]
93
108
  - **Out-of-scope files**: [count]
94
- - **Status**: IN_SCOPE | MINOR CREEP | SIGNIFICANT CREEP
109
+ - **Drift**: [X]% ([level])
110
+ - **Status**: ON_TRACK | MINOR_DRIFT | SIGNIFICANT_DRIFT | OUT_OF_CONTROL
95
111
 
96
112
  ### In-Scope Changes
97
113
  - [file] — [matches planned task]
@@ -100,9 +116,10 @@ Output the following structure:
100
116
  - [file] — [reason: unplanned feature | unrelated refactor | unplanned dep]
101
117
 
102
118
  ### Recommendations
103
- - [If IN_SCOPE]: No action needed. Proceed.
104
- - [If MINOR CREEP]: Review [file] — consider reverting or acknowledging as intentional.
105
- - [If SIGNIFICANT CREEP]: STOP. Re-align with original plan before continuing. [list files to revert]
119
+ - [ON_TRACK]: No action needed. Proceed.
120
+ - [MINOR_DRIFT]: Review [file] — consider reverting or acknowledging as intentional.
121
+ - [SIGNIFICANT_DRIFT]: PAUSE. Drift is [X]%. Re-align scope with original plan. Suggested cuts: [files to revert]
122
+ - [OUT_OF_CONTROL]: STOP. [X]% of changes are unplanned — more drift than planned work. Present full report to user/orchestrator. Do NOT continue until re-scoped.
106
123
  ```
107
124
 
108
125
  ## Output Format
@@ -110,14 +127,15 @@ Output the following structure:
110
127
  ```
111
128
  ## Scope Report
112
129
  - Planned files: 3 | Actual: 5 | Out-of-scope: 2
113
- - Status: MINOR CREEP
130
+ - Drift: 40% (SIGNIFICANT_DRIFT)
114
131
 
115
132
  ### Out-of-Scope Changes
116
133
  - src/components/NewWidget.tsx — unplanned feature
117
134
  - docs/new-feature.md — documentation for unplanned feature
118
135
 
119
136
  ### Recommendations
120
- - Review src/components/NewWidget.tsx revert or log as intentional scope change.
137
+ - PAUSE. Drift is 40%. Re-align scope with original plan.
138
+ - Suggested cuts: revert src/components/NewWidget.tsx + docs/new-feature.md (reduces drift to 0%)
121
139
  ```
122
140
 
123
141
  ## Constraints
@@ -134,7 +152,7 @@ Known failure modes for this skill. Check these before declaring done.
134
152
  |---|---|---|
135
153
  | Classifying test files for planned code as out-of-scope | MEDIUM | Test files for planned source files are always IN_SCOPE — natural dependency |
136
154
  | Classifying lock file changes as out-of-scope | LOW | package-lock.json, yarn.lock, Cargo.lock are always IN_SCOPE |
137
- | SIGNIFICANT CREEP threshold applied to 1-2 unplanned files | LOW | MINOR = 1-2 files, SIGNIFICANT = 3+ files don't escalate prematurely |
155
+ | Over-escalating drift (e.g., 1 extra file = OUT_OF_CONTROL) | LOW | Use drift percentage, not gut feeling. 1 extra file out of 10 = 10% = MINOR_DRIFT, not panic |
138
156
  | Plan not loadable (no TodoWrite, no progress.md) | MEDIUM | Ask calling skill for plan as text description before proceeding |
139
157
  | Scope check against plan but not against stated intent | MEDIUM | Plan-based scope guard catches file drift; review Step 6.6 (Scope Drift Detection) catches intent drift. Both should run for full coverage |
140
158
 
@@ -143,14 +161,14 @@ Known failure modes for this skill. Check these before declaring done.
143
161
  - Plan loaded from TodoWrite active tasks or .rune/progress.md
144
162
  - git diff --stat and --cached output parsed for all changed files
145
163
  - Each changed file classified IN_SCOPE or OUT_OF_SCOPE with reasoning
146
- - Creep severity classified (IN_SCOPE / MINOR CREEP / SIGNIFICANT CREEP)
147
- - Scope Report emitted with recommendations
164
+ - Drift percentage computed and classified (ON_TRACK / MINOR_DRIFT / SIGNIFICANT_DRIFT / OUT_OF_CONTROL)
165
+ - Scope Report emitted with drift %, level, and actionable recommendations
148
166
 
149
167
  ## Returns
150
168
 
151
169
  | Artifact | Format | Location |
152
170
  |----------|--------|----------|
153
- | Scope Report | Markdown (IN_SCOPE / MINOR CREEP / SIGNIFICANT CREEP) | inline |
171
+ | Scope Report | Markdown (drift %, 4-tier level, recommendations) | inline |
154
172
  | In-scope file list | Classified list | inline |
155
173
  | Out-of-scope drift report | File list with reasons | inline |
156
174
  | Recommendations | Actionable list | inline |
@@ -3,7 +3,7 @@ name: scout
3
3
  description: "Fast codebase scanner. Use when any skill needs codebase context. Finds files, patterns, dependencies, project structure. Pure read-only — never modifies files."
4
4
  metadata:
5
5
  author: runedev
6
- version: "0.2.0"
6
+ version: "0.3.0"
7
7
  layer: L2
8
8
  model: haiku
9
9
  group: creation
@@ -79,6 +79,27 @@ Based on the scan request, run focused searches:
79
79
 
80
80
  **Verification gate**: At least 1 relevant file found, OR confirm the target does not exist.
81
81
 
82
+ #### Info Saturation Detection (Know When to Stop)
83
+
84
+ Scout's default is "max 10 file reads" — but the real question is whether additional reads are productive. Track saturation across Phase 2 searches:
85
+
86
+ **Entity tracking**: As you scan files, extract key entities (function names, class names, imports, API endpoints, config keys). Maintain a running set of discovered entities.
87
+
88
+ | Signal | Threshold | Meaning | Action |
89
+ |--------|-----------|---------|--------|
90
+ | **New entity ratio** | Last 2 file reads added <2 new entities | Search is exhausted for this domain | STOP scanning, move to Phase 3 |
91
+ | **Content similarity** | Last 2 files share >70% of the same imports/patterns | Files are in the same module, redundant reads | Skip remaining files in this directory |
92
+ | **Query variation** | 3+ Glob/Grep queries with different patterns all return the same files | All search angles converge | Domain is fully mapped, proceed |
93
+
94
+ **When saturation detected**: Emit in Scout Report:
95
+ ```
96
+ ### Saturation
97
+ - Reached after [N] file reads — last 2 reads added [M] new entities
98
+ - Recommendation: synthesize_and_report (further scanning unlikely to yield new insights)
99
+ ```
100
+
101
+ **Why**: Without saturation detection, scout reads its full budget of 10 files even when 3 files already contain everything needed. This wastes context tokens and delays the calling skill. Early saturation detection returns control faster.
102
+
82
103
  ### Phase 3: Dependency Mapping
83
104
 
84
105
  1. Use `Grep` to find import/require/use statements in identified files
@@ -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.9.0"
6
+ version: "1.0.0"
7
7
  layer: L2
8
8
  model: sonnet
9
9
  group: quality
@@ -198,6 +198,34 @@ If `.rune/contract.md` exists, validate staged changes against project contract
198
198
 
199
199
  If `.rune/contract.md` does not exist, skip and log INFO: "no project contract, contract validation skipped".
200
200
 
201
+ ### Step 4.87 — Config Leak Threshold Detection
202
+
203
+ Detect when agent output or code changes accidentally expose internal configuration files, skill definitions, or sensitive project structure to end users.
204
+
205
+ **Why**: Agents processing SKILL.md, CLAUDE.md, `.rune/` files may copy-paste internal content into user-facing output (chat responses, generated docs, UI strings). This leaks architecture details, security rules, and proprietary skill content.
206
+
207
+ **Detection patterns** (scan agent output + staged files):
208
+
209
+ | Pattern | What to Detect | Severity |
210
+ |---------|---------------|----------|
211
+ | **Internal file exposure** | 3+ distinct internal file names mentioned in plain text (not code blocks): `CLAUDE.md`, `SKILL.md`, `PACK.md`, `.rune/contract.md`, `.rune/runbook.md` | WARN |
212
+ | **Skill content leak** | Verbatim SKILL.md content (>50 chars) appearing in user-facing strings, README, or generated docs | BLOCK |
213
+ | **Config path exposure** | Absolute paths containing user home directory (`/Users/`, `C:\Users\`) in committed code or output | WARN |
214
+ | **Environment variable dump** | `process.env` or `os.environ` iterated/serialized without filtering (exposes all env vars) | BLOCK |
215
+ | **Debug config in production** | `DEBUG=true`, `LOG_LEVEL=debug`, `NODE_ENV=development` in committed config files | WARN |
216
+ | **Connection string patterns** | Strings matching `://user:pass@host` or `mongodb+srv://` or `postgres://` in non-.env files | BLOCK |
217
+
218
+ **Threshold rules:**
219
+ - Single mention of an internal file name → PASS (could be legitimate reference)
220
+ - 3+ distinct internal file names in one output → WARN: "Agent may be leaking internal config"
221
+ - Any SKILL.md verbatim content in user-facing code → BLOCK: "Skill content leaked to output"
222
+
223
+ **Exclusions** (prevent false positives):
224
+ - Code blocks in architecture docs (legitimate documentation)
225
+ - References inside other SKILL.md files (internal cross-references)
226
+ - Test fixtures explicitly testing config handling
227
+ - `.env.example` files (intentionally public)
228
+
201
229
  ### Step 4.86 — Organization Policy Enforcement (Business)
202
230
 
203
231
  If `.rune/org/org.md` exists, load organization security policies and enforce them as additional gates.
@@ -112,8 +112,6 @@ Detect and verify tools the project depends on:
112
112
  5. **Build tools**: Check for `turbo.json` (turborepo), `nx.json` (Nx), `Makefile`, etc.
113
113
 
114
114
  6. **Hard dependencies** — tools the project WRAPS (not just uses as dev dependency):
115
- > From CLI-Anything (HKUDS/CLI-Anything, 17.4k★): "The software is a required dependency, not optional."
116
-
117
115
  Scan for evidence that the project wraps an external tool:
118
116
  - `Grep` for `shutil.which(`, `which `, `command -v ` → project looks up an executable at runtime
119
117
  - `Grep` for `subprocess.run(`, `child_process.exec(`, `Deno.Command(` → project invokes external CLI