continuous-improvement 3.1.0 → 3.9.1
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/.claude-plugin/marketplace.json +66 -0
- package/CHANGELOG.md +216 -0
- package/QUICKSTART.md +79 -12
- package/README.md +229 -349
- package/SKILL.md +87 -9
- package/action.yml +1 -1
- package/bin/analyze.sh +9 -1
- package/bin/backfill.mjs +172 -0
- package/bin/check-doc-runtime-claims.mjs +120 -0
- package/bin/check-docs-substrings.mjs +333 -0
- package/bin/check-everything-mirror.mjs +145 -0
- package/bin/check-routing-targets.mjs +151 -0
- package/bin/check-skill-law-tag.mjs +128 -0
- package/bin/check-skill-mirror.mjs +119 -0
- package/bin/check-skill-tiers.mjs +116 -0
- package/bin/check-third-party-shape.mjs +202 -0
- package/bin/generate-plugin-manifests.mjs +171 -0
- package/bin/harvest-friction.mjs +279 -0
- package/bin/hook-stats.mjs +258 -0
- package/bin/install.mjs +407 -499
- package/bin/lint-transcript.mjs +182 -210
- package/bin/mcp-server.mjs +834 -608
- package/bin/observe.mjs +148 -0
- package/bin/pre-commit-block-strays.sh +49 -0
- package/bin/refresh-third-party.mjs +416 -0
- package/bin/unified-cli.mjs +533 -0
- package/commands/continuous-improvement.md +43 -2
- package/commands/discipline.md +14 -0
- package/commands/harvest.md +76 -0
- package/commands/learn-eval.md +117 -0
- package/commands/planning-with-files.md +66 -0
- package/commands/proceed-with-the-recommendation.md +62 -0
- package/commands/ralph.md +103 -0
- package/commands/release-train.md +81 -0
- package/commands/seven-laws.md +16 -0
- package/commands/superpowers.md +180 -0
- package/commands/swarm.md +101 -0
- package/commands/workspace-surface-audit.md +77 -0
- package/hooks/gateguard.mjs +172 -0
- package/hooks/observe.sh +42 -4
- package/hooks/session.sh +3 -3
- package/hooks/three-section-close.mjs +181 -0
- package/instinct-packs/meta.json +16 -0
- package/lib/cli-anything.mjs +401 -0
- package/lib/compound-engineering.mjs +831 -0
- package/lib/gateguard-state.mjs +85 -0
- package/lib/observe-event.mjs +128 -0
- package/lib/plugin-metadata.mjs +435 -0
- package/lib/pm-marketplace.mjs +61 -0
- package/lib/pm-skills.mjs +1274 -0
- package/lib/resolve-home-dir.mjs +43 -0
- package/lib/skill-tiers.mjs +137 -0
- package/lib/unified-plugin.mjs +924 -0
- package/llms.txt +32 -7
- package/package.json +29 -19
- package/plugins/beginner.json +17 -6
- package/plugins/continuous-improvement/.claude-plugin/marketplace.json +20 -0
- package/plugins/continuous-improvement/.claude-plugin/plugin.json +26 -0
- package/plugins/continuous-improvement/LICENSE +21 -0
- package/plugins/continuous-improvement/README.md +57 -0
- package/plugins/continuous-improvement/agents/README.md +120 -0
- package/plugins/continuous-improvement/agents/code-reviewer.md +97 -0
- package/plugins/continuous-improvement/agents/security-auditor.md +101 -0
- package/plugins/continuous-improvement/agents/test-engineer.md +95 -0
- package/plugins/continuous-improvement/bin/backfill.mjs +172 -0
- package/plugins/continuous-improvement/bin/mcp-server.mjs +889 -0
- package/plugins/continuous-improvement/bin/observe.mjs +148 -0
- package/plugins/continuous-improvement/commands/continuous-improvement.md +115 -0
- package/plugins/continuous-improvement/commands/dashboard.md +56 -0
- package/plugins/continuous-improvement/commands/discipline.md +51 -0
- package/plugins/continuous-improvement/commands/harvest.md +76 -0
- package/plugins/continuous-improvement/commands/learn-eval.md +117 -0
- package/plugins/continuous-improvement/commands/planning-with-files.md +66 -0
- package/plugins/continuous-improvement/commands/proceed-with-the-recommendation.md +62 -0
- package/plugins/continuous-improvement/commands/ralph.md +103 -0
- package/plugins/continuous-improvement/commands/release-train.md +81 -0
- package/plugins/continuous-improvement/commands/seven-laws.md +16 -0
- package/plugins/continuous-improvement/commands/superpowers.md +180 -0
- package/plugins/continuous-improvement/commands/swarm.md +101 -0
- package/plugins/continuous-improvement/commands/workspace-surface-audit.md +77 -0
- package/plugins/continuous-improvement/hooks/gateguard.mjs +172 -0
- package/plugins/continuous-improvement/hooks/hooks.json +65 -0
- package/plugins/continuous-improvement/hooks/observe.sh +172 -0
- package/plugins/continuous-improvement/hooks/session.sh +106 -0
- package/plugins/continuous-improvement/hooks/three-section-close.mjs +181 -0
- package/plugins/continuous-improvement/instinct-packs/go.json +58 -0
- package/plugins/continuous-improvement/instinct-packs/meta.json +16 -0
- package/plugins/continuous-improvement/instinct-packs/python.json +58 -0
- package/plugins/continuous-improvement/instinct-packs/react.json +58 -0
- package/plugins/continuous-improvement/lib/observe-event.mjs +128 -0
- package/plugins/continuous-improvement/lib/plugin-metadata.mjs +435 -0
- package/plugins/continuous-improvement/lib/resolve-home-dir.mjs +43 -0
- package/plugins/continuous-improvement/skills/README.md +37 -0
- package/plugins/continuous-improvement/skills/continuous-improvement/SKILL.md +249 -0
- package/plugins/continuous-improvement/skills/deploy-receipt/SKILL.md +178 -0
- package/plugins/continuous-improvement/skills/gateguard/SKILL.md +163 -0
- package/plugins/continuous-improvement/skills/para-memory-files/SKILL.md +108 -0
- package/plugins/continuous-improvement/skills/proceed-with-the-recommendation/SKILL.md +447 -0
- package/plugins/continuous-improvement/skills/ralph/SKILL.md +221 -0
- package/plugins/continuous-improvement/skills/recovery-classification/SKILL.md +73 -0
- package/plugins/continuous-improvement/skills/safety-guard/SKILL.md +76 -0
- package/plugins/continuous-improvement/skills/state-reconciliation/SKILL.md +63 -0
- package/plugins/continuous-improvement/skills/strategic-compact/SKILL.md +104 -0
- package/plugins/continuous-improvement/skills/superpowers/SKILL.md +219 -0
- package/plugins/continuous-improvement/skills/tdd-workflow/SKILL.md +411 -0
- package/plugins/continuous-improvement/skills/token-budget-advisor/SKILL.md +136 -0
- package/plugins/continuous-improvement/skills/verification-loop/SKILL.md +224 -0
- package/plugins/continuous-improvement/skills/wild-risa-balance/SKILL.md +191 -0
- package/plugins/continuous-improvement/skills/workspace-surface-audit/SKILL.md +147 -0
- package/plugins/continuous-improvement/skills/worktree-safety/SKILL.md +66 -0
- package/plugins/continuous-improvement/templates/planning-with-files/findings.md +8 -0
- package/plugins/continuous-improvement/templates/planning-with-files/progress.md +7 -0
- package/plugins/continuous-improvement/templates/planning-with-files/task_plan.md +23 -0
- package/plugins/expert.json +26 -5
- package/skills/README.md +79 -0
- package/skills/deploy-receipt.md +178 -0
- package/skills/gateguard.md +163 -0
- package/skills/para-memory-files.md +108 -0
- package/skills/proceed-with-the-recommendation.md +447 -0
- package/skills/ralph.md +221 -0
- package/skills/recovery-classification.md +73 -0
- package/skills/safety-guard.md +76 -0
- package/skills/state-reconciliation.md +63 -0
- package/skills/strategic-compact.md +104 -0
- package/skills/superpowers.md +219 -0
- package/skills/tdd-workflow.md +411 -0
- package/skills/token-budget-advisor.md +136 -0
- package/skills/verification-loop.md +224 -0
- package/skills/wild-risa-balance.md +191 -0
- package/skills/workspace-surface-audit.md +147 -0
- package/skills/worktree-safety.md +66 -0
- package/templates/insights-claude-md.md +91 -0
- package/templates/planning-with-files/findings.md +8 -0
- package/templates/planning-with-files/progress.md +7 -0
- package/templates/planning-with-files/task_plan.md +23 -0
- package/templates/verify-ladder.example.json +60 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: token-budget-advisor
|
|
3
|
+
tier: "2"
|
|
4
|
+
description: >-
|
|
5
|
+
Enforces Law 2 (Plan Is Sacred) of the 7 Laws of AI Agent Discipline by
|
|
6
|
+
making token-budget tradeoffs explicit before the response is composed.
|
|
7
|
+
Offers the user an informed choice about how much response depth to
|
|
8
|
+
consume before answering. Use this skill when the user explicitly
|
|
9
|
+
wants to control response length, depth, or token budget.
|
|
10
|
+
TRIGGER when: "token budget", "token count", "token usage", "token limit",
|
|
11
|
+
"response length", "answer depth", "short version", "brief answer",
|
|
12
|
+
"detailed answer", "exhaustive answer", "respuesta corta vs larga",
|
|
13
|
+
"cuántos tokens", "ahorrar tokens", "responde al 50%", "dame la versión
|
|
14
|
+
corta", "quiero controlar cuánto usas", or clear variants where the
|
|
15
|
+
user is explicitly asking to control answer size or depth.
|
|
16
|
+
DO NOT TRIGGER when: user has already specified a level in the current
|
|
17
|
+
session (maintain it), the request is clearly a one-word answer, or
|
|
18
|
+
"token" refers to auth/session/payment tokens rather than response size.
|
|
19
|
+
origin: community
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Token Budget Advisor (TBA)
|
|
23
|
+
|
|
24
|
+
Intercept the response flow to offer the user a choice about response depth **before** the agent answers.
|
|
25
|
+
|
|
26
|
+
## When to Use
|
|
27
|
+
|
|
28
|
+
- User wants to control how long or detailed a response is
|
|
29
|
+
- User mentions tokens, budget, depth, or response length
|
|
30
|
+
- User says "short version", "tldr", "brief", "al 25%", "exhaustive", etc.
|
|
31
|
+
- Any time the user wants to choose depth/detail level upfront
|
|
32
|
+
|
|
33
|
+
**Do not trigger** when: user already set a level this session (maintain it silently), or the answer is trivially one line.
|
|
34
|
+
|
|
35
|
+
## How It Works
|
|
36
|
+
|
|
37
|
+
### Step 1 — Estimate input tokens
|
|
38
|
+
|
|
39
|
+
Use the repository's canonical context-budget heuristics to estimate the prompt's token count mentally.
|
|
40
|
+
|
|
41
|
+
Use the same calibration guidance as [context-budget](../context-budget/SKILL.md):
|
|
42
|
+
|
|
43
|
+
- prose: `words × 1.3`
|
|
44
|
+
- code-heavy or mixed/code blocks: `chars / 4`
|
|
45
|
+
|
|
46
|
+
For mixed content, use the dominant content type and keep the estimate heuristic.
|
|
47
|
+
|
|
48
|
+
### Step 2 — Estimate response size by complexity
|
|
49
|
+
|
|
50
|
+
Classify the prompt, then apply the multiplier range to get the full response window:
|
|
51
|
+
|
|
52
|
+
| Complexity | Multiplier range | Example prompts |
|
|
53
|
+
|--------------|------------------|------------------------------------------------------|
|
|
54
|
+
| Simple | 3× – 8× | "What is X?", yes/no, single fact |
|
|
55
|
+
| Medium | 8× – 20× | "How does X work?" |
|
|
56
|
+
| Medium-High | 10× – 25× | Code request with context |
|
|
57
|
+
| Complex | 15× – 40× | Multi-part analysis, comparisons, architecture |
|
|
58
|
+
| Creative | 10× – 30× | Stories, essays, narrative writing |
|
|
59
|
+
|
|
60
|
+
Response window = `input_tokens × mult_min` to `input_tokens × mult_max` (but don’t exceed your model’s configured output-token limit).
|
|
61
|
+
|
|
62
|
+
### Step 3 — Present depth options
|
|
63
|
+
|
|
64
|
+
Present this block **before** answering, using the actual estimated numbers:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Analyzing your prompt...
|
|
68
|
+
|
|
69
|
+
Input: ~[N] tokens | Type: [type] | Complexity: [level] | Language: [lang]
|
|
70
|
+
|
|
71
|
+
Choose your depth level:
|
|
72
|
+
|
|
73
|
+
[1] Essential (25%) -> ~[tokens] Direct answer only, no preamble
|
|
74
|
+
[2] Moderate (50%) -> ~[tokens] Answer + context + 1 example
|
|
75
|
+
[3] Detailed (75%) -> ~[tokens] Full answer with alternatives
|
|
76
|
+
[4] Exhaustive (100%) -> ~[tokens] Everything, no limits
|
|
77
|
+
|
|
78
|
+
Which level? (1-4 or say "25% depth", "50% depth", "75% depth", "100% depth")
|
|
79
|
+
|
|
80
|
+
Precision: heuristic estimate ~85-90% accuracy (±15%).
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Level token estimates (within the response window):
|
|
84
|
+
- 25% → `min + (max - min) × 0.25`
|
|
85
|
+
- 50% → `min + (max - min) × 0.50`
|
|
86
|
+
- 75% → `min + (max - min) × 0.75`
|
|
87
|
+
- 100% → `max`
|
|
88
|
+
|
|
89
|
+
### Step 4 — Respond at the chosen level
|
|
90
|
+
|
|
91
|
+
| Level | Target length | Include | Omit |
|
|
92
|
+
|------------------|---------------------|-----------------------------------------------------|---------------------------------------------------|
|
|
93
|
+
| 25% Essential | 2-4 sentences max | Direct answer, key conclusion | Context, examples, nuance, alternatives |
|
|
94
|
+
| 50% Moderate | 1-3 paragraphs | Answer + necessary context + 1 example | Deep analysis, edge cases, references |
|
|
95
|
+
| 75% Detailed | Structured response | Multiple examples, pros/cons, alternatives | Extreme edge cases, exhaustive references |
|
|
96
|
+
| 100% Exhaustive | No restriction | Everything — full analysis, all code, all perspectives | Nothing |
|
|
97
|
+
|
|
98
|
+
## Shortcuts — skip the question
|
|
99
|
+
|
|
100
|
+
If the user already signals a level, respond at that level immediately without asking:
|
|
101
|
+
|
|
102
|
+
| What they say | Level |
|
|
103
|
+
|----------------------------------------------------|-------|
|
|
104
|
+
| "1" / "25% depth" / "short version" / "brief answer" / "tldr" | 25% |
|
|
105
|
+
| "2" / "50% depth" / "moderate depth" / "balanced answer" | 50% |
|
|
106
|
+
| "3" / "75% depth" / "detailed answer" / "thorough answer" | 75% |
|
|
107
|
+
| "4" / "100% depth" / "exhaustive answer" / "full deep dive" | 100% |
|
|
108
|
+
|
|
109
|
+
If the user set a level earlier in the session, **maintain it silently** for subsequent responses unless they change it.
|
|
110
|
+
|
|
111
|
+
## Precision note
|
|
112
|
+
|
|
113
|
+
This skill uses heuristic estimation — no real tokenizer. Accuracy ~85-90%, variance ±15%. Always show the disclaimer.
|
|
114
|
+
|
|
115
|
+
## Examples
|
|
116
|
+
|
|
117
|
+
### Triggers
|
|
118
|
+
|
|
119
|
+
- "Give me the short version first."
|
|
120
|
+
- "How many tokens will your answer use?"
|
|
121
|
+
- "Respond at 50% depth."
|
|
122
|
+
- "I want the exhaustive answer, not the summary."
|
|
123
|
+
- "Dame la version corta y luego la detallada."
|
|
124
|
+
|
|
125
|
+
### Does Not Trigger
|
|
126
|
+
|
|
127
|
+
- "What is a JWT token?"
|
|
128
|
+
- "The checkout flow uses a payment token."
|
|
129
|
+
- "Is this normal?"
|
|
130
|
+
- "Complete the refactor."
|
|
131
|
+
- Follow-up questions after the user already chose a depth for the session
|
|
132
|
+
|
|
133
|
+
## Source
|
|
134
|
+
|
|
135
|
+
Standalone skill from [TBA — Token Budget Advisor for Claude Code](https://github.com/Xabilimon1/Token-Budget-Advisor-Claude-Code-).
|
|
136
|
+
Original project also ships a Python estimator script, but this repository keeps the skill self-contained and heuristic-only.
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verification-loop
|
|
3
|
+
tier: "1"
|
|
4
|
+
description: "Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. A comprehensive verification system for agent coding sessions covering build, types, lint, tests, security, and diff with a PASS/FAIL report."
|
|
5
|
+
origin: continuous-improvement
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Verification Loop Skill
|
|
9
|
+
|
|
10
|
+
A comprehensive verification system for agent coding sessions.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
Invoke this skill:
|
|
15
|
+
- After completing a feature or significant code change
|
|
16
|
+
- Before creating a PR
|
|
17
|
+
- When you want to ensure quality gates pass
|
|
18
|
+
- After refactoring
|
|
19
|
+
|
|
20
|
+
## Verification Phases
|
|
21
|
+
|
|
22
|
+
### Phase 0: Resolve the Ladder
|
|
23
|
+
|
|
24
|
+
Every project has its own actual invocation for build / typecheck / lint / test / security / deploy-receipt. Hardcoding `npm run build` and `npm run test` works when the project happens to use those exact scripts; for everything else (pnpm, yarn, cargo, go, mise, just, custom scripts, monorepos with workspace-scoped commands) it returns "deps not installed" or "config not found" misreads from the wrong invocation. Phase 0 runs first so Phases 1–6 never have to guess.
|
|
25
|
+
|
|
26
|
+
**Resolution priority** (first match wins):
|
|
27
|
+
|
|
28
|
+
1. **`.claude/verify-ladder.json` manifest** at the repo root. Schema:
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"build": "npm run build",
|
|
32
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
33
|
+
"lint": "npm run lint",
|
|
34
|
+
"test": "npm test",
|
|
35
|
+
"security": "npm audit --audit-level=high",
|
|
36
|
+
"deploy_receipt": "npx wrangler deployments list --json"
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
Any field omitted falls through to step 2 for that field only. A field set to the literal string `null` means "skip this phase for this project."
|
|
40
|
+
2. **Sniff `package.json` `scripts`** for `build`, `typecheck` or `tsc`, `lint`, `test`, `audit` or `security`. Tie-breaker when multiple scripts could match a phase: prefer `verify:<phase>` over `<phase>` over `<phase>:*`. Do NOT pick `test` when `verify:test` exists; the operator's explicit verification surface always wins over the convenience alias.
|
|
41
|
+
3. **Sniff per-language toolchain files** if `package.json` is absent: `Cargo.toml` → `cargo build` / `cargo test`, `go.mod` → `go build ./...` / `go test ./...`, `pyproject.toml` → `pytest` / `ruff check`, `Gemfile` → `bundle exec rspec`, etc.
|
|
42
|
+
4. **Ask the operator** if none of the above resolves the field. Do not invent.
|
|
43
|
+
|
|
44
|
+
**Output the resolved ladder** as a single fenced block before running any phase, so the operator can spot a wrong resolution before it costs a misread:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
verify-ladder (resolved):
|
|
48
|
+
build: npm run build
|
|
49
|
+
typecheck: npx tsc --noEmit (sniff: package.json scripts.typecheck)
|
|
50
|
+
lint: npm run lint
|
|
51
|
+
test: npm test
|
|
52
|
+
security: (skipped — no script defined)
|
|
53
|
+
deploy_receipt: npx wrangler deployments list --json (manifest)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Each row shows the resolved command + its source (manifest, sniff, or skipped). The fenced block is the contract surface — every later phase reads from this resolved ladder, never from a hardcoded fallback.
|
|
57
|
+
|
|
58
|
+
A starter manifest is provided at `templates/verify-ladder.example.json`; copy it to `.claude/verify-ladder.json` and trim per project.
|
|
59
|
+
|
|
60
|
+
### Phase 1: Build Verification
|
|
61
|
+
Run the `build` command from the resolved ladder. Example for a default Node project:
|
|
62
|
+
```bash
|
|
63
|
+
# Resolved from package.json scripts.build:
|
|
64
|
+
npm run build 2>&1 | tail -20
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
If build fails, STOP and fix before continuing.
|
|
68
|
+
|
|
69
|
+
### Phase 2: Type Check
|
|
70
|
+
```bash
|
|
71
|
+
# TypeScript projects
|
|
72
|
+
npx tsc --noEmit 2>&1 | head -30
|
|
73
|
+
|
|
74
|
+
# Python projects
|
|
75
|
+
pyright . 2>&1 | head -30
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Report all type errors. Fix critical ones before continuing.
|
|
79
|
+
|
|
80
|
+
### Phase 3: Lint Check
|
|
81
|
+
```bash
|
|
82
|
+
# JavaScript/TypeScript
|
|
83
|
+
npm run lint 2>&1 | head -30
|
|
84
|
+
|
|
85
|
+
# Python
|
|
86
|
+
ruff check . 2>&1 | head -30
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Phase 4: Test Suite
|
|
90
|
+
```bash
|
|
91
|
+
# Run tests with coverage
|
|
92
|
+
npm run test -- --coverage 2>&1 | tail -50
|
|
93
|
+
|
|
94
|
+
# Check coverage threshold
|
|
95
|
+
# Target: 80% minimum
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Report:
|
|
99
|
+
- Total tests: X
|
|
100
|
+
- Passed: X
|
|
101
|
+
- Failed: X
|
|
102
|
+
- Coverage: X%
|
|
103
|
+
|
|
104
|
+
### Phase 5: Security Scan
|
|
105
|
+
```bash
|
|
106
|
+
# Check for secrets
|
|
107
|
+
grep -rn "sk-" --include="*.ts" --include="*.js" . 2>/dev/null | head -10
|
|
108
|
+
grep -rn "api_key" --include="*.ts" --include="*.js" . 2>/dev/null | head -10
|
|
109
|
+
|
|
110
|
+
# Check for console.log
|
|
111
|
+
grep -rn "console.log" --include="*.ts" --include="*.tsx" src/ 2>/dev/null | head -10
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Phase 6: Diff Review
|
|
115
|
+
```bash
|
|
116
|
+
# Show what changed
|
|
117
|
+
git diff --stat
|
|
118
|
+
git diff HEAD~1 --name-only
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Review each changed file for:
|
|
122
|
+
- Unintended changes
|
|
123
|
+
- Missing error handling
|
|
124
|
+
- Potential edge cases
|
|
125
|
+
|
|
126
|
+
### Phase 7: Result + Completeness Gate
|
|
127
|
+
|
|
128
|
+
Phases 1–6 verify mechanism — build green, types clean, tests pass, no secrets, diff intentional. Phase 7 verifies outcome: did the work the operator actually asked for actually land? Mechanism passing while outcome is missing is the most expensive failure mode in this loop, because the green report invites a merge that doesn't deliver.
|
|
129
|
+
|
|
130
|
+
Two questions, both required to be `Yes`:
|
|
131
|
+
|
|
132
|
+
**1. Did the stated goal land? Yes/No + evidence.**
|
|
133
|
+
|
|
134
|
+
The stated goal is the goal as named at task start, not the goal as remembered now. If the operator asked "fix the bug where X happens", evidence is the bug no longer happening (failing test now passes, repro screenshot, manual verification). If they asked "add an admin button", evidence is the button visible and functional in the running UI. Build-green is not evidence of result — it is evidence of mechanism. Don't conflate.
|
|
135
|
+
|
|
136
|
+
**2. Did every promised step finish? Yes/No + list.**
|
|
137
|
+
|
|
138
|
+
Enumerate every step you said you would do — the recommendation list, the plan doc, the TodoWrite items, the commit-by-commit roadmap. Mark each Done or Skipped. If any are Skipped, name them and the reason. A "complete" verification with silently skipped promises is a trust violation, not a deliverable.
|
|
139
|
+
|
|
140
|
+
Both gates are independent: `Yes` on goal alone means a half-complete checklist that may break later; `Yes` on completeness alone means busywork that didn't deliver. Both must be `Yes` — even if the previous six phases all pass — or the work isn't done.
|
|
141
|
+
|
|
142
|
+
If either is `No`, the verification report goes back to the operator with the explicit gap, not on to PR. The operator decides whether the gap is acceptable to ship as-is or whether more work is required first. Never silently downgrade to "ready" because the mechanism phases looked good.
|
|
143
|
+
|
|
144
|
+
### Phase 8: Deploy Receipt (auto-deploy projects only)
|
|
145
|
+
|
|
146
|
+
For repos whose `verify-ladder.json` declares a `deploy_receipt` field — or whose sniff path detects an auto-deploy target (Railway, Cloudflare Workers, Vercel, Netlify, Fly.io) — the verify is not complete until the deployed SHA matches the merge SHA and a healthcheck returns 200. Hand off to the `deploy-receipt` skill (Law 4 deploy-seam companion landed in PR #83) and treat its `Receipt status: COMPLETE` as the gate.
|
|
147
|
+
|
|
148
|
+
INCOMPLETE receipts move to "Immediate operator action" in the close, never to "ready". Library-only / package-published repos skip this phase entirely (no deploy seam exists).
|
|
149
|
+
|
|
150
|
+
### Phase 9: Synthetic Checks (production-vs-baseline diff)
|
|
151
|
+
|
|
152
|
+
Phase 8 confirms the deploy seam. Phase 9 confirms the deployed surface matches the staging baseline on the dimensions that matter — endpoint payload shape, header presence, data freshness, routing correctness. A deploy can land with a matching SHA and a 200 healthcheck and still serve broken responses (stale data sources, dropped headers, regressed payloads). Phase 9 is the gate that catches that.
|
|
153
|
+
|
|
154
|
+
**When this rung runs:**
|
|
155
|
+
|
|
156
|
+
- ONLY after Phase 8 reports `Receipt status: COMPLETE`. An INCOMPLETE receipt blocks Phase 9 — fix the receipt gap first, then re-run.
|
|
157
|
+
- ONLY when the resolved ladder declares `synthetic_checks` as a non-null directory path (default: `synthetic-checks/`). A `null` field skips the rung silently. A missing field falls through to the directory sniff: if `synthetic-checks/` exists at the repo root with at least one `*.synthetic.*` file, the rung activates; otherwise it is recorded as "skipped — no synthetic-checks directory found".
|
|
158
|
+
|
|
159
|
+
**What the runner does:**
|
|
160
|
+
|
|
161
|
+
1. List every `*.synthetic.{sh,mjs,ts,py}` file in the resolved directory in lexical order.
|
|
162
|
+
2. For each file, set the input env vars: `BASE_URL` (production base from project config), `BASELINE_URL` (staging baseline from project config), `EXPECTED_SHA` (the merge SHA Phase 8 reported COMPLETE), `DEPLOY_BRANCH` (the deploy branch name), `RECEIPT_TIMESTAMP` (ISO-8601 of the receipt).
|
|
163
|
+
3. Invoke the file via the right interpreter (`bash` for `.sh`, `node` for `.mjs`, `tsx` for `.ts`, `python` for `.py`). Files with unrecognized extensions are skipped with a warning.
|
|
164
|
+
4. Capture stdout + stderr + exit code per file. On exit 0, the check passed. On any non-zero exit, the check failed and stdout is the operator-facing diff.
|
|
165
|
+
5. Aggregate: if every file exited 0, Phase 9 is `PASS`. If any file exited non-zero, Phase 9 is `FAIL — synthetic drift on <filenames>` and the captured diffs go into the verification report verbatim (no agent re-summarization).
|
|
166
|
+
|
|
167
|
+
**Surfacing rule:**
|
|
168
|
+
|
|
169
|
+
A failed synthetic check surfaces as `INCOMPLETE — synthetic drift` at the same severity as a failed deploy receipt. The merge moves to "Immediate operator action" with the named drift and the diff payload. Do NOT downgrade synthetic drift to "warning" — the rung exists because the report flagged exactly this gap (deploys that look healthy but serve broken responses).
|
|
170
|
+
|
|
171
|
+
**Anti-patterns specific to this rung:**
|
|
172
|
+
|
|
173
|
+
- **Smoke checks masquerading as synthetic checks.** A check that only verifies "endpoint returns 200" passes against a stale deploy. Synthetic checks MUST diff production against a baseline.
|
|
174
|
+
- **Hardcoded baseline URLs in the check.** Baseline lives in env (`BASELINE_URL`), not in the file. Hardcoding it breaks the convention and makes per-environment use impossible.
|
|
175
|
+
- **Re-summarizing the diff.** The captured stdout from a failed check is the operator-facing artifact. The agent does not re-write or shorten it.
|
|
176
|
+
- **Treating an absent directory as PASS.** No synthetic-checks directory means the rung is `skipped`, not `PASS`. The operator sees the absence in the resolved ladder.
|
|
177
|
+
|
|
178
|
+
See `synthetic-checks/README.md` for the file convention, the input/output contract, and a runnable sample (`example-version-endpoint.synthetic.sh`).
|
|
179
|
+
|
|
180
|
+
## Output Format
|
|
181
|
+
|
|
182
|
+
After running all phases, produce a verification report:
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
VERIFICATION REPORT
|
|
186
|
+
==================
|
|
187
|
+
|
|
188
|
+
Build: [PASS/FAIL]
|
|
189
|
+
Types: [PASS/FAIL] (X errors)
|
|
190
|
+
Lint: [PASS/FAIL] (X warnings)
|
|
191
|
+
Tests: [PASS/FAIL] (X/Y passed, Z% coverage)
|
|
192
|
+
Security: [PASS/FAIL] (X issues)
|
|
193
|
+
Diff: [X files changed]
|
|
194
|
+
Goal landed: [YES/NO] — <one-line evidence or gap>
|
|
195
|
+
All promised: [YES/NO] — <X of Y steps Done; list any Skipped>
|
|
196
|
+
Deploy: [COMPLETE/INCOMPLETE/skipped] — <SHA + health summary>
|
|
197
|
+
Synthetic: [PASS/FAIL/skipped] — <X of Y checks; failed: <filenames>>
|
|
198
|
+
|
|
199
|
+
Overall: [READY/NOT READY] for PR
|
|
200
|
+
|
|
201
|
+
Issues to Fix:
|
|
202
|
+
1. ...
|
|
203
|
+
2. ...
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
`Overall: READY` requires every line above to pass, including both Phase 7 gates. Mechanism-green plus outcome-`No` is `NOT READY` — surface the gap, do not ship.
|
|
207
|
+
|
|
208
|
+
## Continuous Mode
|
|
209
|
+
|
|
210
|
+
For long sessions, run verification every 15 minutes or after major changes:
|
|
211
|
+
|
|
212
|
+
```markdown
|
|
213
|
+
Set a mental checkpoint:
|
|
214
|
+
- After completing each function
|
|
215
|
+
- After finishing a component
|
|
216
|
+
- Before moving to next task
|
|
217
|
+
|
|
218
|
+
Run: /verify
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Integration with Hooks
|
|
222
|
+
|
|
223
|
+
This skill complements PostToolUse hooks but provides deeper verification.
|
|
224
|
+
Hooks catch issues immediately; this skill provides comprehensive review.
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wild-risa-balance
|
|
3
|
+
tier: "2"
|
|
4
|
+
description: Enforces Law 2 (Plan Is Sacred) of the 7 Laws of AI Agent Discipline. Decision-framing lens that pairs WILD generation with RISA execution when emitting recommendation lists. Not a runtime hook.
|
|
5
|
+
origin: continuous-improvement
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# WILD / RISA Balance
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- Emitting a multi-item recommendation block (≥3 items)
|
|
13
|
+
- Choosing between a safe option and a bold option
|
|
14
|
+
- Reviewing your own plan for over-cautiousness or over-fantasy
|
|
15
|
+
- Pairing with `proceed-with-the-recommendation` to decide which items belong above and below the cut
|
|
16
|
+
|
|
17
|
+
## The Two Modes
|
|
18
|
+
|
|
19
|
+
### RISA (Execution)
|
|
20
|
+
|
|
21
|
+
- **R**ealistic — fits the constraints in front of you
|
|
22
|
+
- **I**mportant — moves a stated goal, not a vanity metric
|
|
23
|
+
- **S**pecific — names files, commands, or owners
|
|
24
|
+
- **A**greeable — the operator can approve it without a meeting
|
|
25
|
+
|
|
26
|
+
If you only stay in RISA, you ship safe, average results.
|
|
27
|
+
|
|
28
|
+
### WILD (Creation)
|
|
29
|
+
|
|
30
|
+
- **W**ild — breaks the default frame
|
|
31
|
+
- **I**maginative — invents an option that did not exist a minute ago
|
|
32
|
+
- **L**imitless — ignores current budget, headcount, or stack
|
|
33
|
+
- **D**isruptive — replaces a workflow rather than tuning it
|
|
34
|
+
|
|
35
|
+
If you only stay in WILD, you generate cool ideas that never ship.
|
|
36
|
+
|
|
37
|
+
## The Trap
|
|
38
|
+
|
|
39
|
+
RISA alone produces a backlog of incremental fixes that never compound. WILD alone produces a graveyard of demos that never reach production. The bigger failure is unconscious switching: drifting into WILD during execution, or drifting into RISA during brainstorming, without naming the switch. Name the mode you are in before you write the next line.
|
|
40
|
+
|
|
41
|
+
## Switching Deliberately
|
|
42
|
+
|
|
43
|
+
| Phase | Mode | Why |
|
|
44
|
+
|-------------------------|-------|----------------------------------------------------|
|
|
45
|
+
| Brainstorm | WILD | Quantity and range beat early filtering |
|
|
46
|
+
| Roadmap framing | WILD | Frame the bigger bet before scoping it down |
|
|
47
|
+
| Per-item recommendation | Mixed | Top items can be WILD, baseline items must be RISA |
|
|
48
|
+
| Per-item execution | RISA | One thing, verified, shipped |
|
|
49
|
+
| Verification | RISA | Reality check, no new invention |
|
|
50
|
+
| Reflection | WILD | Counterfactuals, "what would have been bolder" |
|
|
51
|
+
|
|
52
|
+
WILD owns generation phases. RISA owns execution phases. The switch is intentional, not accidental.
|
|
53
|
+
|
|
54
|
+
## How to Apply in a Recommendation List
|
|
55
|
+
|
|
56
|
+
When this skill is in play, every recommendation block ships **at least 7 items**, split as:
|
|
57
|
+
|
|
58
|
+
1. **Top block — WILD pilots: exactly 2 bold items.** Present both; the operator picks at most one to actually run. If you cannot find a second genuinely bold option, stretch — do not pad with a safe item dressed up as wild.
|
|
59
|
+
2. **Bottom block — RISA baseline: at least 5 safe items.** These ship now regardless of the WILD bet. If you cannot reach 5, the surface is under-explored — expand scope before emitting the list.
|
|
60
|
+
3. Within each block, rank descending by impact.
|
|
61
|
+
4. Once the list is composed, wait for the operator's "proceed" signal before invoking `proceed-with-the-recommendation`. Never auto-trigger it. This skill only changes how the list is composed.
|
|
62
|
+
|
|
63
|
+
Total floor: **2 WILD + 5 RISA = 7 items minimum.** Going above is fine; going below means the skill was not applied.
|
|
64
|
+
|
|
65
|
+
The point: the operator gets a real WILD/RISA contrast (2 bold bets weighed against a 5-deep trusted baseline), not a flat list where the bold option silently competes with safe ones and loses by default.
|
|
66
|
+
|
|
67
|
+
## Audience Tiers (beginner vs expert)
|
|
68
|
+
|
|
69
|
+
Recommendation blocks ship in **two tiers** depending on the operator's signaled level. The 2 WILD + ≥5 RISA floor described above is the **expert** tier. Beginners get a different, lighter shape. The point: under-load for experts and overload for beginners are both failure modes — splitting the format prevents both.
|
|
70
|
+
|
|
71
|
+
### Tier selection
|
|
72
|
+
|
|
73
|
+
**Default = expert.** Switch to beginner only when one of these triggers fires:
|
|
74
|
+
|
|
75
|
+
- **Explicit flag** — the operator types `/beginner` or refers to themselves as a beginner ("for beginner", "as a beginner", "I'm new to this").
|
|
76
|
+
- **Explicit lite framing** — "simple list", "just the top 3", "small list", "short version", "no need for surgical".
|
|
77
|
+
- **Auto-detect heuristic** — the **first message of the thread** contains any of: `beginner`, `new to (this|claude|the system)`, `simple`, `explain like`, `first time`, `i'm just starting`, `i'm learning`. Single-message false positives are acceptable — the operator flips with `/expert` if mismatched.
|
|
78
|
+
|
|
79
|
+
The operator can override mid-thread: `/expert` switches back to WILD+RISA, `/beginner` switches back to the lite tier. Apply the most recently named tier.
|
|
80
|
+
|
|
81
|
+
### Beginner tier (lite shape)
|
|
82
|
+
|
|
83
|
+
When in beginner tier:
|
|
84
|
+
|
|
85
|
+
- **3 minimum, 5 maximum** items. No padding past 5. Below 3 means there is no recommendation — write `Recommendation: no`.
|
|
86
|
+
- **Goal-driven** — each item names the outcome, not the mechanism. Format: `<verb> <thing> → <observable result>`.
|
|
87
|
+
- **Execution-first** — each item is a concrete next action, not a tradeoff to weigh.
|
|
88
|
+
- **One-shot, iterate from there** — no "surgical change" framing, no phased sequencing, no commit-size gates. Get to a working pass, then improve.
|
|
89
|
+
- **Optimized for the latest Opus model (Opus 4.7 at time of writing)** — assume the model holds the full task in one shot. Do not pre-decompose into micro-steps that fight the model's reasoning depth. Lean on broader, outcome-shaped instructions over fine-grained scripts.
|
|
90
|
+
- Order: descending impact.
|
|
91
|
+
- No WILD/RISA labels. No counts annotation. No tiered tables.
|
|
92
|
+
|
|
93
|
+
### Expert tier (default for Naim, default in this repo)
|
|
94
|
+
|
|
95
|
+
The full WILD+RISA structure documented above: ≥7 items, exactly 2 WILD + ≥5 RISA, WILD on top descending, RISA below descending, counts annotated inline.
|
|
96
|
+
|
|
97
|
+
Each item still leads with the outcome inside both WILD and RISA: `<verb> <thing> → <observable result>`.
|
|
98
|
+
|
|
99
|
+
### Tier signal in the 3-section close
|
|
100
|
+
|
|
101
|
+
When Phase 7's three-section close lands, the `## Recommendation` header carries an explicit tier suffix:
|
|
102
|
+
|
|
103
|
+
- Expert: `## Recommendation (expert)`
|
|
104
|
+
- Beginner: `## Recommendation (beginner)`
|
|
105
|
+
|
|
106
|
+
The Stop hook regex (`^#+ +Recommendation(?:\s|$)`) already accepts both forms — the suffix is documentation, not a gate. The point is a self-describing audit trail: a future reader (or an instinct scan) can tell which tier was applied without re-deriving it from item count or label presence.
|
|
107
|
+
|
|
108
|
+
### The "no" escape valve (both tiers)
|
|
109
|
+
|
|
110
|
+
If neither tier can produce a real recommendation — every candidate item would be padding, or you cannot reach the tier's floor (3 for beginner, 7 for expert) without inventing busywork — write `Recommendation: no` and stop. This applies to **both tiers equally**.
|
|
111
|
+
|
|
112
|
+
`no` is not absence. It is an explicit signal that the current session or perspective is exhausted on this surface and the operator should switch context: a fresh session (cold prompt cache, no carryover bias), a different specialist agent (different perspective on the same problem), a different framing (re-scoping the goal), or sleep on it. Padding to hit the floor is the failure mode this escape exists to prevent — a flat 3-item beginner list of "review the README, run the tests, commit your changes" is worse than `Recommendation: no` because it disguises an empty thought as work.
|
|
113
|
+
|
|
114
|
+
When `no` ships, the Phase 7 close header still carries the tier suffix (`## Recommendation (expert)` or `## Recommendation (beginner)`) so the audit trail records which tier exhausted itself, and the body is just the literal `no` on its own line. No tiered tables, no WILD/RISA blocks, no "Want me to: A or B?" closer.
|
|
115
|
+
|
|
116
|
+
## Proactive Roadmap Surfacing (surface, do not execute)
|
|
117
|
+
|
|
118
|
+
A "wait for instructions" agent fails by silence — sitting on a known next step (visible roadmap, deferred item from a prior session) until told. A "proactive" agent fails by running that step without being asked. Both lose. Surface bridges them: raise the next step as a recommendation item, never as a fait accompli.
|
|
119
|
+
|
|
120
|
+
### Trigger conditions
|
|
121
|
+
|
|
122
|
+
Surface a next step when any of these are true:
|
|
123
|
+
|
|
124
|
+
- A persistent roadmap names an undone step — MemoryCore `current-session.md`, `docs/plans/*`, `⚠️ Deferred` entries in a project `CLAUDE.md`, or pending operator actions logged in MemoryCore.
|
|
125
|
+
- The current task is finished and a stated session goal implies the next one.
|
|
126
|
+
- The session has drifted from a stated roadmap (asked to do A, but B is now blocked by A's choice).
|
|
127
|
+
- An instinct or memory record predicts a near-term action the operator typically forgets (e.g., "rotate keys before next deploy", "push branch after N commits").
|
|
128
|
+
|
|
129
|
+
### Hard boundary — surface, do not execute
|
|
130
|
+
|
|
131
|
+
Surfacing emits the next step as a recommendation item. It does **not** mean running the command, editing the file, or shipping the change. Execution still requires explicit "proceed", "go", "run it", or equivalent. The boundary is non-negotiable:
|
|
132
|
+
|
|
133
|
+
- Global CLAUDE.md: "If instructions conflict or information is missing, stop and ask."
|
|
134
|
+
- Auto Mode: even in autonomous execution, "anything that deletes data or modifies shared or production systems still needs explicit user confirmation."
|
|
135
|
+
- Trust is asymmetric — one unauthorized "helpful" action costs more than a hundred missed surfacings. Recovery is one-way.
|
|
136
|
+
|
|
137
|
+
### Format
|
|
138
|
+
|
|
139
|
+
A surfaced item lives inside the normal RISA block. Mark it inline as `(surfaced — <source>)` so the operator can tell which items came from the roadmap vs. the current request:
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
RISA baseline — ship regardless (5 of ≥5)
|
|
143
|
+
1. Run remote D1 migration before next deploy → unblocks Close/Cancel admin button. (surfaced — pending operator action since 2026-05-04)
|
|
144
|
+
2. ...
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
A WILD-tier reframe of the roadmap itself (not a single deferred step, but a re-shape of the whole next phase) goes in the WILD block instead, with the same `(surfaced — <source>)` marker.
|
|
148
|
+
|
|
149
|
+
### Anti-patterns
|
|
150
|
+
|
|
151
|
+
- Re-surfacing an item the operator explicitly deferred — once is a reminder, three times is nagging. After one repeat, log the defer reason to memory and stop.
|
|
152
|
+
- Surfacing speculative steps with no source in any roadmap or memory ("you should also consider…" without a citation).
|
|
153
|
+
- Bundling a surface with execution ("I went ahead and started X"). Surface, wait, execute on go.
|
|
154
|
+
- Treating absence of a roadmap as license to invent one — if no roadmap exists and none was requested, ask before drafting.
|
|
155
|
+
|
|
156
|
+
The point: the operator never has to remember a deferred item, and never has to forgive an unauthorized one. Both at once.
|
|
157
|
+
|
|
158
|
+
## Integration with the 7 Laws
|
|
159
|
+
|
|
160
|
+
| Mode | Reinforces | Tempered by |
|
|
161
|
+
|------|---------------------------------------------------------|--------------------------|
|
|
162
|
+
| RISA | Law 2 (Plan), Law 3 (One Thing), Law 4 (Verify) | Law 6 (Iterate One Thing) |
|
|
163
|
+
| WILD | Law 1 (Research — broader exploration), Law 5 (Reflect) | Law 6 (Iterate One Thing) |
|
|
164
|
+
|
|
165
|
+
Both modes pass through Law 6 before execution. WILD without Law 6 is a wishlist. RISA without Law 6 ships safe fixes while the real bottleneck waits.
|
|
166
|
+
|
|
167
|
+
## Example
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
Recommendations (descending impact within each block)
|
|
171
|
+
|
|
172
|
+
WILD pilots — pick at most one (2 of 2)
|
|
173
|
+
1. Replace the current review workflow with a single adversarial pair.
|
|
174
|
+
2. Drop the staging environment in favor of feature-flagged production.
|
|
175
|
+
|
|
176
|
+
RISA baseline — ship regardless (5 of ≥5)
|
|
177
|
+
1. Add the missing test for the failure path noted in verification.
|
|
178
|
+
2. Rename the ambiguous flag to match its actual behavior.
|
|
179
|
+
3. Backfill the type on the public export that currently widens to `any`.
|
|
180
|
+
4. Wire the existing Stop hook into the new skill's checklist gate.
|
|
181
|
+
5. Update the README mirror so the bundled plugin matches the source skill. (surfaced — verify:skill-mirror gate flagged drift in last CI run)
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Total: 7 items (2 WILD + 5 RISA). That is the floor — emit more on either side if the surface warrants it. The fifth RISA item is marked `(surfaced — <source>)` to demonstrate the convention from the Proactive Roadmap Surfacing section: items lifted from a roadmap or memory carry an inline source attribution so the operator can tell roadmap-driven items apart from current-request items.
|
|
185
|
+
|
|
186
|
+
## Related
|
|
187
|
+
|
|
188
|
+
- `continuous-improvement` — the 7 Laws card (core skill)
|
|
189
|
+
- `proceed-with-the-recommendation` — execution arm; carries surfaced items across the surface → execute boundary defined in the Proactive Roadmap Surfacing section above
|
|
190
|
+
- `superpowers:brainstorming` — upstream WILD generator
|
|
191
|
+
- `verification-loop` — downstream RISA verifier
|