@rune-kit/rune 2.2.4 → 2.3.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.
- package/README.md +1 -1
- package/compiler/adapters/openclaw.js +63 -0
- package/compiler/emitter.js +10 -0
- package/docs/EXTENSION-TEMPLATE.md +18 -0
- package/docs/SKILL-TEMPLATE.md +46 -0
- package/docs/guides/index.html +84 -21
- package/docs/index.html +303 -37
- package/docs/script.js +236 -18
- package/docs/style.css +417 -59
- package/extensions/saas/PACK.md +13 -8
- package/extensions/saas/skills/billing-integration.md +82 -3
- package/package.json +7 -5
- package/skills/adversary/SKILL.md +12 -0
- package/skills/audit/SKILL.md +64 -1
- package/skills/autopsy/SKILL.md +12 -0
- package/skills/ba/SKILL.md +63 -1
- package/skills/brainstorm/SKILL.md +11 -0
- package/skills/completion-gate/SKILL.md +51 -2
- package/skills/context-engine/SKILL.md +83 -1
- package/skills/context-pack/SKILL.md +160 -0
- package/skills/cook/SKILL.md +657 -808
- package/skills/cook/references/deviation-rules.md +19 -0
- package/skills/cook/references/error-recovery.md +37 -0
- package/skills/cook/references/exit-conditions.md +31 -0
- package/skills/cook/references/loop-detection.md +39 -0
- package/skills/cook/references/mid-run-signals.md +31 -0
- package/skills/cook/references/output-format.md +40 -0
- package/skills/cook/references/pack-detection.md +82 -0
- package/skills/cook/references/pause-resume-template.md +38 -0
- package/skills/cook/references/rfc-template.md +52 -0
- package/skills/cook/references/sharp-edges.md +24 -0
- package/skills/cook/references/subagent-status.md +38 -0
- package/skills/db/SKILL.md +12 -0
- package/skills/debug/SKILL.md +81 -2
- package/skills/deploy/SKILL.md +56 -1
- package/skills/design/SKILL.md +9 -0
- package/skills/docs/SKILL.md +12 -0
- package/skills/docs-seeker/SKILL.md +11 -0
- package/skills/fix/SKILL.md +63 -3
- package/skills/git/SKILL.md +55 -1
- package/skills/incident/SKILL.md +10 -0
- package/skills/journal/SKILL.md +51 -3
- package/skills/launch/SKILL.md +12 -0
- package/skills/logic-guardian/SKILL.md +11 -0
- package/skills/marketing/SKILL.md +13 -0
- package/skills/mcp-builder/SKILL.md +13 -0
- package/skills/onboard/SKILL.md +54 -2
- package/skills/perf/SKILL.md +11 -0
- package/skills/plan/SKILL.md +342 -629
- package/skills/plan/references/completeness-scoring.md +37 -0
- package/skills/plan/references/outcome-block.md +41 -0
- package/skills/plan/references/plan-templates.md +193 -0
- package/skills/plan/references/wave-planning.md +44 -0
- package/skills/plan/references/workflow-registry.md +53 -0
- package/skills/preflight/SKILL.md +135 -1
- package/skills/rescue/SKILL.md +10 -0
- package/skills/research/SKILL.md +36 -8
- package/skills/retro/SKILL.md +325 -0
- package/skills/review/SKILL.md +100 -1
- package/skills/review-intake/SKILL.md +11 -0
- package/skills/safeguard/SKILL.md +12 -0
- package/skills/scaffold/SKILL.md +10 -0
- package/skills/scope-guard/SKILL.md +11 -0
- package/skills/scout/SKILL.md +9 -0
- package/skills/sentinel/SKILL.md +307 -320
- package/skills/sentinel/references/config-protection.md +52 -0
- package/skills/sentinel/references/destructive-commands.md +40 -0
- package/skills/sentinel/references/domain-hooks.md +73 -0
- package/skills/sentinel/references/framework-patterns.md +46 -0
- package/skills/sentinel/references/owasp-patterns.md +69 -0
- package/skills/sentinel/references/secret-patterns.md +40 -0
- package/skills/sentinel/references/skill-content-guard.md +55 -0
- package/skills/session-bridge/SKILL.md +60 -2
- package/skills/skill-forge/SKILL.md +131 -4
- package/skills/skill-router/SKILL.md +33 -1
- package/skills/surgeon/SKILL.md +12 -0
- package/skills/team/SKILL.md +35 -1
- package/skills/test/SKILL.md +211 -7
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Completeness Scoring
|
|
2
|
+
|
|
3
|
+
> Reference for `plan` skill — Step 5.5.
|
|
4
|
+
> Load this when presenting alternative approaches from brainstorm or Step 3 decisions.
|
|
5
|
+
|
|
6
|
+
## Scoring Table
|
|
7
|
+
|
|
8
|
+
When presenting alternatives, rate each with **Completeness X/10**:
|
|
9
|
+
|
|
10
|
+
| Score | Meaning |
|
|
11
|
+
|-------|---------|
|
|
12
|
+
| 9-10 | Complete — all edge cases, full coverage, production-ready |
|
|
13
|
+
| 7-8 | Happy path covered, some edges skipped |
|
|
14
|
+
| 4-6 | Shortcut — defers significant work |
|
|
15
|
+
| 1-3 | Minimal viable, debt guaranteed |
|
|
16
|
+
|
|
17
|
+
## Rules
|
|
18
|
+
|
|
19
|
+
- **Always recommend the higher-completeness option.** With AI-assisted coding, the marginal cost of completeness is near-zero.
|
|
20
|
+
- Show **dual effort estimates** for each approach: `(human: ~X / AI: ~Y)`
|
|
21
|
+
- **Anti-pattern**: "Option B saves 70 LOC" → 70 LOC delta is meaningless with AI. Choose complete. The last 10% of coverage is where production bugs hide.
|
|
22
|
+
|
|
23
|
+
> Source: garrytan/gstack v0.9.0 — "Boil the Lake" principle.
|
|
24
|
+
|
|
25
|
+
## Example Format
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
**Option A: Full validation with Zod** — Completeness 9/10
|
|
29
|
+
- Covers: schema validation, error messages, type inference
|
|
30
|
+
- human: ~2h / AI: ~15min
|
|
31
|
+
- Recommended ✅
|
|
32
|
+
|
|
33
|
+
**Option B: Manual checks** — Completeness 5/10
|
|
34
|
+
- Covers: happy path only, defers edge cases
|
|
35
|
+
- human: ~30min / AI: ~5min
|
|
36
|
+
- Not recommended — defers 40% of error handling
|
|
37
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Outcome Block Format
|
|
2
|
+
|
|
3
|
+
> Reference for `plan` skill — mandatory output section for all plan outputs.
|
|
4
|
+
> Load this when writing the final section of any master plan, phase file, or inline plan.
|
|
5
|
+
|
|
6
|
+
## Format
|
|
7
|
+
|
|
8
|
+
Every plan output MUST end with an **Outcome Block**:
|
|
9
|
+
|
|
10
|
+
```markdown
|
|
11
|
+
## Outcome Block
|
|
12
|
+
|
|
13
|
+
### What Was Planned
|
|
14
|
+
<1-2 sentences: what this plan delivers when all phases execute successfully>
|
|
15
|
+
|
|
16
|
+
### Immediate Next Action
|
|
17
|
+
<The SINGLE next action the executor should take right now — not a list, one action>
|
|
18
|
+
Example: "Load phase 1 file and execute Wave 1 tasks (create types, validation schema)"
|
|
19
|
+
|
|
20
|
+
### How to Measure Success
|
|
21
|
+
| Metric | Target | How to Check |
|
|
22
|
+
|--------|--------|-------------|
|
|
23
|
+
| Tests pass | 100% green | `npm test` or `pytest -v` |
|
|
24
|
+
| Type errors | 0 | `tsc --noEmit` or `mypy` |
|
|
25
|
+
| Phase complete | All tasks ✅ | phase file task list |
|
|
26
|
+
| <domain metric> | <value> | <command> |
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Rules
|
|
30
|
+
|
|
31
|
+
1. Outcome Block is the LAST section in every plan output (master plan, phase file, inline plan)
|
|
32
|
+
2. "Immediate Next Action" = ONE action, present tense, imperative mood. Not a list.
|
|
33
|
+
3. "How to Measure" table MUST include at least one verifiable shell command
|
|
34
|
+
4. For phase files: Immediate Next Action = "Execute Wave 1: [list Wave 1 task names]"
|
|
35
|
+
5. For master plans: Immediate Next Action = "Await approval, then load phase 1 file"
|
|
36
|
+
|
|
37
|
+
## Why This Matters
|
|
38
|
+
|
|
39
|
+
Plans without a clear "what to do NOW" cause executor drift — agents re-read the plan, re-analyze, and pick arbitrary starting points. The Immediate Next Action eliminates ambiguity: there is exactly ONE right first move.
|
|
40
|
+
|
|
41
|
+
> Source: Affitor/affiliate-skills — every output ends with: outcome achieved + immediate next action + measurement metric ("What happened → What to do now → How to measure").
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Plan Templates
|
|
2
|
+
|
|
3
|
+
> Reference for `plan` skill — Steps 4 and 5.
|
|
4
|
+
> Load this when writing master plan files or phase files.
|
|
5
|
+
|
|
6
|
+
## Master Plan Template
|
|
7
|
+
|
|
8
|
+
Save to `.rune/plan-<feature>.md`. Max 80 lines.
|
|
9
|
+
|
|
10
|
+
```markdown
|
|
11
|
+
# Feature: <name>
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
<1-3 sentences: what and why>
|
|
15
|
+
|
|
16
|
+
## Phases
|
|
17
|
+
| # | Name | Status | Plan File | Summary |
|
|
18
|
+
|---|------|--------|-----------|---------|
|
|
19
|
+
| 1 | Foundation | ⬚ Pending | plan-X-phase1.md | Types, core engine, basic UI |
|
|
20
|
+
| 2 | Interaction | ⬚ Pending | plan-X-phase2.md | Dialogue, combat, items |
|
|
21
|
+
| 3 | Polish | ⬚ Pending | plan-X-phase3.md | Effects, sounds, game over |
|
|
22
|
+
|
|
23
|
+
## Key Decisions
|
|
24
|
+
- <decision 1 — chosen approach and why>
|
|
25
|
+
- <decision 2>
|
|
26
|
+
|
|
27
|
+
## Decision Compliance
|
|
28
|
+
- Decisions (locked): [list from requirements.md — plan MUST honor these]
|
|
29
|
+
- Discretion (agent): [list — agent chose X because Y]
|
|
30
|
+
- Deferred: [list — explicitly excluded from this feature]
|
|
31
|
+
|
|
32
|
+
## Architecture
|
|
33
|
+
<brief system diagram or component list — NOT implementation detail>
|
|
34
|
+
|
|
35
|
+
## Dependencies
|
|
36
|
+
- <external dep>: <status>
|
|
37
|
+
|
|
38
|
+
## Risks
|
|
39
|
+
- <risk>: <mitigation>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
No implementation details — that's what phase files are for.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Phase File Template (Amateur-Proof)
|
|
47
|
+
|
|
48
|
+
Save to `.rune/plan-<feature>-phase<N>.md`. Max 200 lines.
|
|
49
|
+
|
|
50
|
+
Phase files follow the **Amateur-Proof Template** — designed so that even the weakest model (Haiku) can execute without guessing. Every section exists because an Amateur said "I need this to code correctly."
|
|
51
|
+
|
|
52
|
+
```markdown
|
|
53
|
+
# Phase N: <name>
|
|
54
|
+
|
|
55
|
+
## Goal
|
|
56
|
+
<What this phase delivers — 1-2 sentences>
|
|
57
|
+
|
|
58
|
+
## Data Flow
|
|
59
|
+
<5-line ASCII diagram showing how data moves through this phase's components>
|
|
60
|
+
```
|
|
61
|
+
User Input → validateInput() → calculateProfit() → formatResult() → API Response
|
|
62
|
+
↓
|
|
63
|
+
TradeEntry[]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Code Contracts
|
|
67
|
+
<Function signatures, interfaces, schemas that this phase MUST implement>
|
|
68
|
+
<This is the MOST IMPORTANT section — coder implements these contracts>
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
interface TradeEntry {
|
|
72
|
+
side: 'long' | 'short';
|
|
73
|
+
entryPrice: number;
|
|
74
|
+
exitPrice: number;
|
|
75
|
+
quantity: number;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
interface ProfitResult {
|
|
79
|
+
netPnL: number;
|
|
80
|
+
totalFees: number;
|
|
81
|
+
winRate: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function calculateProfit(entries: TradeEntry[]): ProfitResult;
|
|
85
|
+
function validateInput(raw: unknown): TradeEntry[]; // throws ValidationError
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Tasks
|
|
89
|
+
|
|
90
|
+
Each task MUST include: **File** (exact path), **Test** (test file or N/A), **Verify** (shell command), **Commit** (semantic message). Granularity: 2-5 min per task. If >10min, decompose.
|
|
91
|
+
|
|
92
|
+
- [ ] Task 1 — Create calculateProfit function
|
|
93
|
+
- Req: REQ-001 (P&L calculation)
|
|
94
|
+
- File: `src/foo/bar.ts` (new)
|
|
95
|
+
- Test: `tests/foo/bar.test.ts` (new)
|
|
96
|
+
- Verify: `npm test -- --grep "calculateProfit"`
|
|
97
|
+
- Commit: `feat(trading): add calculateProfit with fee calculation`
|
|
98
|
+
- Logic: sum entries by side, apply fees (0.1% per trade), return net P&L
|
|
99
|
+
- Edge: empty array → return { netPnL: 0, totalFees: 0, winRate: 0 }
|
|
100
|
+
- [ ] Task 2 — Add input validation
|
|
101
|
+
- Req: REQ-002 (input validation)
|
|
102
|
+
- File: `src/foo/baz.ts` (modify)
|
|
103
|
+
- Test: `tests/foo/baz.test.ts` (new)
|
|
104
|
+
- Verify: `npm test -- --grep "validateInput"`
|
|
105
|
+
- Commit: `feat(trading): add input validation for trade entries`
|
|
106
|
+
- Logic: check side is 'long'|'short', prices > 0, quantity > 0
|
|
107
|
+
- [ ] Task 3 — Write integration tests
|
|
108
|
+
- Req: REQ-001, REQ-002 (integration coverage)
|
|
109
|
+
- File: `tests/foo/bar.test.ts` (modify)
|
|
110
|
+
- Test: N/A — this IS the test task
|
|
111
|
+
- Verify: `npm test -- --grep "trading" && npx tsc --noEmit`
|
|
112
|
+
- Commit: `test(trading): add integration tests for edge cases`
|
|
113
|
+
- Cases: happy path, empty input, negative values, overflow
|
|
114
|
+
|
|
115
|
+
## Failure Scenarios
|
|
116
|
+
<What should happen when things go wrong — coder MUST implement these>
|
|
117
|
+
|
|
118
|
+
| When | Then | Error Type |
|
|
119
|
+
|------|------|-----------|
|
|
120
|
+
| entries is empty array | return zero-value ProfitResult | No error (valid edge case) |
|
|
121
|
+
| entry has negative price | throw ValidationError("price must be positive") | ValidationError |
|
|
122
|
+
| entry has quantity = 0 | throw ValidationError("quantity must be > 0") | ValidationError |
|
|
123
|
+
| calculation overflows Number.MAX_SAFE_INTEGER | use BigInt or throw OverflowError | OverflowError |
|
|
124
|
+
|
|
125
|
+
## Performance Constraints
|
|
126
|
+
<Non-functional requirements — skip if not applicable>
|
|
127
|
+
|
|
128
|
+
| Metric | Requirement | Why |
|
|
129
|
+
|--------|-------------|-----|
|
|
130
|
+
| Input size | Must handle 10,000 entries | Production data volume |
|
|
131
|
+
| Response time | < 100ms for 10K entries | Real-time dashboard |
|
|
132
|
+
| Memory | < 50MB for 10K entries | Container memory limit |
|
|
133
|
+
|
|
134
|
+
## Rejection Criteria (DO NOT)
|
|
135
|
+
<Anti-patterns the coder MUST avoid — things that seem right but are wrong>
|
|
136
|
+
|
|
137
|
+
- ❌ DO NOT use `toFixed()` for financial calculations — use Decimal.js or integer cents
|
|
138
|
+
- ❌ DO NOT mutate the input array — create new objects (immutability rule)
|
|
139
|
+
- ❌ DO NOT use `any` type — full TypeScript strict
|
|
140
|
+
- ❌ DO NOT import from Phase 2+ files — this phase is self-contained
|
|
141
|
+
|
|
142
|
+
## Cross-Phase Context
|
|
143
|
+
<What this phase assumes from previous phases / what future phases expect from this one>
|
|
144
|
+
|
|
145
|
+
- **Assumes**: Phase 1 created `src/shared/types.ts` with base types
|
|
146
|
+
- **Exports for Phase 3**: `calculateProfit()` will be imported by `src/dashboard/PnLCard.tsx`
|
|
147
|
+
- **Interface contract**: ProfitResult shape MUST NOT change — Phase 3 depends on it
|
|
148
|
+
|
|
149
|
+
## Acceptance Criteria
|
|
150
|
+
- [ ] All tasks marked done
|
|
151
|
+
- [ ] Tests pass with 80%+ coverage on new code
|
|
152
|
+
- [ ] No TypeScript errors (`tsc --noEmit` passes)
|
|
153
|
+
- [ ] Failure scenarios all handled (table above)
|
|
154
|
+
- [ ] Performance: calculateProfit(10K entries) < 100ms
|
|
155
|
+
- [ ] No `any` types, no mutation, no `toFixed()` for money
|
|
156
|
+
|
|
157
|
+
## Traceability Matrix
|
|
158
|
+
| Req ID | Requirement | Task(s) | Test(s) | Status |
|
|
159
|
+
|--------|-------------|---------|---------|--------|
|
|
160
|
+
| REQ-001 | P&L calculation with fees | Task 1 | `tests/foo/bar.test.ts` | ⬚ |
|
|
161
|
+
| REQ-002 | Input validation | Task 2 | `tests/foo/baz.test.ts` | ⬚ |
|
|
162
|
+
|
|
163
|
+
Every requirement from BA's Requirements Document MUST appear in this matrix. Missing requirement = incomplete phase. `completion-gate` checks this matrix during verification.
|
|
164
|
+
|
|
165
|
+
## Files Touched
|
|
166
|
+
- `src/foo/bar.ts` — new
|
|
167
|
+
- `src/foo/baz.ts` — modify
|
|
168
|
+
- `tests/foo/bar.test.ts` — new
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Must be self-contained — coder should NOT need to read master plan or other phases to execute.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Inline Plan Template (Trivial Tasks)
|
|
176
|
+
|
|
177
|
+
For trivial tasks (1-2 phases, < 5 files, < 100 LOC):
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
## Plan: [Task Name]
|
|
181
|
+
|
|
182
|
+
### Changes
|
|
183
|
+
1. [file]: [what to change] — [function signature]
|
|
184
|
+
2. [file]: [what to change]
|
|
185
|
+
|
|
186
|
+
### Tests
|
|
187
|
+
- [test file]: [test cases]
|
|
188
|
+
|
|
189
|
+
### Risks
|
|
190
|
+
- [risk]: [mitigation]
|
|
191
|
+
|
|
192
|
+
Awaiting approval.
|
|
193
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Wave-Based Task Grouping
|
|
2
|
+
|
|
3
|
+
> Reference for `plan` skill — Step 3 (Decompose into Phases).
|
|
4
|
+
> Load this when writing wave-structured task lists inside a phase.
|
|
5
|
+
|
|
6
|
+
## Wave Format
|
|
7
|
+
|
|
8
|
+
Tasks inside a phase MUST be organized into **waves** based on dependency analysis. Independent tasks within the same wave can execute in parallel.
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
## Tasks
|
|
12
|
+
|
|
13
|
+
### Wave 1 (parallel — no dependencies)
|
|
14
|
+
- [ ] Task 1 — Create types/interfaces
|
|
15
|
+
- File: `src/types.ts` (new)
|
|
16
|
+
- ...
|
|
17
|
+
- [ ] Task 2 — Create validation schema
|
|
18
|
+
- File: `src/validation.ts` (new)
|
|
19
|
+
- ...
|
|
20
|
+
|
|
21
|
+
### Wave 2 (depends on Wave 1)
|
|
22
|
+
- [ ] Task 3 — Implement core logic (imports types from Task 1)
|
|
23
|
+
- File: `src/core.ts` (new)
|
|
24
|
+
- depends_on: [Task 1]
|
|
25
|
+
- ...
|
|
26
|
+
|
|
27
|
+
### Wave 3 (depends on Wave 2)
|
|
28
|
+
- [ ] Task 4 — Wire into API endpoint (imports core from Task 3)
|
|
29
|
+
- File: `src/routes/api.ts` (modify)
|
|
30
|
+
- depends_on: [Task 3]
|
|
31
|
+
- ...
|
|
32
|
+
- [ ] Task 5 — Write integration tests (tests core from Task 3)
|
|
33
|
+
- File: `tests/core.test.ts` (new)
|
|
34
|
+
- depends_on: [Task 3]
|
|
35
|
+
- ...
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Wave Rules
|
|
39
|
+
|
|
40
|
+
- **Wave 1** = tasks with zero dependencies (types, schemas, configs) — always first
|
|
41
|
+
- **Subsequent waves**: a task goes in the earliest wave where ALL its `depends_on` tasks are in prior waves
|
|
42
|
+
- Tasks within the same wave have NO dependencies on each other → safe for parallel dispatch
|
|
43
|
+
- `depends_on` field is MANDATORY for Wave 2+ tasks — explicit is better than implicit
|
|
44
|
+
- `team` orchestrator can dispatch wave tasks as parallel subagents; solo `cook` executes sequentially within a wave but respects wave ordering
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Workflow Registry (4-View)
|
|
2
|
+
|
|
3
|
+
> Reference for `plan` skill — Step 4.5.
|
|
4
|
+
> Load this when building a Workflow Registry for complex features (4+ phases OR 3+ user-facing workflows).
|
|
5
|
+
|
|
6
|
+
## When to Use
|
|
7
|
+
|
|
8
|
+
Build this registry BEFORE writing phase files for complex features. It catches missing pieces, dead ends, and integration gaps at plan time — not implementation time.
|
|
9
|
+
|
|
10
|
+
**Skip conditions**: trivial tasks, inline plans, single-workflow features.
|
|
11
|
+
|
|
12
|
+
> Source: agency-agents (msitarzewski/agency-agents, 50.8k★): "Every route is an entry point. Every worker is a workflow. If it's missing from the registry, it doesn't exist."
|
|
13
|
+
|
|
14
|
+
## 4-View Format
|
|
15
|
+
|
|
16
|
+
```markdown
|
|
17
|
+
## Workflow Registry
|
|
18
|
+
|
|
19
|
+
### View 1: By Workflow
|
|
20
|
+
| Workflow | Entry Point | Components Touched | Exit Point | Phase |
|
|
21
|
+
|----------|-------------|-------------------|------------|-------|
|
|
22
|
+
| User signup | POST /auth/register | AuthService, UserRepo, EmailService | 201 + email sent | Phase 1 |
|
|
23
|
+
| Password reset | POST /auth/reset | AuthService, EmailService, TokenRepo | 200 + reset email | Phase 2 |
|
|
24
|
+
|
|
25
|
+
### View 2: By Component
|
|
26
|
+
| Component | Used By Workflows | Owner Phase | Status |
|
|
27
|
+
|-----------|-------------------|-------------|--------|
|
|
28
|
+
| AuthService | signup, login, reset | Phase 1 | Planned |
|
|
29
|
+
| EmailService | signup, reset, invite | Phase 2 | Planned |
|
|
30
|
+
| TokenRepo | reset, invite | Phase 2 | Missing ← RED FLAG |
|
|
31
|
+
|
|
32
|
+
### View 3: By User Journey
|
|
33
|
+
| Journey | Steps (workflow chain) | Happy Path | Error Path |
|
|
34
|
+
|---------|----------------------|------------|------------|
|
|
35
|
+
| New user → first action | signup → verify email → login → onboard | 4 steps | signup fail, email bounce |
|
|
36
|
+
|
|
37
|
+
### View 4: By State
|
|
38
|
+
| Step | User Sees | DB State | Logs | Operator Sees |
|
|
39
|
+
|------|-----------|----------|------|---------------|
|
|
40
|
+
| After signup | "Check your email" | user.status=pending | user.created event | New user in admin |
|
|
41
|
+
| After verify | Dashboard | user.status=active | user.verified event | Active user count +1 |
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Validation Rules
|
|
45
|
+
|
|
46
|
+
- Every component in View 2 MUST appear in at least one workflow in View 1 — orphaned components = dead code
|
|
47
|
+
- Every workflow in View 1 MUST map to a phase — unphased workflows will be forgotten
|
|
48
|
+
- **"Missing" status in View 2 = red flag** — component needed but not planned in any phase → add to a phase or create new phase
|
|
49
|
+
- Every user journey step in View 3 MUST have a corresponding state row in View 4
|
|
50
|
+
|
|
51
|
+
## Output Placement
|
|
52
|
+
|
|
53
|
+
Add the registry to the master plan file (it fits within the 80-line budget when tables are compact). Phase files reference it but don't duplicate it.
|
|
@@ -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.
|
|
6
|
+
version: "0.6.0"
|
|
7
7
|
layer: L2
|
|
8
8
|
model: sonnet
|
|
9
9
|
group: quality
|
|
@@ -158,6 +158,119 @@ Verify that new code ships complete:
|
|
|
158
158
|
|
|
159
159
|
If any completeness item is missing, flag as **WARN** with: what is missing, which file needs it.
|
|
160
160
|
|
|
161
|
+
### Step 4.2 — Coherence Check
|
|
162
|
+
|
|
163
|
+
Verify that new code is **consistent with existing project patterns** — not just correct, but coherent with the codebase it lives in.
|
|
164
|
+
|
|
165
|
+
| Check | What To Look For | Severity |
|
|
166
|
+
|-------|------------------|----------|
|
|
167
|
+
| Naming conventions | New functions/variables follow project's existing naming style (camelCase, snake_case, etc.) | WARN |
|
|
168
|
+
| File organization | New files placed in correct directory per project structure (e.g., utils/ not lib/, components/ not ui/) | WARN |
|
|
169
|
+
| Import patterns | Uses project's established import style (absolute vs relative, barrel exports vs direct) | WARN |
|
|
170
|
+
| Error handling style | Matches project's existing pattern (Result type, try/catch, error codes) | WARN |
|
|
171
|
+
| State management | Uses same state approach as rest of project (Zustand, context, stores) | BLOCK if different paradigm |
|
|
172
|
+
| API patterns | Follows existing response format, middleware chain, auth pattern | BLOCK if diverges |
|
|
173
|
+
| Design system usage | Uses existing design tokens/components, not inline overrides | WARN |
|
|
174
|
+
|
|
175
|
+
**Detection**: Read 2-3 existing files in the same directory as the change. Compare patterns. Flag divergences.
|
|
176
|
+
|
|
177
|
+
**Skip if**: Project has no established patterns (greenfield, <5 files), or CLAUDE.md/conventions.md explicitly says "no conventions yet."
|
|
178
|
+
|
|
179
|
+
> Source: Fission-AI/OpenSpec (32.8k★) — Coherence axis: "follows design.md? matches project patterns?"
|
|
180
|
+
|
|
181
|
+
### Step 4.3 — Eval Verification
|
|
182
|
+
|
|
183
|
+
If `.rune/evals/` directory exists with eval definition files, verify eval results as part of the quality gate.
|
|
184
|
+
|
|
185
|
+
| Check | Action | Severity |
|
|
186
|
+
|-------|--------|----------|
|
|
187
|
+
| Capability eval defined but not run | Feature has `.rune/evals/<feature>.md` with CAP-* entries but no results | WARN: "Capability evals defined but not executed" |
|
|
188
|
+
| Regression eval failing | Any REG-* eval with status=fail | BLOCK: "Regression detected — existing behavior broken" |
|
|
189
|
+
| Capability eval below threshold | CAP-* eval pass@k below defined threshold | WARN: "Capability eval below threshold (X% vs Y% required)" |
|
|
190
|
+
| No eval file for new feature | New feature added (detected by new test files + new source files) but no `.rune/evals/` entry | INFO: "Consider defining capability evals for new feature" |
|
|
191
|
+
|
|
192
|
+
**Skip if**: No `.rune/evals/` directory exists (project hasn't adopted eval-driven development).
|
|
193
|
+
|
|
194
|
+
> Source: affaan-m/everything-claude-code (91.9k★) — eval-driven development as quality gate.
|
|
195
|
+
|
|
196
|
+
### Step 4.5 — Domain Quality Hooks
|
|
197
|
+
|
|
198
|
+
Apply domain-specific quality checks based on detected file types in the diff. These extend the generic completeness checks in Step 4 with deeper domain validation.
|
|
199
|
+
|
|
200
|
+
<HARD-GATE>
|
|
201
|
+
Domain hooks are additive — they add checks, never remove generic ones from Steps 1-4.
|
|
202
|
+
If a domain hook flags BLOCK, the overall preflight verdict is BLOCK regardless of other steps.
|
|
203
|
+
</HARD-GATE>
|
|
204
|
+
|
|
205
|
+
#### Hook Selection (auto-detect from diff)
|
|
206
|
+
|
|
207
|
+
| Detected Pattern | Domain Hook | Key Checks |
|
|
208
|
+
|-----------------|-------------|------------|
|
|
209
|
+
| `migrations/*.sql`, `*.migration.*` | Database | Rollback script present, no bare DROP/DELETE, migration tested |
|
|
210
|
+
| `openapi.*`, `*.graphql`, `*.proto` | API Contract | Breaking changes flagged, version bumped, deprecated fields documented |
|
|
211
|
+
| `docs/policies/*`, `PRIVACY*`, `TERMS*` | Legal/Compliance | No placeholder text, review date current, practice matches policy |
|
|
212
|
+
| `**/billing*`, `**/payment*`, `**/invoice*` | Financial | Decimal precision correct, currency locale-aware, no hardcoded rates |
|
|
213
|
+
| `skills/*/SKILL.md`, `extensions/*/PACK.md` | Rune Skill | Frontmatter valid, all required sections present, word count within layer budget |
|
|
214
|
+
| `*.test.*`, `*.spec.*`, `__tests__/*` | Test Quality | No `.skip`/`.only` left in, assertions present (not empty tests), no hardcoded timeouts |
|
|
215
|
+
|
|
216
|
+
#### Domain Hook Execution
|
|
217
|
+
|
|
218
|
+
For each detected domain, run its checks on the relevant files in the diff:
|
|
219
|
+
|
|
220
|
+
1. **Identify** which domain hooks apply based on changed file patterns
|
|
221
|
+
2. **Load** domain-specific check rules (inline above, or from pack reference files if a pack is installed)
|
|
222
|
+
3. **Scan** each relevant file for domain violations
|
|
223
|
+
4. **Classify** findings: BLOCK (data loss risk, breaking contract) or WARN (best practice, incomplete)
|
|
224
|
+
5. **Append** to preflight report under `### Domain Quality` section
|
|
225
|
+
|
|
226
|
+
#### Pack Integration
|
|
227
|
+
|
|
228
|
+
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:
|
|
229
|
+
- Installing `@rune-pro/finance` automatically adds financial quality gates to preflight
|
|
230
|
+
- Installing `@rune-pro/legal` automatically adds compliance checks to preflight
|
|
231
|
+
- No manual configuration needed — pack presence = hooks active
|
|
232
|
+
|
|
233
|
+
#### Output Section
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
### Domain Quality
|
|
237
|
+
- **Domains detected**: [Database, Financial]
|
|
238
|
+
- `migrations/003-add-billing.sql` — BLOCK: DROP TABLE without rollback script
|
|
239
|
+
- `src/billing/invoice.ts:42` — WARN: price calculation uses `toFixed(2)` instead of `Intl.NumberFormat`
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Step 4.8 — Preflight Composite Score
|
|
243
|
+
|
|
244
|
+
After all domain hooks (Step 4.5) and completeness checks (Step 4) complete, compute a **Preflight Health Score** to make the verdict numeric and comparable across runs.
|
|
245
|
+
|
|
246
|
+
### Formula
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
Preflight Score = (Logic × 0.30) + (Error Handling × 0.20) + (Completeness × 0.20) + (Coherence × 0.15) + (Regression Risk × 0.15)
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**5 verification axes** (Completeness + Correctness via Logic + Coherence — 3D verification model):
|
|
253
|
+
|
|
254
|
+
Each dimension is scored per staged files:
|
|
255
|
+
- 0 BLOCK findings in dimension → 100
|
|
256
|
+
- 1 BLOCK → dimension capped at 30
|
|
257
|
+
- 1 WARN → dimension capped at 75
|
|
258
|
+
- Each additional WARN → subtract 10 (floor: 40)
|
|
259
|
+
|
|
260
|
+
### Grade Thresholds
|
|
261
|
+
|
|
262
|
+
| Score | Grade | Verdict |
|
|
263
|
+
|-------|-------|---------|
|
|
264
|
+
| 90–100 | Excellent | PASS |
|
|
265
|
+
| 75–89 | Good | PASS with notes |
|
|
266
|
+
| 60–74 | Fair | WARN |
|
|
267
|
+
| 40–59 | Poor | WARN (escalate to developer) |
|
|
268
|
+
| 0–39 | Critical | BLOCK |
|
|
269
|
+
|
|
270
|
+
Score is appended to the Preflight Report footer. Useful for tracking quality trend across sprints when cook logs preflight scores to `.rune/metrics/`.
|
|
271
|
+
|
|
272
|
+
> Source: zubair-trabzada/geo-seo-claude (2.7k★) — weighted formula, 5-tier thresholds, comparable across runs.
|
|
273
|
+
|
|
161
274
|
### Step 5 — Security Sub-Check
|
|
162
275
|
Invoke `rune:sentinel` on the changed files. Attach sentinel's output verbatim under the "Security" section of the preflight report. If sentinel returns BLOCK, preflight verdict is also BLOCK.
|
|
163
276
|
|
|
@@ -191,9 +304,17 @@ Report PASS, WARN, or BLOCK. For WARN, list each item the developer must acknowl
|
|
|
191
304
|
- `api/users.ts` — new POST endpoint missing input validation schema
|
|
192
305
|
- `components/Form.tsx` — no loading state during submission
|
|
193
306
|
|
|
307
|
+
### Coherence
|
|
308
|
+
- `api/users.ts` — uses `res.json()` but project convention is `sendResponse()` wrapper
|
|
309
|
+
- `utils/newHelper.ts` — placed in utils/ but project uses helpers/ directory
|
|
310
|
+
|
|
194
311
|
### Security (from sentinel)
|
|
195
312
|
- [sentinel findings if any]
|
|
196
313
|
|
|
314
|
+
### Composite Score
|
|
315
|
+
- Logic: [score] | Error: [score] | Completeness: [score] | Coherence: [score] | Regression: [score]
|
|
316
|
+
- **Preflight Score**: [weighted value] → Grade: [Excellent/Good/Fair/Poor/Critical]
|
|
317
|
+
|
|
197
318
|
### Verdict
|
|
198
319
|
WARN — 3 issues found (0 blocking, 3 must-acknowledge). Resolve before commit or explicitly acknowledge each WARN.
|
|
199
320
|
```
|
|
@@ -206,6 +327,16 @@ WARN — 3 issues found (0 blocking, 3 must-acknowledge). Resolve before commit
|
|
|
206
327
|
4. MUST verify error messages are user-friendly and don't leak internal details
|
|
207
328
|
5. MUST check that async operations have proper error handling and cleanup
|
|
208
329
|
|
|
330
|
+
## Returns
|
|
331
|
+
|
|
332
|
+
| Artifact | Format | Location |
|
|
333
|
+
|----------|--------|----------|
|
|
334
|
+
| Preflight report | Markdown | inline (chat output) |
|
|
335
|
+
| Issue list (BLOCK/WARN by category) | Markdown list | inline |
|
|
336
|
+
| Preflight health score | Markdown table | inline (footer of report) |
|
|
337
|
+
| Spec compliance verdict | Markdown table | inline |
|
|
338
|
+
| Domain quality findings | Markdown section | inline |
|
|
339
|
+
|
|
209
340
|
## Sharp Edges
|
|
210
341
|
|
|
211
342
|
| Failure Mode | Severity | Mitigation |
|
|
@@ -216,6 +347,9 @@ WARN — 3 issues found (0 blocking, 3 must-acknowledge). Resolve before commit
|
|
|
216
347
|
| Skipping sentinel sub-check because "this file doesn't look security-relevant" | HIGH | MUST invoke sentinel — security relevance is sentinel's job to determine, not preflight's |
|
|
217
348
|
| Skipping Stage A (spec compliance) when plan is available | HIGH | If cook provides an approved plan, Stage A is mandatory — catches incomplete implementations |
|
|
218
349
|
| Agent modified files not in plan without flagging | MEDIUM | Stage A flags unplanned file changes as WARN — scope creep detection |
|
|
350
|
+
| Domain hooks not triggered when pack is installed | HIGH | Step 4.5 auto-detects file patterns — if pack is installed but hooks don't fire, check file pattern matching |
|
|
351
|
+
| Domain hooks overriding generic checks | HIGH | HARD-GATE: domain hooks are ADDITIVE — they never replace Steps 1-4 |
|
|
352
|
+
| Pack Hard-Stop Thresholds ignored in preflight | MEDIUM | Step 4.5 Pack Integration must read installed pack thresholds — test with each new pack |
|
|
219
353
|
|
|
220
354
|
## Done When
|
|
221
355
|
|
package/skills/rescue/SKILL.md
CHANGED
|
@@ -413,6 +413,16 @@ Rollback point: git tag rune-rescue-baseline (set in Phase 0)
|
|
|
413
413
|
- **Rollback Tag**: [git tag name]
|
|
414
414
|
```
|
|
415
415
|
|
|
416
|
+
## Returns
|
|
417
|
+
|
|
418
|
+
| Artifact | Format | Location |
|
|
419
|
+
|----------|--------|----------|
|
|
420
|
+
| Rescue state | Markdown | `RESCUE-STATE.md` (updated each session) |
|
|
421
|
+
| Characterization tests | Source files | Written by `rune:safeguard` per module |
|
|
422
|
+
| Refactored modules | Source files | Modified in-place, committed per surgery session |
|
|
423
|
+
| Health score comparison | Inline (Rescue Report) | Baseline vs final autopsy scores |
|
|
424
|
+
| Rescue Report | Markdown (inline) | Emitted at session end (per module and final) |
|
|
425
|
+
|
|
416
426
|
## Sharp Edges
|
|
417
427
|
|
|
418
428
|
Known failure modes for this skill. Check these before declaring done.
|
package/skills/research/SKILL.md
CHANGED
|
@@ -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.
|
|
6
|
+
version: "0.3.0"
|
|
7
7
|
layer: L3
|
|
8
8
|
model: haiku
|
|
9
9
|
group: knowledge
|
|
@@ -44,25 +44,51 @@ Generate 2-3 targeted search queries from the research question. Vary phrasing t
|
|
|
44
44
|
- Secondary: "[topic] best practices 2026" or "[topic] vs alternatives"
|
|
45
45
|
- Tertiary: "[topic] example" or "[topic] tutorial" if implementation detail needed
|
|
46
46
|
|
|
47
|
-
### Step 2 — Search
|
|
47
|
+
### Step 2 — Search (Minimum 3 Complementary Sources)
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
<HARD-GATE>
|
|
50
|
+
Every research conclusion MUST be backed by at minimum 3 complementary sources from DIFFERENT source types.
|
|
51
|
+
Single-source conclusions are flagged as `low` confidence regardless of source authority.
|
|
52
|
+
</HARD-GATE>
|
|
53
|
+
|
|
54
|
+
Call `WebSearch` for each query. Collect result titles, URLs, and snippets. Identify the top 3-5 most relevant URLs prioritizing **source diversity**:
|
|
55
|
+
|
|
56
|
+
| Source Type | Examples | Why |
|
|
57
|
+
|-------------|----------|-----|
|
|
58
|
+
| **Official docs** | Framework docs, API reference, RFC | Authoritative but may lag behind reality |
|
|
59
|
+
| **Community** | Stack Overflow, GitHub Issues, Reddit | Real-world pain points, edge cases |
|
|
60
|
+
| **Technical blogs** | Dev.to, Medium engineering blogs, personal blogs | Practical experience, tutorials |
|
|
61
|
+
| **Repositories** | GitHub repos, npm packages, example code | Working implementations |
|
|
62
|
+
|
|
63
|
+
**Selection rules:**
|
|
64
|
+
- Source authority (official docs > major blogs > personal blogs)
|
|
51
65
|
- Recency (prefer 2025-2026)
|
|
52
66
|
- Relevance to the query
|
|
67
|
+
- **Diversity: never select 3+ URLs from the same domain** — spread across source types
|
|
68
|
+
|
|
69
|
+
> Source: K-Dense claude-scientific-skills (literature-review "minimum 3 complementary databases" pattern), adapted for software research.
|
|
53
70
|
|
|
54
71
|
### Step 3 — Deep Dive
|
|
55
72
|
|
|
56
73
|
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:
|
|
57
74
|
- Extract key facts, API signatures, code examples
|
|
58
75
|
- Note the source URL and publication date if visible
|
|
76
|
+
- Tag the source type (official/community/blog/repo) for Step 4 triangulation
|
|
59
77
|
|
|
60
|
-
### Step 4 — Synthesize
|
|
78
|
+
### Step 4 — Synthesize (Triangulation)
|
|
61
79
|
|
|
62
|
-
Across all fetched content:
|
|
63
|
-
- Identify points of consensus across sources
|
|
80
|
+
Across all fetched content, **triangulate** — don't just aggregate:
|
|
81
|
+
- Identify points of consensus across sources (≥3 sources = strong signal)
|
|
64
82
|
- Flag any conflicting information explicitly (e.g., "Source A says X, Source B says Y")
|
|
65
|
-
-
|
|
83
|
+
- Check if conflicts are temporal (old vs new info) or genuine disagreement
|
|
84
|
+
- Assign confidence using source diversity:
|
|
85
|
+
|
|
86
|
+
| Confidence | Criteria |
|
|
87
|
+
|------------|----------|
|
|
88
|
+
| `high` | 3+ sources from different types agree |
|
|
89
|
+
| `medium` | 2 sources agree, or 3+ from same type |
|
|
90
|
+
| `low` | Single source, or sources conflict without resolution |
|
|
91
|
+
| `unverified` | No sources found — report this explicitly, NEVER fabricate |
|
|
66
92
|
|
|
67
93
|
### Step 5 — Report
|
|
68
94
|
|
|
@@ -108,6 +134,8 @@ Known failure modes for this skill. Check these before declaring done.
|
|
|
108
134
|
| Reporting conflicting sources without flagging the conflict | HIGH | Constraint: flag conflicting information explicitly, never silently pick one side |
|
|
109
135
|
| Assigning "high" confidence from a single source | MEDIUM | High = 3+ sources agree; 1-2 sources = medium confidence |
|
|
110
136
|
| Exceeding 5 WebFetch calls per invocation | MEDIUM | Hard limit: prioritize top 3-5 URLs from search, fetch only the most relevant |
|
|
137
|
+
| Single-source conclusions presented as fact | HIGH | HARD-GATE: minimum 3 complementary sources from different source types. Single source = `low` confidence |
|
|
138
|
+
| All sources from same domain (e.g., 3 Stack Overflow links) | MEDIUM | Source diversity rule: never 3+ URLs from the same domain. Spread across official/community/blog/repo |
|
|
111
139
|
|
|
112
140
|
## Done When
|
|
113
141
|
|