continuous-improvement 3.9.2 → 3.12.3
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 +3 -3
- package/CHANGELOG.md +95 -0
- package/LICENSE +21 -21
- package/QUICKSTART.md +13 -8
- package/README.md +94 -162
- package/SKILL.md +1 -1
- package/bin/analyze.sh +161 -161
- package/bin/backfill.mjs +19 -19
- package/bin/check-docs-substrings.mjs +73 -0
- package/bin/check-scripts-citation-drift.mjs +210 -0
- package/bin/check-skill-count.mjs +110 -0
- package/bin/check-test-imports-only.mjs +126 -0
- package/bin/check-tool-count.mjs +129 -0
- package/bin/companion-preference-status.mjs +231 -0
- package/bin/gateguard-clear.mjs +53 -0
- package/bin/generate-plugin-manifests.mjs +8 -1
- package/bin/harvest-friction.mjs +1 -1
- package/bin/hook-stats.mjs +21 -21
- package/bin/install.mjs +185 -28
- package/bin/mcp-server.mjs +216 -3
- package/bin/refresh-third-party.mjs +315 -313
- package/commands/audit.md +34 -0
- package/commands/companion-preference.md +58 -0
- package/commands/continuous-improvement.md +115 -115
- package/commands/dashboard.md +56 -56
- package/commands/discipline.md +14 -0
- package/commands/distill.md +39 -0
- package/commands/goal-check.md +53 -0
- package/commands/grill-me.md +40 -0
- package/commands/grill-with-docs.md +38 -0
- package/commands/handoff.md +42 -0
- package/commands/harvest.md +1 -1
- package/commands/proceed-with-the-recommendation.md +20 -0
- package/commands/recall.md +49 -0
- package/commands/reconcile.md +47 -0
- package/commands/seven-laws.md +16 -16
- package/commands/superpowers.md +3 -3
- package/commands/verify-install.md +55 -0
- package/commands/workspace-surface-audit.md +77 -77
- package/hooks/companion-preference.mjs +190 -0
- package/hooks/gateguard.mjs +72 -25
- package/hooks/goal-drift-stop.mjs +183 -0
- package/hooks/observe.sh +15 -1
- package/hooks/recall-briefing.mjs +167 -0
- package/hooks/route-prompt.mjs +180 -0
- package/hooks/route-table.json +35 -0
- package/hooks/session.sh +106 -106
- package/hooks/three-section-close.mjs +134 -132
- package/instinct-packs/go.json +58 -58
- package/instinct-packs/meta.json +16 -16
- package/instinct-packs/python.json +58 -58
- package/instinct-packs/react.json +58 -58
- package/lib/gateguard-state.mjs +54 -2
- package/lib/goal-drift-gate.mjs +50 -0
- package/lib/goal-state.mjs +285 -0
- package/lib/plugin-metadata.mjs +134 -15
- package/lib/recall-briefing.mjs +57 -0
- package/lib/recall-index.mjs +175 -0
- package/lib/skill-distill.mjs +222 -0
- package/llms.txt +2 -2
- package/package.json +12 -7
- package/plugins/beginner.json +9 -4
- package/plugins/continuous-improvement/.claude-plugin/marketplace.json +2 -2
- package/plugins/continuous-improvement/.claude-plugin/plugin.json +2 -2
- package/plugins/continuous-improvement/LICENSE +21 -21
- package/plugins/continuous-improvement/agents/README.md +3 -3
- package/plugins/continuous-improvement/bin/backfill.mjs +19 -19
- package/plugins/continuous-improvement/bin/gateguard-clear.mjs +53 -0
- package/plugins/continuous-improvement/bin/mcp-server.mjs +216 -3
- package/plugins/continuous-improvement/commands/audit.md +34 -0
- package/plugins/continuous-improvement/commands/companion-preference.md +58 -0
- package/plugins/continuous-improvement/commands/continuous-improvement.md +115 -115
- package/plugins/continuous-improvement/commands/dashboard.md +56 -56
- package/plugins/continuous-improvement/commands/discipline.md +14 -0
- package/plugins/continuous-improvement/commands/distill.md +39 -0
- package/plugins/continuous-improvement/commands/goal-check.md +53 -0
- package/plugins/continuous-improvement/commands/grill-me.md +40 -0
- package/plugins/continuous-improvement/commands/grill-with-docs.md +38 -0
- package/plugins/continuous-improvement/commands/handoff.md +42 -0
- package/plugins/continuous-improvement/commands/harvest.md +1 -1
- package/plugins/continuous-improvement/commands/proceed-with-the-recommendation.md +20 -0
- package/plugins/continuous-improvement/commands/recall.md +49 -0
- package/plugins/continuous-improvement/commands/reconcile.md +47 -0
- package/plugins/continuous-improvement/commands/seven-laws.md +16 -16
- package/plugins/continuous-improvement/commands/superpowers.md +3 -3
- package/plugins/continuous-improvement/commands/verify-install.md +55 -0
- package/plugins/continuous-improvement/commands/workspace-surface-audit.md +77 -77
- package/plugins/continuous-improvement/hooks/companion-preference.mjs +190 -0
- package/plugins/continuous-improvement/hooks/gateguard.mjs +72 -25
- package/plugins/continuous-improvement/hooks/goal-drift-stop.mjs +183 -0
- package/plugins/continuous-improvement/hooks/hooks.json +23 -2
- package/plugins/continuous-improvement/hooks/observe.sh +15 -1
- package/plugins/continuous-improvement/hooks/recall-briefing.mjs +167 -0
- package/plugins/continuous-improvement/hooks/route-prompt.mjs +180 -0
- package/plugins/continuous-improvement/hooks/route-table.json +35 -0
- package/plugins/continuous-improvement/hooks/session.sh +106 -106
- package/plugins/continuous-improvement/hooks/three-section-close.mjs +134 -132
- package/plugins/continuous-improvement/instinct-packs/go.json +58 -58
- package/plugins/continuous-improvement/instinct-packs/meta.json +16 -16
- package/plugins/continuous-improvement/instinct-packs/python.json +58 -58
- package/plugins/continuous-improvement/instinct-packs/react.json +58 -58
- package/plugins/continuous-improvement/lib/gateguard-state.mjs +137 -0
- package/plugins/continuous-improvement/lib/goal-drift-gate.mjs +50 -0
- package/plugins/continuous-improvement/lib/goal-state.mjs +285 -0
- package/plugins/continuous-improvement/lib/plugin-metadata.mjs +134 -15
- package/plugins/continuous-improvement/lib/recall-briefing.mjs +57 -0
- package/plugins/continuous-improvement/lib/recall-index.mjs +175 -0
- package/plugins/continuous-improvement/lib/skill-distill.mjs +222 -0
- package/plugins/continuous-improvement/skills/README.md +8 -0
- package/plugins/continuous-improvement/skills/audit/SKILL.md +73 -0
- package/plugins/continuous-improvement/skills/continuous-improvement/SKILL.md +1 -1
- package/plugins/continuous-improvement/skills/deploy-receipt/SKILL.md +13 -17
- package/plugins/continuous-improvement/skills/gateguard/SKILL.md +36 -17
- package/plugins/continuous-improvement/skills/goal-monitor/SKILL.md +81 -0
- package/plugins/continuous-improvement/skills/grill-me/SKILL.md +66 -0
- package/plugins/continuous-improvement/skills/grill-with-docs/SKILL.md +252 -0
- package/plugins/continuous-improvement/skills/handoff/SKILL.md +59 -0
- package/plugins/continuous-improvement/skills/para-memory-files/SKILL.md +1 -1
- package/plugins/continuous-improvement/skills/proceed-with-the-recommendation/SKILL.md +82 -6
- package/plugins/continuous-improvement/skills/ralph/SKILL.md +1 -0
- package/plugins/continuous-improvement/skills/recall/SKILL.md +50 -0
- package/plugins/continuous-improvement/skills/reconcile/SKILL.md +80 -0
- package/plugins/continuous-improvement/skills/recovery-classification/SKILL.md +1 -0
- package/plugins/continuous-improvement/skills/safety-guard/SKILL.md +1 -0
- package/plugins/continuous-improvement/skills/skill-distillation/SKILL.md +57 -0
- package/plugins/continuous-improvement/skills/state-reconciliation/SKILL.md +1 -0
- package/plugins/continuous-improvement/skills/strategic-compact/SKILL.md +1 -0
- package/plugins/continuous-improvement/skills/superpowers/SKILL.md +77 -3
- package/plugins/continuous-improvement/skills/tdd-workflow/SKILL.md +411 -411
- package/plugins/continuous-improvement/skills/token-budget-advisor/SKILL.md +1 -1
- package/plugins/continuous-improvement/skills/verification-loop/SKILL.md +28 -20
- package/plugins/continuous-improvement/skills/wild-risa-balance/SKILL.md +1 -0
- package/plugins/continuous-improvement/skills/workspace-surface-audit/SKILL.md +1 -1
- package/plugins/continuous-improvement/skills/worktree-safety/SKILL.md +3 -2
- package/plugins/expert.json +28 -3
- package/skills/README.md +3 -0
- package/skills/audit.md +73 -0
- package/skills/deploy-receipt.md +13 -17
- package/skills/gateguard.md +36 -17
- package/skills/goal-monitor.md +81 -0
- package/skills/grill-me.md +66 -0
- package/skills/grill-with-docs.md +252 -0
- package/skills/handoff.md +59 -0
- package/skills/para-memory-files.md +1 -1
- package/skills/proceed-with-the-recommendation.md +82 -6
- package/skills/ralph.md +1 -0
- package/skills/recall.md +50 -0
- package/skills/reconcile.md +80 -0
- package/skills/recovery-classification.md +1 -0
- package/skills/safety-guard.md +1 -0
- package/skills/skill-distillation.md +57 -0
- package/skills/state-reconciliation.md +1 -0
- package/skills/strategic-compact.md +1 -0
- package/skills/superpowers.md +77 -3
- package/skills/tdd-workflow.md +411 -411
- package/skills/token-budget-advisor.md +1 -1
- package/skills/verification-loop.md +28 -20
- package/skills/wild-risa-balance.md +1 -0
- package/skills/workspace-surface-audit.md +1 -1
- package/skills/worktree-safety.md +3 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// three-section-close.
|
|
2
|
+
// three-section-close.mts — Stop hook that requires every substantive
|
|
3
3
|
// assistant reply to close with three named sections:
|
|
4
4
|
// "What has been done", "What is next", "Recommendation".
|
|
5
5
|
//
|
|
@@ -19,163 +19,165 @@
|
|
|
19
19
|
// Telemetry: best-effort JSONL line per gated invocation written to
|
|
20
20
|
// ~/.claude/hook-telemetry/<project-hash>.jsonl. Never throws, never
|
|
21
21
|
// blocks the response. No network. No transcript content recorded.
|
|
22
|
-
|
|
23
22
|
import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
24
23
|
import { createHash } from "node:crypto";
|
|
25
24
|
import { platform } from "node:os";
|
|
26
25
|
import { dirname, join } from "node:path";
|
|
27
26
|
import { performance } from "node:perf_hooks";
|
|
28
|
-
|
|
29
27
|
import { resolveHomeDir } from "../lib/resolve-home-dir.mjs";
|
|
30
|
-
|
|
31
28
|
const MIN_LENGTH_TO_GATE = 600;
|
|
32
|
-
|
|
33
29
|
const REQUIRED_SECTIONS = [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
30
|
+
{
|
|
31
|
+
heading: "What has been done",
|
|
32
|
+
hint: "concrete summary of changes/findings from this turn",
|
|
33
|
+
pattern: /^#+ +What has been done(?:\s|$)/m,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
heading: "What is next",
|
|
37
|
+
hint: "minimum 5 specific, actionable bullets",
|
|
38
|
+
pattern: /^#+ +What is next(?:\s|$)/m,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
heading: "Recommendation",
|
|
42
|
+
hint: "ranked descending by impact, or write \"no\" if there is no recommendation",
|
|
43
|
+
pattern: /^#+ +Recommendation(?:\s|$)/m,
|
|
44
|
+
},
|
|
49
45
|
];
|
|
50
|
-
|
|
51
46
|
function readStdinSync() {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
try {
|
|
48
|
+
return readFileSync(0, "utf8");
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return "";
|
|
52
|
+
}
|
|
57
53
|
}
|
|
58
|
-
|
|
59
54
|
function safeJsonParse(text) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
try {
|
|
56
|
+
return JSON.parse(text);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
65
61
|
}
|
|
66
|
-
|
|
67
62
|
function extractLastAssistantText(transcriptPath) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
63
|
+
const raw = readFileSync(transcriptPath, "utf8");
|
|
64
|
+
const lines = raw.split(/\r?\n/);
|
|
65
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
66
|
+
const line = lines[i].trim();
|
|
67
|
+
if (!line)
|
|
68
|
+
continue;
|
|
69
|
+
const obj = safeJsonParse(line);
|
|
70
|
+
if (!obj || obj.type !== "assistant")
|
|
71
|
+
continue;
|
|
72
|
+
const blocks = obj.message?.content;
|
|
73
|
+
if (!Array.isArray(blocks))
|
|
74
|
+
continue;
|
|
75
|
+
const texts = blocks
|
|
76
|
+
.filter((b) => b &&
|
|
77
|
+
typeof b === "object" &&
|
|
78
|
+
b.type === "text" &&
|
|
79
|
+
typeof b.text === "string")
|
|
80
|
+
.map((b) => b.text);
|
|
81
|
+
if (texts.length === 0)
|
|
82
|
+
continue;
|
|
83
|
+
return texts.join("\n");
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
84
86
|
}
|
|
85
|
-
|
|
86
87
|
function emitBlock(missing) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
)
|
|
92
|
-
.join("\n");
|
|
93
|
-
const reason =
|
|
94
|
-
`Your reply is missing the required 3-section close. Add these sections at the end of the reply with these exact headings:\n${bullets}`;
|
|
95
|
-
process.stdout.write(JSON.stringify({ decision: "block", reason }) + "\n");
|
|
88
|
+
const bullets = missing
|
|
89
|
+
.map((s) => `- "## ${s.heading}" — ${s.hint}`)
|
|
90
|
+
.join("\n");
|
|
91
|
+
const reason = `Your reply is missing the required 3-section close. Add these sections at the end of the reply with these exact headings:\n${bullets}`;
|
|
92
|
+
process.stdout.write(JSON.stringify({ decision: "block", reason }) + "\n");
|
|
96
93
|
}
|
|
97
|
-
|
|
98
94
|
function projectHashFor(transcriptPath) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
const dir = dirname(transcriptPath);
|
|
96
|
+
let normalized = dir.split("\\").join("/");
|
|
97
|
+
if (platform() === "win32")
|
|
98
|
+
normalized = normalized.toLowerCase();
|
|
99
|
+
return createHash("sha256").update(normalized).digest("hex").slice(0, 12);
|
|
103
100
|
}
|
|
104
|
-
|
|
105
101
|
function recordTelemetry(entry, transcriptPath) {
|
|
106
|
-
try {
|
|
107
|
-
const home = resolveHomeDir();
|
|
108
|
-
if (!home) return;
|
|
109
|
-
const telemetryDir = join(home, ".claude", "hook-telemetry");
|
|
110
102
|
try {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
103
|
+
const home = resolveHomeDir();
|
|
104
|
+
if (!home)
|
|
105
|
+
return;
|
|
106
|
+
const telemetryDir = join(home, ".claude", "hook-telemetry");
|
|
107
|
+
try {
|
|
108
|
+
mkdirSync(telemetryDir, { recursive: true });
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const file = join(telemetryDir, `${projectHashFor(transcriptPath)}.jsonl`);
|
|
114
|
+
try {
|
|
115
|
+
appendFileSync(file, JSON.stringify(entry) + "\n", "utf8");
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
114
120
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
appendFileSync(file, JSON.stringify(entry) + "\n", "utf8");
|
|
118
|
-
} catch {
|
|
119
|
-
return;
|
|
121
|
+
catch {
|
|
122
|
+
// belt-and-suspenders: telemetry must never throw
|
|
120
123
|
}
|
|
121
|
-
} catch {
|
|
122
|
-
// belt-and-suspenders: telemetry must never throw
|
|
123
|
-
}
|
|
124
124
|
}
|
|
125
|
-
|
|
126
125
|
function main() {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
lastText
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
const textLength = lastText.length;
|
|
151
|
-
let action;
|
|
152
|
-
let missing = [];
|
|
153
|
-
|
|
154
|
-
if (textLength < MIN_LENGTH_TO_GATE) {
|
|
155
|
-
action = "skip-short";
|
|
156
|
-
} else {
|
|
157
|
-
missing = REQUIRED_SECTIONS.filter((s) => !s.pattern.test(lastText));
|
|
158
|
-
if (missing.length === 0) {
|
|
159
|
-
action = "pass";
|
|
160
|
-
} else {
|
|
161
|
-
action = "block";
|
|
162
|
-
emitBlock(missing);
|
|
126
|
+
// Per-operator opt-out. When CLAUDE_THREE_SECTION_CLOSE_DISABLED=1, the hook
|
|
127
|
+
// short-circuits entirely: no enforcement, no telemetry. Public default is
|
|
128
|
+
// unchanged (rule still fires for everyone else). See feedback memory
|
|
129
|
+
// 2026-05-04 for rationale: an audit found 22,876 observations produced
|
|
130
|
+
// only 2 graduated instincts, so visible end-of-turn reflection earns its
|
|
131
|
+
// keep poorly enough that operators may want to run it as internal thinking.
|
|
132
|
+
if (process.env.CLAUDE_THREE_SECTION_CLOSE_DISABLED === "1")
|
|
133
|
+
return;
|
|
134
|
+
const startedAt = performance.now();
|
|
135
|
+
const stdin = readStdinSync();
|
|
136
|
+
if (!stdin)
|
|
137
|
+
return;
|
|
138
|
+
const payload = safeJsonParse(stdin);
|
|
139
|
+
if (!payload || typeof payload.transcript_path !== "string")
|
|
140
|
+
return;
|
|
141
|
+
if (!existsSync(payload.transcript_path))
|
|
142
|
+
return;
|
|
143
|
+
let lastText;
|
|
144
|
+
try {
|
|
145
|
+
lastText = extractLastAssistantText(payload.transcript_path);
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
return; // fail open on read error
|
|
163
149
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
150
|
+
if (!lastText)
|
|
151
|
+
return;
|
|
152
|
+
const textLength = lastText.length;
|
|
153
|
+
let action;
|
|
154
|
+
let missing = [];
|
|
155
|
+
if (textLength < MIN_LENGTH_TO_GATE) {
|
|
156
|
+
action = "skip-short";
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
missing = REQUIRED_SECTIONS.filter((s) => !s.pattern.test(lastText));
|
|
160
|
+
if (missing.length === 0) {
|
|
161
|
+
action = "pass";
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
action = "block";
|
|
165
|
+
emitBlock(missing);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const entry = {
|
|
169
|
+
ts: new Date().toISOString(),
|
|
170
|
+
hook: "three-section-close",
|
|
171
|
+
action,
|
|
172
|
+
textLength,
|
|
173
|
+
missing: missing.map((s) => s.heading),
|
|
174
|
+
durationMs: Math.round((performance.now() - startedAt) * 1000) / 1000,
|
|
175
|
+
};
|
|
176
|
+
recordTelemetry(entry, payload.transcript_path);
|
|
175
177
|
}
|
|
176
|
-
|
|
177
178
|
try {
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
179
|
+
main();
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
// fail open — never block the session due to a hook bug
|
|
181
183
|
}
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "go-error-handling",
|
|
4
|
-
"trigger": "when calling functions that return errors",
|
|
5
|
-
"body": "Always check returned errors immediately. Never use _ to discard errors unless you've explicitly decided it's safe and documented why.",
|
|
6
|
-
"confidence": 0.7,
|
|
7
|
-
"domain": "patterns"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"id": "go-defer-cleanup",
|
|
11
|
-
"trigger": "when opening files, connections, or acquiring locks",
|
|
12
|
-
"body": "Use defer immediately after acquiring a resource for cleanup. Place defer right after the error check for the acquisition.",
|
|
13
|
-
"confidence": 0.7,
|
|
14
|
-
"domain": "patterns"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"id": "go-interface-consumer",
|
|
18
|
-
"trigger": "when defining Go interfaces",
|
|
19
|
-
"body": "Define interfaces at the consumer side, not the producer side. Keep interfaces small (1-3 methods). Accept interfaces, return structs.",
|
|
20
|
-
"confidence": 0.65,
|
|
21
|
-
"domain": "patterns"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"id": "go-table-driven-tests",
|
|
25
|
-
"trigger": "when writing Go tests",
|
|
26
|
-
"body": "Use table-driven tests with subtests (t.Run) for functions with multiple input/output cases. Name test cases descriptively.",
|
|
27
|
-
"confidence": 0.7,
|
|
28
|
-
"domain": "testing"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"id": "go-context-propagation",
|
|
32
|
-
"trigger": "when writing HTTP handlers or long-running operations",
|
|
33
|
-
"body": "Accept context.Context as the first parameter. Propagate it to all downstream calls. Use it for cancellation and timeouts.",
|
|
34
|
-
"confidence": 0.65,
|
|
35
|
-
"domain": "patterns"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"id": "go-goroutine-lifecycle",
|
|
39
|
-
"trigger": "when spawning goroutines",
|
|
40
|
-
"body": "Always ensure goroutines have a way to exit (context cancellation, done channel, or WaitGroup). Never fire-and-forget goroutines without cleanup.",
|
|
41
|
-
"confidence": 0.7,
|
|
42
|
-
"domain": "patterns"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"id": "go-struct-zero-values",
|
|
46
|
-
"trigger": "when designing Go structs",
|
|
47
|
-
"body": "Design structs so their zero value is useful. Use pointer fields only when nil is a meaningful distinct state from zero value.",
|
|
48
|
-
"confidence": 0.6,
|
|
49
|
-
"domain": "patterns"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"id": "go-mod-tidy",
|
|
53
|
-
"trigger": "when adding or removing dependencies",
|
|
54
|
-
"body": "Run 'go mod tidy' after adding or removing imports to keep go.mod and go.sum clean.",
|
|
55
|
-
"confidence": 0.65,
|
|
56
|
-
"domain": "workflow"
|
|
57
|
-
}
|
|
58
|
-
]
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "go-error-handling",
|
|
4
|
+
"trigger": "when calling functions that return errors",
|
|
5
|
+
"body": "Always check returned errors immediately. Never use _ to discard errors unless you've explicitly decided it's safe and documented why.",
|
|
6
|
+
"confidence": 0.7,
|
|
7
|
+
"domain": "patterns"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "go-defer-cleanup",
|
|
11
|
+
"trigger": "when opening files, connections, or acquiring locks",
|
|
12
|
+
"body": "Use defer immediately after acquiring a resource for cleanup. Place defer right after the error check for the acquisition.",
|
|
13
|
+
"confidence": 0.7,
|
|
14
|
+
"domain": "patterns"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "go-interface-consumer",
|
|
18
|
+
"trigger": "when defining Go interfaces",
|
|
19
|
+
"body": "Define interfaces at the consumer side, not the producer side. Keep interfaces small (1-3 methods). Accept interfaces, return structs.",
|
|
20
|
+
"confidence": 0.65,
|
|
21
|
+
"domain": "patterns"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "go-table-driven-tests",
|
|
25
|
+
"trigger": "when writing Go tests",
|
|
26
|
+
"body": "Use table-driven tests with subtests (t.Run) for functions with multiple input/output cases. Name test cases descriptively.",
|
|
27
|
+
"confidence": 0.7,
|
|
28
|
+
"domain": "testing"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "go-context-propagation",
|
|
32
|
+
"trigger": "when writing HTTP handlers or long-running operations",
|
|
33
|
+
"body": "Accept context.Context as the first parameter. Propagate it to all downstream calls. Use it for cancellation and timeouts.",
|
|
34
|
+
"confidence": 0.65,
|
|
35
|
+
"domain": "patterns"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "go-goroutine-lifecycle",
|
|
39
|
+
"trigger": "when spawning goroutines",
|
|
40
|
+
"body": "Always ensure goroutines have a way to exit (context cancellation, done channel, or WaitGroup). Never fire-and-forget goroutines without cleanup.",
|
|
41
|
+
"confidence": 0.7,
|
|
42
|
+
"domain": "patterns"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "go-struct-zero-values",
|
|
46
|
+
"trigger": "when designing Go structs",
|
|
47
|
+
"body": "Design structs so their zero value is useful. Use pointer fields only when nil is a meaningful distinct state from zero value.",
|
|
48
|
+
"confidence": 0.6,
|
|
49
|
+
"domain": "patterns"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "go-mod-tidy",
|
|
53
|
+
"trigger": "when adding or removing dependencies",
|
|
54
|
+
"body": "Run 'go mod tidy' after adding or removing imports to keep go.mod and go.sum clean.",
|
|
55
|
+
"confidence": 0.65,
|
|
56
|
+
"domain": "workflow"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "skip-thin-observation-schema",
|
|
4
|
-
"trigger": "when running /continuous-improvement and observations.jsonl entries contain only tool_start events with no inputs/outputs/errors",
|
|
5
|
-
"body": "Skip instinct fabrication and report the schema gap instead. With only ts/event/session/tool/project_id/project_name fields, the stream cannot distinguish a `git status` Bash call from a `rm -rf` Bash call. Tool-name bigrams (Bash→Bash, Edit→Edit, Read→Edit) reflect parallel-call artifacts and harness-enforced read-before-edit, not learned preferences. Recommend enhancing PostToolUse/PreToolUse hooks to log tool inputs (Bash command head, Skill name) and tool_end with success flag before retrying analysis.",
|
|
6
|
-
"confidence": 0.6,
|
|
7
|
-
"domain": "meta"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"id": "parallelize-independent-tool-calls",
|
|
11
|
-
"trigger": "when issuing 2+ tool calls with no data dependency between them in the same turn",
|
|
12
|
-
"body": "Batch independent tool calls into a single message instead of issuing them sequentially. Independent reads, independent greps, independent git inspections, independent file edits in unrelated files belong in one message with multiple tool blocks. Dependent calls (output of A determines input of B) stay sequential. Exception: when a single check would short-circuit the whole task (e.g., `git status` returning empty), one call first is fine. Sequential issuing of independent calls wastes wall-clock time and burns context per round-trip.",
|
|
13
|
-
"confidence": 0.6,
|
|
14
|
-
"domain": "workflow"
|
|
15
|
-
}
|
|
16
|
-
]
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "skip-thin-observation-schema",
|
|
4
|
+
"trigger": "when running /continuous-improvement and observations.jsonl entries contain only tool_start events with no inputs/outputs/errors",
|
|
5
|
+
"body": "Skip instinct fabrication and report the schema gap instead. With only ts/event/session/tool/project_id/project_name fields, the stream cannot distinguish a `git status` Bash call from a `rm -rf` Bash call. Tool-name bigrams (Bash→Bash, Edit→Edit, Read→Edit) reflect parallel-call artifacts and harness-enforced read-before-edit, not learned preferences. Recommend enhancing PostToolUse/PreToolUse hooks to log tool inputs (Bash command head, Skill name) and tool_end with success flag before retrying analysis.",
|
|
6
|
+
"confidence": 0.6,
|
|
7
|
+
"domain": "meta"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "parallelize-independent-tool-calls",
|
|
11
|
+
"trigger": "when issuing 2+ tool calls with no data dependency between them in the same turn",
|
|
12
|
+
"body": "Batch independent tool calls into a single message instead of issuing them sequentially. Independent reads, independent greps, independent git inspections, independent file edits in unrelated files belong in one message with multiple tool blocks. Dependent calls (output of A determines input of B) stay sequential. Exception: when a single check would short-circuit the whole task (e.g., `git status` returning empty), one call first is fine. Sequential issuing of independent calls wastes wall-clock time and burns context per round-trip.",
|
|
13
|
+
"confidence": 0.6,
|
|
14
|
+
"domain": "workflow"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "python-virtual-env",
|
|
4
|
-
"trigger": "when starting work on a Python project",
|
|
5
|
-
"body": "Check for virtual environment (venv, .venv, conda) before installing packages. Never install to system Python.",
|
|
6
|
-
"confidence": 0.7,
|
|
7
|
-
"domain": "workflow"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"id": "python-type-hints",
|
|
11
|
-
"trigger": "when writing Python functions",
|
|
12
|
-
"body": "Add type hints to function parameters and return values. Use Optional[], list[], dict[] (Python 3.10+) or typing module for older versions.",
|
|
13
|
-
"confidence": 0.6,
|
|
14
|
-
"domain": "code-style"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"id": "python-pathlib",
|
|
18
|
-
"trigger": "when working with file paths in Python",
|
|
19
|
-
"body": "Use pathlib.Path instead of os.path for file operations. It's more readable and cross-platform.",
|
|
20
|
-
"confidence": 0.65,
|
|
21
|
-
"domain": "patterns"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"id": "python-context-managers",
|
|
25
|
-
"trigger": "when opening files or database connections",
|
|
26
|
-
"body": "Always use context managers (with statement) for files, database connections, and locks. Never rely on manual .close() calls.",
|
|
27
|
-
"confidence": 0.7,
|
|
28
|
-
"domain": "patterns"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"id": "python-list-comprehension",
|
|
32
|
-
"trigger": "when writing simple for loops that build lists",
|
|
33
|
-
"body": "Prefer list comprehensions for simple transformations. Use regular for loops when the logic is complex or has side effects.",
|
|
34
|
-
"confidence": 0.6,
|
|
35
|
-
"domain": "code-style"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"id": "python-requirements-check",
|
|
39
|
-
"trigger": "when adding a new import",
|
|
40
|
-
"body": "Check if the package is already in requirements.txt, pyproject.toml, or Pipfile before adding. Search for existing usage in the codebase.",
|
|
41
|
-
"confidence": 0.65,
|
|
42
|
-
"domain": "workflow"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"id": "python-pytest-fixtures",
|
|
46
|
-
"trigger": "when writing Python tests",
|
|
47
|
-
"body": "Use pytest fixtures for test setup/teardown instead of unittest setUp/tearDown. Use conftest.py for shared fixtures.",
|
|
48
|
-
"confidence": 0.6,
|
|
49
|
-
"domain": "testing"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"id": "python-dataclass",
|
|
53
|
-
"trigger": "when creating classes that primarily hold data",
|
|
54
|
-
"body": "Use @dataclass or Pydantic BaseModel instead of plain classes for data containers. They provide __init__, __repr__, and comparison for free.",
|
|
55
|
-
"confidence": 0.65,
|
|
56
|
-
"domain": "patterns"
|
|
57
|
-
}
|
|
58
|
-
]
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "python-virtual-env",
|
|
4
|
+
"trigger": "when starting work on a Python project",
|
|
5
|
+
"body": "Check for virtual environment (venv, .venv, conda) before installing packages. Never install to system Python.",
|
|
6
|
+
"confidence": 0.7,
|
|
7
|
+
"domain": "workflow"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "python-type-hints",
|
|
11
|
+
"trigger": "when writing Python functions",
|
|
12
|
+
"body": "Add type hints to function parameters and return values. Use Optional[], list[], dict[] (Python 3.10+) or typing module for older versions.",
|
|
13
|
+
"confidence": 0.6,
|
|
14
|
+
"domain": "code-style"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "python-pathlib",
|
|
18
|
+
"trigger": "when working with file paths in Python",
|
|
19
|
+
"body": "Use pathlib.Path instead of os.path for file operations. It's more readable and cross-platform.",
|
|
20
|
+
"confidence": 0.65,
|
|
21
|
+
"domain": "patterns"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "python-context-managers",
|
|
25
|
+
"trigger": "when opening files or database connections",
|
|
26
|
+
"body": "Always use context managers (with statement) for files, database connections, and locks. Never rely on manual .close() calls.",
|
|
27
|
+
"confidence": 0.7,
|
|
28
|
+
"domain": "patterns"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "python-list-comprehension",
|
|
32
|
+
"trigger": "when writing simple for loops that build lists",
|
|
33
|
+
"body": "Prefer list comprehensions for simple transformations. Use regular for loops when the logic is complex or has side effects.",
|
|
34
|
+
"confidence": 0.6,
|
|
35
|
+
"domain": "code-style"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "python-requirements-check",
|
|
39
|
+
"trigger": "when adding a new import",
|
|
40
|
+
"body": "Check if the package is already in requirements.txt, pyproject.toml, or Pipfile before adding. Search for existing usage in the codebase.",
|
|
41
|
+
"confidence": 0.65,
|
|
42
|
+
"domain": "workflow"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "python-pytest-fixtures",
|
|
46
|
+
"trigger": "when writing Python tests",
|
|
47
|
+
"body": "Use pytest fixtures for test setup/teardown instead of unittest setUp/tearDown. Use conftest.py for shared fixtures.",
|
|
48
|
+
"confidence": 0.6,
|
|
49
|
+
"domain": "testing"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "python-dataclass",
|
|
53
|
+
"trigger": "when creating classes that primarily hold data",
|
|
54
|
+
"body": "Use @dataclass or Pydantic BaseModel instead of plain classes for data containers. They provide __init__, __repr__, and comparison for free.",
|
|
55
|
+
"confidence": 0.65,
|
|
56
|
+
"domain": "patterns"
|
|
57
|
+
}
|
|
58
|
+
]
|