continuous-improvement 3.8.0 → 3.9.2

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 (96) hide show
  1. package/.claude-plugin/marketplace.json +2 -14
  2. package/CHANGELOG.md +25 -0
  3. package/LICENSE +21 -21
  4. package/QUICKSTART.md +148 -101
  5. package/README.md +50 -18
  6. package/action.yml +33 -33
  7. package/bin/analyze.sh +161 -161
  8. package/bin/backfill.mjs +19 -19
  9. package/bin/check-doc-runtime-claims.mjs +120 -0
  10. package/bin/generate-plugin-manifests.mjs +2 -0
  11. package/bin/hook-stats.mjs +21 -21
  12. package/bin/install.mjs +51 -44
  13. package/bin/mcp-server.mjs +43 -40
  14. package/bin/refresh-third-party.mjs +416 -416
  15. package/commands/continuous-improvement.md +115 -115
  16. package/commands/dashboard.md +56 -56
  17. package/commands/discipline.md +51 -51
  18. package/commands/proceed-with-the-recommendation.md +62 -62
  19. package/commands/seven-laws.md +16 -16
  20. package/commands/superpowers.md +119 -92
  21. package/commands/workspace-surface-audit.md +77 -77
  22. package/hooks/gateguard.mjs +172 -0
  23. package/hooks/observe.sh +172 -172
  24. package/hooks/session.sh +106 -106
  25. package/hooks/three-section-close.mjs +181 -181
  26. package/instinct-packs/go.json +58 -58
  27. package/instinct-packs/meta.json +16 -16
  28. package/instinct-packs/python.json +58 -58
  29. package/instinct-packs/react.json +58 -58
  30. package/lib/gateguard-state.mjs +85 -0
  31. package/lib/plugin-metadata.mjs +25 -18
  32. package/llms.txt +68 -68
  33. package/package.json +3 -2
  34. package/plugins/beginner.json +1 -1
  35. package/plugins/continuous-improvement/.claude-plugin/marketplace.json +1 -1
  36. package/plugins/continuous-improvement/.claude-plugin/plugin.json +1 -1
  37. package/plugins/continuous-improvement/LICENSE +21 -21
  38. package/plugins/continuous-improvement/README.md +1 -0
  39. package/plugins/continuous-improvement/agents/README.md +120 -0
  40. package/plugins/continuous-improvement/agents/code-reviewer.md +97 -0
  41. package/plugins/continuous-improvement/agents/security-auditor.md +101 -0
  42. package/plugins/continuous-improvement/agents/test-engineer.md +95 -0
  43. package/plugins/continuous-improvement/bin/backfill.mjs +19 -19
  44. package/plugins/continuous-improvement/bin/mcp-server.mjs +43 -40
  45. package/plugins/continuous-improvement/commands/continuous-improvement.md +115 -115
  46. package/plugins/continuous-improvement/commands/dashboard.md +56 -56
  47. package/plugins/continuous-improvement/commands/discipline.md +51 -51
  48. package/plugins/continuous-improvement/commands/proceed-with-the-recommendation.md +62 -62
  49. package/plugins/continuous-improvement/commands/seven-laws.md +16 -16
  50. package/plugins/continuous-improvement/commands/superpowers.md +119 -92
  51. package/plugins/continuous-improvement/commands/workspace-surface-audit.md +77 -77
  52. package/plugins/continuous-improvement/hooks/gateguard.mjs +172 -0
  53. package/plugins/continuous-improvement/hooks/hooks.json +6 -1
  54. package/plugins/continuous-improvement/hooks/observe.sh +172 -172
  55. package/plugins/continuous-improvement/hooks/session.sh +106 -106
  56. package/plugins/continuous-improvement/hooks/three-section-close.mjs +181 -181
  57. package/plugins/continuous-improvement/instinct-packs/go.json +58 -58
  58. package/plugins/continuous-improvement/instinct-packs/meta.json +16 -16
  59. package/plugins/continuous-improvement/instinct-packs/python.json +58 -58
  60. package/plugins/continuous-improvement/instinct-packs/react.json +58 -58
  61. package/plugins/continuous-improvement/lib/plugin-metadata.mjs +25 -18
  62. package/plugins/continuous-improvement/skills/README.md +4 -1
  63. package/plugins/continuous-improvement/skills/deploy-receipt/SKILL.md +47 -0
  64. package/plugins/continuous-improvement/skills/gateguard/SKILL.md +17 -9
  65. package/plugins/continuous-improvement/skills/para-memory-files/SKILL.md +108 -108
  66. package/plugins/continuous-improvement/skills/proceed-with-the-recommendation/SKILL.md +1 -8
  67. package/plugins/continuous-improvement/skills/ralph/SKILL.md +221 -221
  68. package/plugins/continuous-improvement/skills/recovery-classification/SKILL.md +73 -0
  69. package/plugins/continuous-improvement/skills/safety-guard/SKILL.md +76 -76
  70. package/plugins/continuous-improvement/skills/state-reconciliation/SKILL.md +63 -0
  71. package/plugins/continuous-improvement/skills/strategic-compact/SKILL.md +104 -104
  72. package/plugins/continuous-improvement/skills/superpowers/SKILL.md +22 -15
  73. package/plugins/continuous-improvement/skills/tdd-workflow/SKILL.md +411 -411
  74. package/plugins/continuous-improvement/skills/token-budget-advisor/SKILL.md +136 -136
  75. package/plugins/continuous-improvement/skills/verification-loop/SKILL.md +32 -0
  76. package/plugins/continuous-improvement/skills/wild-risa-balance/SKILL.md +191 -191
  77. package/plugins/continuous-improvement/skills/worktree-safety/SKILL.md +66 -0
  78. package/plugins/expert.json +1 -1
  79. package/skills/README.md +79 -79
  80. package/skills/deploy-receipt.md +47 -0
  81. package/skills/gateguard.md +17 -9
  82. package/skills/para-memory-files.md +108 -108
  83. package/skills/proceed-with-the-recommendation.md +1 -8
  84. package/skills/ralph.md +221 -221
  85. package/skills/recovery-classification.md +73 -0
  86. package/skills/safety-guard.md +76 -76
  87. package/skills/state-reconciliation.md +63 -0
  88. package/skills/strategic-compact.md +104 -104
  89. package/skills/superpowers.md +22 -15
  90. package/skills/tdd-workflow.md +411 -411
  91. package/skills/token-budget-advisor.md +136 -136
  92. package/skills/verification-loop.md +32 -0
  93. package/skills/wild-risa-balance.md +191 -191
  94. package/skills/worktree-safety.md +66 -0
  95. package/templates/insights-claude-md.md +91 -0
  96. package/templates/verify-ladder.example.json +37 -24
@@ -1,58 +1,58 @@
1
- [
2
- {
3
- "id": "react-check-existing-components",
4
- "trigger": "when creating a new React component",
5
- "body": "Search the codebase for existing components that solve the same problem before creating new ones. Check shared/, components/, and ui/ directories.",
6
- "confidence": 0.65,
7
- "domain": "workflow"
8
- },
9
- {
10
- "id": "react-prefer-server-components",
11
- "trigger": "when creating components in Next.js App Router",
12
- "body": "Default to Server Components. Only add 'use client' when the component needs useState, useEffect, event handlers, or browser APIs.",
13
- "confidence": 0.7,
14
- "domain": "patterns"
15
- },
16
- {
17
- "id": "react-key-prop-lists",
18
- "trigger": "when rendering lists with .map()",
19
- "body": "Always use a stable, unique key prop. Never use array index as key unless the list is static and never reordered.",
20
- "confidence": 0.7,
21
- "domain": "patterns"
22
- },
23
- {
24
- "id": "react-effect-cleanup",
25
- "trigger": "when writing useEffect with subscriptions or timers",
26
- "body": "Always return a cleanup function from useEffect when setting up subscriptions, event listeners, or timers to prevent memory leaks.",
27
- "confidence": 0.7,
28
- "domain": "patterns"
29
- },
30
- {
31
- "id": "react-memo-expensive",
32
- "trigger": "when a component re-renders with expensive calculations",
33
- "body": "Use useMemo for expensive computations and React.memo for components that receive the same props frequently. Don't memo everything — only what's measurably slow.",
34
- "confidence": 0.6,
35
- "domain": "patterns"
36
- },
37
- {
38
- "id": "react-form-validation",
39
- "trigger": "when building forms",
40
- "body": "Check if react-hook-form or zod is already in the project before building custom form validation. Prefer library solutions over hand-rolled validation.",
41
- "confidence": 0.65,
42
- "domain": "tooling"
43
- },
44
- {
45
- "id": "react-error-boundary",
46
- "trigger": "when adding a new page or route",
47
- "body": "Ensure error boundaries exist around new pages/routes. In Next.js App Router, add error.tsx. In other React apps, wrap with ErrorBoundary component.",
48
- "confidence": 0.6,
49
- "domain": "patterns"
50
- },
51
- {
52
- "id": "react-test-user-behavior",
53
- "trigger": "when writing React component tests",
54
- "body": "Test user behavior, not implementation details. Use @testing-library/react. Query by role, label, or text — not by class name or test ID.",
55
- "confidence": 0.65,
56
- "domain": "testing"
57
- }
58
- ]
1
+ [
2
+ {
3
+ "id": "react-check-existing-components",
4
+ "trigger": "when creating a new React component",
5
+ "body": "Search the codebase for existing components that solve the same problem before creating new ones. Check shared/, components/, and ui/ directories.",
6
+ "confidence": 0.65,
7
+ "domain": "workflow"
8
+ },
9
+ {
10
+ "id": "react-prefer-server-components",
11
+ "trigger": "when creating components in Next.js App Router",
12
+ "body": "Default to Server Components. Only add 'use client' when the component needs useState, useEffect, event handlers, or browser APIs.",
13
+ "confidence": 0.7,
14
+ "domain": "patterns"
15
+ },
16
+ {
17
+ "id": "react-key-prop-lists",
18
+ "trigger": "when rendering lists with .map()",
19
+ "body": "Always use a stable, unique key prop. Never use array index as key unless the list is static and never reordered.",
20
+ "confidence": 0.7,
21
+ "domain": "patterns"
22
+ },
23
+ {
24
+ "id": "react-effect-cleanup",
25
+ "trigger": "when writing useEffect with subscriptions or timers",
26
+ "body": "Always return a cleanup function from useEffect when setting up subscriptions, event listeners, or timers to prevent memory leaks.",
27
+ "confidence": 0.7,
28
+ "domain": "patterns"
29
+ },
30
+ {
31
+ "id": "react-memo-expensive",
32
+ "trigger": "when a component re-renders with expensive calculations",
33
+ "body": "Use useMemo for expensive computations and React.memo for components that receive the same props frequently. Don't memo everything — only what's measurably slow.",
34
+ "confidence": 0.6,
35
+ "domain": "patterns"
36
+ },
37
+ {
38
+ "id": "react-form-validation",
39
+ "trigger": "when building forms",
40
+ "body": "Check if react-hook-form or zod is already in the project before building custom form validation. Prefer library solutions over hand-rolled validation.",
41
+ "confidence": 0.65,
42
+ "domain": "tooling"
43
+ },
44
+ {
45
+ "id": "react-error-boundary",
46
+ "trigger": "when adding a new page or route",
47
+ "body": "Ensure error boundaries exist around new pages/routes. In Next.js App Router, add error.tsx. In other React apps, wrap with ErrorBoundary component.",
48
+ "confidence": 0.6,
49
+ "domain": "patterns"
50
+ },
51
+ {
52
+ "id": "react-test-user-behavior",
53
+ "trigger": "when writing React component tests",
54
+ "body": "Test user behavior, not implementation details. Use @testing-library/react. Query by role, label, or text — not by class name or test ID.",
55
+ "confidence": 0.65,
56
+ "domain": "testing"
57
+ }
58
+ ]
@@ -1,5 +1,9 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
1
4
  export const PACKAGE_NAME = "continuous-improvement";
2
- export const VERSION = "3.8.0";
5
+ const PKG_PATH = join(dirname(fileURLToPath(import.meta.url)), "..", "package.json");
6
+ export const VERSION = JSON.parse(readFileSync(PKG_PATH, "utf8")).version;
3
7
  export const PLUGIN_MODES = ["beginner", "expert"];
4
8
  const REPOSITORY_URL = "https://github.com/naimkatiman/continuous-improvement";
5
9
  const HOMEPAGE_URL = `${REPOSITORY_URL}#readme`;
@@ -23,11 +27,17 @@ const KEYWORDS = [
23
27
  ];
24
28
  const CLAUDE_PLUGIN_CATEGORY = "productivity";
25
29
  const SHARED_PLUGIN_DESCRIPTION = "Stops Claude Code from skipping research, claiming 'done' without verifying, and repeating yesterday's mistakes. The 7 Laws of AI Agent Discipline — 13 enforcement skills, gating hooks, and the Mulahazah auto-leveling instinct engine.";
26
- // Five vendored upstream companions registered alongside the CI plugin.
30
+ // Four vendored upstream companions registered alongside the CI plugin.
27
31
  // Each entry points at a pinned-SHA snapshot under third-party/<name>/.
28
32
  // See third-party/MANIFEST.md for refresh recipes and per-snapshot
29
33
  // OUR_NOTES.md for integration scope and overlap matrices. The unified
30
- // /superpowers dispatcher (skills/superpowers.md) routes across all five.
34
+ // /superpowers dispatcher (skills/superpowers.md) routes across all four.
35
+ // Product-management coverage is supplied by phuryn/pm-skills as an
36
+ // out-of-band marketplace install — see docs/THIRD_PARTY.md for the
37
+ // `claude plugin marketplace add phuryn/pm-skills` recipe and the eight
38
+ // installable plugins (pm-toolkit, pm-product-strategy, pm-product-discovery,
39
+ // pm-market-research, pm-data-analytics, pm-marketing-growth,
40
+ // pm-go-to-market, pm-execution).
31
41
  const THIRD_PARTY_COMPANIONS = [
32
42
  {
33
43
  name: "superpowers",
@@ -75,18 +85,6 @@ const THIRD_PARTY_COMPANIONS = [
75
85
  category: "orchestration",
76
86
  homepage: "https://github.com/Yeachan-Heo/oh-my-claudecode",
77
87
  },
78
- {
79
- name: "pm-skills",
80
- description: "Product management skills for AI agents — 41 skills + 47 commands across the full product lifecycle (discover, define, develop, deliver, measure, iterate). Includes Meeting Skills Family v2.11.0 (5 cross-cutting skills under a shared contract with enforcing CI), OKR Skills v2.12.0 (foundation-okr-writer + measure-okr-grader for the quarterly OKR write-and-score cycle), lean canvas, persona, JTBD, PRD, user stories, acceptance criteria, hypothesis, experiment design, retrospective, launch checklist, release notes, and pm-skill-builder for authoring new skills. Follows the agentskills.io specification. Vendored snapshot at third-party/pm-skills/ pinned to upstream SHA 8d23508 (v2.13.1).",
81
- version: "2.13.1",
82
- source: "./third-party/pm-skills",
83
- author: {
84
- name: "product-on-purpose",
85
- url: "https://github.com/product-on-purpose",
86
- },
87
- category: "product",
88
- homepage: "https://github.com/product-on-purpose/pm-skills",
89
- },
90
88
  ];
91
89
  export function isPluginMode(value) {
92
90
  return value === "beginner" || value === "expert";
@@ -358,6 +356,11 @@ export function getClaudePluginManifest() {
358
356
  };
359
357
  }
360
358
  export function getPluginHooksConfig() {
359
+ const gateguardCommand = {
360
+ type: "command",
361
+ command: "node \"${CLAUDE_PLUGIN_ROOT}/hooks/gateguard.mjs\"",
362
+ timeout: 5,
363
+ };
361
364
  const observeCommand = {
362
365
  type: "command",
363
366
  command: "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/observe.sh\"",
@@ -374,9 +377,13 @@ export function getPluginHooksConfig() {
374
377
  timeout: 5,
375
378
  };
376
379
  return {
377
- description: "Observation, session lifecycle, and 3-section-close discipline hooks for continuous-improvement.",
380
+ description: "Gateguard fact-forcing PreToolUse, observation, session lifecycle, and 3-section-close discipline hooks for continuous-improvement.",
378
381
  hooks: {
379
- PreToolUse: [{ hooks: [observeCommand] }],
382
+ // gateguard runs FIRST so its block decision short-circuits before
383
+ // observe.sh records the tool call. observe.sh stays in PreToolUse for
384
+ // the observation feed; the Claude Code host runs both regardless of
385
+ // gateguard's decision.
386
+ PreToolUse: [{ hooks: [gateguardCommand, observeCommand] }],
380
387
  PostToolUse: [{ hooks: [observeCommand] }],
381
388
  SessionStart: [{ hooks: [sessionCommand] }],
382
389
  SessionEnd: [{ hooks: [sessionCommand] }],
@@ -409,7 +416,7 @@ export function getClaudePluginMarketplaceManifest() {
409
416
  export function getClaudeRepoMarketplaceManifest(extraPlugins = []) {
410
417
  return {
411
418
  name: PACKAGE_NAME,
412
- description: "Marketplace for the Continuous Improvement Claude Code plugin and five vendored upstream companions (Obra superpowers, addyosmani/agent-skills, ruflo-swarm, oh-my-claudecode, product-on-purpose/pm-skills). All five companions are pinned-SHA snapshots in third-party/ — see third-party/MANIFEST.md for refresh recipes and per-snapshot OUR_NOTES.md for integration scope.",
419
+ description: "Marketplace for the Continuous Improvement Claude Code plugin and four vendored upstream companions (Obra superpowers, addyosmani/agent-skills, ruflo-swarm, oh-my-claudecode). All four companions are pinned-SHA snapshots in third-party/ — see third-party/MANIFEST.md for refresh recipes and per-snapshot OUR_NOTES.md for integration scope. Product-management coverage is provided out-of-band by phuryn/pm-skills via Claude Code's plugin marketplace — see docs/THIRD_PARTY.md.",
413
420
  owner: {
414
421
  name: AUTHOR.name,
415
422
  },
@@ -23,12 +23,15 @@ skill set on disk.
23
23
  - `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
24
 
25
25
  ## Tier 2 — expert-mode add-ons
26
+ - `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'.
26
27
  - `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.
28
+ - `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.
27
29
  - `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.
28
30
  - `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.
29
31
  - `wild-risa-balance` — Enforces Law 2 (Plan Is Sacred) of the 7 Laws of AI Agent Discipline. Decision-framing lens that pairs WILD generation with RISA execution when emitting recommendation lists. Not a runtime hook.
32
+ - `worktree-safety` — Enforces Law 4 (Verify Before Reporting) of the 7 Laws of AI Agent Discipline. Pre-dispatch invariant: validate worktree root before any source-writing tool call. Catches missing .git, fallback path-only creation, stale leases, foreign-session ownership, and non-worktree git operations before they corrupt history.
30
33
 
31
34
  ## Always-bundled companions
32
35
  - `ralph` — Enforces Law 6 (Iterate Means One Thing) of the 7 Laws of AI Agent Discipline at PRD scale. Ralph is an autonomous AI agent loop that runs repeatedly until all PRD items are complete. Converts PRDs to executable JSON, implements stories iteratively with quality checks, and tracks progress.
33
- - `superpowers` — Law activator for the 7 Laws of AI Agent Discipline. Unified five-source dispatcher — routes tasks to the correct Law-aligned specialist across the CI plugin (tdd-workflow, verification-loop, gateguard, ralph, deploy-receipt) and four registered upstream companions (Obra superpowers, addy agent-skills, ruflo-swarm, oh-my-claudecode, pm-skills) so the right discipline fires automatically instead of the agent skipping a step. Not a peer skill — a dispatcher for the others.
36
+ - `superpowers` — Law activator for the 7 Laws of AI Agent Discipline. Unified four-source dispatcher — routes tasks to the correct Law-aligned specialist across the CI plugin (tdd-workflow, verification-loop, gateguard, ralph, deploy-receipt) and four registered upstream companions (Obra superpowers, addy agent-skills, ruflo-swarm, oh-my-claudecode) so the right discipline fires automatically instead of the agent skipping a step. Product-management coverage comes from phuryn/pm-skills via an out-of-band marketplace install (see docs/THIRD_PARTY.md). Not a peer skill — a dispatcher for the others.
34
37
  - `workspace-surface-audit` — Enforces Law 1 (Research Before Executing) of the 7 Laws of AI Agent Discipline. Audits the active repo, MCP servers, plugins, connectors, env surfaces, and harness setup, then recommends the highest-value continuous-improvement-native skills, hooks, agents, and operator workflows. Use when the user wants help setting up Claude Code or understanding what capabilities are actually available in their environment.
@@ -101,6 +101,50 @@ After running verification:
101
101
 
102
102
  A `COMPLETE` receipt is the only state that lets the merge be reported as `done`. `INCOMPLETE` receipts surface a single named operator-action item (e.g. "Railway last deploy is older than the merge — re-trigger from dashboard or `railway up`").
103
103
 
104
+ ## On-Incomplete Modes
105
+
106
+ The default behavior on `INCOMPLETE` is **report-only** — the receipt block names the gap, the operator decides recovery. A second mode is available for projects that want the skill to also stage a recovery branch and a failing repro test, without ever executing rollback or merge.
107
+
108
+ ### Mode A — `report-only` (default)
109
+
110
+ The current behavior. Print the receipt block, surface the named operator-action item, hand off. No branch creation, no PR opened. Use this mode when the operator is at the keyboard and will react to the receipt directly. No flag required.
111
+
112
+ ### Mode B — `open-hotfix-pr` (opt-in)
113
+
114
+ Use this mode when the receipt is `INCOMPLETE` AND a documented recovery window has elapsed without the deploy self-correcting (default 10 minutes from merge; tunable per project via `verify-ladder.json` `deploy_receipt_recovery_window_seconds`). The skill then stages a recovery branch *for the operator to review*, but never merges or rolls back on its own.
115
+
116
+ Activate with the explicit invocation:
117
+
118
+ ```
119
+ deploy-receipt --on-incomplete=open-hotfix-pr
120
+ ```
121
+
122
+ When triggered, this mode performs four steps in order, halting on the first failure:
123
+
124
+ 1. **Branch.** `git checkout -b hotfix/<merge-sha-short>-<symptom-slug> origin/<deploy-branch>`. The symptom slug is derived from the named gap on the receipt — `sha-mismatch`, `health-non-200`, `version-endpoint-stale`, or `no-provider-source`. If the slug cannot be derived, halt and revert to report-only.
125
+ 2. **Failing repro test.** Write a single test file at `tests/regressions/deploy-<merge-sha-short>.test.<ext>` that asserts the gap (e.g. `expect(deployedSha).toEqual(mergeSha)` or `expect(healthResponse.status).toBe(200)`). The test MUST currently fail when run against production. The skill writes the assertion against the receipt's recorded values, not against speculation. If the test cannot be made to fail deterministically, halt and revert to report-only.
126
+ 3. **Open PR.** `gh pr create --base <deploy-branch> --head hotfix/... --draft` with body that cites the receipt block verbatim, the merge SHA, the deployed SHA, the named gap, and the documented rollback command for the detected provider (a one-line shell snippet from the table below). Draft state is mandatory — never open as ready-for-review without operator approval.
127
+ 4. **Hand off.** Print a single-line operator-action item naming the new branch, the PR URL, and the documented rollback command. Stop. Do not modify production. Do not merge the PR. Do not run the rollback.
128
+
129
+ ### Documented rollback commands (cited in the PR body, never executed)
130
+
131
+ | Provider | Documented rollback command |
132
+ |---|---|
133
+ | Railway | `railway redeploy --service <service-id> --commit <previous-good-sha>` |
134
+ | Cloudflare Workers | `wrangler rollback --message "deploy-receipt: <merge-sha-short> failed health/SHA gate"` |
135
+ | Vercel | `vercel rollback <previous-good-deployment-url>` |
136
+ | Netlify | `netlify rollback` (interactive — operator picks the prior deploy) |
137
+ | Fly.io | `fly releases rollback <previous-good-version>` |
138
+
139
+ The rollback command is **printed**, not run. The skill's job is to give the operator a complete recovery packet (branch + failing test + cited command) without taking the irreversible step itself.
140
+
141
+ ### When NOT to use Mode B
142
+
143
+ - The deploy is mid-rolling-restart or mid-canary — the receipt is INCOMPLETE because the deploy is still in progress, not because it failed. Wait for the recovery window first.
144
+ - Branch protection on the deploy branch denies hotfix branches by name pattern — the PR will fail to open and the skill should fall back to report-only with a named operator action ("hotfix branch denied by protection — recovery requires direct console access").
145
+ - The previous-good SHA cannot be determined from `git log origin/<deploy-branch>` alone — the rollback command in the PR body would be a guess. Fall back to report-only and name the gap as "previous-good SHA unverifiable — operator must select".
146
+ - The operator has already started a manual recovery (a fresh deploy is running, the dashboard shows a rollback in progress). Detect via Route A or Route B and skip Mode B for this receipt cycle.
147
+
104
148
  ## Anti-Patterns
105
149
 
106
150
  - **"Eventually consistent" excuse.** Reporting done with `Deployed SHA: not retrieved` and a comment like "deploy will pick up shortly" is exactly the failure mode this skill prevents. There is no eventually — there is COMPLETE or INCOMPLETE.
@@ -108,6 +152,9 @@ A `COMPLETE` receipt is the only state that lets the merge be reported as `done`
108
152
  - **Skipping for "small changes."** A docs-only commit still needs a receipt if the deploy branch auto-deploys — small changes have caused stale-build incidents on every provider in the table above.
109
153
  - **Recommending the CLI install mid-receipt.** If Route A is unavailable, fall through to B then C. Adding tooling is a separate decision the operator makes outside the receipt loop.
110
154
  - **Treating absence of evidence as evidence of success.** If none of the three routes produce a SHA, the receipt is `INCOMPLETE — no provider source available`, not `COMPLETE (assumed)`.
155
+ - **Auto-merging the hotfix PR.** Mode B opens the PR as draft and stops. Auto-merge, `--admin` overrides, and `gh pr merge` calls are refused inside this skill. The hotfix is the operator's decision; the skill stages it but never lands it.
156
+ - **Force-pushing or rewriting the hotfix branch.** Mode B branches off `origin/<deploy-branch>` once and pushes once. If the failing test needs changes, the skill writes a new commit on the branch — never `--force` and never `git rebase --interactive`.
157
+ - **Executing the rollback command.** The rollback command is cited in the PR body for operator review. Mode B never runs `railway redeploy`, `wrangler rollback`, `vercel rollback`, etc. on its own. If the operator wants execution, they run it themselves or they wire a separate runner; that is a different skill.
111
158
 
112
159
  ## Pairs With
113
160
 
@@ -7,7 +7,9 @@ origin: community
7
7
 
8
8
  # GateGuard — Fact-Forcing Pre-Action Gate
9
9
 
10
- A PreToolUse hook 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.
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).
11
13
 
12
14
  ## When to Activate
13
15
 
@@ -124,18 +126,24 @@ This gate is what catches the squash-merge / ahead-of-origin trap recorded in th
124
126
 
125
127
  ## Quick Start
126
128
 
127
- ### Option A: Use the continuous-improvement hook (zero install)
129
+ ### Today: runtime hook + skill (zero install beyond the plugin)
128
130
 
129
- The hook at `scripts/hooks/gateguard-fact-force.js` is included in this plugin. Enable it via hooks.json.
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`.
130
132
 
131
- ### Option B: Full package with config
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.
132
134
 
133
- ```bash
134
- pip install gateguard-ai
135
- gateguard init
136
- ```
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
137
145
 
138
- This adds `.gateguard.yml` for per-project configuration (custom messages, ignore paths, gate toggles).
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.
139
147
 
140
148
  ## Anti-Patterns
141
149
 
@@ -1,108 +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.
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.
@@ -160,14 +160,7 @@ Rows whose **Preferred skill** is not bundled with the `continuous-improvement`
160
160
  | Visual regression / browser-level diff | `oh-my-claudecode:visual-verdict` | Playwright screenshot diff against staging baseline. (Reference behavior — does not require `oh-my-claudecode`.) |
161
161
  | Multi-session retrospective across a sprint | `oh-my-claudecode:retrospective` → `learn-eval` | What worked / what failed / what to do differently / 3 ranked next moves. (Reference behavior — does not require `oh-my-claudecode`.) |
162
162
  | Long autonomous run with quality gates | `oh-my-claudecode:ultrawork` → `ralph` | PRD-shaped autonomous loop with verify-between-iterations. (Reference behavior — does not require `oh-my-claudecode`.) |
163
- | Draft a PRD before implementation | `pm-skills:prd` | Problem → user → goal → metric → scope. Engineering plan is a separate doc. (Reference behavior does not require `pm-skills`.) |
164
- | Decompose feature into user stories + acceptance criteria | `pm-skills:user-stories` + `pm-skills:acceptance-criteria` | "As <role> I want <action> so that <benefit>" + Given/When/Then per story. (Reference behavior — does not require `pm-skills`.) |
165
- | Write or grade quarterly OKRs | `pm-skills:okr-writer` + `pm-skills:okr-grader` | Objective + 3-5 measurable key results; grade 0.0-1.0 at end of cycle. (Reference behavior — does not require `pm-skills`.) |
166
- | Design hypothesis-driven experiment | `pm-skills:experiment-design` + `pm-skills:hypothesis` | "We believe <X> will produce <Y>; we'll know if <Z> moves by <delta>." (Reference behavior — does not require `pm-skills`.) |
167
- | Discovery framework: persona / JTBD / lean canvas | `pm-skills:persona` / `pm-skills:jtbd-canvas` / `pm-skills:lean-canvas` | Pick the framework that matches the gap; do not run all three. (Reference behavior — does not require `pm-skills`.) |
168
- | Market sizing or competitive analysis | `pm-skills:market-sizing` / `pm-skills:competitive-analysis` | TAM/SAM/SOM bottom-up; competitive matrix on 5 axes. (Reference behavior — does not require `pm-skills`.) |
169
- | Meeting agenda / brief / recap / synthesize | `pm-skills:meeting-agenda` / `pm-skills:meeting-brief` / `pm-skills:meeting-recap` / `pm-skills:meeting-synthesize` | Cross-cutting Meeting Skills Family v2.11.0 with shared contract. (Reference behavior — does not require `pm-skills`.) |
170
- | Product launch checklist | `pm-skills:launch-checklist` | Marketing + ops + analytics + comms gates. Engineering uses `finishing-a-development-branch` + `deploy-receipt`. (Reference behavior — does not require `pm-skills`.) |
163
+ | Product-management work (PRD, user stories, acceptance criteria, OKRs, experiments, personas, JTBD, lean canvas, market sizing, competitive analysis, meetings family, launch checklist) | Install phuryn/pm-skills via Claude Code marketplace — see docs/THIRD_PARTY.md | Out-of-band install (`claude plugin marketplace add phuryn/pm-skills` + the eight `pm-*@pm-skills` plugins). Inline fallback: keep the work shape (problem → user → goal → metric → scope; Given/When/Then per story; objective + 3-5 measurable KRs; we-believe / we'll-know hypothesis; TAM/SAM/SOM bottom-up; cross-cutting meetings agenda/brief/recap/synthesize) without depending on a specific routing target. |
171
164
 
172
165
  ## Phase 4: Verify (Law 4 — Verify Before Reporting)
173
166