@rune-kit/rune 2.17.1 → 2.18.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.
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: perf
3
- description: "Performance regression gate. Detects N+1 queries, sync-in-async, missing indexes, memory leaks, and bundle bloat before they reach production."
3
+ description: "Performance regression gate. Detects N+1 queries, sync-in-async, missing indexes, memory leaks, and bundle bloat before they reach production. Ranks findings by Cost Impact Hierarchy (architecture > data transfer > compute > DB > caching) so fix priority maps to actual unit-cost reduction."
4
4
  metadata:
5
5
  author: runedev
6
- version: "0.3.0"
6
+ version: "0.4.0"
7
7
  layer: L2
8
8
  model: sonnet
9
9
  group: quality
@@ -139,6 +139,30 @@ def get(key):
139
139
  ```
140
140
  Finding: `UNBOUNDED_CACHE — [file:line] — dict grows indefinitely — add LRU eviction or TTL`
141
141
 
142
+ **Closure-captured arrays:**
143
+ ```javascript
144
+ // BAD: closure retains entire `items` even after only `id` is needed
145
+ function makeHandler(items) {
146
+ return (e) => items.find(x => x.id === e.id); // items array retained
147
+ }
148
+ // GOOD: extract minimum data
149
+ function makeHandler(items) {
150
+ const ids = new Set(items.map(x => x.id));
151
+ return (e) => ids.has(e.id);
152
+ }
153
+ ```
154
+ Finding: `CLOSURE_RETAIN — [file:line] — closure captures full collection — extract needed fields only`
155
+
156
+ **Timer / interval without clear:**
157
+ - `setInterval` / `setTimeout` callback referencing component state without cleanup on unmount
158
+ - Finding: `LEAK_TIMER — [file:line] — interval not cleared — add clearInterval in cleanup`
159
+
160
+ **Cost framing — memory leak = cost driver:**
161
+
162
+ Unbounded caches + forgotten listeners + closure-captured arrays produce a chain reaction in production: memory grows → process exceeds container limit → orchestrator kills + cold-starts → cold-start latency spike → autoscaler provisions more replicas → bill climbs 20-40% versus a leak-free baseline. The leak finding is also a COST finding. When tagging severity, escalate any leak in a long-running process (worker, daemon, queue consumer) to **BLOCK** even if heap profile is currently under threshold — the slope, not the absolute, determines OOM timing.
163
+
164
+ Cross-link to `debug` when a leak surfaces during diagnosis: `debug` finds the cause, `perf` quantifies the cost driver and recommends scope (LRU vs WeakRef vs explicit lifecycle).
165
+
142
166
  ### Step 5 — Bundle Analysis (frontend only)
143
167
 
144
168
  If project type is frontend:
@@ -276,6 +300,69 @@ Total estimated monthly $X.XX
276
300
 
277
301
  **Key insight**: The most impactful optimization is often **model selection per operation** — using a cheaper model for background tasks (summarization, classification, metadata extraction) while reserving expensive models for primary user-facing interactions. A 10x cost reduction on 60% of calls = 6x overall savings.
278
302
 
303
+ ### Step 8.6 — Observability Cost Control
304
+
305
+ Logging, tracing, and metrics infrastructure is often the **second-largest cloud bill line after compute** for production workloads. Most observability cost is self-inflicted — high-cardinality labels, unsampled traces, or 100% INFO log retention. Scan for the four common patterns:
306
+
307
+ **Sampling discipline:**
308
+ | Layer | Healthy default | Anti-pattern |
309
+ |---|---|---|
310
+ | INFO logs | 5-10% sample, 100% on warn/error | 100% retention on all levels |
311
+ | Distributed traces | 5-10% normal, 100% on errors or > p95 latency | Head-based 100% sampling |
312
+ | Metrics | Pre-aggregated at agent (no per-event metrics) | Per-event metrics emission |
313
+ | Debug logs | Off in prod; on-demand via runtime flag | Always-on debug retention |
314
+
315
+ **Findings to emit:**
316
+
317
+ | Pattern | Finding | Cost impact |
318
+ |---|---|---|
319
+ | Log line emits unique IDs (`user_id`, `request_id`, `trace_id`) AS A METRIC LABEL | `HIGH_CARDINALITY_METRIC — [file:line] — label [name] is unbounded — move to log/trace, not metric` | Metric stores explode 100x+ ingestion cost |
320
+ | No sampling on INFO logs | `LOG_NO_SAMPLE — [file:line] — INFO logged at 100% — add sampling (10% INFO, 100% warn+)` | 10x log volume = 10x bill |
321
+ | Trace sampling head-based at 100% | `TRACE_NO_SAMPLE — [file:line] — head sampling 100% — switch to tail-based 5-10% with always-on for errors/slow` | 20x trace volume |
322
+ | `console.log` in production hot path | `LOG_HOT_PATH — [file:line] — log emitted per request in tight loop — gate behind LOG_LEVEL or remove` | Logs dominate IOPS; throttles real traffic |
323
+ | Sentry / OTel SDK with no scrubbing config | `OBS_NO_SCRUB — [file:line] — payloads emitted unscrubbed — risk PII + cost (large payloads)` | Compliance + ingestion cost |
324
+
325
+ **Cost framing**: same project, same business logic; the observability cost line moves 5-20x depending on whether sampling is disciplined. Especially severe in serverless/edge runtimes where every invocation pays cold-start log ingestion overhead.
326
+
327
+ ## Cost Impact Hierarchy
328
+
329
+ Not every perf finding has the same cost impact. When the report has multiple findings competing for engineering attention, rank them by where they sit in this hierarchy — fixes higher up the tree deliver more $ per engineering hour than fixes lower down.
330
+
331
+ ```
332
+ Tier 1 — Architecture choices (10x impact)
333
+ • Hot loop running on wrong runtime (serverless cold-start per call vs warm container)
334
+ • N+1 queries that fan out to upstream rate limit (compounds with retries)
335
+ • Single-region for global users (egress + latency cost)
336
+
337
+ Tier 2 — Data transfer (3-5x impact)
338
+ • Cross-AZ chatter (per-GB egress)
339
+ • Uncompressed responses (gzip = 70-90% reduction)
340
+ • Image format (WebP/AVIF = 25-50% reduction over JPEG/PNG)
341
+ • Log/trace volume (see Step 8.6)
342
+
343
+ Tier 3 — Compute right-sizing (2-3x impact)
344
+ • Oversized instance types
345
+ • Over-provisioned autoscaler floor
346
+ • Always-on workers for bursty traffic
347
+
348
+ Tier 4 — DB optimization (1.5-2x impact)
349
+ • Missing index on hot query
350
+ • N+1 within a single DB connection (cheaper than cross-service N+1)
351
+ • Connection pool sizing
352
+ • Query result caching
353
+
354
+ Tier 5 — Caching layer (1.2-1.5x impact)
355
+ • CDN cache hit rate
356
+ • Application-level memoization
357
+ • Read-through cache for hot reads
358
+ ```
359
+
360
+ **Reporting rule**: when verdict is BLOCK or WARN, group findings by tier in the report. Operator should NOT optimize Tier 5 caching when a Tier 1 architecture mismatch is sitting unaddressed — the Tier 1 fix subsumes the Tier 5 gain.
361
+
362
+ **Unit economics anchor**: where possible, attach a unit-cost delta to each finding (e.g., `LOG_NO_SAMPLE` → `~$X/mo per 10k req` based on operator's current observability vendor pricing). If unit-cost data unavailable, flag the finding with the tier-based multiplier band instead of leaving impact blank.
363
+
364
+ **Cost-allocation precondition**: a perf report's cost claims are only auditable if cloud resources have allocation tags (Environment, Team, Service). If `deploy` artifacts show untagged resources, raise a WARN `COST_UNATTRIBUTED — resources lack allocation tags — anomaly detection blind; tag-first then optimize`.
365
+
279
366
  ## Output Format
280
367
 
281
368
  ```
@@ -321,6 +408,10 @@ Known failure modes for this skill. Check these before declaring done.
321
408
  | Skipping framework checks because framework not detected | MEDIUM | If scout returns unknown framework, run generic checks + note in report |
322
409
  | Calling browser-pilot on backend-only project | LOW | Check project type in Step 1 — browser-pilot only for frontend/fullstack |
323
410
  | Reporting WARN as BLOCK (severity inflation) | MEDIUM | BLOCK = measurable regression on hot path; WARN = pattern that could be slow |
411
+ | Memory leak found, severity left as MEDIUM | HIGH | Leak in long-running process = cost driver (OOM restart loop → autoscaler spend). Escalate to BLOCK when process lifetime > 1 hour |
412
+ | High-cardinality label silently added as metric tag | HIGH | `user_id` / `request_id` / `trace_id` as METRIC label explodes ingestion cost 100x. Move to log/trace, never metric |
413
+ | Findings reported without tier ranking when multiple compete | MEDIUM | Cost Impact Hierarchy groups by tier (1-5). Tier 1 fix subsumes Tier 5 gain; operator otherwise optimizes wrong target |
414
+ | Cost claim made without cloud tag prerequisite | MEDIUM | Untagged resources = anomaly detection blind. Pair perf findings with WARN `COST_UNATTRIBUTED` when cloud tags missing |
324
415
 
325
416
  ## Done When
326
417
 
@@ -3,7 +3,7 @@ name: sentinel-env
3
3
  description: "Environment-aware pre-flight check. Use when starting work in a new environment, switching machines, or when 'works on my machine' bugs surface. Validates OS, runtime versions, installed tools, port availability, env vars, and disk space BEFORE coding starts. Like sentinel but for the environment, not the code."
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: validation
@@ -130,7 +130,7 @@ Detect and verify tools the project depends on:
130
130
  | 5 | Platform desktop-app bundle (macOS `.app/Contents/Resources`, Windows `%LOCALAPPDATA%\Programs`, Linux `/opt`) | Desktop app users (~40% of population) |
131
131
  | 6 | PATH lookup (`which`/`where.exe`) | Standard shell users |
132
132
  | 7 | Package manager global bin (`npm config get prefix`, `pnpm`, `pipx --list`, `cargo install --root`) | npm-global on Windows (PATH oversight) |
133
- | 8 | Platform common directories (`~/.local/bin`, `~/.npm-global/bin`, Homebrew, `%APPDATA%\npm`, `%LOCALAPPDATA%\Microsoft\WindowsApps`, `%ProgramFiles%\nodejs`) | Manual installers |
133
+ | 8 | Platform common directories — Unix: `~/.local/bin`, `~/.npm-global/bin`, `~/.bun/bin`, `~/.cargo/bin`, `~/.deno/bin`, `~/.volta/bin`, `~/.asdf/shims`, `~/.proto/bin`, `/opt/homebrew/bin`, `/usr/local/bin`. Windows: `%APPDATA%\npm`, `%USERPROFILE%\.bun\bin`, `%USERPROFILE%\.cargo\bin`, `%USERPROFILE%\.deno\bin`, `%LOCALAPPDATA%\Microsoft\WindowsApps`, `%ProgramFiles%\nodejs` | Bun / Cargo / Deno / Volta / asdf / proto users + manual installers |
134
134
  | 9 | Platform release archive names (e.g., `codex-x86_64-unknown-linux-musl`, `<tool>-aarch64-apple-darwin`) | Release-tarball downloaders |
135
135
 
136
136
  **Verdict:**
@@ -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.8.0"
6
+ version: "1.9.0"
7
7
  layer: L2
8
8
  model: opus
9
9
  group: creation
@@ -436,6 +436,46 @@ Wire the skill into the mesh:
436
436
  5. **Write Self-Validation** — 3-5 domain-specific checks unique to this skill's output. Ask: "What quality issues can ONLY this skill catch?"
437
437
  6. **Verify no conflicts** — new skill's output format compatible with consumers?
438
438
 
439
+ ### Phase 6.25 — EXAMPLES (output-format skills only)
440
+
441
+ Output-format skills (skills that produce visual or text artifacts a human will see) SHOULD ship a literal example of the output alongside SKILL.md. The example is a target the agent can copy from — not a description it must interpret.
442
+
443
+ **Applies to:**
444
+ - `design`, `asset-creator`, `slides`, `marketing`, `video-creator`, `doc-processor`
445
+ - Any pack skill whose primary output is a rendered artifact (HTML page, slide deck, social card, video script, report PDF)
446
+
447
+ **Does not apply to:**
448
+ - Process / orchestration skills (`cook`, `plan`, `review`) — their output is structural, not rendered
449
+ - Diagnostic skills (`debug`, `audit`, `perf`) — their output is findings, not artifacts
450
+
451
+ **Convention:**
452
+
453
+ ```
454
+ skills/<name>/
455
+ ├── SKILL.md
456
+ ├── references/
457
+ │ └── ...
458
+ └── examples/
459
+ ├── README.md # short index: which example fits which scenario
460
+ ├── <scenario-1>.html # or .md / .json / .svg per skill domain
461
+ ├── <scenario-2>.html
462
+ └── ...
463
+ ```
464
+
465
+ **Why a literal example beats a description:**
466
+ - An agent can copy structure, density, and rhythm from a real file. It cannot copy them from "make it modern."
467
+ - A reviewer can diff agent output against the example to spot drift.
468
+ - Examples are the test corpus for the skill — if a new style emerges, the example shows whether SKILL.md kept up.
469
+
470
+ **Quality bar:**
471
+ - Each example MUST render without error in the target environment (browser, Marp, Notion, etc.)
472
+ - Each example MUST use real-looking data, not lorem ipsum (mirrors design Step 2.9 Rule 5)
473
+ - Cover at least 2 scenarios per skill — minimum spread reveals which decisions are baked in vs which are scenario-driven
474
+
475
+ **Soft, not HARD-GATE:** Per Rune's no-discipline-heavy-grafts policy, don't enforce as a ship blocker. A new skill without examples ships fine; reviewers may suggest adding them. Existing output-format skills are encouraged (not required) to backfill examples on the next material edit.
476
+
477
+ **Inspiration:** Pattern adapted from `nexu-io/html-anything` (Apache-2.0), where every "surface skill" ships a hand-authored `example.html` so the agent has a copy target. They make it a ship blocker; we make it a strong recommendation.
478
+
439
479
  ### Phase 6.5 — EXTENSION AUTHORING (if building an extension, not a skill)
440
480
 
441
481
  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.
@@ -566,6 +606,12 @@ git commit -m "feat: add [skill-name] — [one-line purpose]"
566
606
  - [ ] ARCHITECTURE.md updated
567
607
  - [ ] CLAUDE.md updated
568
608
 
609
+ **Output-format skills only (recommended, not blocking):**
610
+ - [ ] `examples/` directory present with ≥ 2 scenario examples
611
+ - [ ] `examples/README.md` indexes which example fits which scenario
612
+ - [ ] Each example renders without error in its target environment
613
+ - [ ] No lorem ipsum in any example (use real-looking data)
614
+
569
615
  **Extension-specific (if building an extension):**
570
616
  - [ ] EXTENSION.md manifest present with extends, requires, install_method
571
617
  - [ ] install.sh + install.ps1 tested (non-destructive merge)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: surgeon
3
- description: "Incremental refactorer. Use within a rescue workflow after safeguard has set up safety nets. Refactors ONE module per session using proven patterns Strangler Fig, Branch by Abstraction, Expand-Migrate-Contract."
3
+ description: "Incremental refactorer. Use when refactoring ONE module at a time within a rescue workflow after safeguard has set up safety nets never as a standalone refactor for greenfield code. Applies proven patterns: Strangler Fig, Branch by Abstraction, Expand-Migrate-Contract."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.2.0"
@@ -5,7 +5,7 @@ context: fork
5
5
  agent: general-purpose
6
6
  metadata:
7
7
  author: runedev
8
- version: "1.0.0"
8
+ version: "1.1.0"
9
9
  layer: L1
10
10
  model: opus
11
11
  group: orchestrator
@@ -165,8 +165,34 @@ GATE CHECK — before proceeding:
165
165
  [ ] Total streams ≤ 3
166
166
  [ ] Change Stacking check: no file appears in touches[] of 2+ parallel streams
167
167
  [ ] Every stream's requires[] is satisfied by a prior stream's provides[] or existing code
168
+ [ ] Shared Contract Gate: if 2+ parallel streams consume the same interface/type/API, the contract MUST be defined before any stream starts (see below)
168
169
 
169
170
  If any check fails → re-invoke plan with conflict notes.
171
+
172
+ **Shared Contract Gate:**
173
+
174
+ When parallel streams both depend on a shared interface (types, API contract, database schema), that contract must be locked before streams start. Otherwise two agents may independently define incompatible versions.
175
+
176
+ ```
177
+ Detection:
178
+ → Grep each stream's file list for shared imports (types, interfaces, API clients)
179
+ → If stream A and stream B both import from the same module:
180
+ EITHER: move that module to a dependency stream (depends_on: [])
181
+ OR: define the contract inline in the NEXUS Handoff as "Code Contracts" section
182
+
183
+ Contract format in NEXUS Handoff:
184
+ ### Code Contracts (locked — do not modify)
185
+ ```typescript
186
+ // Shared interface — both streams consume this, neither owns it
187
+ interface OrderResult {
188
+ orderId: string;
189
+ status: 'pending' | 'filled' | 'cancelled';
190
+ filledAt?: Date;
191
+ }
192
+ ```
193
+ Streams may consume this contract but MUST NOT modify it.
194
+ If a stream discovers the contract is insufficient → status = NEEDS_CONTEXT, not silent modification.
195
+ ```
170
196
  ```
171
197
 
172
198
  **1d. Question Gate (non-trivial tasks only).**