continuous-improvement 3.1.0 → 3.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +66 -0
- package/CHANGELOG.md +216 -0
- package/QUICKSTART.md +79 -12
- package/README.md +229 -349
- package/SKILL.md +87 -9
- package/action.yml +1 -1
- package/bin/analyze.sh +9 -1
- package/bin/backfill.mjs +172 -0
- package/bin/check-doc-runtime-claims.mjs +120 -0
- package/bin/check-docs-substrings.mjs +333 -0
- package/bin/check-everything-mirror.mjs +145 -0
- package/bin/check-routing-targets.mjs +151 -0
- package/bin/check-skill-law-tag.mjs +128 -0
- package/bin/check-skill-mirror.mjs +119 -0
- package/bin/check-skill-tiers.mjs +116 -0
- package/bin/check-third-party-shape.mjs +202 -0
- package/bin/generate-plugin-manifests.mjs +171 -0
- package/bin/harvest-friction.mjs +279 -0
- package/bin/hook-stats.mjs +258 -0
- package/bin/install.mjs +407 -499
- package/bin/lint-transcript.mjs +182 -210
- package/bin/mcp-server.mjs +834 -608
- package/bin/observe.mjs +148 -0
- package/bin/pre-commit-block-strays.sh +49 -0
- package/bin/refresh-third-party.mjs +416 -0
- package/bin/unified-cli.mjs +533 -0
- package/commands/continuous-improvement.md +43 -2
- package/commands/discipline.md +14 -0
- package/commands/harvest.md +76 -0
- package/commands/learn-eval.md +117 -0
- package/commands/planning-with-files.md +66 -0
- package/commands/proceed-with-the-recommendation.md +62 -0
- package/commands/ralph.md +103 -0
- package/commands/release-train.md +81 -0
- package/commands/seven-laws.md +16 -0
- package/commands/superpowers.md +180 -0
- package/commands/swarm.md +101 -0
- package/commands/workspace-surface-audit.md +77 -0
- package/hooks/gateguard.mjs +172 -0
- package/hooks/observe.sh +42 -4
- package/hooks/session.sh +3 -3
- package/hooks/three-section-close.mjs +181 -0
- package/instinct-packs/meta.json +16 -0
- package/lib/cli-anything.mjs +401 -0
- package/lib/compound-engineering.mjs +831 -0
- package/lib/gateguard-state.mjs +85 -0
- package/lib/observe-event.mjs +128 -0
- package/lib/plugin-metadata.mjs +435 -0
- package/lib/pm-marketplace.mjs +61 -0
- package/lib/pm-skills.mjs +1274 -0
- package/lib/resolve-home-dir.mjs +43 -0
- package/lib/skill-tiers.mjs +137 -0
- package/lib/unified-plugin.mjs +924 -0
- package/llms.txt +32 -7
- package/package.json +29 -19
- package/plugins/beginner.json +17 -6
- package/plugins/continuous-improvement/.claude-plugin/marketplace.json +20 -0
- package/plugins/continuous-improvement/.claude-plugin/plugin.json +26 -0
- package/plugins/continuous-improvement/LICENSE +21 -0
- package/plugins/continuous-improvement/README.md +57 -0
- package/plugins/continuous-improvement/agents/README.md +120 -0
- package/plugins/continuous-improvement/agents/code-reviewer.md +97 -0
- package/plugins/continuous-improvement/agents/security-auditor.md +101 -0
- package/plugins/continuous-improvement/agents/test-engineer.md +95 -0
- package/plugins/continuous-improvement/bin/backfill.mjs +172 -0
- package/plugins/continuous-improvement/bin/mcp-server.mjs +889 -0
- package/plugins/continuous-improvement/bin/observe.mjs +148 -0
- package/plugins/continuous-improvement/commands/continuous-improvement.md +115 -0
- package/plugins/continuous-improvement/commands/dashboard.md +56 -0
- package/plugins/continuous-improvement/commands/discipline.md +51 -0
- package/plugins/continuous-improvement/commands/harvest.md +76 -0
- package/plugins/continuous-improvement/commands/learn-eval.md +117 -0
- package/plugins/continuous-improvement/commands/planning-with-files.md +66 -0
- package/plugins/continuous-improvement/commands/proceed-with-the-recommendation.md +62 -0
- package/plugins/continuous-improvement/commands/ralph.md +103 -0
- package/plugins/continuous-improvement/commands/release-train.md +81 -0
- package/plugins/continuous-improvement/commands/seven-laws.md +16 -0
- package/plugins/continuous-improvement/commands/superpowers.md +180 -0
- package/plugins/continuous-improvement/commands/swarm.md +101 -0
- package/plugins/continuous-improvement/commands/workspace-surface-audit.md +77 -0
- package/plugins/continuous-improvement/hooks/gateguard.mjs +172 -0
- package/plugins/continuous-improvement/hooks/hooks.json +65 -0
- package/plugins/continuous-improvement/hooks/observe.sh +172 -0
- package/plugins/continuous-improvement/hooks/session.sh +106 -0
- package/plugins/continuous-improvement/hooks/three-section-close.mjs +181 -0
- package/plugins/continuous-improvement/instinct-packs/go.json +58 -0
- package/plugins/continuous-improvement/instinct-packs/meta.json +16 -0
- package/plugins/continuous-improvement/instinct-packs/python.json +58 -0
- package/plugins/continuous-improvement/instinct-packs/react.json +58 -0
- package/plugins/continuous-improvement/lib/observe-event.mjs +128 -0
- package/plugins/continuous-improvement/lib/plugin-metadata.mjs +435 -0
- package/plugins/continuous-improvement/lib/resolve-home-dir.mjs +43 -0
- package/plugins/continuous-improvement/skills/README.md +37 -0
- package/plugins/continuous-improvement/skills/continuous-improvement/SKILL.md +249 -0
- package/plugins/continuous-improvement/skills/deploy-receipt/SKILL.md +178 -0
- package/plugins/continuous-improvement/skills/gateguard/SKILL.md +163 -0
- package/plugins/continuous-improvement/skills/para-memory-files/SKILL.md +108 -0
- package/plugins/continuous-improvement/skills/proceed-with-the-recommendation/SKILL.md +447 -0
- package/plugins/continuous-improvement/skills/ralph/SKILL.md +221 -0
- package/plugins/continuous-improvement/skills/recovery-classification/SKILL.md +73 -0
- package/plugins/continuous-improvement/skills/safety-guard/SKILL.md +76 -0
- package/plugins/continuous-improvement/skills/state-reconciliation/SKILL.md +63 -0
- package/plugins/continuous-improvement/skills/strategic-compact/SKILL.md +104 -0
- package/plugins/continuous-improvement/skills/superpowers/SKILL.md +219 -0
- package/plugins/continuous-improvement/skills/tdd-workflow/SKILL.md +411 -0
- package/plugins/continuous-improvement/skills/token-budget-advisor/SKILL.md +136 -0
- package/plugins/continuous-improvement/skills/verification-loop/SKILL.md +224 -0
- package/plugins/continuous-improvement/skills/wild-risa-balance/SKILL.md +191 -0
- package/plugins/continuous-improvement/skills/workspace-surface-audit/SKILL.md +147 -0
- package/plugins/continuous-improvement/skills/worktree-safety/SKILL.md +66 -0
- package/plugins/continuous-improvement/templates/planning-with-files/findings.md +8 -0
- package/plugins/continuous-improvement/templates/planning-with-files/progress.md +7 -0
- package/plugins/continuous-improvement/templates/planning-with-files/task_plan.md +23 -0
- package/plugins/expert.json +26 -5
- package/skills/README.md +79 -0
- package/skills/deploy-receipt.md +178 -0
- package/skills/gateguard.md +163 -0
- package/skills/para-memory-files.md +108 -0
- package/skills/proceed-with-the-recommendation.md +447 -0
- package/skills/ralph.md +221 -0
- package/skills/recovery-classification.md +73 -0
- package/skills/safety-guard.md +76 -0
- package/skills/state-reconciliation.md +63 -0
- package/skills/strategic-compact.md +104 -0
- package/skills/superpowers.md +219 -0
- package/skills/tdd-workflow.md +411 -0
- package/skills/token-budget-advisor.md +136 -0
- package/skills/verification-loop.md +224 -0
- package/skills/wild-risa-balance.md +191 -0
- package/skills/workspace-surface-audit.md +147 -0
- package/skills/worktree-safety.md +66 -0
- package/templates/insights-claude-md.md +91 -0
- package/templates/planning-with-files/findings.md +8 -0
- package/templates/planning-with-files/progress.md +7 -0
- package/templates/planning-with-files/task_plan.md +23 -0
- package/templates/verify-ladder.example.json +60 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workspace-surface-audit
|
|
3
|
+
tier: companion
|
|
4
|
+
description: "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."
|
|
5
|
+
origin: continuous-improvement
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Workspace Surface Audit
|
|
9
|
+
|
|
10
|
+
Read-only audit skill for answering the question "what can this workspace and machine actually do right now, and what should we add or enable next?"
|
|
11
|
+
|
|
12
|
+
This is the continuous-improvement answer to setup-audit plugins. It does not modify files unless the user explicitly asks for follow-up implementation.
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
- User says "set up Claude Code", "recommend automations", "what plugins or MCPs should I use?", or "what am I missing?"
|
|
17
|
+
- Auditing a machine or repo before installing more skills, hooks, or connectors
|
|
18
|
+
- Comparing official marketplace plugins against continuous-improvement coverage
|
|
19
|
+
- Reviewing `.env`, `.mcp.json`, plugin settings, or connected-app surfaces to find missing workflow layers
|
|
20
|
+
- Deciding whether a capability should be a skill, hook, agent, MCP, or external connector
|
|
21
|
+
|
|
22
|
+
## Non-Negotiable Rules
|
|
23
|
+
|
|
24
|
+
- Never print secret values. Surface only provider names, capability names, file paths, and whether a key or config exists.
|
|
25
|
+
- Prefer continuous-improvement workflows over generic "install another plugin" advice when continuous-improvement can reasonably own the surface.
|
|
26
|
+
- Treat external plugins as benchmarks and inspiration, not authoritative product boundaries.
|
|
27
|
+
- Separate three things clearly:
|
|
28
|
+
- already available now
|
|
29
|
+
- available but not wrapped well in continuous-improvement
|
|
30
|
+
- not available and would require a new integration
|
|
31
|
+
|
|
32
|
+
## Audit Inputs
|
|
33
|
+
|
|
34
|
+
Inspect only the files and settings needed to answer the question well:
|
|
35
|
+
|
|
36
|
+
1. **Repo surface**
|
|
37
|
+
- `package.json`, lockfiles, language markers, framework config, `README.md`
|
|
38
|
+
- `.mcp.json`, `.lsp.json`, `.claude/settings*.json`, `.codex/*`
|
|
39
|
+
- `AGENTS.md`, `CLAUDE.md`, install manifests, hook configs
|
|
40
|
+
2. **Environment surface**
|
|
41
|
+
- `.env*` files in the active repo and obvious adjacent continuous-improvement workspaces
|
|
42
|
+
- Surface only key names such as `STRIPE_API_KEY`, `TWILIO_AUTH_TOKEN`, `FAL_KEY`
|
|
43
|
+
3. **Connected tool surface**
|
|
44
|
+
- Installed plugins, enabled connectors, MCP servers, LSPs, and app integrations
|
|
45
|
+
4. **continuous-improvement surface**
|
|
46
|
+
- Existing skills, commands, hooks, agents, and install modules that already cover the need
|
|
47
|
+
|
|
48
|
+
## Audit Process
|
|
49
|
+
|
|
50
|
+
### Phase 1: Inventory What Exists
|
|
51
|
+
|
|
52
|
+
Produce a compact inventory:
|
|
53
|
+
|
|
54
|
+
- active harness targets
|
|
55
|
+
- installed plugins and connected apps
|
|
56
|
+
- configured MCP servers
|
|
57
|
+
- configured LSP servers
|
|
58
|
+
- env-backed services implied by key names
|
|
59
|
+
- existing continuous-improvement skills already relevant to the workspace
|
|
60
|
+
|
|
61
|
+
If a surface exists only as a primitive, call that out. Example:
|
|
62
|
+
|
|
63
|
+
- "Stripe is available via connected app, but continuous-improvement lacks a billing-operator skill"
|
|
64
|
+
- "Google Drive is connected, but there is no continuous-improvement-native Google Workspace operator workflow"
|
|
65
|
+
|
|
66
|
+
#### Environment Grain
|
|
67
|
+
|
|
68
|
+
Before any tool-class advice, capture the per-host facts that make commands either run or fail. The 28-day usage report's recurring "command failed / wrong approach" friction class roots almost entirely in this grain being unrecorded at session start — the agent reaches for `jq`, finds it missing, retries; reaches for bash chaining, hits PowerShell parser errors, retries; trusts a stale `pwd` after `tsc`, runs verification from the wrong directory, retries.
|
|
69
|
+
|
|
70
|
+
Probe and record (no destructive commands; quote results inline):
|
|
71
|
+
|
|
72
|
+
- **Shell flavor.** `echo $SHELL` on POSIX or `$PSVersionTable.PSEdition` on Windows; detect `bash`, `zsh`, `pwsh`, or `cmd`. PowerShell on Windows treats `&&`, `2>&1`, and quoting differently from bash; Git Bash on Windows is bash-shaped but lacks several POSIX utilities by default.
|
|
73
|
+
- **OS family + line endings.** `uname -s` (or PowerShell `$IsWindows`) plus `git config --get core.autocrlf`. On Windows with `core.autocrlf=true`, `git status` reports phantom modifications on every checked-out file — `git diff --stat` is the reliable change-set view.
|
|
74
|
+
- **jq availability.** `command -v jq` (or `Get-Command jq`). When jq is missing, observation-pipeline hooks fall back to a thin schema and curl/JSON one-liners need a node/python rewrite.
|
|
75
|
+
- **Case-sensitive filesystem.** Test by creating two paths differing only in case in a tempdir. NTFS (Windows) and APFS (macOS default) are case-insensitive; Linux ext4 and case-sensitive APFS are case-sensitive. Affects `CLAUDE.md` vs `claude.md` resolution and import paths.
|
|
76
|
+
- **CWD baseline.** `pwd` (or `Get-Location`) recorded at session start. `tsc`, build scripts, and some test runners change CWD as a side effect; subsequent commands run from the wrong directory return "deps not installed" or "config not found" misreads.
|
|
77
|
+
- **Parallel-actor expectation.** Document whether a second Claude / Codex / Maulana session may operate on the same working tree. If yes, the `gateguard` Parallel-Actor Gate must baseline `git rev-parse HEAD` + `git status --porcelain` + upstream before the first mutation, and re-check on every subsequent mutation.
|
|
78
|
+
|
|
79
|
+
Output the recorded grain as a single fenced block so it survives context compaction and any later phase can reference it without re-probing:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
shell-flavor: pwsh
|
|
83
|
+
os: windows-11 / autocrlf=true
|
|
84
|
+
jq: missing
|
|
85
|
+
case-sensitive: false
|
|
86
|
+
cwd-baseline: D:/Ai/continuous-improvement
|
|
87
|
+
parallel-actor: yes
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The fenced block is the contract surface — keep the field names stable so downstream skills (`gateguard`, `verification-loop`, future autonomous-release-train) can parse it without per-host special-casing.
|
|
91
|
+
|
|
92
|
+
### Phase 2: Benchmark Against Official and Installed Surfaces
|
|
93
|
+
|
|
94
|
+
Compare the workspace against:
|
|
95
|
+
|
|
96
|
+
- official Claude plugins that overlap with setup, review, docs, design, or workflow quality
|
|
97
|
+
- locally installed plugins in Claude or Codex
|
|
98
|
+
- the user's currently connected app surfaces
|
|
99
|
+
|
|
100
|
+
Do not just list names. For each comparison, answer:
|
|
101
|
+
|
|
102
|
+
1. what they actually do
|
|
103
|
+
2. whether continuous-improvement already has parity
|
|
104
|
+
3. whether continuous-improvement only has primitives
|
|
105
|
+
4. whether continuous-improvement is missing the workflow entirely
|
|
106
|
+
|
|
107
|
+
### Phase 3: Turn Gaps Into continuous-improvement Decisions
|
|
108
|
+
|
|
109
|
+
For every real gap, recommend the correct continuous-improvement-native shape:
|
|
110
|
+
|
|
111
|
+
| Gap Type | Preferred continuous-improvement Shape |
|
|
112
|
+
|----------|---------------------|
|
|
113
|
+
| Repeatable operator workflow | Skill |
|
|
114
|
+
| Automatic enforcement or side-effect | Hook |
|
|
115
|
+
| Specialized delegated role | Agent |
|
|
116
|
+
| External tool bridge | MCP server or connector |
|
|
117
|
+
| Install/bootstrap guidance | Setup or audit skill |
|
|
118
|
+
|
|
119
|
+
Default to user-facing skills that orchestrate existing tools when the need is operational rather than infrastructural.
|
|
120
|
+
|
|
121
|
+
## Output Format
|
|
122
|
+
|
|
123
|
+
Return five sections in this order:
|
|
124
|
+
|
|
125
|
+
1. **Current surface** — what is already usable right now
|
|
126
|
+
2. **Parity** — where continuous-improvement already matches or exceeds the benchmark
|
|
127
|
+
3. **Primitive-only gaps** — tools exist, but continuous-improvement lacks a clean operator skill
|
|
128
|
+
4. **Missing integrations** — capability not available yet
|
|
129
|
+
5. **Top 3-5 next moves** — concrete continuous-improvement-native additions, ordered by impact
|
|
130
|
+
|
|
131
|
+
## Recommendation Rules
|
|
132
|
+
|
|
133
|
+
- Recommend at most 1-2 highest-value ideas per category.
|
|
134
|
+
- Favor skills with obvious user intent and business value:
|
|
135
|
+
- setup audit
|
|
136
|
+
- billing/customer ops
|
|
137
|
+
- issue/program ops
|
|
138
|
+
- Google Workspace ops
|
|
139
|
+
- deployment/ops control
|
|
140
|
+
- If a connector is company-specific, recommend it only when it is genuinely available or clearly useful to the user's workflow.
|
|
141
|
+
- If continuous-improvement already has a strong primitive, propose a wrapper skill instead of inventing a brand-new subsystem.
|
|
142
|
+
|
|
143
|
+
## Good Outcomes
|
|
144
|
+
|
|
145
|
+
- The user can immediately see what is connected, what is missing, and what continuous-improvement should own next.
|
|
146
|
+
- Recommendations are specific enough to implement in the repo without another discovery pass.
|
|
147
|
+
- The final answer is organized around workflows, not API brands.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: worktree-safety
|
|
3
|
+
tier: "2"
|
|
4
|
+
description: "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."
|
|
5
|
+
origin: continuous-improvement
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Worktree Safety Skill
|
|
9
|
+
|
|
10
|
+
A pre-dispatch invariant. Before any tool call that writes source files or runs git, validate that the current working directory is a registered worktree with a healthy `.git`, owned by this session, on the expected branch.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- Before every Edit / Write / Bash that touches source code in a multi-worktree session.
|
|
15
|
+
- Before any `git` command in an auto-loop.
|
|
16
|
+
- After any pause/resume — CWD may have drifted, the worktree may have been pruned, the lease may have expired.
|
|
17
|
+
- When the verification ladder reports a class-`worktree` failure (see `recovery-classification`).
|
|
18
|
+
|
|
19
|
+
## Why This Skill Exists
|
|
20
|
+
|
|
21
|
+
GSD-2's [CONTEXT.md](https://github.com/gsd-build/gsd-2/blob/main/CONTEXT.md) names "Worktree Safety" as one of four runtime invariant modules. Common failure modes it catches:
|
|
22
|
+
|
|
23
|
+
- **Units dispatch into ghost / invalid worktree roots** — `.git` missing, fallback path-only creation, the worktree was pruned but the loop kept its handle.
|
|
24
|
+
- **Health checks unit-specific instead of lifecycle-wide** — earlier units (sketch, plan) write into invalid roots before any check runs.
|
|
25
|
+
- **Brittle exit / merge signals** — relying on artifact presence instead of authoritative branch and commit state.
|
|
26
|
+
- **Parallel actors mutating the working tree of a worktree they don't own** — a known hazard on this host (see `feedback_parallel_actor.md`).
|
|
27
|
+
|
|
28
|
+
The continuous-improvement repo runs on Windows + Git Bash with `autocrlf=true` and a parallel-actor expectation, both of which make weak worktree handling expensive.
|
|
29
|
+
|
|
30
|
+
## The Five-Check Envelope
|
|
31
|
+
|
|
32
|
+
Before any source-writing call, verify all five. Fail closed on any miss.
|
|
33
|
+
|
|
34
|
+
1. **Root validity** — `git rev-parse --show-toplevel` resolves; the resolved path matches CWD after symlink-safe canonicalization.
|
|
35
|
+
2. **`.git` presence** — `.git` exists (file pointer for worktrees, directory for primary checkout). A missing or unreadable `.git` is an immediate stop.
|
|
36
|
+
3. **Worktree registration** — `git worktree list` includes the resolved root with no `prunable` flag. Prunable worktrees can be deleted by another process at any moment.
|
|
37
|
+
4. **Branch alignment** — current branch matches the lease ledger; `HEAD` is not detached unless the unit explicitly asked for detached state.
|
|
38
|
+
5. **Lease ownership** — the session ID in `.git/worktrees/<name>/lease` (or your equivalent ledger) matches this session. Stale or foreign leases block the call.
|
|
39
|
+
|
|
40
|
+
Output a single fenced block before any source-writing dispatch:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
worktree-safety (resolved):
|
|
44
|
+
root: d:/Ai/ci-wt-skill-trio (matches CWD, canonicalized)
|
|
45
|
+
.git: file pointer → /shared/.git/worktrees/skill-trio (present)
|
|
46
|
+
registration: listed in `git worktree list` (not prunable)
|
|
47
|
+
branch: feat/verification-ladder-skill-trio (matches lease)
|
|
48
|
+
lease: owned by session 4f2a (this session) → CLEAR
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
If any line is non-`CLEAR`, dispatch is blocked and the failure routes to `recovery-classification` as class `worktree`.
|
|
52
|
+
|
|
53
|
+
## Anti-Patterns
|
|
54
|
+
|
|
55
|
+
- **Per-tool checks, not lifecycle checks.** Validating only at execute-task lets sketch / plan / research units write into invalid roots first.
|
|
56
|
+
- **Trusting CWD.** A `process.chdir` (or operator `cd`) in another loop iteration can leave CWD pointing at a pruned worktree. Re-resolve every time; do not cache.
|
|
57
|
+
- **Fallback-to-primary on worktree miss.** Silently writing to the primary checkout when the worktree is broken is the worst recovery — it corrupts the wrong branch with no audit trail.
|
|
58
|
+
- **Skipping lease ownership.** Two sessions in the same worktree race on every commit. The lease is the authoritative single-writer signal; do not skip it because "it's only one session" — that assumption breaks the moment a parallel actor appears.
|
|
59
|
+
- **Allowing detached HEAD silently.** A detached HEAD is sometimes legitimate (bisect, snapshot read), but every check must name whether detached is expected for this unit.
|
|
60
|
+
|
|
61
|
+
## Pairs With
|
|
62
|
+
|
|
63
|
+
- [verification-loop](verification-loop.md) — runs as a pre-Phase-0 invariant; the resolved-safety block fires before the resolved-ladder block.
|
|
64
|
+
- [state-reconciliation](state-reconciliation.md) — both fire before dispatch; safety runs first because reconciliation depends on a valid worktree root.
|
|
65
|
+
- [recovery-classification](recovery-classification.md) — any non-`CLEAR` line routes here as class `worktree`.
|
|
66
|
+
- [gateguard](gateguard.md) — gateguard fires at the tool boundary; worktree-safety is the lifecycle counterpart that runs before tool dispatch is even considered.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# insights-claude-md.md — paste-in CLAUDE.md blocks
|
|
2
|
+
|
|
3
|
+
The four blocks below originate from the 28-day Claude Code usage report (`usage-data/report.html`, "Suggested CLAUDE.md Additions" section). Each block targets a recurring friction class the report flagged:
|
|
4
|
+
|
|
5
|
+
- **Verification Discipline** — sessions where typecheck/test was skipped or run from the wrong CWD
|
|
6
|
+
- **Environment Notes** — Windows + Git Bash + PowerShell mismatches that cost retries
|
|
7
|
+
- **Think Before Acting** — sessions where edits started before grounding was complete
|
|
8
|
+
- **Git & Deploy Workflow** — merge declared "done" while the deploy provider was still on a stale commit
|
|
9
|
+
|
|
10
|
+
The discipline behavior is already encoded as continuous-improvement skills (`gateguard`, `workspace-surface-audit`, `verification-loop`, `deploy-receipt`). These blocks are the *project-local* CLAUDE.md text — the per-repo reminder that lives where developers actually look when they read `CLAUDE.md`. Skills enforce; CLAUDE.md communicates.
|
|
11
|
+
|
|
12
|
+
## How to use this file
|
|
13
|
+
|
|
14
|
+
1. Open the target project's `CLAUDE.md`.
|
|
15
|
+
2. Pick the blocks that apply to that project (TypeScript projects probably want all four; library-only projects can skip the deploy block).
|
|
16
|
+
3. Paste them under existing sections or as new top-level sections.
|
|
17
|
+
4. Adjust placeholders — the report's wording is opinionated. `pnpm` is just an example; if the project uses `npm` or `yarn` or `bun`, swap it. If the project's deploy target is not Railway or Cloudflare, swap those names. The structure stays; the specifics adapt.
|
|
18
|
+
5. Optionally lock the section headings under `bin/check-docs-substrings.mjs` so a wholesale CLAUDE.md rewrite doesn't silently drop the discipline contract.
|
|
19
|
+
|
|
20
|
+
The blocks are paste-in markdown — copy them verbatim into your project's CLAUDE.md.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Block 1 — Verification Discipline
|
|
25
|
+
|
|
26
|
+
Paste under a "Working norms" or "Coding standards" section. Adjust `pnpm` → your package manager.
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
## Verification Discipline
|
|
30
|
+
- Always run `pnpm typecheck` and `pnpm test` after code changes before declaring done
|
|
31
|
+
- Run verification commands from the repo root; verify CWD with `pwd` if a previous command may have changed it
|
|
32
|
+
- Never claim 'verified' or 'done' without showing the passing output
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Why this block: the report flagged sessions where Claude either skipped typecheck/test until the operator prompted, or ran `tsc` from `frontend/` and incorrectly concluded deps weren't installed. The CWD line addresses the second failure mode directly.
|
|
36
|
+
|
|
37
|
+
## Block 2 — Environment Notes
|
|
38
|
+
|
|
39
|
+
Paste under a "Local development" or "Environment" section. Adjust the shell + tool list to match the project's actual setup.
|
|
40
|
+
|
|
41
|
+
```markdown
|
|
42
|
+
## Environment Notes
|
|
43
|
+
- Shell is Git Bash on Windows; do NOT use `jq` (not installed) — use PowerShell or node/python for JSON parsing
|
|
44
|
+
- Be careful with bash quoting in curl/psql commands; prefer heredocs or files over inline single-quoted JSON
|
|
45
|
+
- CLAUDE.md is case-sensitive on some filesystems — always use uppercase
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Why this block: the report flagged repeated jq-not-installed retries, shell-quoting failures on curl/psql, and a Windows case-sensitivity issue with `CLAUDE.md` vs `claude.md`. If your environment is different (macOS + zsh, Linux + bash, WSL2), rewrite this block to name *your* environment's grain — the goal is to surface the per-project gotchas before the agent re-discovers them at a cost of one wasted retry each.
|
|
49
|
+
|
|
50
|
+
## Block 3 — Think Before Acting
|
|
51
|
+
|
|
52
|
+
Paste near the top of CLAUDE.md, ideally above any task-specific instructions.
|
|
53
|
+
|
|
54
|
+
```markdown
|
|
55
|
+
## Think Before Acting
|
|
56
|
+
- For any non-trivial request, produce a short plan before editing files
|
|
57
|
+
- When the user references prior work (e.g. 'the Finnhub stuff'), verify it exists in the repo before acting on the assumption
|
|
58
|
+
- Use TDD for new features: write failing test, then code, then verify
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Why this block: the operator literally had to type "you need to think before u response" mid-session, and a separate session was wasted verifying nonexistent "Finnhub work" that was only used as a framework analogy. The first bullet generalizes the "plan first" rule from the global CLAUDE.md; the second is project-local — if your project has its own analogy-vs-real-code traps, name them here.
|
|
62
|
+
|
|
63
|
+
## Block 4 — Git & Deploy Workflow
|
|
64
|
+
|
|
65
|
+
Paste under a "Git workflow" or "Release process" section. Adjust the deploy provider names to match your project.
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
## Git & Deploy Workflow
|
|
69
|
+
- Never push directly to main — use PR workflow; harness will block direct pushes
|
|
70
|
+
- After merging, verify Railway/Cloudflare actually picked up the commit before declaring deploy complete
|
|
71
|
+
- For production POSTs and wrangler tail, expect harness blocks and surface them as caveats requiring user action
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Why this block: multiple sessions hit "Railway deploy didn't pick up the latest commit" or "harness blocked merge-to-main / production POST / wrangler" — pre-emptive awareness saves retry cycles. The second bullet is what `deploy-receipt` enforces in-tooling; this CLAUDE.md text makes the same expectation visible to humans reviewing PRs.
|
|
75
|
+
|
|
76
|
+
If your project deploys somewhere other than Railway or Cloudflare, swap those names. If your project does NOT auto-deploy from main (library-only / package-published), drop the second bullet entirely — receipt verification doesn't apply.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Companion skills (already installed if you have continuous-improvement)
|
|
81
|
+
|
|
82
|
+
Each block has a corresponding skill that enforces the rule when an agent is in the loop. Pasting the block tells humans the rule; installing the skill makes the agent obey it.
|
|
83
|
+
|
|
84
|
+
| Block | Companion skill |
|
|
85
|
+
|---|---|
|
|
86
|
+
| Verification Discipline | `verification-loop` (per-project ladder via `.claude/verify-ladder.json`) |
|
|
87
|
+
| Environment Notes | `workspace-surface-audit` (records environment grain at session start) |
|
|
88
|
+
| Think Before Acting | `gateguard` (blocks Edit/Write/Bash before grounding) |
|
|
89
|
+
| Git & Deploy Workflow | `deploy-receipt` (verifies deployed SHA + healthcheck before declaring done) |
|
|
90
|
+
|
|
91
|
+
If you want both layers (CLAUDE.md text + skill enforcement), paste the block AND keep the skill installed. If you only want one, the skill is the higher-fidelity surface — it runs at the tool boundary and cannot be skipped by an agent that didn't read the markdown.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Task Plan
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
{{goal}}
|
|
5
|
+
|
|
6
|
+
## Status
|
|
7
|
+
{{status}}
|
|
8
|
+
|
|
9
|
+
## Phases
|
|
10
|
+
{{phases}}
|
|
11
|
+
|
|
12
|
+
## Key Questions
|
|
13
|
+
- [ ] What existing implementation or context should be reviewed first?
|
|
14
|
+
- [ ] What constraints or risks need validation before execution?
|
|
15
|
+
- [ ] What verification proves the task is complete?
|
|
16
|
+
|
|
17
|
+
## Decisions Made
|
|
18
|
+
- None yet.
|
|
19
|
+
|
|
20
|
+
## Errors Encountered
|
|
21
|
+
| Error | Attempt | Resolution |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| None yet | - | - |
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_doc": [
|
|
3
|
+
"Per-project verification ladder for the verification-loop skill.",
|
|
4
|
+
"Copy this file to .claude/verify-ladder.json at your repo root and trim per project.",
|
|
5
|
+
"Phase 0 of verification-loop reads this manifest first, then sniffs package.json scripts,",
|
|
6
|
+
"then per-language toolchain files (Cargo.toml, go.mod, pyproject.toml, etc.), then asks.",
|
|
7
|
+
"Set any field to the literal null to skip that phase for this project.",
|
|
8
|
+
"",
|
|
9
|
+
"Three starter shapes are provided below — pick one, delete the others, then trim."
|
|
10
|
+
],
|
|
11
|
+
|
|
12
|
+
"_synthetic_checks_doc": [
|
|
13
|
+
"synthetic_checks names a directory (relative to the repo root) containing",
|
|
14
|
+
"*.synthetic.{sh,mjs,ts,py} files. Each file is invoked once after deploy-receipt",
|
|
15
|
+
"reports COMPLETE, with BASE_URL + BASELINE_URL + EXPECTED_SHA env vars set.",
|
|
16
|
+
"Exit 0 = production matches baseline; non-zero = drift, stdout is the diff.",
|
|
17
|
+
"Set to null to skip; set to a different path (e.g. 'infra/synthetic/') to relocate.",
|
|
18
|
+
"See synthetic-checks/README.md for the full contract."
|
|
19
|
+
],
|
|
20
|
+
|
|
21
|
+
"_typescript_node_example": {
|
|
22
|
+
"build": "npm run build",
|
|
23
|
+
"typecheck": "npx tsc --noEmit",
|
|
24
|
+
"lint": "npm run lint",
|
|
25
|
+
"test": "npm test",
|
|
26
|
+
"security": "npm audit --audit-level=high",
|
|
27
|
+
"deploy_receipt": null,
|
|
28
|
+
"synthetic_checks": null
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
"_rust_cargo_example": {
|
|
32
|
+
"build": "cargo build --release",
|
|
33
|
+
"typecheck": "cargo check --all-targets",
|
|
34
|
+
"lint": "cargo clippy --all-targets -- -D warnings",
|
|
35
|
+
"test": "cargo test --all-features",
|
|
36
|
+
"security": "cargo audit",
|
|
37
|
+
"deploy_receipt": null,
|
|
38
|
+
"synthetic_checks": null
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
"_python_uv_example": {
|
|
42
|
+
"build": null,
|
|
43
|
+
"typecheck": "uv run pyright",
|
|
44
|
+
"lint": "uv run ruff check .",
|
|
45
|
+
"test": "uv run pytest",
|
|
46
|
+
"security": "uv run pip-audit",
|
|
47
|
+
"deploy_receipt": null,
|
|
48
|
+
"synthetic_checks": null
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
"_cloudflare_worker_example": {
|
|
52
|
+
"build": "npm run build",
|
|
53
|
+
"typecheck": "npx tsc --noEmit",
|
|
54
|
+
"lint": "npm run lint",
|
|
55
|
+
"test": "npm test",
|
|
56
|
+
"security": "npm audit --audit-level=high",
|
|
57
|
+
"deploy_receipt": "npx wrangler deployments list --json",
|
|
58
|
+
"synthetic_checks": "synthetic-checks/"
|
|
59
|
+
}
|
|
60
|
+
}
|