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,136 +1,136 @@
1
- ---
2
- name: token-budget-advisor
3
- tier: "2"
4
- description: >-
5
- Enforces Law 2 (Plan Is Sacred) of the 7 Laws of AI Agent Discipline by
6
- making token-budget tradeoffs explicit before the response is composed.
7
- Offers the user an informed choice about how much response depth to
8
- consume before answering. Use this skill when the user explicitly
9
- wants to control response length, depth, or token budget.
10
- TRIGGER when: "token budget", "token count", "token usage", "token limit",
11
- "response length", "answer depth", "short version", "brief answer",
12
- "detailed answer", "exhaustive answer", "respuesta corta vs larga",
13
- "cuántos tokens", "ahorrar tokens", "responde al 50%", "dame la versión
14
- corta", "quiero controlar cuánto usas", or clear variants where the
15
- user is explicitly asking to control answer size or depth.
16
- DO NOT TRIGGER when: user has already specified a level in the current
17
- session (maintain it), the request is clearly a one-word answer, or
18
- "token" refers to auth/session/payment tokens rather than response size.
19
- origin: community
20
- ---
21
-
22
- # Token Budget Advisor (TBA)
23
-
24
- Intercept the response flow to offer the user a choice about response depth **before** the agent answers.
25
-
26
- ## When to Use
27
-
28
- - User wants to control how long or detailed a response is
29
- - User mentions tokens, budget, depth, or response length
30
- - User says "short version", "tldr", "brief", "al 25%", "exhaustive", etc.
31
- - Any time the user wants to choose depth/detail level upfront
32
-
33
- **Do not trigger** when: user already set a level this session (maintain it silently), or the answer is trivially one line.
34
-
35
- ## How It Works
36
-
37
- ### Step 1 — Estimate input tokens
38
-
39
- Use the repository's canonical context-budget heuristics to estimate the prompt's token count mentally.
40
-
41
- Use the same calibration guidance as [context-budget](../context-budget/SKILL.md):
42
-
43
- - prose: `words × 1.3`
44
- - code-heavy or mixed/code blocks: `chars / 4`
45
-
46
- For mixed content, use the dominant content type and keep the estimate heuristic.
47
-
48
- ### Step 2 — Estimate response size by complexity
49
-
50
- Classify the prompt, then apply the multiplier range to get the full response window:
51
-
52
- | Complexity | Multiplier range | Example prompts |
53
- |--------------|------------------|------------------------------------------------------|
54
- | Simple | 3× – 8× | "What is X?", yes/no, single fact |
55
- | Medium | 8× – 20× | "How does X work?" |
56
- | Medium-High | 10× – 25× | Code request with context |
57
- | Complex | 15× – 40× | Multi-part analysis, comparisons, architecture |
58
- | Creative | 10× – 30× | Stories, essays, narrative writing |
59
-
60
- Response window = `input_tokens × mult_min` to `input_tokens × mult_max` (but don’t exceed your model’s configured output-token limit).
61
-
62
- ### Step 3 — Present depth options
63
-
64
- Present this block **before** answering, using the actual estimated numbers:
65
-
66
- ```
67
- Analyzing your prompt...
68
-
69
- Input: ~[N] tokens | Type: [type] | Complexity: [level] | Language: [lang]
70
-
71
- Choose your depth level:
72
-
73
- [1] Essential (25%) -> ~[tokens] Direct answer only, no preamble
74
- [2] Moderate (50%) -> ~[tokens] Answer + context + 1 example
75
- [3] Detailed (75%) -> ~[tokens] Full answer with alternatives
76
- [4] Exhaustive (100%) -> ~[tokens] Everything, no limits
77
-
78
- Which level? (1-4 or say "25% depth", "50% depth", "75% depth", "100% depth")
79
-
80
- Precision: heuristic estimate ~85-90% accuracy (±15%).
81
- ```
82
-
83
- Level token estimates (within the response window):
84
- - 25% → `min + (max - min) × 0.25`
85
- - 50% → `min + (max - min) × 0.50`
86
- - 75% → `min + (max - min) × 0.75`
87
- - 100% → `max`
88
-
89
- ### Step 4 — Respond at the chosen level
90
-
91
- | Level | Target length | Include | Omit |
92
- |------------------|---------------------|-----------------------------------------------------|---------------------------------------------------|
93
- | 25% Essential | 2-4 sentences max | Direct answer, key conclusion | Context, examples, nuance, alternatives |
94
- | 50% Moderate | 1-3 paragraphs | Answer + necessary context + 1 example | Deep analysis, edge cases, references |
95
- | 75% Detailed | Structured response | Multiple examples, pros/cons, alternatives | Extreme edge cases, exhaustive references |
96
- | 100% Exhaustive | No restriction | Everything — full analysis, all code, all perspectives | Nothing |
97
-
98
- ## Shortcuts — skip the question
99
-
100
- If the user already signals a level, respond at that level immediately without asking:
101
-
102
- | What they say | Level |
103
- |----------------------------------------------------|-------|
104
- | "1" / "25% depth" / "short version" / "brief answer" / "tldr" | 25% |
105
- | "2" / "50% depth" / "moderate depth" / "balanced answer" | 50% |
106
- | "3" / "75% depth" / "detailed answer" / "thorough answer" | 75% |
107
- | "4" / "100% depth" / "exhaustive answer" / "full deep dive" | 100% |
108
-
109
- If the user set a level earlier in the session, **maintain it silently** for subsequent responses unless they change it.
110
-
111
- ## Precision note
112
-
113
- This skill uses heuristic estimation — no real tokenizer. Accuracy ~85-90%, variance ±15%. Always show the disclaimer.
114
-
115
- ## Examples
116
-
117
- ### Triggers
118
-
119
- - "Give me the short version first."
120
- - "How many tokens will your answer use?"
121
- - "Respond at 50% depth."
122
- - "I want the exhaustive answer, not the summary."
123
- - "Dame la version corta y luego la detallada."
124
-
125
- ### Does Not Trigger
126
-
127
- - "What is a JWT token?"
128
- - "The checkout flow uses a payment token."
129
- - "Is this normal?"
130
- - "Complete the refactor."
131
- - Follow-up questions after the user already chose a depth for the session
132
-
133
- ## Source
134
-
135
- Standalone skill from [TBA — Token Budget Advisor for Claude Code](https://github.com/Xabilimon1/Token-Budget-Advisor-Claude-Code-).
136
- Original project also ships a Python estimator script, but this repository keeps the skill self-contained and heuristic-only.
1
+ ---
2
+ name: token-budget-advisor
3
+ tier: "2"
4
+ description: >-
5
+ Enforces Law 2 (Plan Is Sacred) of the 7 Laws of AI Agent Discipline by
6
+ making token-budget tradeoffs explicit before the response is composed.
7
+ Offers the user an informed choice about how much response depth to
8
+ consume before answering. Use this skill when the user explicitly
9
+ wants to control response length, depth, or token budget.
10
+ TRIGGER when: "token budget", "token count", "token usage", "token limit",
11
+ "response length", "answer depth", "short version", "brief answer",
12
+ "detailed answer", "exhaustive answer", "respuesta corta vs larga",
13
+ "cuántos tokens", "ahorrar tokens", "responde al 50%", "dame la versión
14
+ corta", "quiero controlar cuánto usas", or clear variants where the
15
+ user is explicitly asking to control answer size or depth.
16
+ DO NOT TRIGGER when: user has already specified a level in the current
17
+ session (maintain it), the request is clearly a one-word answer, or
18
+ "token" refers to auth/session/payment tokens rather than response size.
19
+ origin: community
20
+ ---
21
+
22
+ # Token Budget Advisor (TBA)
23
+
24
+ Intercept the response flow to offer the user a choice about response depth **before** the agent answers.
25
+
26
+ ## When to Use
27
+
28
+ - User wants to control how long or detailed a response is
29
+ - User mentions tokens, budget, depth, or response length
30
+ - User says "short version", "tldr", "brief", "al 25%", "exhaustive", etc.
31
+ - Any time the user wants to choose depth/detail level upfront
32
+
33
+ **Do not trigger** when: user already set a level this session (maintain it silently), or the answer is trivially one line.
34
+
35
+ ## How It Works
36
+
37
+ ### Step 1 — Estimate input tokens
38
+
39
+ Use the repository's canonical context-budget heuristics to estimate the prompt's token count mentally.
40
+
41
+ Use the same calibration guidance as [context-budget](../context-budget/SKILL.md):
42
+
43
+ - prose: `words × 1.3`
44
+ - code-heavy or mixed/code blocks: `chars / 4`
45
+
46
+ For mixed content, use the dominant content type and keep the estimate heuristic.
47
+
48
+ ### Step 2 — Estimate response size by complexity
49
+
50
+ Classify the prompt, then apply the multiplier range to get the full response window:
51
+
52
+ | Complexity | Multiplier range | Example prompts |
53
+ |--------------|------------------|------------------------------------------------------|
54
+ | Simple | 3× – 8× | "What is X?", yes/no, single fact |
55
+ | Medium | 8× – 20× | "How does X work?" |
56
+ | Medium-High | 10× – 25× | Code request with context |
57
+ | Complex | 15× – 40× | Multi-part analysis, comparisons, architecture |
58
+ | Creative | 10× – 30× | Stories, essays, narrative writing |
59
+
60
+ Response window = `input_tokens × mult_min` to `input_tokens × mult_max` (but don’t exceed your model’s configured output-token limit).
61
+
62
+ ### Step 3 — Present depth options
63
+
64
+ Present this block **before** answering, using the actual estimated numbers:
65
+
66
+ ```
67
+ Analyzing your prompt...
68
+
69
+ Input: ~[N] tokens | Type: [type] | Complexity: [level] | Language: [lang]
70
+
71
+ Choose your depth level:
72
+
73
+ [1] Essential (25%) -> ~[tokens] Direct answer only, no preamble
74
+ [2] Moderate (50%) -> ~[tokens] Answer + context + 1 example
75
+ [3] Detailed (75%) -> ~[tokens] Full answer with alternatives
76
+ [4] Exhaustive (100%) -> ~[tokens] Everything, no limits
77
+
78
+ Which level? (1-4 or say "25% depth", "50% depth", "75% depth", "100% depth")
79
+
80
+ Precision: heuristic estimate ~85-90% accuracy (±15%).
81
+ ```
82
+
83
+ Level token estimates (within the response window):
84
+ - 25% → `min + (max - min) × 0.25`
85
+ - 50% → `min + (max - min) × 0.50`
86
+ - 75% → `min + (max - min) × 0.75`
87
+ - 100% → `max`
88
+
89
+ ### Step 4 — Respond at the chosen level
90
+
91
+ | Level | Target length | Include | Omit |
92
+ |------------------|---------------------|-----------------------------------------------------|---------------------------------------------------|
93
+ | 25% Essential | 2-4 sentences max | Direct answer, key conclusion | Context, examples, nuance, alternatives |
94
+ | 50% Moderate | 1-3 paragraphs | Answer + necessary context + 1 example | Deep analysis, edge cases, references |
95
+ | 75% Detailed | Structured response | Multiple examples, pros/cons, alternatives | Extreme edge cases, exhaustive references |
96
+ | 100% Exhaustive | No restriction | Everything — full analysis, all code, all perspectives | Nothing |
97
+
98
+ ## Shortcuts — skip the question
99
+
100
+ If the user already signals a level, respond at that level immediately without asking:
101
+
102
+ | What they say | Level |
103
+ |----------------------------------------------------|-------|
104
+ | "1" / "25% depth" / "short version" / "brief answer" / "tldr" | 25% |
105
+ | "2" / "50% depth" / "moderate depth" / "balanced answer" | 50% |
106
+ | "3" / "75% depth" / "detailed answer" / "thorough answer" | 75% |
107
+ | "4" / "100% depth" / "exhaustive answer" / "full deep dive" | 100% |
108
+
109
+ If the user set a level earlier in the session, **maintain it silently** for subsequent responses unless they change it.
110
+
111
+ ## Precision note
112
+
113
+ This skill uses heuristic estimation — no real tokenizer. Accuracy ~85-90%, variance ±15%. Always show the disclaimer.
114
+
115
+ ## Examples
116
+
117
+ ### Triggers
118
+
119
+ - "Give me the short version first."
120
+ - "How many tokens will your answer use?"
121
+ - "Respond at 50% depth."
122
+ - "I want the exhaustive answer, not the summary."
123
+ - "Dame la version corta y luego la detallada."
124
+
125
+ ### Does Not Trigger
126
+
127
+ - "What is a JWT token?"
128
+ - "The checkout flow uses a payment token."
129
+ - "Is this normal?"
130
+ - "Complete the refactor."
131
+ - Follow-up questions after the user already chose a depth for the session
132
+
133
+ ## Source
134
+
135
+ Standalone skill from [TBA — Token Budget Advisor for Claude Code](https://github.com/Xabilimon1/Token-Budget-Advisor-Claude-Code-).
136
+ Original project also ships a Python estimator script, but this repository keeps the skill self-contained and heuristic-only.
@@ -147,6 +147,36 @@ For repos whose `verify-ladder.json` declares a `deploy_receipt` field — or wh
147
147
 
148
148
  INCOMPLETE receipts move to "Immediate operator action" in the close, never to "ready". Library-only / package-published repos skip this phase entirely (no deploy seam exists).
149
149
 
150
+ ### Phase 9: Synthetic Checks (production-vs-baseline diff)
151
+
152
+ Phase 8 confirms the deploy seam. Phase 9 confirms the deployed surface matches the staging baseline on the dimensions that matter — endpoint payload shape, header presence, data freshness, routing correctness. A deploy can land with a matching SHA and a 200 healthcheck and still serve broken responses (stale data sources, dropped headers, regressed payloads). Phase 9 is the gate that catches that.
153
+
154
+ **When this rung runs:**
155
+
156
+ - ONLY after Phase 8 reports `Receipt status: COMPLETE`. An INCOMPLETE receipt blocks Phase 9 — fix the receipt gap first, then re-run.
157
+ - ONLY when the resolved ladder declares `synthetic_checks` as a non-null directory path (default: `synthetic-checks/`). A `null` field skips the rung silently. A missing field falls through to the directory sniff: if `synthetic-checks/` exists at the repo root with at least one `*.synthetic.*` file, the rung activates; otherwise it is recorded as "skipped — no synthetic-checks directory found".
158
+
159
+ **What the runner does:**
160
+
161
+ 1. List every `*.synthetic.{sh,mjs,ts,py}` file in the resolved directory in lexical order.
162
+ 2. For each file, set the input env vars: `BASE_URL` (production base from project config), `BASELINE_URL` (staging baseline from project config), `EXPECTED_SHA` (the merge SHA Phase 8 reported COMPLETE), `DEPLOY_BRANCH` (the deploy branch name), `RECEIPT_TIMESTAMP` (ISO-8601 of the receipt).
163
+ 3. Invoke the file via the right interpreter (`bash` for `.sh`, `node` for `.mjs`, `tsx` for `.ts`, `python` for `.py`). Files with unrecognized extensions are skipped with a warning.
164
+ 4. Capture stdout + stderr + exit code per file. On exit 0, the check passed. On any non-zero exit, the check failed and stdout is the operator-facing diff.
165
+ 5. Aggregate: if every file exited 0, Phase 9 is `PASS`. If any file exited non-zero, Phase 9 is `FAIL — synthetic drift on <filenames>` and the captured diffs go into the verification report verbatim (no agent re-summarization).
166
+
167
+ **Surfacing rule:**
168
+
169
+ A failed synthetic check surfaces as `INCOMPLETE — synthetic drift` at the same severity as a failed deploy receipt. The merge moves to "Immediate operator action" with the named drift and the diff payload. Do NOT downgrade synthetic drift to "warning" — the rung exists because the report flagged exactly this gap (deploys that look healthy but serve broken responses).
170
+
171
+ **Anti-patterns specific to this rung:**
172
+
173
+ - **Smoke checks masquerading as synthetic checks.** A check that only verifies "endpoint returns 200" passes against a stale deploy. Synthetic checks MUST diff production against a baseline.
174
+ - **Hardcoded baseline URLs in the check.** Baseline lives in env (`BASELINE_URL`), not in the file. Hardcoding it breaks the convention and makes per-environment use impossible.
175
+ - **Re-summarizing the diff.** The captured stdout from a failed check is the operator-facing artifact. The agent does not re-write or shorten it.
176
+ - **Treating an absent directory as PASS.** No synthetic-checks directory means the rung is `skipped`, not `PASS`. The operator sees the absence in the resolved ladder.
177
+
178
+ See `synthetic-checks/README.md` for the file convention, the input/output contract, and a runnable sample (`example-version-endpoint.synthetic.sh`).
179
+
150
180
  ## Output Format
151
181
 
152
182
  After running all phases, produce a verification report:
@@ -163,6 +193,8 @@ Security: [PASS/FAIL] (X issues)
163
193
  Diff: [X files changed]
164
194
  Goal landed: [YES/NO] — <one-line evidence or gap>
165
195
  All promised: [YES/NO] — <X of Y steps Done; list any Skipped>
196
+ Deploy: [COMPLETE/INCOMPLETE/skipped] — <SHA + health summary>
197
+ Synthetic: [PASS/FAIL/skipped] — <X of Y checks; failed: <filenames>>
166
198
 
167
199
  Overall: [READY/NOT READY] for PR
168
200