continuous-improvement 3.20.4 → 3.21.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/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +10 -0
- package/QUICKSTART.md +1 -1
- package/README.md +7 -6
- package/bin/install.mjs +30 -69
- package/commands/production-readiness-review.md +5 -4
- package/commands/simplicity-review.md +35 -0
- package/commands/verify-install.md +2 -2
- package/hooks/session.mjs +85 -0
- package/lib/plugin-metadata.mjs +18 -20
- package/llms.txt +1 -1
- package/package.json +2 -2
- package/plugins/beginner.json +1 -1
- package/plugins/continuous-improvement/.claude-plugin/marketplace.json +2 -2
- package/plugins/continuous-improvement/.claude-plugin/plugin.json +2 -2
- package/plugins/continuous-improvement/commands/production-readiness-review.md +5 -4
- package/plugins/continuous-improvement/commands/simplicity-review.md +35 -0
- package/plugins/continuous-improvement/commands/verify-install.md +2 -2
- package/plugins/continuous-improvement/hooks/hooks.json +15 -16
- package/plugins/continuous-improvement/hooks/session.mjs +85 -0
- package/plugins/continuous-improvement/lib/plugin-metadata.mjs +18 -20
- package/plugins/continuous-improvement/skills/README.md +1 -0
- package/plugins/continuous-improvement/skills/proceed-with-the-recommendation/SKILL.md +1 -0
- package/plugins/continuous-improvement/skills/simplicity-review/SKILL.md +80 -0
- package/plugins/expert.json +1 -1
- package/skills/proceed-with-the-recommendation.md +1 -0
- package/skills/simplicity-review.md +80 -0
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"plugins": [
|
|
8
8
|
{
|
|
9
9
|
"name": "continuous-improvement",
|
|
10
|
-
"description": "The persistent-memory and runtime-discipline layer for Claude Code. It remembers the corrections you already gave, grounds every edit in real facts before it lands, and — through the Mulahazah engine — turns each fix into a reusable instinct, so a lesson learned once is applied automatically next time with no re-teaching. Built on the 7 Laws of AI Agent Discipline (research, plan, verify, reflect, learn) and shipped as
|
|
11
|
-
"version": "3.
|
|
10
|
+
"description": "The persistent-memory and runtime-discipline layer for Claude Code. It remembers the corrections you already gave, grounds every edit in real facts before it lands, and — through the Mulahazah engine — turns each fix into a reusable instinct, so a lesson learned once is applied automatically next time with no re-teaching. Built on the 7 Laws of AI Agent Discipline (research, plan, verify, reflect, learn) and shipped as 28 bundled skills, instinct-aware hooks, an MCP toolset for recall and reflection, and a GitHub Action transcript linter that feeds real work history back into sharper instincts.",
|
|
11
|
+
"version": "3.21.0",
|
|
12
12
|
"source": "./",
|
|
13
13
|
"author": {
|
|
14
14
|
"name": "naimkatiman"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "continuous-improvement",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "The persistent-memory and runtime-discipline layer for Claude Code. It remembers the corrections you already gave, grounds every edit in real facts before it lands, and — through the Mulahazah engine — turns each fix into a reusable instinct, so a lesson learned once is applied automatically next time with no re-teaching. Built on the 7 Laws of AI Agent Discipline (research, plan, verify, reflect, learn) and shipped as
|
|
3
|
+
"version": "3.21.0",
|
|
4
|
+
"description": "The persistent-memory and runtime-discipline layer for Claude Code. It remembers the corrections you already gave, grounds every edit in real facts before it lands, and — through the Mulahazah engine — turns each fix into a reusable instinct, so a lesson learned once is applied automatically next time with no re-teaching. Built on the 7 Laws of AI Agent Discipline (research, plan, verify, reflect, learn) and shipped as 28 bundled skills, instinct-aware hooks, an MCP toolset for recall and reflection, and a GitHub Action transcript linter that feeds real work history back into sharper instincts.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "naimkatiman",
|
|
7
7
|
"url": "https://github.com/naimkatiman"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: production-readiness-review
|
|
3
|
-
description: "Parallel multi-agent readiness gate — fan blind reviewers across performance, security, UI/UX,
|
|
3
|
+
description: "Parallel multi-agent readiness gate — fan blind reviewers across performance, security, UI/UX, test coverage, and simplicity, each grounding findings in real code/logs/live data, then reconcile into one deduplicated, severity-ranked punch-list. Reports only; never fixes, merges, or deploys."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /production-readiness-review
|
|
@@ -20,11 +20,12 @@ Pure routing over existing skills and agents. Adds no new code.
|
|
|
20
20
|
## Behavior
|
|
21
21
|
|
|
22
22
|
1. **Scope** — establish ground truth: the diff under review and which changes are recent (`git diff`; `reconcile` fallback for branch/base state). Recent changes get extra scrutiny because they are the likeliest source of self-inflicted defects.
|
|
23
|
-
2. **Fan out** — `superpowers:dispatching-parallel-agents` launches
|
|
23
|
+
2. **Fan out** — `superpowers:dispatching-parallel-agents` launches five reviewers, each blind to the others. Every reviewer is instructed to ground each finding in real code, logs, or live queries, and never to assume or fabricate state:
|
|
24
24
|
- **Performance & bundle-size** — hot paths, N+1 queries, unbounded work, regressions.
|
|
25
25
|
- **Security & data-access** (`security-auditor`) — authn/authz, input handling, injection, secret exposure, unsafe data access.
|
|
26
26
|
- **UI/UX correctness** — verified live with Playwright when the MCP is available, else static review of the changed surface.
|
|
27
27
|
- **Test coverage & flaky/stale mocks** (`test-engineer`) — uncovered branches, stale mocks, timing-flaky tests.
|
|
28
|
+
- **Simplicity & over-engineering** (`simplicity-review`) — code that could reuse an existing file, a stdlib or native feature, or fewer lines; reports trim opportunities via the reuse ladder and never flags input validation, data-loss handling, security, or accessibility.
|
|
28
29
|
3. **Reconcile** — a final pass dedupes findings across reviewers, ranks each CRITICAL / HIGH / MEDIUM / LOW by severity and confidence, and explicitly flags any defect introduced by the changes under review.
|
|
29
30
|
4. **Present** — emit the consolidated punch-list, severity-ranked, with file references. **Stop.**
|
|
30
31
|
|
|
@@ -42,7 +43,7 @@ Pure routing over existing skills and agents. Adds no new code.
|
|
|
42
43
|
|
|
43
44
|
## Composition
|
|
44
45
|
|
|
45
|
-
Routes through: `reconcile` (scope/ground truth) → `superpowers:dispatching-parallel-agents` (fan-out) → the `security-auditor` and `test-engineer` agents (
|
|
46
|
+
Routes through: `reconcile` (scope/ground truth) → `superpowers:dispatching-parallel-agents` (fan-out) → the `security-auditor` and `test-engineer` agents and the `simplicity-review` skill (three of the five dimensions) → a reconciliation pass that ranks and dedupes. Each step falls back to its inline behavior when the preferred skill or agent is not installed.
|
|
46
47
|
|
|
47
48
|
## Example
|
|
48
49
|
|
|
@@ -50,4 +51,4 @@ Routes through: `reconcile` (scope/ground truth) → `superpowers:dispatching-pa
|
|
|
50
51
|
/production-readiness-review #246
|
|
51
52
|
```
|
|
52
53
|
|
|
53
|
-
Scopes PR #246's diff, fans
|
|
54
|
+
Scopes PR #246's diff, fans five blind reviewers across performance, security, UI/UX, test coverage, and simplicity, then returns one deduplicated severity-ranked punch-list — flagging anything the PR's own changes introduced — and stops for you to prioritize.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: simplicity-review
|
|
3
|
+
description: Review the current diff for over-engineering — flag code that could reuse an existing file, a stdlib or native feature, or fewer lines — and report GO/TRIM findings without touching code. Enforces Law 4 (Verify Before Reporting).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /simplicity-review — Judge the Diff Before You Ship It
|
|
7
|
+
|
|
8
|
+
Read the current change like the laziest senior dev in the room: could this have been smaller? Passing tests prove correctness, not minimality. Backed by the `simplicity-review` skill.
|
|
9
|
+
|
|
10
|
+
## What it does
|
|
11
|
+
|
|
12
|
+
Takes the working-tree diff (vs HEAD by default; accepts an optional commit range or file list), reads each changed block, and walks a fixed reuse ladder:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
1. Does this need to exist? -> skip it (YAGNI)
|
|
16
|
+
2. Already in this codebase? -> reuse it
|
|
17
|
+
3. Stdlib does it? -> use it
|
|
18
|
+
4. Native platform feature? -> use it
|
|
19
|
+
5. Installed dependency? -> use it
|
|
20
|
+
6. One line? -> one line
|
|
21
|
+
7. Only then: the minimum that works
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
It reports `file:line`, what is over-built, the specific simpler path, and closes with `GO` (already minimal) or `TRIM` (findings to apply). It does not edit code.
|
|
25
|
+
|
|
26
|
+
## Default skeptical
|
|
27
|
+
|
|
28
|
+
A finding is a hypothesis. Read the surrounding code and prove the simpler path exists and preserves behavior before asserting it; a wrong trim is worse than the over-build. Never flag input validation, data-loss-preventing error handling, security, or accessibility — lazy, not negligent.
|
|
29
|
+
|
|
30
|
+
## Pairs with
|
|
31
|
+
|
|
32
|
+
- **`simplicity-review`** skill — the discipline this command runs.
|
|
33
|
+
- **`proceed-with-the-recommendation`** — apply the trims under the 7 Laws.
|
|
34
|
+
- **`verification-loop`** — the ladder to re-run on whatever you trim.
|
|
35
|
+
- **`production-readiness-review`** — the sibling diff review for performance, security, UI, and test coverage.
|
|
@@ -40,8 +40,8 @@ The observation hook appends one row per tool call to
|
|
|
40
40
|
`<project-hash>` from the current repo, or check `~/.claude/instincts/global/`).
|
|
41
41
|
|
|
42
42
|
- If it exists and has at least one row — capture is recording. Record `observe: ✓`.
|
|
43
|
-
- If it is missing or empty
|
|
44
|
-
|
|
43
|
+
- If it is missing or empty, record `observe: ✗ (observation hook not recording; re-run
|
|
44
|
+
the installer to migrate legacy Bash hook rows to the Node observer)`.
|
|
45
45
|
|
|
46
46
|
## Report
|
|
47
47
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"description": "Gateguard fact-forcing PreToolUse, companion-preference enforcement, observation, session lifecycle, 3-section-close discipline, goal-drift Stop gate, opt-in workflow-distill Stop nudge, opt-in typecheck Stop gate, opt-in query-cost Stop nudge, and UserPromptSubmit lazy-routing plus opt-in proactive recall-briefing hooks for continuous-improvement.",
|
|
3
2
|
"hooks": {
|
|
4
3
|
"PreToolUse": [
|
|
5
4
|
{
|
|
@@ -7,12 +6,12 @@
|
|
|
7
6
|
{
|
|
8
7
|
"type": "command",
|
|
9
8
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/gateguard.mjs\"",
|
|
10
|
-
"timeout":
|
|
9
|
+
"timeout": 30
|
|
11
10
|
},
|
|
12
11
|
{
|
|
13
12
|
"type": "command",
|
|
14
13
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/companion-preference.mjs\"",
|
|
15
|
-
"timeout":
|
|
14
|
+
"timeout": 30
|
|
16
15
|
}
|
|
17
16
|
]
|
|
18
17
|
},
|
|
@@ -22,7 +21,7 @@
|
|
|
22
21
|
{
|
|
23
22
|
"type": "command",
|
|
24
23
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/hook-pack.mjs\"",
|
|
25
|
-
"timeout":
|
|
24
|
+
"timeout": 30
|
|
26
25
|
}
|
|
27
26
|
]
|
|
28
27
|
}
|
|
@@ -32,8 +31,8 @@
|
|
|
32
31
|
"hooks": [
|
|
33
32
|
{
|
|
34
33
|
"type": "command",
|
|
35
|
-
"command": "
|
|
36
|
-
"timeout":
|
|
34
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/bin/observe.mjs\"",
|
|
35
|
+
"timeout": 30
|
|
37
36
|
}
|
|
38
37
|
]
|
|
39
38
|
}
|
|
@@ -44,12 +43,12 @@
|
|
|
44
43
|
{
|
|
45
44
|
"type": "command",
|
|
46
45
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/route-prompt.mjs\"",
|
|
47
|
-
"timeout":
|
|
46
|
+
"timeout": 30
|
|
48
47
|
},
|
|
49
48
|
{
|
|
50
49
|
"type": "command",
|
|
51
50
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/recall-briefing.mjs\"",
|
|
52
|
-
"timeout":
|
|
51
|
+
"timeout": 30
|
|
53
52
|
}
|
|
54
53
|
]
|
|
55
54
|
}
|
|
@@ -59,8 +58,8 @@
|
|
|
59
58
|
"hooks": [
|
|
60
59
|
{
|
|
61
60
|
"type": "command",
|
|
62
|
-
"command": "
|
|
63
|
-
"timeout":
|
|
61
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/session.mjs\"",
|
|
62
|
+
"timeout": 30
|
|
64
63
|
}
|
|
65
64
|
]
|
|
66
65
|
}
|
|
@@ -70,8 +69,8 @@
|
|
|
70
69
|
"hooks": [
|
|
71
70
|
{
|
|
72
71
|
"type": "command",
|
|
73
|
-
"command": "
|
|
74
|
-
"timeout":
|
|
72
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/session.mjs\"",
|
|
73
|
+
"timeout": 30
|
|
75
74
|
}
|
|
76
75
|
]
|
|
77
76
|
}
|
|
@@ -82,17 +81,17 @@
|
|
|
82
81
|
{
|
|
83
82
|
"type": "command",
|
|
84
83
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/three-section-close.mjs\"",
|
|
85
|
-
"timeout":
|
|
84
|
+
"timeout": 30
|
|
86
85
|
},
|
|
87
86
|
{
|
|
88
87
|
"type": "command",
|
|
89
88
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/goal-drift-stop.mjs\"",
|
|
90
|
-
"timeout":
|
|
89
|
+
"timeout": 30
|
|
91
90
|
},
|
|
92
91
|
{
|
|
93
92
|
"type": "command",
|
|
94
93
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/workflow-distill.mjs\"",
|
|
95
|
-
"timeout":
|
|
94
|
+
"timeout": 30
|
|
96
95
|
},
|
|
97
96
|
{
|
|
98
97
|
"type": "command",
|
|
@@ -102,7 +101,7 @@
|
|
|
102
101
|
{
|
|
103
102
|
"type": "command",
|
|
104
103
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/query-cost-nudge.mjs\"",
|
|
105
|
-
"timeout":
|
|
104
|
+
"timeout": 30
|
|
106
105
|
}
|
|
107
106
|
]
|
|
108
107
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { execFileSync } from "node:child_process";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
4
|
+
import { readFileSync, readdirSync } from "node:fs";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import { resolveHomeDir } from "../lib/resolve-home-dir.mjs";
|
|
7
|
+
function read(path) {
|
|
8
|
+
try {
|
|
9
|
+
return readFileSync(path, "utf8");
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return "";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function eventFromStdin() {
|
|
16
|
+
const raw = read(0);
|
|
17
|
+
if (!raw)
|
|
18
|
+
return null;
|
|
19
|
+
try {
|
|
20
|
+
const payload = JSON.parse(raw);
|
|
21
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload))
|
|
22
|
+
return null;
|
|
23
|
+
const event = payload.hook_event_name ?? payload.hook_type ?? payload.event_type;
|
|
24
|
+
return event === "SessionStart" || event === "SessionEnd" ? event : "unknown";
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function projectRoot() {
|
|
31
|
+
if (process.env.CLAUDE_PROJECT_DIR)
|
|
32
|
+
return process.env.CLAUDE_PROJECT_DIR;
|
|
33
|
+
try {
|
|
34
|
+
return execFileSync("git", ["rev-parse", "--show-toplevel"], {
|
|
35
|
+
encoding: "utf8",
|
|
36
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
37
|
+
}).trim() || "global";
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return "global";
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function yamlFiles(dir) {
|
|
44
|
+
try {
|
|
45
|
+
return readdirSync(dir)
|
|
46
|
+
.filter((name) => name.endsWith(".yaml"))
|
|
47
|
+
.map((name) => join(dir, name));
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function main() {
|
|
54
|
+
const event = eventFromStdin();
|
|
55
|
+
if (event === null)
|
|
56
|
+
return;
|
|
57
|
+
if (event === "SessionEnd") {
|
|
58
|
+
process.stderr.write("[continuous-improvement] Session ending. Run /continuous-improvement to reflect and capture learnings.\n");
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const home = resolveHomeDir();
|
|
62
|
+
if (!home)
|
|
63
|
+
return;
|
|
64
|
+
const instinctsRoot = join(home, ".claude", "instincts");
|
|
65
|
+
const hash = createHash("sha256").update(projectRoot()).digest("hex").slice(0, 12);
|
|
66
|
+
const projectDir = join(instinctsRoot, hash);
|
|
67
|
+
const files = [...yamlFiles(projectDir), ...yamlFiles(join(instinctsRoot, "global"))];
|
|
68
|
+
const observations = read(join(projectDir, "observations.jsonl")).split(/\r?\n/).filter(Boolean).length;
|
|
69
|
+
let level = observations >= 20 || files.length > 0 ? "ANALYZE" : "CAPTURE";
|
|
70
|
+
for (const file of files) {
|
|
71
|
+
const value = Number(read(file).match(/^confidence:\s*([0-9]*\.?[0-9]+)/m)?.[1]);
|
|
72
|
+
if (Number.isFinite(value) && value >= 0.7) {
|
|
73
|
+
level = "AUTO-APPLY";
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
if (Number.isFinite(value) && value >= 0.5)
|
|
77
|
+
level = "SUGGEST";
|
|
78
|
+
}
|
|
79
|
+
process.stderr.write(`[continuous-improvement] Level: ${level} | Observations: ${observations} | Instincts: ${files.length}\n`);
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
main();
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
}
|
|
@@ -26,7 +26,7 @@ const KEYWORDS = [
|
|
|
26
26
|
"transcript-linter",
|
|
27
27
|
];
|
|
28
28
|
const CLAUDE_PLUGIN_CATEGORY = "productivity";
|
|
29
|
-
const SHARED_PLUGIN_DESCRIPTION = "The persistent-memory and runtime-discipline layer for Claude Code. It remembers the corrections you already gave, grounds every edit in real facts before it lands, and — through the Mulahazah engine — turns each fix into a reusable instinct, so a lesson learned once is applied automatically next time with no re-teaching. Built on the 7 Laws of AI Agent Discipline (research, plan, verify, reflect, learn) and shipped as
|
|
29
|
+
const SHARED_PLUGIN_DESCRIPTION = "The persistent-memory and runtime-discipline layer for Claude Code. It remembers the corrections you already gave, grounds every edit in real facts before it lands, and — through the Mulahazah engine — turns each fix into a reusable instinct, so a lesson learned once is applied automatically next time with no re-teaching. Built on the 7 Laws of AI Agent Discipline (research, plan, verify, reflect, learn) and shipped as 28 bundled skills, instinct-aware hooks, an MCP toolset for recall and reflection, and a GitHub Action transcript linter that feeds real work history back into sharper instincts.";
|
|
30
30
|
// Four vendored upstream companions registered alongside the CI plugin.
|
|
31
31
|
// Each entry points at a pinned-SHA snapshot under third-party/<name>/.
|
|
32
32
|
// See third-party/MANIFEST.md for refresh recipes and per-snapshot
|
|
@@ -457,76 +457,74 @@ export function getClaudePluginManifest() {
|
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
459
|
export function getPluginHooksConfig() {
|
|
460
|
+
// Cold Node startup on loaded Windows hosts has exceeded five seconds.
|
|
461
|
+
const hookTimeoutSeconds = 30;
|
|
460
462
|
const gateguardCommand = {
|
|
461
463
|
type: "command",
|
|
462
464
|
command: "node \"${CLAUDE_PLUGIN_ROOT}/hooks/gateguard.mjs\"",
|
|
463
|
-
timeout:
|
|
465
|
+
timeout: hookTimeoutSeconds,
|
|
464
466
|
};
|
|
465
467
|
const companionPreferenceCommand = {
|
|
466
468
|
type: "command",
|
|
467
469
|
command: "node \"${CLAUDE_PLUGIN_ROOT}/hooks/companion-preference.mjs\"",
|
|
468
|
-
timeout:
|
|
470
|
+
timeout: hookTimeoutSeconds,
|
|
469
471
|
};
|
|
470
472
|
const hookPackCommand = {
|
|
471
473
|
type: "command",
|
|
472
474
|
command: "node \"${CLAUDE_PLUGIN_ROOT}/hooks/hook-pack.mjs\"",
|
|
473
|
-
timeout:
|
|
475
|
+
timeout: hookTimeoutSeconds,
|
|
474
476
|
};
|
|
475
477
|
const observeCommand = {
|
|
476
478
|
type: "command",
|
|
477
|
-
command: "
|
|
478
|
-
timeout:
|
|
479
|
+
command: "node \"${CLAUDE_PLUGIN_ROOT}/bin/observe.mjs\"",
|
|
480
|
+
timeout: hookTimeoutSeconds,
|
|
479
481
|
};
|
|
480
482
|
const sessionCommand = {
|
|
481
483
|
type: "command",
|
|
482
|
-
command: "
|
|
483
|
-
timeout:
|
|
484
|
+
command: "node \"${CLAUDE_PLUGIN_ROOT}/hooks/session.mjs\"",
|
|
485
|
+
timeout: hookTimeoutSeconds,
|
|
484
486
|
};
|
|
485
487
|
const threeSectionCloseCommand = {
|
|
486
488
|
type: "command",
|
|
487
489
|
command: "node \"${CLAUDE_PLUGIN_ROOT}/hooks/three-section-close.mjs\"",
|
|
488
|
-
timeout:
|
|
490
|
+
timeout: hookTimeoutSeconds,
|
|
489
491
|
};
|
|
490
492
|
const goalDriftStopCommand = {
|
|
491
493
|
type: "command",
|
|
492
494
|
command: "node \"${CLAUDE_PLUGIN_ROOT}/hooks/goal-drift-stop.mjs\"",
|
|
493
|
-
timeout:
|
|
495
|
+
timeout: hookTimeoutSeconds,
|
|
494
496
|
};
|
|
495
497
|
const workflowDistillCommand = {
|
|
496
498
|
type: "command",
|
|
497
499
|
command: "node \"${CLAUDE_PLUGIN_ROOT}/hooks/workflow-distill.mjs\"",
|
|
498
|
-
timeout:
|
|
500
|
+
timeout: hookTimeoutSeconds,
|
|
499
501
|
};
|
|
500
502
|
const typecheckStopCommand = {
|
|
501
503
|
type: "command",
|
|
502
504
|
command: "node \"${CLAUDE_PLUGIN_ROOT}/hooks/typecheck-stop.mjs\"",
|
|
503
|
-
|
|
504
|
-
// (off by default) and near-zero cost when off / no TS file changed; on an
|
|
505
|
-
// internal timeout it fails open (allow) rather than blocking.
|
|
506
|
-
timeout: 30,
|
|
505
|
+
timeout: hookTimeoutSeconds,
|
|
507
506
|
};
|
|
508
507
|
const queryCostNudgeCommand = {
|
|
509
508
|
type: "command",
|
|
510
509
|
command: "node \"${CLAUDE_PLUGIN_ROOT}/hooks/query-cost-nudge.mjs\"",
|
|
511
|
-
timeout:
|
|
510
|
+
timeout: hookTimeoutSeconds,
|
|
512
511
|
};
|
|
513
512
|
const routePromptCommand = {
|
|
514
513
|
type: "command",
|
|
515
514
|
command: "node \"${CLAUDE_PLUGIN_ROOT}/hooks/route-prompt.mjs\"",
|
|
516
|
-
timeout:
|
|
515
|
+
timeout: hookTimeoutSeconds,
|
|
517
516
|
};
|
|
518
517
|
const recallBriefingCommand = {
|
|
519
518
|
type: "command",
|
|
520
519
|
command: "node \"${CLAUDE_PLUGIN_ROOT}/hooks/recall-briefing.mjs\"",
|
|
521
|
-
timeout:
|
|
520
|
+
timeout: hookTimeoutSeconds,
|
|
522
521
|
};
|
|
523
522
|
return {
|
|
524
|
-
description: "Gateguard fact-forcing PreToolUse, companion-preference enforcement, observation, session lifecycle, 3-section-close discipline, goal-drift Stop gate, opt-in workflow-distill Stop nudge, opt-in typecheck Stop gate, opt-in query-cost Stop nudge, and UserPromptSubmit lazy-routing plus opt-in proactive recall-briefing hooks for continuous-improvement.",
|
|
525
523
|
hooks: {
|
|
526
524
|
// gateguard runs FIRST on PreToolUse so its block decision short-circuits
|
|
527
525
|
// before companion-preference sees the call. companion-preference runs
|
|
528
526
|
// second on Skill tool calls; it is a no-op under ci-first (the default)
|
|
529
|
-
// and never blocks under companions-first.
|
|
527
|
+
// and never blocks under companions-first. The observer only runs on
|
|
530
528
|
// PostToolUse: gateguard-blocked calls are intentionally not observed so
|
|
531
529
|
// PreToolUse stays at two subprocesses on the hot path. route-prompt
|
|
532
530
|
// fires on UserPromptSubmit and emits a system-reminder when a prompt
|
|
@@ -34,6 +34,7 @@ skill set on disk.
|
|
|
34
34
|
- `recovery-classification` — Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. After any failure in the verification ladder or auto-loop, classify the failure class before retrying — provider, tool-schema, deterministic-policy, git, worktree, runtime — so retry-vs-pause-vs-self-heal-vs-stop is an intentional decision, not a generic 'try again'.
|
|
35
35
|
- `roast` — Enforces Law 1 (Research Before Executing) of the 7 Laws of AI Agent Discipline. Convene a 5-persona adversarial council (Contrarian, Expansionist, Logician, Researcher, Buyer) that attacks an idea from every angle, then a Judge returns one GO / RESHAPE / KILL verdict plus the cheapest 48-hour test to de-risk it — so you pressure-test an idea before sinking time into building the wrong thing.
|
|
36
36
|
- `safety-guard` — Enforces Law 3 (One Thing at a Time) of the 7 Laws of AI Agent Discipline by scoping edits to a directory and blocking destructive shell commands. Use this skill to prevent destructive operations when working on production systems or running agents autonomously.
|
|
37
|
+
- `simplicity-review` — Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. Reviews the current diff for over-engineering (code that could reuse an existing file, a stdlib or native feature, or fewer lines) and reports trim findings without touching code, so 'it works' is never mistaken for 'it is the minimum that works'.
|
|
37
38
|
- `skill-distillation` — Enforces Law 7 (Learn From Every Session) of the 7 Laws of AI Agent Discipline. Distills repeated successful tool sequences into reusable draft instincts, so a pattern that worked three times becomes a captured recipe instead of being re-derived from scratch every session.
|
|
38
39
|
- `state-reconciliation` — Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. Pre-dispatch invariant: reconcile DB-vs-disk-vs-memory state before any unit runs, so a stale flag, missing artifact, or out-of-sync row never re-dispatches a unit that already completed or never started.
|
|
39
40
|
- `strategic-compact` — Enforces Law 5 (Reflect After Every Session) of the 7 Laws of AI Agent Discipline at phase boundaries. Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
|
|
@@ -213,6 +213,7 @@ Rows whose **Preferred skill** is not bundled with the `continuous-improvement`
|
|
|
213
213
|
| Fix bug / investigate failure | `superpowers:systematic-debugging` | Hypothesis → add logs/tests → reproduce → smallest fix → verify with the failing repro. (Reference behavior — does not require `superpowers:systematic-debugging`.) |
|
|
214
214
|
| Write tests / add coverage | `superpowers:test-driven-development` or `tdd-workflow` | RED (failing test) → GREEN (minimal code) → REFACTOR; one test, one behavior |
|
|
215
215
|
| Refactor / dead code cleanup | `simplify` | Find dupes/unused exports, delete in place, re-run type check and smallest test. (Reference behavior — does not require `simplify`.) |
|
|
216
|
+
| Over-engineering check on a diff | `simplicity-review` (bundled) | Walk the reuse ladder (existing file, stdlib, native feature, one line) over the current diff and report GO/TRIM without editing; apply trims, then re-run the smallest check. Never flags input validation, data-loss handling, security, or accessibility. |
|
|
216
217
|
| Security review / auth audit | `security-review` | Scan for hardcoded secrets, unsanitized input, missing authz, SQL string concat, open CORS. (Reference behavior — does not require `security-review`.) |
|
|
217
218
|
| Code review before merge | `superpowers:requesting-code-review` or `code-review` | Read diff top-to-bottom, flag CRITICAL / HIGH / MEDIUM. (Reference behavior — does not require `code-review`.) |
|
|
218
219
|
| Verify before shipping | `superpowers:verification-before-completion` | Smallest check that proves correctness: typecheck + one test + one curl. (Reference behavior — does not require `superpowers:verification-before-completion`.) |
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: simplicity-review
|
|
3
|
+
tier: "2"
|
|
4
|
+
description: Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. Reviews the current diff for over-engineering (code that could reuse an existing file, a stdlib or native feature, or fewer lines) and reports trim findings without touching code, so 'it works' is never mistaken for 'it is the minimum that works'.
|
|
5
|
+
origin: continuous-improvement
|
|
6
|
+
user-invocable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Simplicity Review — Flag the Over-Build Before It Ships
|
|
10
|
+
|
|
11
|
+
Law 4 says verify before reporting. "It compiles and the test passes" is a claim about correctness, not about whether the change is the minimum that works. This skill runs a diff-scoped review with one question: could this have been smaller? It reads the change like the laziest senior dev in the room, walks a fixed reuse ladder, and reports what to trim. It never edits code. The best code is the code you never wrote.
|
|
12
|
+
|
|
13
|
+
## When to Activate
|
|
14
|
+
|
|
15
|
+
- After writing a feature or fix, before opening a PR, when the diff feels larger than the task warranted.
|
|
16
|
+
- When you reached for a new file, a new dependency, or a wrapper component and a native or existing option might already cover it.
|
|
17
|
+
- As a routed step from `proceed-with-the-recommendation` at the "Refactor / dead code cleanup" line, as the repo-owned alternative to the built-in `simplify`.
|
|
18
|
+
- Before a release cut, over the diff since the last tag, as a last pass on accreted complexity.
|
|
19
|
+
|
|
20
|
+
## The Ladder
|
|
21
|
+
|
|
22
|
+
Read each added or changed block and stop at the first rung that holds:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
1. Does this need to exist? -> skip it (YAGNI)
|
|
26
|
+
2. Already in this codebase? -> reuse it
|
|
27
|
+
3. Stdlib does it? -> use it
|
|
28
|
+
4. Native platform feature? -> use it
|
|
29
|
+
5. Installed dependency? -> use it
|
|
30
|
+
6. One line? -> one line
|
|
31
|
+
7. Only then: the minimum that works
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Most real cuts come from rungs 2 to 4: a hand-rolled helper that duplicates an existing one, a component built where a native input, a stdlib call, or a platform primitive already does the job.
|
|
35
|
+
|
|
36
|
+
## Read Before You Cut
|
|
37
|
+
|
|
38
|
+
Lazy about the solution, never about the reading. The ladder shortens the solution, not the investigation. Trace the whole change and what it touches first. A "simpler" path proposed without reading the surrounding code is a guess, and a wrong trim is worse than the over-build.
|
|
39
|
+
|
|
40
|
+
## Safety Carve-Out (Never Flag)
|
|
41
|
+
|
|
42
|
+
Lazy, not negligent. These are never on the chopping block, no matter how many lines they cost:
|
|
43
|
+
|
|
44
|
+
- Input validation at trust boundaries.
|
|
45
|
+
- Error handling that prevents data loss.
|
|
46
|
+
- Security controls (authz checks, escaping, secret handling).
|
|
47
|
+
- Accessibility.
|
|
48
|
+
|
|
49
|
+
This aligns with `rules/common/security.md` and `rules/common/coding-style.md`. If a trim would weaken any of the above, it is not a finding.
|
|
50
|
+
|
|
51
|
+
## Output
|
|
52
|
+
|
|
53
|
+
A findings list. For each item:
|
|
54
|
+
|
|
55
|
+
- `file:line`
|
|
56
|
+
- `over-built:` what the code does the long way
|
|
57
|
+
- `simpler:` the specific shorter path (reuse existing `X` / stdlib `Y` / native `Z` / one line / delete)
|
|
58
|
+
- one-line rationale
|
|
59
|
+
|
|
60
|
+
Close with a verdict:
|
|
61
|
+
|
|
62
|
+
- `GO` — the diff is already at or near minimal; nothing to trim.
|
|
63
|
+
- `TRIM` — findings listed above; apply, then re-verify.
|
|
64
|
+
|
|
65
|
+
No score, no line-count target. A net-negative diff is a nice side effect, not the goal. Optimizing for fewer lines invites golfing and deletion of things that earn their keep; the ladder, not a number, decides.
|
|
66
|
+
|
|
67
|
+
## Review Only
|
|
68
|
+
|
|
69
|
+
This skill reports; it does not edit. Apply the trims yourself or route them through `proceed-with-the-recommendation`, then run the `verification-loop` ladder on what changed. This mirrors `audit`'s confirm-before-fix: a finding is a hypothesis until the simpler path is proven to exist and to preserve behavior.
|
|
70
|
+
|
|
71
|
+
## Overlap With `simplify`
|
|
72
|
+
|
|
73
|
+
The Claude Code built-in `simplify` and this skill share intent but differ in kind. `simplify` auto-applies broad reuse, efficiency, and altitude cleanups across changed code. `simplicity-review` is a repo-owned, Law-4-tagged, review-only lens scoped to over-engineering in the current diff, with an explicit safety carve-out, that feeds its findings into the 7-Laws flow. Use `simplify` when you want the fixes applied; use `simplicity-review` when you want the diff judged first.
|
|
74
|
+
|
|
75
|
+
## Pairs With
|
|
76
|
+
|
|
77
|
+
- **`verification-loop`** (Law 4) — the build/test/lint ladder you run after applying a trim.
|
|
78
|
+
- **`gateguard`** (Law 1) — the write-time reuse gate ("confirm no existing file serves the same purpose"); this skill catches at review time what slipped past it.
|
|
79
|
+
- **`proceed-with-the-recommendation`** — applies the trims under the 7 Laws.
|
|
80
|
+
- **`wild-risa-balance`** (Law 2) — the recommendation-layer analog: the same anti-padding instinct applied to advice instead of code.
|
package/plugins/expert.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "continuous-improvement",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.21.0",
|
|
4
4
|
"mode": "expert",
|
|
5
5
|
"description": "Expert mode: tune confidence, manage instincts, and persist plans on disk. Adds safety, token-budget, and strategic-compact skills plus the /learn-eval command so long sessions stay sharp and learnings survive context resets.",
|
|
6
6
|
"tools": [
|
|
@@ -213,6 +213,7 @@ Rows whose **Preferred skill** is not bundled with the `continuous-improvement`
|
|
|
213
213
|
| Fix bug / investigate failure | `superpowers:systematic-debugging` | Hypothesis → add logs/tests → reproduce → smallest fix → verify with the failing repro. (Reference behavior — does not require `superpowers:systematic-debugging`.) |
|
|
214
214
|
| Write tests / add coverage | `superpowers:test-driven-development` or `tdd-workflow` | RED (failing test) → GREEN (minimal code) → REFACTOR; one test, one behavior |
|
|
215
215
|
| Refactor / dead code cleanup | `simplify` | Find dupes/unused exports, delete in place, re-run type check and smallest test. (Reference behavior — does not require `simplify`.) |
|
|
216
|
+
| Over-engineering check on a diff | `simplicity-review` (bundled) | Walk the reuse ladder (existing file, stdlib, native feature, one line) over the current diff and report GO/TRIM without editing; apply trims, then re-run the smallest check. Never flags input validation, data-loss handling, security, or accessibility. |
|
|
216
217
|
| Security review / auth audit | `security-review` | Scan for hardcoded secrets, unsanitized input, missing authz, SQL string concat, open CORS. (Reference behavior — does not require `security-review`.) |
|
|
217
218
|
| Code review before merge | `superpowers:requesting-code-review` or `code-review` | Read diff top-to-bottom, flag CRITICAL / HIGH / MEDIUM. (Reference behavior — does not require `code-review`.) |
|
|
218
219
|
| Verify before shipping | `superpowers:verification-before-completion` | Smallest check that proves correctness: typecheck + one test + one curl. (Reference behavior — does not require `superpowers:verification-before-completion`.) |
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: simplicity-review
|
|
3
|
+
tier: "2"
|
|
4
|
+
description: Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. Reviews the current diff for over-engineering (code that could reuse an existing file, a stdlib or native feature, or fewer lines) and reports trim findings without touching code, so 'it works' is never mistaken for 'it is the minimum that works'.
|
|
5
|
+
origin: continuous-improvement
|
|
6
|
+
user-invocable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Simplicity Review — Flag the Over-Build Before It Ships
|
|
10
|
+
|
|
11
|
+
Law 4 says verify before reporting. "It compiles and the test passes" is a claim about correctness, not about whether the change is the minimum that works. This skill runs a diff-scoped review with one question: could this have been smaller? It reads the change like the laziest senior dev in the room, walks a fixed reuse ladder, and reports what to trim. It never edits code. The best code is the code you never wrote.
|
|
12
|
+
|
|
13
|
+
## When to Activate
|
|
14
|
+
|
|
15
|
+
- After writing a feature or fix, before opening a PR, when the diff feels larger than the task warranted.
|
|
16
|
+
- When you reached for a new file, a new dependency, or a wrapper component and a native or existing option might already cover it.
|
|
17
|
+
- As a routed step from `proceed-with-the-recommendation` at the "Refactor / dead code cleanup" line, as the repo-owned alternative to the built-in `simplify`.
|
|
18
|
+
- Before a release cut, over the diff since the last tag, as a last pass on accreted complexity.
|
|
19
|
+
|
|
20
|
+
## The Ladder
|
|
21
|
+
|
|
22
|
+
Read each added or changed block and stop at the first rung that holds:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
1. Does this need to exist? -> skip it (YAGNI)
|
|
26
|
+
2. Already in this codebase? -> reuse it
|
|
27
|
+
3. Stdlib does it? -> use it
|
|
28
|
+
4. Native platform feature? -> use it
|
|
29
|
+
5. Installed dependency? -> use it
|
|
30
|
+
6. One line? -> one line
|
|
31
|
+
7. Only then: the minimum that works
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Most real cuts come from rungs 2 to 4: a hand-rolled helper that duplicates an existing one, a component built where a native input, a stdlib call, or a platform primitive already does the job.
|
|
35
|
+
|
|
36
|
+
## Read Before You Cut
|
|
37
|
+
|
|
38
|
+
Lazy about the solution, never about the reading. The ladder shortens the solution, not the investigation. Trace the whole change and what it touches first. A "simpler" path proposed without reading the surrounding code is a guess, and a wrong trim is worse than the over-build.
|
|
39
|
+
|
|
40
|
+
## Safety Carve-Out (Never Flag)
|
|
41
|
+
|
|
42
|
+
Lazy, not negligent. These are never on the chopping block, no matter how many lines they cost:
|
|
43
|
+
|
|
44
|
+
- Input validation at trust boundaries.
|
|
45
|
+
- Error handling that prevents data loss.
|
|
46
|
+
- Security controls (authz checks, escaping, secret handling).
|
|
47
|
+
- Accessibility.
|
|
48
|
+
|
|
49
|
+
This aligns with `rules/common/security.md` and `rules/common/coding-style.md`. If a trim would weaken any of the above, it is not a finding.
|
|
50
|
+
|
|
51
|
+
## Output
|
|
52
|
+
|
|
53
|
+
A findings list. For each item:
|
|
54
|
+
|
|
55
|
+
- `file:line`
|
|
56
|
+
- `over-built:` what the code does the long way
|
|
57
|
+
- `simpler:` the specific shorter path (reuse existing `X` / stdlib `Y` / native `Z` / one line / delete)
|
|
58
|
+
- one-line rationale
|
|
59
|
+
|
|
60
|
+
Close with a verdict:
|
|
61
|
+
|
|
62
|
+
- `GO` — the diff is already at or near minimal; nothing to trim.
|
|
63
|
+
- `TRIM` — findings listed above; apply, then re-verify.
|
|
64
|
+
|
|
65
|
+
No score, no line-count target. A net-negative diff is a nice side effect, not the goal. Optimizing for fewer lines invites golfing and deletion of things that earn their keep; the ladder, not a number, decides.
|
|
66
|
+
|
|
67
|
+
## Review Only
|
|
68
|
+
|
|
69
|
+
This skill reports; it does not edit. Apply the trims yourself or route them through `proceed-with-the-recommendation`, then run the `verification-loop` ladder on what changed. This mirrors `audit`'s confirm-before-fix: a finding is a hypothesis until the simpler path is proven to exist and to preserve behavior.
|
|
70
|
+
|
|
71
|
+
## Overlap With `simplify`
|
|
72
|
+
|
|
73
|
+
The Claude Code built-in `simplify` and this skill share intent but differ in kind. `simplify` auto-applies broad reuse, efficiency, and altitude cleanups across changed code. `simplicity-review` is a repo-owned, Law-4-tagged, review-only lens scoped to over-engineering in the current diff, with an explicit safety carve-out, that feeds its findings into the 7-Laws flow. Use `simplify` when you want the fixes applied; use `simplicity-review` when you want the diff judged first.
|
|
74
|
+
|
|
75
|
+
## Pairs With
|
|
76
|
+
|
|
77
|
+
- **`verification-loop`** (Law 4) — the build/test/lint ladder you run after applying a trim.
|
|
78
|
+
- **`gateguard`** (Law 1) — the write-time reuse gate ("confirm no existing file serves the same purpose"); this skill catches at review time what slipped past it.
|
|
79
|
+
- **`proceed-with-the-recommendation`** — applies the trims under the 7 Laws.
|
|
80
|
+
- **`wild-risa-balance`** (Law 2) — the recommendation-layer analog: the same anti-padding instinct applied to advice instead of code.
|