@rune-kit/rune 2.11.0 → 2.12.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.
Files changed (60) hide show
  1. package/README.md +58 -1
  2. package/compiler/__tests__/detect-invariants.test.js +136 -0
  3. package/compiler/__tests__/doctor-mesh.test.js +229 -0
  4. package/compiler/__tests__/hook-dispatch.test.js +91 -0
  5. package/compiler/__tests__/hooks-antigravity.test.js +120 -0
  6. package/compiler/__tests__/hooks-cursor.test.js +141 -0
  7. package/compiler/__tests__/hooks-install.test.js +307 -0
  8. package/compiler/__tests__/hooks-merge.test.js +204 -0
  9. package/compiler/__tests__/hooks-tiers.test.js +620 -0
  10. package/compiler/__tests__/hooks-windsurf.test.js +117 -0
  11. package/compiler/__tests__/inject-claude-md.test.js +152 -0
  12. package/compiler/__tests__/load-invariants.test.js +408 -0
  13. package/compiler/__tests__/onboard-invariants.test.js +240 -0
  14. package/compiler/adapters/hooks/antigravity.js +140 -0
  15. package/compiler/adapters/hooks/claude.js +166 -0
  16. package/compiler/adapters/hooks/cursor.js +191 -0
  17. package/compiler/adapters/hooks/index.js +82 -0
  18. package/compiler/adapters/hooks/tier-emitter.js +182 -0
  19. package/compiler/adapters/hooks/windsurf.js +202 -0
  20. package/compiler/bin/rune.js +196 -6
  21. package/compiler/commands/hook-dispatch.js +87 -0
  22. package/compiler/commands/hooks/install.js +120 -0
  23. package/compiler/commands/hooks/merge.js +211 -0
  24. package/compiler/commands/hooks/presets.js +116 -0
  25. package/compiler/commands/hooks/status.js +112 -0
  26. package/compiler/commands/hooks/tiers.js +323 -0
  27. package/compiler/commands/hooks/uninstall.js +94 -0
  28. package/compiler/doctor.js +236 -0
  29. package/package.json +2 -2
  30. package/skills/ba/SKILL.md +85 -1
  31. package/skills/brainstorm/SKILL.md +39 -1
  32. package/skills/browser-pilot/SKILL.md +1 -0
  33. package/skills/context-engine/SKILL.md +6 -2
  34. package/skills/design/SKILL.md +1 -0
  35. package/skills/docs-seeker/SKILL.md +1 -0
  36. package/skills/fix/SKILL.md +4 -2
  37. package/skills/hallucination-guard/SKILL.md +1 -0
  38. package/skills/journal/SKILL.md +1 -0
  39. package/skills/logic-guardian/SKILL.md +22 -4
  40. package/skills/marketing/SKILL.md +62 -1
  41. package/skills/neural-memory/SKILL.md +13 -16
  42. package/skills/onboard/SKILL.md +30 -2
  43. package/skills/onboard/references/invariants-template.md +76 -0
  44. package/skills/onboard/scripts/detect-invariants.js +439 -0
  45. package/skills/onboard/scripts/inject-claude-md.js +150 -0
  46. package/skills/onboard/scripts/onboard-invariants.js +196 -0
  47. package/skills/perf/SKILL.md +1 -0
  48. package/skills/plan/SKILL.md +2 -0
  49. package/skills/preflight/SKILL.md +1 -1
  50. package/skills/research/SKILL.md +4 -0
  51. package/skills/review/SKILL.md +4 -2
  52. package/skills/scope-guard/SKILL.md +4 -1
  53. package/skills/scout/SKILL.md +6 -0
  54. package/skills/sentinel/SKILL.md +2 -0
  55. package/skills/session-bridge/SKILL.md +53 -1
  56. package/skills/session-bridge/scripts/load-invariants.js +397 -0
  57. package/skills/slides/SKILL.md +19 -0
  58. package/skills/team/SKILL.md +2 -1
  59. package/skills/test/SKILL.md +6 -0
  60. package/skills/verification/SKILL.md +8 -0
@@ -2,6 +2,7 @@
2
2
  * Doctor — Validates compiled output
3
3
  *
4
4
  * Checks: files exist, cross-references resolve, layer discipline, source freshness.
5
+ * Mesh checks: reciprocal connections, version suggestions, required sections.
5
6
  */
6
7
 
7
8
  import { existsSync } from 'node:fs';
@@ -454,6 +455,241 @@ async function checkOrgTemplates(_runeRoot, config) {
454
455
  return errors;
455
456
  }
456
457
 
458
+ /**
459
+ * Check mesh integrity: reciprocal connections, version suggestions, required sections
460
+ *
461
+ * @param {string} runeRoot - path to Rune source root
462
+ * @returns {Promise<object>} mesh check results
463
+ */
464
+ export async function checkMeshIntegrity(runeRoot) {
465
+ const results = {
466
+ checks: [],
467
+ warnings: [],
468
+ errors: [],
469
+ stats: { skills: 0, connections: 0, missingReciprocals: 0 },
470
+ };
471
+
472
+ const skillsDir = path.join(runeRoot, 'skills');
473
+ if (!existsSync(skillsDir)) {
474
+ results.errors.push('skills/ directory not found');
475
+ return results;
476
+ }
477
+
478
+ // Step 1: Parse all skills
479
+ const skills = new Map(); // name → { calls: [], calledBy: [], version, sections }
480
+ const entries = await readdir(skillsDir, { withFileTypes: true });
481
+
482
+ for (const entry of entries) {
483
+ if (!entry.isDirectory()) continue;
484
+ const skillFile = path.join(skillsDir, entry.name, 'SKILL.md');
485
+ if (!existsSync(skillFile)) continue;
486
+
487
+ const content = await readFile(skillFile, 'utf-8');
488
+ const parsed = parseSkillConnections(content, entry.name);
489
+ skills.set(entry.name, parsed);
490
+ }
491
+
492
+ results.stats.skills = skills.size;
493
+
494
+ // Step 2: Validate reciprocals
495
+ const missingReciprocals = [];
496
+
497
+ for (const [name, skill] of skills) {
498
+ for (const called of skill.calls) {
499
+ const targetSkill = skills.get(called.skill);
500
+ if (!targetSkill) continue; // External skill or L4 pack
501
+
502
+ // Check if target acknowledges this caller
503
+ const acknowledges = targetSkill.calledBy.some((c) => c.skill === name);
504
+ if (!acknowledges) {
505
+ missingReciprocals.push({
506
+ caller: name,
507
+ callee: called.skill,
508
+ reason: called.reason,
509
+ });
510
+ }
511
+ }
512
+ results.stats.connections += skill.calls.length;
513
+ }
514
+
515
+ results.stats.missingReciprocals = missingReciprocals.length;
516
+
517
+ if (missingReciprocals.length === 0) {
518
+ results.checks.push({ name: 'Reciprocal connections', status: 'pass' });
519
+ } else {
520
+ results.checks.push({
521
+ name: 'Reciprocal connections',
522
+ status: 'warn',
523
+ detail: `${missingReciprocals.length} missing`,
524
+ });
525
+ // Group by callee for cleaner output
526
+ const byCallee = {};
527
+ for (const m of missingReciprocals) {
528
+ if (!byCallee[m.callee]) byCallee[m.callee] = [];
529
+ byCallee[m.callee].push(m.caller);
530
+ }
531
+ for (const [callee, callers] of Object.entries(byCallee)) {
532
+ results.warnings.push(`${callee}: missing callers in Called By: ${callers.join(', ')}`);
533
+ }
534
+ }
535
+
536
+ // Step 3: Check version maturity
537
+ const matureButLow = [];
538
+ for (const [name, skill] of skills) {
539
+ if (!skill.version) continue;
540
+ const [major, minor] = skill.version.split('.').map(Number);
541
+ // Suggest 1.0 if version is 0.8+ and has all required sections
542
+ if (major === 0 && minor >= 8 && skill.hasAllSections) {
543
+ matureButLow.push({ name, version: skill.version });
544
+ }
545
+ }
546
+
547
+ if (matureButLow.length === 0) {
548
+ results.checks.push({ name: 'Version maturity', status: 'pass' });
549
+ } else {
550
+ results.checks.push({
551
+ name: 'Version maturity',
552
+ status: 'warn',
553
+ detail: `${matureButLow.length} skills ready for 1.0`,
554
+ });
555
+ for (const s of matureButLow) {
556
+ results.warnings.push(`${s.name} v${s.version}: mature skill, consider promoting to 1.0`);
557
+ }
558
+ }
559
+
560
+ // Step 4: Check required sections
561
+ const requiredSections = ['Sharp Edges', 'Done When', 'Cost Profile'];
562
+ const missingSections = [];
563
+
564
+ for (const [name, skill] of skills) {
565
+ const missing = requiredSections.filter((s) => !skill.sections.includes(s));
566
+ if (missing.length > 0) {
567
+ missingSections.push({ name, missing });
568
+ }
569
+ }
570
+
571
+ if (missingSections.length === 0) {
572
+ results.checks.push({ name: 'Required sections', status: 'pass' });
573
+ } else {
574
+ results.checks.push({
575
+ name: 'Required sections',
576
+ status: 'warn',
577
+ detail: `${missingSections.length} skills incomplete`,
578
+ });
579
+ for (const s of missingSections) {
580
+ results.warnings.push(`${s.name}: missing sections: ${s.missing.join(', ')}`);
581
+ }
582
+ }
583
+
584
+ return results;
585
+ }
586
+
587
+ /**
588
+ * Parse skill connections from SKILL.md content
589
+ */
590
+ function parseSkillConnections(content, skillName) {
591
+ const result = {
592
+ name: skillName,
593
+ calls: [],
594
+ calledBy: [],
595
+ version: null,
596
+ sections: [],
597
+ hasAllSections: false,
598
+ };
599
+
600
+ // Extract version from frontmatter
601
+ const versionMatch = content.match(/version:\s*["']?([\d.]+)["']?/);
602
+ if (versionMatch) {
603
+ result.version = versionMatch[1];
604
+ }
605
+
606
+ // Extract Calls section
607
+ const callsMatch = content.match(/## Calls \(outbound\)\s*\n([\s\S]*?)(?=\n## |\n---|Z)/);
608
+ if (callsMatch) {
609
+ const lines = callsMatch[1].split('\n');
610
+ for (const line of lines) {
611
+ // Match patterns like: - `scout` (L2): scan codebase
612
+ // Or: - scout (L2): scan codebase
613
+ const match = line.match(/^-\s*`?([a-z][\w-]*)`?\s*\(L\d\)/i);
614
+ if (match) {
615
+ const skillRef = match[1].toLowerCase();
616
+ const reason = line
617
+ .replace(match[0], '')
618
+ .replace(/^[:\s-]+/, '')
619
+ .trim();
620
+ result.calls.push({ skill: skillRef, reason });
621
+ }
622
+ }
623
+ }
624
+
625
+ // Extract Called By section
626
+ const calledByMatch = content.match(/## Called By \(inbound\)\s*\n([\s\S]*?)(?=\n## |\n---|Z)/);
627
+ if (calledByMatch) {
628
+ const lines = calledByMatch[1].split('\n');
629
+ for (const line of lines) {
630
+ const match = line.match(/^-\s*`?([a-z][\w-]*)`?\s*\(L\d\)/i);
631
+ if (match) {
632
+ const skillRef = match[1].toLowerCase();
633
+ result.calledBy.push({ skill: skillRef });
634
+ }
635
+ }
636
+ }
637
+
638
+ // Check for required sections
639
+ const sectionPatterns = [
640
+ { name: 'Sharp Edges', pattern: /## Sharp Edges/ },
641
+ { name: 'Done When', pattern: /## Done When/ },
642
+ { name: 'Cost Profile', pattern: /## Cost Profile/ },
643
+ { name: 'Returns', pattern: /## Returns/ },
644
+ ];
645
+
646
+ for (const { name, pattern } of sectionPatterns) {
647
+ if (pattern.test(content)) {
648
+ result.sections.push(name);
649
+ }
650
+ }
651
+
652
+ result.hasAllSections = sectionPatterns.every(({ name }) => result.sections.includes(name));
653
+
654
+ return result;
655
+ }
656
+
657
+ /**
658
+ * Format mesh results for console output
659
+ */
660
+ export function formatMeshResults(results) {
661
+ const lines = [];
662
+ lines.push(`\n Mesh Integrity Check`);
663
+ lines.push(` Skills: ${results.stats.skills} | Connections: ${results.stats.connections}`);
664
+ lines.push('');
665
+
666
+ for (const check of results.checks) {
667
+ const icon = check.status === 'pass' ? '✓' : check.status === 'warn' ? '!' : '✗';
668
+ const detail = check.detail ? ` (${check.detail})` : '';
669
+ lines.push(` [${icon}] ${check.name}${detail}`);
670
+ }
671
+
672
+ if (results.warnings.length > 0) {
673
+ lines.push('');
674
+ for (const w of results.warnings) {
675
+ lines.push(` ⚠ ${w}`);
676
+ }
677
+ }
678
+
679
+ if (results.errors.length > 0) {
680
+ lines.push('');
681
+ for (const e of results.errors) {
682
+ lines.push(` ✗ ${e}`);
683
+ }
684
+ }
685
+
686
+ const healthy = results.errors.length === 0 && results.warnings.length === 0;
687
+ lines.push('');
688
+ lines.push(healthy ? ' ✓ Mesh is healthy' : ` ! Mesh has ${results.warnings.length} warnings`);
689
+
690
+ return lines.join('\n');
691
+ }
692
+
457
693
  /**
458
694
  * Format doctor results for console output
459
695
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rune-kit/rune",
3
- "version": "2.11.0",
4
- "description": "62-skill mesh for AI coding assistants — 5-layer architecture, 215+ connections, 8 platforms (Claude Code, Cursor, Windsurf, Antigravity, Codex, OpenCode, OpenClaw, Generic)",
3
+ "version": "2.12.2",
4
+ "description": "62-skill mesh for AI coding assistants — runtime auto-discipline via native hooks (Claude/Cursor/Windsurf/Antigravity), 5-layer architecture, 215+ connections, multi-platform compiler.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "rune": "./compiler/bin/rune.js"
@@ -3,7 +3,7 @@ name: ba
3
3
  description: Business Analyst agent. Deeply understands user requirements before any planning or coding begins. Asks probing questions, identifies hidden requirements, maps stakeholders, defines scope boundaries, and produces a structured Requirements Document that plan and cook consume.
4
4
  metadata:
5
5
  author: runedev
6
- version: "0.5.0"
6
+ version: "0.6.0"
7
7
  layer: L2
8
8
  model: opus
9
9
  group: creation
@@ -41,6 +41,7 @@ Output is a Requirements Document → hand off to rune:plan for implementation p
41
41
  - `cook` (L1): before Phase 2 PLAN, when task is non-trivial
42
42
  - `scaffold` (L1): Phase 1, before any project generation
43
43
  - `plan` (L2): when plan receives vague requirements
44
+ - `mcp-builder` (L2): requirements elicitation before MCP server design
44
45
  - User: `/rune ba` direct invocation
45
46
 
46
47
  ## Cross-Hub Connections
@@ -271,6 +272,47 @@ Assess and document ONLY relevant NFRs:
271
272
 
272
273
  Only include NFRs relevant to this specific task. Don't generate a generic checklist.
273
274
 
275
+ ### Step 6.5 — Tiered Recommendations
276
+
277
+ For product-oriented requirements (Feature Request, Integration, Greenfield), generate **tiered strategic recommendations**. This structures the path forward into actionable time horizons.
278
+
279
+ **Three Tiers:**
280
+
281
+ | Tier | Timeframe | Focus | Characteristics |
282
+ |------|-----------|-------|-----------------|
283
+ | **Quick Win** | 0-30 days | Immediate impact | Low effort, high visibility, builds momentum |
284
+ | **Differentiation** | 1-3 months | Competitive edge | Medium effort, unique value, hard to copy |
285
+ | **Long-term Moat** | 6-12 months | Sustainable advantage | High effort, defensible, compounds over time |
286
+
287
+ **For each tier, specify:**
288
+
289
+ ```markdown
290
+ ### Quick Win (0-30 days)
291
+ - **Action**: [Specific deliverable]
292
+ - **Resources**: [Team size, tools, dependencies]
293
+ - **Expected Impact**: [Measurable outcome]
294
+ - **Risk if skipped**: [What happens without this]
295
+
296
+ ### Differentiation (1-3 months)
297
+ - **Action**: [...]
298
+ - **Resources**: [...]
299
+ - **Expected Impact**: [...]
300
+ - **Risk if skipped**: [...]
301
+
302
+ ### Long-term Moat (6-12 months)
303
+ - **Action**: [...]
304
+ - **Resources**: [...]
305
+ - **Expected Impact**: [...]
306
+ - **Risk if skipped**: [...]
307
+ ```
308
+
309
+ **Rules:**
310
+ - Quick Win MUST be achievable in first sprint — no dependencies on later tiers
311
+ - Differentiation should create switching costs or unique capabilities
312
+ - Long-term Moat should compound (network effects, data moats, ecosystem lock-in)
313
+ - Every tier includes "Risk if skipped" — makes trade-offs explicit
314
+ - Skip this step for Bug Fix and Refactor types (no strategic dimension)
315
+
274
316
  ### Step 7 — Requirements Document
275
317
 
276
318
  Produce structured output and hand off to `plan`:
@@ -306,6 +348,24 @@ Created: [date] | BA Session: [summary]
306
348
  ## Risks
307
349
  - [risk]: [mitigation]
308
350
 
351
+ ## Strategic Recommendations
352
+ [from Step 6.5 — skip for Bug Fix/Refactor]
353
+
354
+ ### Quick Win (0-30 days)
355
+ - **Action**: [specific deliverable]
356
+ - **Resources**: [effort estimate]
357
+ - **Expected Impact**: [measurable outcome]
358
+
359
+ ### Differentiation (1-3 months)
360
+ - **Action**: [...]
361
+ - **Resources**: [...]
362
+ - **Expected Impact**: [...]
363
+
364
+ ### Long-term Moat (6-12 months)
365
+ - **Action**: [...]
366
+ - **Resources**: [...]
367
+ - **Expected Impact**: [...]
368
+
309
369
  ## Next Step
310
370
  → Hand off to rune:plan for implementation planning
311
371
  ```
@@ -360,6 +420,27 @@ US-1: As a [persona], I want to [action] so that [benefit]
360
420
 
361
421
  Plan gates on Decision compliance — Discretion items don't need approval.
362
422
 
423
+ ## Strategic Recommendations
424
+ [Skip for Bug Fix/Refactor]
425
+
426
+ ### Quick Win (0-30 days)
427
+ - **Action**: [immediate deliverable]
428
+ - **Resources**: [effort + dependencies]
429
+ - **Expected Impact**: [measurable KPI]
430
+ - **Risk if skipped**: [consequence]
431
+
432
+ ### Differentiation (1-3 months)
433
+ - **Action**: [competitive advantage work]
434
+ - **Resources**: [...]
435
+ - **Expected Impact**: [...]
436
+ - **Risk if skipped**: [...]
437
+
438
+ ### Long-term Moat (6-12 months)
439
+ - **Action**: [defensible position work]
440
+ - **Resources**: [...]
441
+ - **Expected Impact**: [...]
442
+ - **Risk if skipped**: [...]
443
+
363
444
  ## Next Step
364
445
  → Hand off to rune:plan for implementation planning
365
446
  ```
@@ -401,6 +482,8 @@ Known failure modes for this skill. Check these before declaring done.
401
482
  | Recommending shortcuts without Completeness Score | MEDIUM | Step 3.5: every option needs X/10 score + dual effort estimate (human vs AI). "90% coverage" is a red flag when 100% costs 15 min more |
402
483
  | Handing off to plan with ambiguity > 40% | CRITICAL | Step 2.5 HARD-GATE: compute ambiguity score after elicitation, block handoff if > 40%, ask targeted follow-up on weakest dimension |
403
484
  | Skipping ambiguity scoring because "user seems clear" | HIGH | Always compute the score — perceived clarity ≠ measured clarity. The formula catches gaps humans miss |
485
+ | Tiered recommendations too vague ("improve things") | MEDIUM | Each tier needs specific Action + measurable Expected Impact. "Build better UX" → "Reduce checkout steps from 5 to 3, targeting 15% conversion lift" |
486
+ | All three tiers have same resources/effort | MEDIUM | Quick Win should be low-effort. If all tiers need "2 engineers, 3 months" → re-scope Quick Win to something achievable in 1 sprint |
404
487
 
405
488
  ## Done When
406
489
 
@@ -411,6 +494,7 @@ Known failure modes for this skill. Check these before declaring done.
411
494
  - Scope defined (in/out/assumptions/dependencies)
412
495
  - User stories with testable acceptance criteria produced
413
496
  - Non-functional requirements assessed (relevant ones only)
497
+ - Tiered recommendations generated (Quick Win / Differentiation / Moat) — skip for Bug Fix/Refactor
414
498
  - Requirements Document saved to `.rune/features/<name>/requirements.md`
415
499
  - Handed off to `plan` for implementation planning
416
500
 
@@ -3,7 +3,7 @@ name: brainstorm
3
3
  description: Creative ideation and solution exploration. Generates multiple approaches with trade-offs, uses structured frameworks (SCAMPER, First Principles), and hands off to plan for structuring.
4
4
  metadata:
5
5
  author: runedev
6
- version: "0.4.0"
6
+ version: "0.5.0"
7
7
  layer: L2
8
8
  model: opus
9
9
  group: creation
@@ -101,6 +101,7 @@ Direct API call ≠ Wrapper/middleware layer ≠ Reverse engineering ≠ Browser
101
101
  - `plan` (L2): when architecture decision needs creative exploration (Discovery Mode)
102
102
  - User: `/rune brainstorm <topic>` direct invocation (Discovery Mode)
103
103
  - User: `/rune brainstorm rescue <context>` manual rescue (Rescue Mode)
104
+ - `ba` (L2): when multiple requirement approaches exist
104
105
 
105
106
  ## Cross-Hub Connections
106
107
 
@@ -243,6 +244,7 @@ Additionally in Rescue Mode:
243
244
  For approaches with many interacting variables, invoke `rune:sequential-thinking` to reason through trade-offs systematically.
244
245
 
245
246
  ### Step 4 — Recommend
247
+
246
248
  Select ONE approach as the recommendation. State:
247
249
  - Which option is recommended
248
250
  - Primary reason (1 sentence)
@@ -250,6 +252,42 @@ Select ONE approach as the recommendation. State:
250
252
 
251
253
  Do not recommend "it depends" without a concrete decision rule.
252
254
 
255
+ ### Step 4.5 — Tiered Recommendations (Product/Strategy Mode)
256
+
257
+ For product-level brainstorming (Vision Mode or when approaches have strategic implications), structure the recommendation into **time-horizon tiers**:
258
+
259
+ | Tier | Timeframe | Focus |
260
+ |------|-----------|-------|
261
+ | **Quick Win** | 0-30 days | Immediate value, validates direction, low risk |
262
+ | **Differentiation** | 1-3 months | Competitive advantage, harder to copy |
263
+ | **Long-term Moat** | 6-12 months | Defensible position, compounds over time |
264
+
265
+ **For each tier, specify:**
266
+
267
+ ```markdown
268
+ ### Quick Win (0-30 days)
269
+ - **Action**: [specific deliverable from the chosen approach]
270
+ - **Resources**: [team/tools needed]
271
+ - **Expected Impact**: [measurable outcome]
272
+ - **Validates**: [what assumption this proves/disproves]
273
+
274
+ ### Differentiation (1-3 months)
275
+ - **Action**: [...]
276
+ - **Resources**: [...]
277
+ - **Expected Impact**: [...]
278
+
279
+ ### Long-term Moat (6-12 months)
280
+ - **Action**: [...]
281
+ - **Resources**: [...]
282
+ - **Expected Impact**: [...]
283
+ ```
284
+
285
+ **Rules:**
286
+ - Quick Win MUST be achievable with chosen approach in first sprint
287
+ - Each tier builds on the previous — not 3 independent tracks
288
+ - Skip this step for pure technical brainstorming (no product/strategy dimension)
289
+ - If all tiers look equally expensive → approach may be too complex for Quick Win
290
+
253
291
  ### Step 5 — Return to Plan
254
292
  Pass the recommended approach back to `rune:plan` for structuring into an executable implementation plan. Include:
255
293
  - The chosen option name
@@ -24,6 +24,7 @@ Browser automation for testing and verification using MCP Playwright tools. Navi
24
24
  - `marketing` (L2): screenshot for assets
25
25
  - `launch` (L1): verify live site after deployment
26
26
  - `perf` (L2): Lighthouse / Core Web Vitals measurement
27
+ - `audit` (L2): visual verification during quality assessment
27
28
 
28
29
  ## Calls (outbound)
29
30
 
@@ -4,7 +4,7 @@ description: "Context window management. Auto-triggered when context is filling
4
4
  user-invocable: false
5
5
  metadata:
6
6
  author: runedev
7
- version: "0.9.0"
7
+ version: "1.0.0"
8
8
  layer: L3
9
9
  model: haiku
10
10
  group: state
@@ -44,7 +44,11 @@ Context-engine also manages **behavioral mode injection** via `contexts/` direct
44
44
 
45
45
  ## Called By (inbound)
46
46
 
47
- - Auto-triggered at phase boundaries and context thresholds by L1 orchestrators
47
+ - `cook` (L1): Phase boundaries and when tool count exceeds thresholds
48
+ - `team` (L1): before parallel workstream dispatch, after merge
49
+ - `rescue` (L1): between refactoring sessions for state persistence
50
+ - `context-pack` (L3): when packaging context for sub-agent handoff
51
+ - `session-bridge` (L3): coordinates with context-engine for compaction timing
48
52
 
49
53
  ## Execution
50
54
 
@@ -32,6 +32,7 @@ Design system reasoning layer. Converts a product description into a concrete de
32
32
  ## Called By (inbound)
33
33
 
34
34
  - `cook` (L1): before any frontend code generation
35
+ - `scaffold` (L1): design system for new project
35
36
  - `brainstorm` (L2): when selected approach has UI/UX implications
36
37
  - `ba` (L2): when requirements include UI/UX components
37
38
  - `review` (L2): when AI anti-pattern detected in diff
@@ -25,6 +25,7 @@ None — pure L3 utility using `WebSearch`, `WebFetch`, and Context7 MCP tools d
25
25
  - `debug` (L2): lookup API docs for unclear errors
26
26
  - `fix` (L2): check correct API usage before applying changes
27
27
  - `review` (L2): verify API usage is current and correct
28
+ - `adversary` (L2): verify framework/API assumptions in plan are correct
28
29
 
29
30
  ## Execution
30
31
 
@@ -3,7 +3,7 @@ name: fix
3
3
  description: Apply code changes and fixes. Writes implementation code, applies bug fixes, and verifies changes with tests. Core action hub in the development mesh.
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: development
@@ -49,6 +49,8 @@ If unsure whether the test is wrong or the implementation is wrong → call `run
49
49
  - `review` (L2): bug found during review, needs fixing
50
50
  - `surgeon` (L2): apply refactoring changes
51
51
  - `review-intake` (L2): apply fixes identified during structured review intake
52
+ - `graft` (L2): apply integration fixes for grafted code
53
+ - `scaffold` (L1): apply fixes during project scaffolding
52
54
 
53
55
  ## Cross-Hub Connections
54
56
 
@@ -278,7 +280,7 @@ Append to Fix Report when invoked standalone. Suppress when called as sub-skill
278
280
  ```yaml
279
281
  chain_metadata:
280
282
  skill: "rune:fix"
281
- version: "0.9.0"
283
+ version: "1.0.0"
282
284
  status: "[DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED]"
283
285
  domain: "[area fixed]"
284
286
  files_changed:
@@ -38,6 +38,7 @@ Post-generation validation that verifies AI-generated code references actually e
38
38
  - `db` (L2): verify SQL syntax and ORM method calls are real
39
39
  - `review-intake` (L2): verify imports in code submitted for review
40
40
  - `skill-forge` (L2): verify imports in newly generated skill code
41
+ - `adversary` (L2): verify APIs/packages in plan actually exist
41
42
 
42
43
  ## Execution
43
44
 
@@ -37,6 +37,7 @@ None — pure L3 state management utility.
37
37
  - `incident` (L2): record incident timeline and postmortem
38
38
  - `skill-forge` (L2): record skill creation decisions and rationale
39
39
  - `graft` (L2): auto-log graft operations — source URL, mode, challenge score, files changed
40
+ - `retro` (L2): record retrospective insights and decisions
40
41
 
41
42
  ## Files Managed
42
43
 
@@ -3,11 +3,12 @@ name: logic-guardian
3
3
  description: Protects complex business logic from accidental deletion or overwrite. Maintains a logic manifest, enforces pre-edit gates, and validates post-edit diffs.
4
4
  metadata:
5
5
  author: runedev
6
- version: "0.1.0"
6
+ version: "0.3.0"
7
7
  layer: L2
8
8
  model: sonnet
9
9
  group: quality
10
10
  tools: "Read, Write, Edit, Glob, Grep"
11
+ listen: invariants.loaded
11
12
  ---
12
13
 
13
14
  # logic-guardian
@@ -41,15 +42,23 @@ Complex projects (trading bots, payment systems, game engines, state machines) c
41
42
 
42
43
  ## Workflow
43
44
 
44
- ### Phase 0 — Load or Initialize Manifest
45
+ ### Phase 0 — Load Manifest + Invariants
45
46
 
46
47
  1. Use `Read` on `.rune/logic-manifest.json`
47
48
  2. If file exists:
48
49
  - Parse manifest, display summary: "Loaded logic manifest: N components, M functions, K parameters"
49
- - Proceed to Phase 1 (Validate)
50
- 3. If file does NOT exist:
50
+ - Proceed to step 4 (load invariants)
51
+ 3. If manifest does NOT exist:
51
52
  - Announce: "No logic manifest found. Scanning project to generate one."
52
53
  - Proceed to Phase 3 (Generate)
54
+ 4. Obtain invariants (seeded by `onboard` — see onboard Step 5.4):
55
+ - **Preferred**: consume the `invariants.loaded` signal emitted by `session-bridge` at session start (contains pre-parsed `rules[]` + stats). No second file read needed.
56
+ - **Fallback**: if no signal was emitted this session, `Read` `.rune/INVARIANTS.md` directly and invoke `skills/session-bridge/scripts/load-invariants.js` to parse.
57
+ - Entries come from `## Danger Zones`, `## Critical Invariants`, `## State Machine Rules`, `## Cross-File Consistency`, and `## Auto-detected (new)`. Archived rules are automatically excluded by the loader.
58
+ - Each entry follows the `WHAT / WHERE / WHY` contract from `invariants-template.md`.
59
+ - Treat `INVARIANTS.md` as the **primary source of cross-file rules** — the JSON manifest covers component-level signatures; INVARIANTS.md covers rules that span files (shared constants, state transitions, mirrored schemas).
60
+ - If the file is absent, log **WARN**: "INVARIANTS.md not found — run `rune onboard` to seed baseline rules." Do not block.
61
+ - Cache parsed rules keyed by glob so Phase 2 can match the edit target in O(rules × globs) time.
53
62
 
54
63
  ### Phase 1 — Validate Manifest Against Codebase
55
64
 
@@ -83,6 +92,15 @@ Before ANY edit to a manifested file:
83
92
  - What it will NOT change
84
93
  - Which existing functions/logic will be preserved
85
94
  4. If the agent cannot list the existing functions → BLOCK the edit. Force a `Read` of the file first.
95
+ 5. **Cross-file invariant check** — for each rule loaded from `.rune/INVARIANTS.md` in Phase 0:
96
+ - If the target file matches any rule's `WHERE` glob, surface the rule to the agent before the edit proceeds:
97
+ ```
98
+ INVARIANT (from .rune/INVARIANTS.md):
99
+ WHAT: <rule.what>
100
+ WHY: <rule.why>
101
+ ```
102
+ - The agent MUST either (a) acknowledge the rule in its plan, or (b) explicitly mark it obsolete and move the entry to `## Archived`.
103
+ - A matched rule with no acknowledgement → BLOCK in `strict` preset, WARN in `gentle` preset.
86
104
 
87
105
  ### Phase 3 — Generate Manifest (first-time or rescan)
88
106