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.
Files changed (160) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/CHANGELOG.md +95 -0
  3. package/LICENSE +21 -21
  4. package/QUICKSTART.md +13 -8
  5. package/README.md +94 -162
  6. package/SKILL.md +1 -1
  7. package/bin/analyze.sh +161 -161
  8. package/bin/backfill.mjs +19 -19
  9. package/bin/check-docs-substrings.mjs +73 -0
  10. package/bin/check-scripts-citation-drift.mjs +210 -0
  11. package/bin/check-skill-count.mjs +110 -0
  12. package/bin/check-test-imports-only.mjs +126 -0
  13. package/bin/check-tool-count.mjs +129 -0
  14. package/bin/companion-preference-status.mjs +231 -0
  15. package/bin/gateguard-clear.mjs +53 -0
  16. package/bin/generate-plugin-manifests.mjs +8 -1
  17. package/bin/harvest-friction.mjs +1 -1
  18. package/bin/hook-stats.mjs +21 -21
  19. package/bin/install.mjs +185 -28
  20. package/bin/mcp-server.mjs +216 -3
  21. package/bin/refresh-third-party.mjs +315 -313
  22. package/commands/audit.md +34 -0
  23. package/commands/companion-preference.md +58 -0
  24. package/commands/continuous-improvement.md +115 -115
  25. package/commands/dashboard.md +56 -56
  26. package/commands/discipline.md +14 -0
  27. package/commands/distill.md +39 -0
  28. package/commands/goal-check.md +53 -0
  29. package/commands/grill-me.md +40 -0
  30. package/commands/grill-with-docs.md +38 -0
  31. package/commands/handoff.md +42 -0
  32. package/commands/harvest.md +1 -1
  33. package/commands/proceed-with-the-recommendation.md +20 -0
  34. package/commands/recall.md +49 -0
  35. package/commands/reconcile.md +47 -0
  36. package/commands/seven-laws.md +16 -16
  37. package/commands/superpowers.md +3 -3
  38. package/commands/verify-install.md +55 -0
  39. package/commands/workspace-surface-audit.md +77 -77
  40. package/hooks/companion-preference.mjs +190 -0
  41. package/hooks/gateguard.mjs +72 -25
  42. package/hooks/goal-drift-stop.mjs +183 -0
  43. package/hooks/observe.sh +15 -1
  44. package/hooks/recall-briefing.mjs +167 -0
  45. package/hooks/route-prompt.mjs +180 -0
  46. package/hooks/route-table.json +35 -0
  47. package/hooks/session.sh +106 -106
  48. package/hooks/three-section-close.mjs +134 -132
  49. package/instinct-packs/go.json +58 -58
  50. package/instinct-packs/meta.json +16 -16
  51. package/instinct-packs/python.json +58 -58
  52. package/instinct-packs/react.json +58 -58
  53. package/lib/gateguard-state.mjs +54 -2
  54. package/lib/goal-drift-gate.mjs +50 -0
  55. package/lib/goal-state.mjs +285 -0
  56. package/lib/plugin-metadata.mjs +134 -15
  57. package/lib/recall-briefing.mjs +57 -0
  58. package/lib/recall-index.mjs +175 -0
  59. package/lib/skill-distill.mjs +222 -0
  60. package/llms.txt +2 -2
  61. package/package.json +12 -7
  62. package/plugins/beginner.json +9 -4
  63. package/plugins/continuous-improvement/.claude-plugin/marketplace.json +2 -2
  64. package/plugins/continuous-improvement/.claude-plugin/plugin.json +2 -2
  65. package/plugins/continuous-improvement/LICENSE +21 -21
  66. package/plugins/continuous-improvement/agents/README.md +3 -3
  67. package/plugins/continuous-improvement/bin/backfill.mjs +19 -19
  68. package/plugins/continuous-improvement/bin/gateguard-clear.mjs +53 -0
  69. package/plugins/continuous-improvement/bin/mcp-server.mjs +216 -3
  70. package/plugins/continuous-improvement/commands/audit.md +34 -0
  71. package/plugins/continuous-improvement/commands/companion-preference.md +58 -0
  72. package/plugins/continuous-improvement/commands/continuous-improvement.md +115 -115
  73. package/plugins/continuous-improvement/commands/dashboard.md +56 -56
  74. package/plugins/continuous-improvement/commands/discipline.md +14 -0
  75. package/plugins/continuous-improvement/commands/distill.md +39 -0
  76. package/plugins/continuous-improvement/commands/goal-check.md +53 -0
  77. package/plugins/continuous-improvement/commands/grill-me.md +40 -0
  78. package/plugins/continuous-improvement/commands/grill-with-docs.md +38 -0
  79. package/plugins/continuous-improvement/commands/handoff.md +42 -0
  80. package/plugins/continuous-improvement/commands/harvest.md +1 -1
  81. package/plugins/continuous-improvement/commands/proceed-with-the-recommendation.md +20 -0
  82. package/plugins/continuous-improvement/commands/recall.md +49 -0
  83. package/plugins/continuous-improvement/commands/reconcile.md +47 -0
  84. package/plugins/continuous-improvement/commands/seven-laws.md +16 -16
  85. package/plugins/continuous-improvement/commands/superpowers.md +3 -3
  86. package/plugins/continuous-improvement/commands/verify-install.md +55 -0
  87. package/plugins/continuous-improvement/commands/workspace-surface-audit.md +77 -77
  88. package/plugins/continuous-improvement/hooks/companion-preference.mjs +190 -0
  89. package/plugins/continuous-improvement/hooks/gateguard.mjs +72 -25
  90. package/plugins/continuous-improvement/hooks/goal-drift-stop.mjs +183 -0
  91. package/plugins/continuous-improvement/hooks/hooks.json +23 -2
  92. package/plugins/continuous-improvement/hooks/observe.sh +15 -1
  93. package/plugins/continuous-improvement/hooks/recall-briefing.mjs +167 -0
  94. package/plugins/continuous-improvement/hooks/route-prompt.mjs +180 -0
  95. package/plugins/continuous-improvement/hooks/route-table.json +35 -0
  96. package/plugins/continuous-improvement/hooks/session.sh +106 -106
  97. package/plugins/continuous-improvement/hooks/three-section-close.mjs +134 -132
  98. package/plugins/continuous-improvement/instinct-packs/go.json +58 -58
  99. package/plugins/continuous-improvement/instinct-packs/meta.json +16 -16
  100. package/plugins/continuous-improvement/instinct-packs/python.json +58 -58
  101. package/plugins/continuous-improvement/instinct-packs/react.json +58 -58
  102. package/plugins/continuous-improvement/lib/gateguard-state.mjs +137 -0
  103. package/plugins/continuous-improvement/lib/goal-drift-gate.mjs +50 -0
  104. package/plugins/continuous-improvement/lib/goal-state.mjs +285 -0
  105. package/plugins/continuous-improvement/lib/plugin-metadata.mjs +134 -15
  106. package/plugins/continuous-improvement/lib/recall-briefing.mjs +57 -0
  107. package/plugins/continuous-improvement/lib/recall-index.mjs +175 -0
  108. package/plugins/continuous-improvement/lib/skill-distill.mjs +222 -0
  109. package/plugins/continuous-improvement/skills/README.md +8 -0
  110. package/plugins/continuous-improvement/skills/audit/SKILL.md +73 -0
  111. package/plugins/continuous-improvement/skills/continuous-improvement/SKILL.md +1 -1
  112. package/plugins/continuous-improvement/skills/deploy-receipt/SKILL.md +13 -17
  113. package/plugins/continuous-improvement/skills/gateguard/SKILL.md +36 -17
  114. package/plugins/continuous-improvement/skills/goal-monitor/SKILL.md +81 -0
  115. package/plugins/continuous-improvement/skills/grill-me/SKILL.md +66 -0
  116. package/plugins/continuous-improvement/skills/grill-with-docs/SKILL.md +252 -0
  117. package/plugins/continuous-improvement/skills/handoff/SKILL.md +59 -0
  118. package/plugins/continuous-improvement/skills/para-memory-files/SKILL.md +1 -1
  119. package/plugins/continuous-improvement/skills/proceed-with-the-recommendation/SKILL.md +82 -6
  120. package/plugins/continuous-improvement/skills/ralph/SKILL.md +1 -0
  121. package/plugins/continuous-improvement/skills/recall/SKILL.md +50 -0
  122. package/plugins/continuous-improvement/skills/reconcile/SKILL.md +80 -0
  123. package/plugins/continuous-improvement/skills/recovery-classification/SKILL.md +1 -0
  124. package/plugins/continuous-improvement/skills/safety-guard/SKILL.md +1 -0
  125. package/plugins/continuous-improvement/skills/skill-distillation/SKILL.md +57 -0
  126. package/plugins/continuous-improvement/skills/state-reconciliation/SKILL.md +1 -0
  127. package/plugins/continuous-improvement/skills/strategic-compact/SKILL.md +1 -0
  128. package/plugins/continuous-improvement/skills/superpowers/SKILL.md +77 -3
  129. package/plugins/continuous-improvement/skills/tdd-workflow/SKILL.md +411 -411
  130. package/plugins/continuous-improvement/skills/token-budget-advisor/SKILL.md +1 -1
  131. package/plugins/continuous-improvement/skills/verification-loop/SKILL.md +28 -20
  132. package/plugins/continuous-improvement/skills/wild-risa-balance/SKILL.md +1 -0
  133. package/plugins/continuous-improvement/skills/workspace-surface-audit/SKILL.md +1 -1
  134. package/plugins/continuous-improvement/skills/worktree-safety/SKILL.md +3 -2
  135. package/plugins/expert.json +28 -3
  136. package/skills/README.md +3 -0
  137. package/skills/audit.md +73 -0
  138. package/skills/deploy-receipt.md +13 -17
  139. package/skills/gateguard.md +36 -17
  140. package/skills/goal-monitor.md +81 -0
  141. package/skills/grill-me.md +66 -0
  142. package/skills/grill-with-docs.md +252 -0
  143. package/skills/handoff.md +59 -0
  144. package/skills/para-memory-files.md +1 -1
  145. package/skills/proceed-with-the-recommendation.md +82 -6
  146. package/skills/ralph.md +1 -0
  147. package/skills/recall.md +50 -0
  148. package/skills/reconcile.md +80 -0
  149. package/skills/recovery-classification.md +1 -0
  150. package/skills/safety-guard.md +1 -0
  151. package/skills/skill-distillation.md +57 -0
  152. package/skills/state-reconciliation.md +1 -0
  153. package/skills/strategic-compact.md +1 -0
  154. package/skills/superpowers.md +77 -3
  155. package/skills/tdd-workflow.md +411 -411
  156. package/skills/token-budget-advisor.md +1 -1
  157. package/skills/verification-loop.md +28 -20
  158. package/skills/wild-risa-balance.md +1 -0
  159. package/skills/workspace-surface-audit.md +1 -1
  160. package/skills/worktree-safety.md +3 -2
@@ -19,12 +19,20 @@ skill set on disk.
19
19
  - `deploy-receipt` — Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline at the deploy seam. A merge into a branch that auto-deploys is not "done" until the deploy provider reports the merged commit SHA running and a healthcheck endpoint returns 200. Companion to the vendored `finishing-a-development-branch` skill — does not replace it, runs after it for projects on Railway, Cloudflare Workers, Vercel, Netlify, Fly.io, or any other auto-deploy target.
20
20
  - `gateguard` — 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.
21
21
  - `para-memory-files` — Enforces Law 5 (Reflect After Every Session) and Law 7 (Learn From Every Session) of the 7 Laws of AI Agent Discipline by giving the agent a durable file-based memory it can read on resume and write at session end. File-based memory system using Tiago Forte's PARA method. Use this skill whenever you need to store, retrieve, update, or organize knowledge across sessions. Covers three memory layers: (1) Knowledge graph in PARA folders with atomic YAML facts, (2) Daily notes as raw timeline, (3) Tacit knowledge about user patterns. Also handles planning files, memory decay, weekly synthesis, and recall via qmd. Trigger on any memory operation: saving facts, writing daily notes, creating entities, running weekly synthesis, recalling past context, or managing plans.
22
+ - `recall` — Enforces Law 1 (Research Before Executing) of the 7 Laws of AI Agent Discipline. Makes past sessions first-class research material by searching the observation log with BM25 ranking, so 'have I hit this before?' is answerable before re-deriving a fix or repeating a mistake.
22
23
  - `tdd-workflow` — Enforces Law 3 (One Thing at a Time) and Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
23
24
  - `verification-loop` — Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. A comprehensive verification system for agent coding sessions covering build, types, lint, tests, security, and diff with a PASS/FAIL report.
24
25
 
25
26
  ## Tier 2 — expert-mode add-ons
27
+ - `audit` — Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. Audits a window of recent commits for real defects, confirms each finding before touching code so false positives die first, and checks every surface a change touches — so 'looks done' is never mistaken for 'is correct'.
28
+ - `goal-monitor` — Enforces Law 2 (Plan Is Sacred) of the 7 Laws of AI Agent Discipline. Detects when a session has drifted away from its stated goal by scoring recent tool activity against the '## Goal' section of task_plan.md, so drift is caught mid-session instead of at end-of-session reflection.
29
+ - `grill-me` — Enforces Law 1 (Research Before Executing) of the 7 Laws of AI Agent Discipline. Interview the user relentlessly about a plan or design until shared understanding is reached, resolving every branch of the decision tree before any code is written. Ported from mattpocock/skills under MIT.
30
+ - `grill-with-docs` — Enforces Law 1 (Research Before Executing) and Law 7 (Learn From Every Session) of the 7 Laws of AI Agent Discipline. Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates CONTEXT.md + ADRs inline as decisions crystallise. Ported from mattpocock/skills under MIT.
31
+ - `handoff` — Enforces Law 5 (Reflect After Every Session) of the 7 Laws of AI Agent Discipline. Compact the current conversation into a handoff document for another agent to pick up. Ported from mattpocock/skills under MIT.
32
+ - `reconcile` — Enforces Law 1 (Research Before Executing) of the 7 Laws of AI Agent Discipline. Establishes git ground truth — branch, status, stashes, worktrees, ahead/behind — before any mutation, halts on protected or destructive operations, and verifies a push actually landed instead of assuming it did.
26
33
  - `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'.
27
34
  - `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.
35
+ - `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.
28
36
  - `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.
29
37
  - `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.
30
38
  - `token-budget-advisor` — Enforces Law 2 (Plan Is Sacred) of the 7 Laws of AI Agent Discipline by making token-budget tradeoffs explicit before the response is composed. Offers the user an informed choice about how much response depth to consume before answering. Use this skill when the user explicitly wants to control response length, depth, or token budget. TRIGGER when: "token budget", "token count", "token usage", "token limit", "response length", "answer depth", "short version", "brief answer", "detailed answer", "exhaustive answer", "respuesta corta vs larga", "cuántos tokens", "ahorrar tokens", "responde al 50%", "dame la versión corta", "quiero controlar cuánto usas", or clear variants where the user is explicitly asking to control answer size or depth. DO NOT TRIGGER when: user has already specified a level in the current session (maintain it), the request is clearly a one-word answer, or "token" refers to auth/session/payment tokens rather than response size.
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: audit
3
+ tier: "2"
4
+ description: Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. Audits a window of recent commits for real defects, confirms each finding before touching code so false positives die first, and checks every surface a change touches — so 'looks done' is never mistaken for 'is correct'.
5
+ origin: continuous-improvement
6
+ user-invocable: true
7
+ ---
8
+
9
+ # Audit — Confirm Recent Commits Before You Trust Them
10
+
11
+ Law 4 says verify before reporting. A merged commit with green CI is a claim, not a proof. This skill runs the audit-driven loop: take a window of recent commits, hunt for real defects, prove each one before touching code, fix on a branch, and verify every surface the fix touches before declaring the audit clean.
12
+
13
+ ## When to Activate
14
+
15
+ - After a batch of commits lands ("audit today's commits"), especially on money-handling, auth, or state-mutating code.
16
+ - When a feature shipped across several surfaces (backend, frontend, admin, migration) and you suspect one was missed.
17
+ - After a large refactor or a conflicted merge — exactly when individually-correct functions can still cancel each other out.
18
+ - Before a release cut, as the last gate over "everything claimed done."
19
+
20
+ ## The Loop
21
+
22
+ ```
23
+ 1. Scope — pick the commit window (e.g. main since last release, or HEAD~N..HEAD)
24
+ 2. Find — hunt for real defects, one concern per pass
25
+ 3. Confirm — prove each finding against the actual code; false positives die here
26
+ 4. Fix — one branch, one concern per commit, smallest diff that closes the defect
27
+ 5. Verify — exercise EVERY surface the fix touches, not just the one you edited
28
+ 6. Report — confirmed defects, dismissed false positives, and no-op items, with evidence
29
+ ```
30
+
31
+ ## Find: One Concern Per Pass
32
+
33
+ Run the find pass once per dimension rather than one undifferentiated sweep. The dimensions that have actually caught defects in this codebase's domain:
34
+
35
+ - **Value/economy drift** — a constant duplicated across surfaces (a prize array hardcoded in the frontend while the backend reads an endpoint; a cap defined twice). Grep both sides; compare.
36
+ - **Concurrency** — a read-modify-write with no guard, a settlement that is not idempotent, a row that can get stuck between two states.
37
+ - **Surface coverage** — a change that updated the backend but not the admin filter or the client cache that mirrors it.
38
+ - **Type/contract** — a payload shape that one side narrowed and the other did not.
39
+
40
+ For a thorough audit, use the `superpowers:dispatching-parallel-agents` skill to fan these out as parallel reviewers — each blind to the others — then merge findings.
41
+
42
+ ## Confirm Before Fixing
43
+
44
+ A finding is a hypothesis until proven against the code. Before writing any fix:
45
+
46
+ - Read the actual lines, not the diff summary. Confirm the defect reproduces in the current tree.
47
+ - State why it is real in one sentence. If you cannot, it is a false positive — record it as dismissed and move on.
48
+ - Prefer a failing test that reproduces the defect, then fix to green (`tdd-workflow`).
49
+
50
+ Defaulting findings to "real" is how plausible-but-wrong fixes get shipped. Default to skeptical; make the code prove the bug.
51
+
52
+ ## Verify Every Surface the Fix Touches
53
+
54
+ The recurring failure this skill exists to stop: a fix that the agent claims is done while the frontend array, admin filter, or cached copy still carries the old value. This is the functional-surface check `audit` gates before reporting — not the build/test/lint ladder itself (that is `verification-loop`). Before reporting an item closed:
55
+
56
+ - List every surface the changed value or behavior touches (backend, frontend, admin, migration, cache, generated artifact).
57
+ - Re-check each surface yourself — do not assume one auto-updates from another.
58
+ - On each surface, run the resolved `verification-loop` ladder against the code that implements it, not a manual spot-check.
59
+
60
+ This applies the `verification-loop` (Law 4) and `goal-monitor` (Law 2) discipline to someone else's recent work.
61
+
62
+ ## Report Honestly
63
+
64
+ Three buckets, with evidence: **confirmed** (defect + fix + the check that proves it), **dismissed** (looked like a bug, here is why it is not), **no-op** (in scope but nothing to change). Silence on a surface is not a pass.
65
+
66
+ ## Pairs With
67
+
68
+ - **`code-review`** / **`security-review`** — the dimension passes; `audit` is the loop that runs them over a commit window and acts on the output.
69
+ - **`superpowers:dispatching-parallel-agents`** — fan the find pass out across dimensions, then verify each finding adversarially.
70
+ - **`verification-loop`** (Law 4) — the build/test/lint ladder `audit` runs on each surface before a finding is closed.
71
+ - **`goal-monitor`** (Law 2) — confirms the fix still serves the task goal, not just that it compiles.
72
+ - **`recall`** (Law 1) — before confirming a finding, recall whether this exact defect was hit and fixed before.
73
+ - **`reconcile`** (Law 1) — when the audit ends in a fix, reconcile the branch state before pushing.
@@ -6,7 +6,7 @@ description: "Install structured self-improvement loops with instinct-based lear
6
6
 
7
7
  # continuous-improvement
8
8
 
9
- You follow the continuous-improvement framework. These 7 laws govern all your work.
9
+ You follow the continuous-improvement framework. These 7 laws make every task sharper — each is a capability that compounds: research deeper, plan tighter, verify with evidence, reflect, and learn so the same lesson is never re-taught.
10
10
 
11
11
  ## Law 1: Research Before Executing
12
12
 
@@ -3,6 +3,7 @@ name: deploy-receipt
3
3
  tier: "1"
4
4
  description: Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline at the deploy seam. A merge into a branch that auto-deploys is not "done" until the deploy provider reports the merged commit SHA running and a healthcheck endpoint returns 200. Companion to the vendored `finishing-a-development-branch` skill — does not replace it, runs after it for projects on Railway, Cloudflare Workers, Vercel, Netlify, Fly.io, or any other auto-deploy target.
5
5
  origin: https://github.com/naimkatiman/continuous-improvement
6
+ disable-model-invocation: true
6
7
  ---
7
8
 
8
9
  # Deploy Receipt — Closing the Merge-to-Production Gap
@@ -20,14 +21,7 @@ This skill defines the receipt that closes that gap, without modifying the vendo
20
21
  Activate when ALL of the following are true:
21
22
 
22
23
  1. A merge into the deploy branch (typically `main` or `master`) has just landed
23
- 2. The repo declares an auto-deploy targetdetect via any of:
24
- - `railway.toml`, `railway.json`, or `RAILWAY_*` env vars in `.env.example`
25
- - `wrangler.toml` / `wrangler.jsonc` (Cloudflare Workers)
26
- - `vercel.json` or `.vercel/` directory
27
- - `netlify.toml`
28
- - `fly.toml`
29
- - `app.yaml` (App Engine), `apprunner.yaml` (App Runner)
30
- - GitHub Actions workflow with `deploy:` job triggered on push to the deploy branch
24
+ 2. [`scripts/detect-deploy-target.sh`](../scripts/detect-deploy-target.sh) returns a value other than `none` at the repo root. The script encodes the full file-marker table`railway.toml` / `railway.json` → `railway`, `wrangler.toml` / `wrangler.jsonc` → `cloudflare`, `vercel.json` / `.vercel/` → `vercel`, `netlify.toml` → `netlify`, `fly.toml` → `fly`, `app.yaml` → `appengine`, `apprunner.yaml` → `apprunner`, `.github/workflows/*.yml` with a `deploy:` job → `gha-deploy`. First match wins, in that order. The script is the source of truth; the file list above is documentation
31
25
  3. `finishing-a-development-branch` has reported "merged" — not "PR opened", not "review pending"
32
26
 
33
27
  Do NOT activate when:
@@ -51,17 +45,19 @@ The skill is provider-aware but never hardcodes a specific API key or token shap
51
45
 
52
46
  ### Route A — Provider CLI (preferred when authenticated)
53
47
 
54
- The CLI is the highest-fidelity source.
48
+ The CLI is the highest-fidelity source. Run [`scripts/get-deployed-sha.sh <provider>`](../scripts/get-deployed-sha.sh) — the script owns the per-provider pipeline (CLI + jq filter) and prints just the SHA on stdout. Inspect the pipeline shape without executing via `bash scripts/get-deployed-sha.sh --show-command <provider>`.
55
49
 
56
- | Provider | Command shape | Receipt extraction |
57
- |---|---|---|
58
- | Railway | `railway status --json` | `.deployments[0].meta.commitHash` |
59
- | Cloudflare Workers | `wrangler deployments list --json` | `[0].metadata.deployment_trigger.metadata.commit_hash` |
60
- | Vercel | `vercel inspect <url> --json` | `.gitSource.sha` |
61
- | Netlify | `netlify api listSiteDeploys --data='{"site_id":"<id>"}'` | `[0].commit_ref` |
62
- | Fly.io | `fly releases --json` | `[0].commit_sha` |
50
+ Provider-to-pipeline map (cited from the script, not redefined here):
63
51
 
64
- If the CLI is not installed or not authenticated in this session, fall through to Route B. Do NOT prompt the operator to install the CLI mid-session — that is a drive-by.
52
+ | Provider value | CLI |
53
+ |---|---|
54
+ | `railway` | `railway` |
55
+ | `cloudflare` | `wrangler` |
56
+ | `vercel` | `vercel` |
57
+ | `netlify` | `netlify` |
58
+ | `fly` | `fly` |
59
+
60
+ Exit codes from the script: `0` on success (SHA printed), `2` on missing/unknown provider (usage error), `3` when the required CLI is not installed locally — that is the fall-through signal to Route B, not a hard failure. Do NOT prompt the operator to install the CLI mid-session — that is a drive-by.
65
61
 
66
62
  ### Route B — GitHub Deployments API (works for any provider that posts back)
67
63
 
@@ -3,6 +3,7 @@ name: gateguard
3
3
  tier: "1"
4
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
5
  origin: community
6
+ user-invocable: false
6
7
  ---
7
8
 
8
9
  # GateGuard — Fact-Forcing Pre-Action Gate
@@ -96,30 +97,37 @@ A second Claude/Codex/Maulana session can be running on the same host and the sa
96
97
 
97
98
  **On the first Edit / Write / mutating Bash of a session:**
98
99
 
100
+ Run [`scripts/git-state-snapshot.sh`](../scripts/git-state-snapshot.sh) and quote its JSON envelope verbatim. Example output:
101
+
102
+ ```
103
+ {"head":"966ce51","upstream":"966ce51","dirty":0,"root":"/path/to/repo","branch":"main"}
99
104
  ```
100
- Baseline these three values and quote them in your response:
101
105
 
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
106
+ Field meanings:
105
107
 
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
- ```
108
+ 1. `head` short SHA of the commit you started on
109
+ 2. `upstream` short SHA of `@{u}` if the branch tracks an upstream, else the literal `"none"`
110
+ 3. `dirty` — integer count of `git status --porcelain` lines (0 == clean)
111
+ 4. `root` — repo root path from `git rev-parse --show-toplevel`
112
+ 5. `branch` — current branch name, or the literal `"detached"`
113
+
114
+ If `upstream` is `"none"` or `branch` is `"detached"`, say so explicitly. Do not proceed past the baseline silently. If the script exits non-zero (output is `{"error":"not-a-git-repo"}`), HALT — the harness is not running in a git checkout and no mutation should land here.
109
115
 
110
116
  **On every subsequent Edit / Write / mutating Bash, before allowing the action:**
111
117
 
112
- ```
113
- Re-check the three baselines against current state:
118
+ Re-run [`scripts/git-state-snapshot.sh`](../scripts/git-state-snapshot.sh) and diff against the baseline:
114
119
 
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?
120
+ 1. `head` — has it advanced past your baseline without your commits?
121
+ 2. `upstream` — did upstream move while you worked?
122
+ 3. `dirty` — are there modifications you did not introduce (count increased)?
123
+ 4. `branch` — did the working tree switch branches under you?
118
124
 
119
125
  If ANY of those drifted from baseline, HALT. Emit:
120
- "Parallel-actor divergence: <field> moved from <baseline> to <current>.
126
+
127
+ ```
128
+ Parallel-actor divergence: <field> moved from <baseline> to <current>.
121
129
  Working tree may belong to another session. Stop, surface to operator,
122
- get clearance before next mutation."
130
+ get clearance before next mutation.
123
131
  ```
124
132
 
125
133
  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.
@@ -132,14 +140,25 @@ This gate is what catches the squash-merge / ahead-of-origin trap recorded in th
132
140
 
133
141
  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
142
 
143
+ ### Clearing the gate (after presenting the facts)
144
+
145
+ The block reason prints the exact `gateguard-session.json` path and the clearance commands. Clearance matches a file regardless of drive-letter case or path separator (`d:\x` and `D:/x` resolve to the same key), so it no longer matters whether the hook and the helper spelled the project root differently. Any one of these allows the retry:
146
+
147
+ - **MCP tool** (beginner + expert): `ci_gateguard_clear` with `file_paths: ["<path>", …]`.
148
+ - **CLI** (Bash, never gated): `node "${CLAUDE_PLUGIN_ROOT}/bin/gateguard-clear.mjs" "<path>"`; add `--state <gateguard-session.json>` to write the exact file the block reason printed.
149
+ - **Manual**: append each path to `cleared_files` in the printed `gateguard-session.json` via a non-destructive Bash write.
150
+
151
+ The inline `_gateguard_facts_presented: true` retry still works on harnesses that forward unknown tool params, but Claude Code's strict tool schema (`additionalProperties: false`) rejects it with `InputValidationError` — use one of the above on Claude Code.
152
+
135
153
  ### V1 honest limitations (not mitigated, documented)
136
154
 
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.
155
+ - **Honor system.** Clearance is recorded by `ci_gateguard_clear`, the `gateguard-clear.mjs` CLI, a manual state-file write, or the inline `_gateguard_facts_presented` flag where the harness allows it (see "Clearing the gate" above). The hook can't verify the investigation actually happened; the 50-file cap bounds damage from stuck loops or rogue agents.
138
156
  - **State-file deletion.** `rm`-ing the session state resets every gate. Acceptable because the session itself is the trust boundary.
139
157
  - **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
158
 
142
- All four documented in `src/hooks/gateguard.mts` and `src/lib/gateguard-state.mts` headers.
159
+ **MultiEdit per-file gating.** The hook clears and checks every `edits[]` path individually, so a mixed-clearance batch blocks until *all* edited files are cleared or facts are presented. The block reason now names the whole batch, not just the first uncleared path.
160
+
161
+ These behaviors are documented in `src/hooks/gateguard.mts` and `src/lib/gateguard-state.mts` headers.
143
162
 
144
163
  ### Future: third-party `gateguard-ai` package
145
164
 
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: goal-monitor
3
+ tier: "2"
4
+ description: Enforces Law 2 (Plan Is Sacred) of the 7 Laws of AI Agent Discipline. Detects when a session has drifted away from its stated goal by scoring recent tool activity against the '## Goal' section of task_plan.md, so drift is caught mid-session instead of at end-of-session reflection.
5
+ origin: continuous-improvement
6
+ user-invocable: true
7
+ ---
8
+
9
+ # Goal Monitor — Continuous Drift Detection
10
+
11
+ A "Clear Goal" discipline: a stated goal is only useful if something keeps checking the work against it. `task_plan.md` captures the goal once; this skill turns it into a recurring check so a session that has quietly wandered off into unrelated files surfaces the drift while there is still budget to course-correct.
12
+
13
+ ## When to Activate
14
+
15
+ - After a long stretch of edits, before claiming progress on the original goal.
16
+ - When you suspect the work has sprawled across unrelated areas of the codebase.
17
+ - Before a checkpoint or handoff, to confirm the session stayed on its stated goal.
18
+ - Any time the goal in `task_plan.md` and the actual tool activity might have diverged.
19
+
20
+ ## Core Concept
21
+
22
+ Law 2 says the plan is sacred. But "sacred" is hollow if nothing measures adherence. Goal Monitor scores the most recent observations against the goal and reports one of three states:
23
+
24
+ ```
25
+ ON GOAL — recent activity relates to the goal (score >= threshold)
26
+ DRIFT — most recent activity is unrelated, or touched forbidden paths
27
+ NO DATA — not enough observations in the window yet
28
+ ```
29
+
30
+ The score is the fraction of recent observations whose tool name, input, or output references a goal keyword — or whose edited path falls under a goal-scope glob.
31
+
32
+ ## Goal Source
33
+
34
+ The check reads, in order:
35
+
36
+ 1. `task_plan.md` in the project root (seeded by `ci_plan_init` / `/planning-with-files`).
37
+ 2. `~/.claude/instincts/<project-hash>/goal.md` (fallback for non-repo sessions).
38
+ 3. An explicit `goal_file` argument, if provided.
39
+
40
+ The plan needs a `## Goal` section. Two optional sections sharpen the signal:
41
+
42
+ ```markdown
43
+ ## Goal
44
+ Implement OAuth login with JWT session tokens for the auth service.
45
+
46
+ ## Goal Keywords
47
+ oauth, jwt, login, session
48
+
49
+ ## Goal Scope
50
+ paths: src/auth/**, test/auth/**
51
+ forbidden: src/marketing/**
52
+ ```
53
+
54
+ When `## Goal Keywords` is absent, keywords are auto-extracted from the goal prose (stopwords and short tokens dropped). `## Goal Scope` is optional: `paths` globs count as on-goal matches; `forbidden` globs are a hard drift signal even when keywords also match.
55
+
56
+ ## How to Invoke
57
+
58
+ The check is exposed as the `ci_goal_check` MCP tool (expert mode) and the `/goal-check` slash command:
59
+
60
+ ```
61
+ ci_goal_check # score the last 30 observations against task_plan.md
62
+ ci_goal_check limit=50 # widen the window
63
+ ci_goal_check goal_file=docs/x.md # score against a specific plan file
64
+ ```
65
+
66
+ ## Acting on the Result
67
+
68
+ - **ON GOAL** — proceed; the plan and the work agree.
69
+ - **DRIFT** — stop and decide explicitly: either steer back to the goal, or, if the goal has legitimately changed, update the `## Goal` section so the plan stays the single source of truth. Do not silently let the work and the plan disagree — that is exactly the Law 2 violation this skill exists to catch.
70
+ - **NO DATA** — keep working; the observation window is still filling.
71
+
72
+ ## Limitations
73
+
74
+ - Keyword scoring is lexical, not semantic: a goal that says "login" will not match activity that only ever says "authentication". Add synonyms to `## Goal Keywords` when vocabulary diverges.
75
+ - A deliberately broad goal ("refactor the whole repo") will score nearly everything as on-goal. Use `## Goal Scope` to add precision when the goal is narrow.
76
+
77
+ ## Pairs With
78
+
79
+ - **`proceed-with-the-recommendation`** (orchestrator, Law 2) — run a goal check at phase boundaries to confirm the plan still matches the work.
80
+ - **`para-memory-files`** / planning-with-files — the `## Goal` section this skill reads is the same one those workflows write.
81
+ - **`strategic-compact`** — before compacting a long session, a goal check confirms what the session was actually about.
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: grill-me
3
+ tier: "2"
4
+ description: Enforces Law 1 (Research Before Executing) of the 7 Laws of AI Agent Discipline. Interview the user relentlessly about a plan or design until shared understanding is reached, resolving every branch of the decision tree before any code is written. Ported from mattpocock/skills under MIT.
5
+ origin: https://github.com/mattpocock/skills
6
+ ---
7
+
8
+ # /grill-me — Interrogate the plan before executing it
9
+
10
+ Ported verbatim in behavior from [mattpocock/skills `productivity/grill-me`](https://github.com/mattpocock/skills/blob/main/skills/productivity/grill-me/SKILL.md) (MIT, © 2026 Matt Pocock). Cold-storage snapshot at [`third-party/mattpocock-skills/skills/productivity/grill-me/SKILL.md`](../third-party/mattpocock-skills/skills/productivity/grill-me/SKILL.md); SHA pin in [`third-party/MANIFEST.md`](../third-party/MANIFEST.md).
11
+
12
+ ## What this skill does
13
+
14
+ Interview the user relentlessly about every aspect of the plan until shared understanding is reached. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide a recommended answer.
15
+
16
+ Ask questions one at a time.
17
+
18
+ If a question can be answered by exploring the codebase, explore the codebase instead.
19
+
20
+ ## When to fire it
21
+
22
+ - The user has just stated a goal at a high level ("add auth", "speed up the API") with no spec underneath.
23
+ - A `/proceed-with-the-recommendation` walk is about to start but the recommendation list itself is ambiguous about scope or success criteria.
24
+ - An RFC, PRD, or plan doc is being drafted and the user wants pressure on the assumptions before writing it.
25
+ - The user types "grill me", "stress-test this plan", or "interview me about X".
26
+ - `gateguard` is firing because the agent does not have enough grounding to proceed safely on a Write/Edit/Bash — alignment is missing, not just facts.
27
+
28
+ ## How it differs from `gateguard`
29
+
30
+ `gateguard` is a tool-boundary gate that blocks Edit / Write / Bash until the agent provides concrete investigation (importers, schemas, user instruction). It catches the case where the agent thinks it knows enough to mutate state. `grill-me` is the conversational layer one floor above: it surfaces the missing decisions before any tool call would even be attempted. They compose:
31
+
32
+ | Gap | Caught by |
33
+ |---|---|
34
+ | Agent has no spec, no plan — about to invent one | `grill-me` |
35
+ | Agent has a plan but specific branches are under-specified | `grill-me` |
36
+ | Agent is about to Edit / Write / Bash without grounding | `gateguard` |
37
+ | Plan exists, grounded, but the implementation drifts | `verification-loop`, `tdd-workflow` |
38
+
39
+ ## Interview discipline
40
+
41
+ Five rules the agent should hold while grilling:
42
+
43
+ 1. **One question at a time.** Multi-question turns let the user skim and answer the easy ones. Force depth on each branch.
44
+ 2. **Always recommend.** Every question carries a "my answer would be X because Y" so the user can confirm, override, or expose a third option you hadn't considered.
45
+ 3. **Explore before asking.** If `grep` / `ls` / a quick read can answer the question, do that first. Do not waste user attention on questions the codebase already answers.
46
+ 4. **Walk the tree, do not jump.** Resolve dependencies in order — do not ask about deployment if you have not pinned the data model yet.
47
+ 5. **Stop when the spec is shippable.** The end state is a plan a fresh agent could execute cold, not an endless interview. When the next agent could pick up the doc and run, stop.
48
+
49
+ ## How it fits the 7 Laws
50
+
51
+ | Law | Role of this skill |
52
+ |---|---|
53
+ | Law 1 (Research Before Executing) | Pre-execution interrogation closes the alignment gap that misaligns the agent with the user before any tool call. |
54
+ | Law 2 (Plan Is Sacred) | The interview produces a plan grounded in real decisions, not invented defaults. |
55
+ | Law 4 (Verify Before Reporting) | Every recommended answer is a falsifiable claim the user can correct in the moment. |
56
+
57
+ ## Companion / alternative skills
58
+
59
+ - [`gateguard`](./gateguard.md) — tool-boundary gate; blocks Edit / Write / Bash until grounding is presented. Fires after `grill-me` has aligned the spec.
60
+ - [`workspace-surface-audit`](./workspace-surface-audit.md) — Law 1 surface audit; inventory of MCP servers, plugins, env, hooks. Use when the missing context is "what is available in this repo" rather than "what should we build."
61
+ - [`superpowers:brainstorming`](https://github.com/obra/superpowers/blob/main/skills/brainstorming/SKILL.md) — Socratic design refinement. Use for open-ended ideation; use `grill-me` once the idea is committed and needs hardening.
62
+ - [`handoff`](./handoff.md) — session-end compaction. Pair with `grill-me`: grill at start, handoff at end.
63
+
64
+ ## Attribution
65
+
66
+ This skill is a port of [mattpocock/skills `productivity/grill-me`](https://github.com/mattpocock/skills/blob/main/skills/productivity/grill-me/SKILL.md). MIT-licensed upstream, MIT-licensed here. See [`third-party/mattpocock-skills/LICENSE`](../third-party/mattpocock-skills/LICENSE) for the verbatim license and [`third-party/mattpocock-skills/OUR_NOTES.md`](../third-party/mattpocock-skills/OUR_NOTES.md) for the vendoring rationale and drift radar.