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.
Files changed (136) hide show
  1. package/.claude-plugin/marketplace.json +66 -0
  2. package/CHANGELOG.md +216 -0
  3. package/QUICKSTART.md +79 -12
  4. package/README.md +229 -349
  5. package/SKILL.md +87 -9
  6. package/action.yml +1 -1
  7. package/bin/analyze.sh +9 -1
  8. package/bin/backfill.mjs +172 -0
  9. package/bin/check-doc-runtime-claims.mjs +120 -0
  10. package/bin/check-docs-substrings.mjs +333 -0
  11. package/bin/check-everything-mirror.mjs +145 -0
  12. package/bin/check-routing-targets.mjs +151 -0
  13. package/bin/check-skill-law-tag.mjs +128 -0
  14. package/bin/check-skill-mirror.mjs +119 -0
  15. package/bin/check-skill-tiers.mjs +116 -0
  16. package/bin/check-third-party-shape.mjs +202 -0
  17. package/bin/generate-plugin-manifests.mjs +171 -0
  18. package/bin/harvest-friction.mjs +279 -0
  19. package/bin/hook-stats.mjs +258 -0
  20. package/bin/install.mjs +407 -499
  21. package/bin/lint-transcript.mjs +182 -210
  22. package/bin/mcp-server.mjs +834 -608
  23. package/bin/observe.mjs +148 -0
  24. package/bin/pre-commit-block-strays.sh +49 -0
  25. package/bin/refresh-third-party.mjs +416 -0
  26. package/bin/unified-cli.mjs +533 -0
  27. package/commands/continuous-improvement.md +43 -2
  28. package/commands/discipline.md +14 -0
  29. package/commands/harvest.md +76 -0
  30. package/commands/learn-eval.md +117 -0
  31. package/commands/planning-with-files.md +66 -0
  32. package/commands/proceed-with-the-recommendation.md +62 -0
  33. package/commands/ralph.md +103 -0
  34. package/commands/release-train.md +81 -0
  35. package/commands/seven-laws.md +16 -0
  36. package/commands/superpowers.md +180 -0
  37. package/commands/swarm.md +101 -0
  38. package/commands/workspace-surface-audit.md +77 -0
  39. package/hooks/gateguard.mjs +172 -0
  40. package/hooks/observe.sh +42 -4
  41. package/hooks/session.sh +3 -3
  42. package/hooks/three-section-close.mjs +181 -0
  43. package/instinct-packs/meta.json +16 -0
  44. package/lib/cli-anything.mjs +401 -0
  45. package/lib/compound-engineering.mjs +831 -0
  46. package/lib/gateguard-state.mjs +85 -0
  47. package/lib/observe-event.mjs +128 -0
  48. package/lib/plugin-metadata.mjs +435 -0
  49. package/lib/pm-marketplace.mjs +61 -0
  50. package/lib/pm-skills.mjs +1274 -0
  51. package/lib/resolve-home-dir.mjs +43 -0
  52. package/lib/skill-tiers.mjs +137 -0
  53. package/lib/unified-plugin.mjs +924 -0
  54. package/llms.txt +32 -7
  55. package/package.json +29 -19
  56. package/plugins/beginner.json +17 -6
  57. package/plugins/continuous-improvement/.claude-plugin/marketplace.json +20 -0
  58. package/plugins/continuous-improvement/.claude-plugin/plugin.json +26 -0
  59. package/plugins/continuous-improvement/LICENSE +21 -0
  60. package/plugins/continuous-improvement/README.md +57 -0
  61. package/plugins/continuous-improvement/agents/README.md +120 -0
  62. package/plugins/continuous-improvement/agents/code-reviewer.md +97 -0
  63. package/plugins/continuous-improvement/agents/security-auditor.md +101 -0
  64. package/plugins/continuous-improvement/agents/test-engineer.md +95 -0
  65. package/plugins/continuous-improvement/bin/backfill.mjs +172 -0
  66. package/plugins/continuous-improvement/bin/mcp-server.mjs +889 -0
  67. package/plugins/continuous-improvement/bin/observe.mjs +148 -0
  68. package/plugins/continuous-improvement/commands/continuous-improvement.md +115 -0
  69. package/plugins/continuous-improvement/commands/dashboard.md +56 -0
  70. package/plugins/continuous-improvement/commands/discipline.md +51 -0
  71. package/plugins/continuous-improvement/commands/harvest.md +76 -0
  72. package/plugins/continuous-improvement/commands/learn-eval.md +117 -0
  73. package/plugins/continuous-improvement/commands/planning-with-files.md +66 -0
  74. package/plugins/continuous-improvement/commands/proceed-with-the-recommendation.md +62 -0
  75. package/plugins/continuous-improvement/commands/ralph.md +103 -0
  76. package/plugins/continuous-improvement/commands/release-train.md +81 -0
  77. package/plugins/continuous-improvement/commands/seven-laws.md +16 -0
  78. package/plugins/continuous-improvement/commands/superpowers.md +180 -0
  79. package/plugins/continuous-improvement/commands/swarm.md +101 -0
  80. package/plugins/continuous-improvement/commands/workspace-surface-audit.md +77 -0
  81. package/plugins/continuous-improvement/hooks/gateguard.mjs +172 -0
  82. package/plugins/continuous-improvement/hooks/hooks.json +65 -0
  83. package/plugins/continuous-improvement/hooks/observe.sh +172 -0
  84. package/plugins/continuous-improvement/hooks/session.sh +106 -0
  85. package/plugins/continuous-improvement/hooks/three-section-close.mjs +181 -0
  86. package/plugins/continuous-improvement/instinct-packs/go.json +58 -0
  87. package/plugins/continuous-improvement/instinct-packs/meta.json +16 -0
  88. package/plugins/continuous-improvement/instinct-packs/python.json +58 -0
  89. package/plugins/continuous-improvement/instinct-packs/react.json +58 -0
  90. package/plugins/continuous-improvement/lib/observe-event.mjs +128 -0
  91. package/plugins/continuous-improvement/lib/plugin-metadata.mjs +435 -0
  92. package/plugins/continuous-improvement/lib/resolve-home-dir.mjs +43 -0
  93. package/plugins/continuous-improvement/skills/README.md +37 -0
  94. package/plugins/continuous-improvement/skills/continuous-improvement/SKILL.md +249 -0
  95. package/plugins/continuous-improvement/skills/deploy-receipt/SKILL.md +178 -0
  96. package/plugins/continuous-improvement/skills/gateguard/SKILL.md +163 -0
  97. package/plugins/continuous-improvement/skills/para-memory-files/SKILL.md +108 -0
  98. package/plugins/continuous-improvement/skills/proceed-with-the-recommendation/SKILL.md +447 -0
  99. package/plugins/continuous-improvement/skills/ralph/SKILL.md +221 -0
  100. package/plugins/continuous-improvement/skills/recovery-classification/SKILL.md +73 -0
  101. package/plugins/continuous-improvement/skills/safety-guard/SKILL.md +76 -0
  102. package/plugins/continuous-improvement/skills/state-reconciliation/SKILL.md +63 -0
  103. package/plugins/continuous-improvement/skills/strategic-compact/SKILL.md +104 -0
  104. package/plugins/continuous-improvement/skills/superpowers/SKILL.md +219 -0
  105. package/plugins/continuous-improvement/skills/tdd-workflow/SKILL.md +411 -0
  106. package/plugins/continuous-improvement/skills/token-budget-advisor/SKILL.md +136 -0
  107. package/plugins/continuous-improvement/skills/verification-loop/SKILL.md +224 -0
  108. package/plugins/continuous-improvement/skills/wild-risa-balance/SKILL.md +191 -0
  109. package/plugins/continuous-improvement/skills/workspace-surface-audit/SKILL.md +147 -0
  110. package/plugins/continuous-improvement/skills/worktree-safety/SKILL.md +66 -0
  111. package/plugins/continuous-improvement/templates/planning-with-files/findings.md +8 -0
  112. package/plugins/continuous-improvement/templates/planning-with-files/progress.md +7 -0
  113. package/plugins/continuous-improvement/templates/planning-with-files/task_plan.md +23 -0
  114. package/plugins/expert.json +26 -5
  115. package/skills/README.md +79 -0
  116. package/skills/deploy-receipt.md +178 -0
  117. package/skills/gateguard.md +163 -0
  118. package/skills/para-memory-files.md +108 -0
  119. package/skills/proceed-with-the-recommendation.md +447 -0
  120. package/skills/ralph.md +221 -0
  121. package/skills/recovery-classification.md +73 -0
  122. package/skills/safety-guard.md +76 -0
  123. package/skills/state-reconciliation.md +63 -0
  124. package/skills/strategic-compact.md +104 -0
  125. package/skills/superpowers.md +219 -0
  126. package/skills/tdd-workflow.md +411 -0
  127. package/skills/token-budget-advisor.md +136 -0
  128. package/skills/verification-loop.md +224 -0
  129. package/skills/wild-risa-balance.md +191 -0
  130. package/skills/workspace-surface-audit.md +147 -0
  131. package/skills/worktree-safety.md +66 -0
  132. package/templates/insights-claude-md.md +91 -0
  133. package/templates/planning-with-files/findings.md +8 -0
  134. package/templates/planning-with-files/progress.md +7 -0
  135. package/templates/planning-with-files/task_plan.md +23 -0
  136. package/templates/verify-ladder.example.json +60 -0
@@ -0,0 +1,163 @@
1
+ ---
2
+ name: gateguard
3
+ tier: "1"
4
+ description: Enforces Law 1 (Research Before Executing) of the 7 Laws of AI Agent Discipline. Fact-forcing gate that blocks Edit/Write/Bash (including MultiEdit) and demands concrete investigation (importers, data schemas, user instruction) before allowing the action. Measurably improves output quality by +2.25 points vs ungated agents.
5
+ origin: community
6
+ ---
7
+
8
+ # GateGuard — Fact-Forcing Pre-Action Gate
9
+
10
+ A runtime PreToolUse hook + skill pair that forces the agent to investigate before editing. Instead of self-evaluation ("are you sure?"), it demands concrete facts. The act of investigation creates awareness that self-evaluation never did.
11
+
12
+ > **Implementation status:** GateGuard ships as a **runtime PreToolUse hook** at `hooks/gateguard.mjs`, wired as the first PreToolUse entry in the plugin bundle. The hook physically blocks Edit / Write / MultiEdit and every destructive Bash on stdin/stdout JSON, returning `{decision: "block", reason: "..."}` until the agent presents facts and retries with the per-session clearance signal. This skill file is the human-readable spec the hook implements. Originally tracked in [issue #106](https://github.com/naimkatiman/continuous-improvement/issues/106) (closed; landed as PR #108).
13
+
14
+ ## When to Activate
15
+
16
+ - Working on any codebase where file edits affect multiple modules
17
+ - Projects with data files that have specific schemas or date formats
18
+ - Teams where AI-generated code must match existing patterns
19
+ - Any workflow where the agent tends to guess instead of investigating
20
+
21
+ ## Core Concept
22
+
23
+ LLM self-evaluation doesn't work. Ask "did you violate any policies?" and the answer is always "no." This is verified experimentally.
24
+
25
+ But asking "list every file that imports this module" forces the LLM to run Grep and Read. The investigation itself creates context that changes the output.
26
+
27
+ **Three-stage gate:**
28
+
29
+ ```
30
+ 1. DENY — block the first Edit/Write/Bash attempt
31
+ 2. FORCE — tell the model exactly which facts to gather
32
+ 3. ALLOW — permit retry after facts are presented
33
+ ```
34
+
35
+ No competitor does all three. Most stop at deny.
36
+
37
+ ## Evidence
38
+
39
+ Two independent A/B tests, identical agents, same task:
40
+
41
+ | Task | Gated | Ungated | Gap |
42
+ | --- | --- | --- | --- |
43
+ | Analytics module | 8.0/10 | 6.5/10 | +1.5 |
44
+ | Webhook validator | 10.0/10 | 7.0/10 | +3.0 |
45
+ | **Average** | **9.0** | **6.75** | **+2.25** |
46
+
47
+ Both agents produce code that runs and passes tests. The difference is design depth.
48
+
49
+ ## Gate Types
50
+
51
+ ### Edit / MultiEdit Gate (first edit per file)
52
+
53
+ MultiEdit is handled identically — each file in the batch is gated individually.
54
+
55
+ ```
56
+ Before editing {file_path}, present these facts:
57
+
58
+ 1. List ALL files that import/require this file (use Grep)
59
+ 2. List the public functions/classes affected by this change
60
+ 3. If this file reads/writes data files, show field names, structure,
61
+ and date format (use redacted or synthetic values, not raw production data)
62
+ 4. Quote the user's current instruction verbatim
63
+ ```
64
+
65
+ ### Write Gate (first new file creation)
66
+
67
+ ```
68
+ Before creating {file_path}, present these facts:
69
+
70
+ 1. Name the file(s) and line(s) that will call this new file
71
+ 2. Confirm no existing file serves the same purpose (use Glob)
72
+ 3. If this file reads/writes data files, show field names, structure,
73
+ and date format (use redacted or synthetic values, not raw production data)
74
+ 4. Quote the user's current instruction verbatim
75
+ ```
76
+
77
+ ### Destructive Bash Gate (every destructive command)
78
+
79
+ Triggers on: `rm -rf`, `git reset --hard`, `git push --force`, `drop table`, etc.
80
+
81
+ ```
82
+ 1. List all files/data this command will modify or delete
83
+ 2. Write a one-line rollback procedure
84
+ 3. Quote the user's current instruction verbatim
85
+ ```
86
+
87
+ ### Routine Bash Gate (once per session)
88
+
89
+ ```
90
+ Quote the user's current instruction verbatim.
91
+ ```
92
+
93
+ ### Parallel-Actor Gate (first mutation per session, then divergence-checked)
94
+
95
+ A second Claude/Codex/Maulana session can be running on the same host and the same working tree. On this operator's setup that is the common case, not the edge case (multi-clauding observed at 67% of recent messages). A mutation that looks safe in isolation can land on top of an upstream commit, an unstaged change, or a branch advance that this session never saw.
96
+
97
+ **On the first Edit / Write / mutating Bash of a session:**
98
+
99
+ ```
100
+ Baseline these three values and quote them in your response:
101
+
102
+ 1. `git rev-parse HEAD` — record the commit you started on
103
+ 2. `git rev-parse @{u}` (if branch tracks an upstream) — record where origin was
104
+ 3. `git status --porcelain` — record the working tree state
105
+
106
+ If any value is "unknown" (detached HEAD, no upstream, untracked-only tree),
107
+ say so explicitly. Do not proceed past the baseline silently.
108
+ ```
109
+
110
+ **On every subsequent Edit / Write / mutating Bash, before allowing the action:**
111
+
112
+ ```
113
+ Re-check the three baselines against current state:
114
+
115
+ 1. `git rev-parse HEAD` — has it advanced past your baseline without your commits?
116
+ 2. `git rev-parse @{u}` — did upstream move while you worked?
117
+ 3. `git status --porcelain` — are there modifications you did not introduce?
118
+
119
+ If ANY of those drifted from baseline, HALT. Emit:
120
+ "Parallel-actor divergence: <field> moved from <baseline> to <current>.
121
+ Working tree may belong to another session. Stop, surface to operator,
122
+ get clearance before next mutation."
123
+ ```
124
+
125
+ This gate is what catches the squash-merge / ahead-of-origin trap recorded in the operator's memory (`feedback_pre_branch_check.md`, `feedback_parallel_actor.md`) — both classes of failure occurred because a baseline was never captured at session start.
126
+
127
+ ## Quick Start
128
+
129
+ ### Today: runtime hook + skill (zero install beyond the plugin)
130
+
131
+ `hooks/gateguard.mjs` is bundled with this plugin and wired as the first PreToolUse hook in `plugins/continuous-improvement/hooks/hooks.json`. When you install the plugin, the runtime gate is live — no extra config, no opt-in. The hook reads tool input from stdin, classifies it through a data-driven routing table (Read/Grep/Glob → allow, Write/Edit/MultiEdit → mutating-file gate, Bash → destructive-pattern check), and emits `{decision, reason?}` on stdout. Per-session state lives at `~/.claude/instincts/<project-hash>/gateguard-session.json` (override via `GATEGUARD_SESSION_DIR` for tests) and caps cumulative clearances at `MAX_CLEARED_FILES = 50`.
132
+
133
+ Smoke-test the runtime gate after install: ask Claude to write a throwaway file with no research first. The hook should return a `block` decision with a fact-list reason; Claude should pause rather than write.
134
+
135
+ ### V1 honest limitations (not mitigated, documented)
136
+
137
+ - **Honor system.** Once the agent flips `_gateguard_facts_presented: true` in `tool_input`, the hook can't verify the investigation actually happened. The 50-file cap bounds damage from stuck loops or rogue agents.
138
+ - **State-file deletion.** `rm`-ing the session state resets every gate. Acceptable because the session itself is the trust boundary.
139
+ - **Parallel-hook race.** Two simultaneous hook invocations can race the read+write of the state file. Acceptable trade-off vs Windows atomic-rename complexity.
140
+ - **MultiEdit V1.** Currently gates on `edits[0].file_path` only. Per-file batching is a TODO.
141
+
142
+ All four documented in `src/hooks/gateguard.mts` and `src/lib/gateguard-state.mts` headers.
143
+
144
+ ### Future: third-party `gateguard-ai` package
145
+
146
+ The standalone `gateguard-ai` Python/CLI package referenced in earlier drafts of this skill is not currently part of this plugin and not a published package. It may ship later with `.gateguard.yml` per-project config; for now, treat it as design notes only.
147
+
148
+ ## Anti-Patterns
149
+
150
+ - **Don't use self-evaluation instead.** "Are you sure?" always gets "yes." This is experimentally verified.
151
+ - **Don't skip the data schema check.** Both A/B test agents assumed ISO-8601 dates when real data used `%Y/%m/%d %H:%M`. Checking data structure (with redacted values) prevents this entire class of bugs.
152
+ - **Don't gate every single Bash command.** Routine bash gates once per session. Destructive bash gates every time. This balance avoids slowdown while catching real risks.
153
+
154
+ ## Best Practices
155
+
156
+ - Let the gate fire naturally. Don't try to pre-answer the gate questions — the investigation itself is what improves quality.
157
+ - Customize gate messages for your domain. If your project has specific conventions, add them to the gate prompts.
158
+ - Use `.gateguard.yml` to ignore paths like `.venv/`, `node_modules/`, `.git/`.
159
+
160
+ ## Related Skills
161
+
162
+ - `safety-guard` — Runtime safety checks (complementary, not overlapping)
163
+ - `code-reviewer` — Post-edit review (GateGuard is pre-edit investigation)
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: para-memory-files
3
+ tier: "1"
4
+ description: >
5
+ Enforces Law 5 (Reflect After Every Session) and Law 7 (Learn From Every Session)
6
+ of the 7 Laws of AI Agent Discipline by giving the agent a durable file-based
7
+ memory it can read on resume and write at session end.
8
+ File-based memory system using Tiago Forte's PARA method. Use this skill whenever
9
+ you need to store, retrieve, update, or organize knowledge across sessions. Covers
10
+ three memory layers: (1) Knowledge graph in PARA folders with atomic YAML facts,
11
+ (2) Daily notes as raw timeline, (3) Tacit knowledge about user patterns. Also
12
+ handles planning files, memory decay, weekly synthesis, and recall via qmd.
13
+ Trigger on any memory operation: saving facts, writing daily notes, creating
14
+ entities, running weekly synthesis, recalling past context, or managing plans.
15
+ ---
16
+
17
+ # PARA Memory Files
18
+
19
+ Persistent, file-based memory organized by Tiago Forte's PARA method. Three layers: a knowledge graph, daily notes, and tacit knowledge. All paths are relative to `$AGENT_HOME`.
20
+
21
+ ## Three Memory Layers
22
+
23
+ ### Layer 1: Knowledge Graph (`$AGENT_HOME/life/` -- PARA)
24
+
25
+ Entity-based storage. Each entity gets a folder with two tiers:
26
+
27
+ 1. `summary.md` -- quick context, load first.
28
+ 2. `items.yaml` -- atomic facts, load on demand.
29
+
30
+ ```text
31
+ $AGENT_HOME/life/
32
+ projects/ # Active work with clear goals/deadlines
33
+ <name>/
34
+ summary.md
35
+ items.yaml
36
+ areas/ # Ongoing responsibilities, no end date
37
+ people/<name>/
38
+ companies/<name>/
39
+ resources/ # Reference material, topics of interest
40
+ <topic>/
41
+ archives/ # Inactive items from the other three
42
+ index.md
43
+ ```
44
+
45
+ **PARA rules:**
46
+
47
+ - **Projects** -- active work with a goal or deadline. Move to archives when complete.
48
+ - **Areas** -- ongoing (people, companies, responsibilities). No end date.
49
+ - **Resources** -- reference material, topics of interest.
50
+ - **Archives** -- inactive items from any category.
51
+
52
+ **Fact rules:**
53
+
54
+ - Save durable facts immediately to `items.yaml`.
55
+ - Weekly: rewrite `summary.md` from active facts.
56
+ - Never delete facts. Supersede instead (`status: superseded`, add `superseded_by`).
57
+ - When an entity goes inactive, move its folder to `$AGENT_HOME/life/archives/`.
58
+
59
+ **When to create an entity:**
60
+
61
+ - Mentioned 3+ times, OR
62
+ - Direct relationship to the user (family, coworker, partner, client), OR
63
+ - Significant project or company in the user's life.
64
+ - Otherwise, note it in daily notes.
65
+
66
+ For the atomic fact YAML schema and memory decay rules, see [references/schemas.md](references/schemas.md).
67
+
68
+ ### Layer 2: Daily Notes (`$AGENT_HOME/memory/YYYY-MM-DD.md`)
69
+
70
+ Raw timeline of events -- the "when" layer.
71
+
72
+ - Write continuously during conversations.
73
+ - Extract durable facts to Layer 1 during heartbeats.
74
+
75
+ ### Layer 3: Tacit Knowledge (`$AGENT_HOME/MEMORY.md`)
76
+
77
+ How the user operates -- patterns, preferences, lessons learned.
78
+
79
+ - Not facts about the world; facts about the user.
80
+ - Update whenever you learn new operating patterns.
81
+
82
+ ## Write It Down -- No Mental Notes
83
+
84
+ Memory does not survive session restarts. Files do.
85
+
86
+ - Want to remember something -> WRITE IT TO A FILE.
87
+ - "Remember this" -> update `$AGENT_HOME/memory/YYYY-MM-DD.md` or the relevant entity file.
88
+ - Learn a lesson -> update AGENTS.md, TOOLS.md, or the relevant skill file.
89
+ - Make a mistake -> document it so future-you does not repeat it.
90
+ - On-disk text files are always better than holding it in temporary context.
91
+
92
+ ## Memory Recall -- Use qmd
93
+
94
+ Use `qmd` rather than grepping files:
95
+
96
+ ```bash
97
+ qmd query "what happened at Christmas" # Semantic search with reranking
98
+ qmd search "specific phrase" # BM25 keyword search
99
+ qmd vsearch "conceptual question" # Pure vector similarity
100
+ ```
101
+
102
+ Index your personal folder: `qmd index $AGENT_HOME`
103
+
104
+ Vectors + BM25 + reranking finds things even when the wording differs.
105
+
106
+ ## Planning
107
+
108
+ Keep plans in timestamped files in `plans/` at the project root (outside personal memory so other agents can access them). Use `qmd` to search plans. Plans go stale -- if a newer plan exists, do not confuse yourself with an older version. If you notice staleness, update the file to note what it is supersededBy.