@thebassclef/lite 1.1.1 → 1.2.0
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/dist/cli.cjs +23 -6
- package/dist/cli.js +23 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lite/.claude/bassclef-configs.jsonc +56 -0
- package/dist/lite/.claude/bassclef-orientation.md +120 -0
- package/dist/lite/.claude/hooks/adr-discipline-check.sh +132 -0
- package/dist/lite/.claude/hooks/atomic-pr-check.sh +169 -0
- package/dist/lite/.claude/hooks/auto-save-idle.sh +51 -0
- package/dist/lite/.claude/hooks/bassclef-sync.sh +51 -13
- package/dist/lite/.claude/hooks/bet-doc-gate.sh +283 -0
- package/dist/lite/.claude/hooks/bug-diagnosis.sh +64 -0
- package/dist/lite/.claude/hooks/destructive-command-guard.sh +136 -0
- package/dist/lite/.claude/hooks/file-rename-discipline-check.sh +147 -0
- package/dist/lite/.claude/hooks/hook-classifier-canary.sh +158 -0
- package/dist/lite/.claude/hooks/kiss-default-check.sh +129 -0
- package/dist/lite/.claude/hooks/multi-tenancy-check.sh +83 -0
- package/dist/lite/.claude/hooks/oo-ad-entry-point-check.sh +216 -0
- package/dist/lite/.claude/hooks/operator-private-path-check.sh +203 -0
- package/dist/lite/.claude/hooks/pattern-annotation-validate.sh +142 -0
- package/dist/lite/.claude/hooks/plain-english-steering.sh +15 -1
- package/dist/lite/.claude/hooks/post-write-trace.sh +66 -0
- package/dist/lite/.claude/hooks/pr-body-scrub-check.sh +446 -0
- package/dist/lite/.claude/hooks/pre-commit-identifier-leak-scrub.sh +137 -0
- package/dist/lite/.claude/hooks/pre-gh-pr-body-scrub.sh +192 -0
- package/dist/lite/.claude/hooks/pre-gh-pr-title-scrub.sh +172 -0
- package/dist/lite/.claude/hooks/role-entry-gate.sh +115 -0
- package/dist/lite/.claude/hooks/save-state.sh +268 -0
- package/dist/lite/.claude/hooks/session-reflection.d/08-settings-drift.sh +8 -1
- package/dist/lite/.claude/hooks/session-reflection.d/10-abrupt-stop-recovery.sh +52 -0
- package/dist/lite/.claude/hooks/session-reflection.d/55-orientation-gate.sh +40 -4
- package/dist/lite/.claude/hooks/session-reflection.d/80-hook-heartbeat-check.sh +12 -5
- package/dist/lite/.claude/hooks/session-reflection.d/81-hook-manifest-staleness.sh +18 -2
- package/dist/lite/.claude/hooks/session-reflection.d/91-npm-version-drift.sh +54 -0
- package/dist/lite/.claude/hooks/session-reflection.d/tests/10-abrupt-stop-recovery.test.sh +95 -0
- package/dist/lite/.claude/hooks/session-reflection.sh +62 -15
- package/dist/lite/.claude/hooks/tool-failure-diagnosis.sh +50 -0
- package/dist/lite/.claude/luminaries/andrej-karpathy.md +165 -0
- package/dist/lite/.claude/luminaries/dave-gray.md +155 -0
- package/dist/lite/.claude/luminaries/gary-klein.md +166 -0
- package/dist/lite/.claude/luminaries/kaoru-ishikawa.md +162 -0
- package/dist/lite/.claude/luminaries/lean-product-canvas.md +33 -0
- package/dist/lite/.claude/luminaries/luke-wroblewski.md +224 -0
- package/dist/lite/.claude/luminaries/ryan-singer.md +113 -0
- package/dist/lite/.claude/luminaries/steve-krug.md +168 -0
- package/dist/lite/.claude/luminaries/tony-ulwick.md +134 -0
- package/dist/lite/.claude/rules/arc-level-orientation-before-leaf.md +60 -0
- package/dist/lite/.claude/rules/architect-review-discipline.md +71 -0
- package/dist/lite/.claude/rules/auto-fix-criteria.md +126 -0
- package/dist/lite/.claude/rules/bassclef-hook-drift-blocker.md +144 -0
- package/dist/lite/.claude/rules/bassclef-models-discovery.md +107 -0
- package/dist/lite/.claude/rules/bassclef-workflow-parity.md +104 -0
- package/dist/lite/.claude/rules/cost-governance.md +154 -0
- package/dist/lite/.claude/rules/file-rename-discipline.md +95 -0
- package/dist/lite/.claude/rules/mechanism-fidelity.md +88 -0
- package/dist/lite/.claude/rules/prototype-production-coupling.md +125 -0
- package/dist/lite/.claude/rules/quick-fix-criteria.md +90 -0
- package/dist/lite/.claude/rules/session-artifacts.md +30 -0
- package/dist/lite/.claude/rules/sibling-smoke-after-substrate-change.md +107 -0
- package/dist/lite/.claude/rules/substrate-as-system.md +67 -0
- package/dist/lite/.claude/rules/usability.md +22 -0
- package/dist/lite/.claude/settings.json +20 -0
- package/dist/lite/.claude/skills/agent-research-spawn/SKILL.md +100 -0
- package/dist/lite/.claude/skills/architect-review/SKILL.md +201 -0
- package/dist/lite/.claude/skills/auto-fix/SKILL.md +297 -0
- package/dist/lite/.claude/skills/autonomous/SKILL.md +300 -0
- package/dist/lite/.claude/skills/bind-subdomain/SKILL.md +232 -0
- package/dist/lite/.claude/skills/canvas/SKILL.md +41 -0
- package/dist/lite/.claude/skills/deploy-prod/SKILL.md +106 -0
- package/dist/lite/.claude/skills/docs-sync/SKILL.md +188 -0
- package/dist/lite/.claude/skills/eisenhower/SKILL.md +273 -0
- package/dist/lite/.claude/skills/empathy-map/SKILL.md +168 -0
- package/dist/lite/.claude/skills/frontend-design/SKILL.md +53 -0
- package/dist/lite/.claude/skills/interview-me/SKILL.md +171 -0
- package/dist/lite/.claude/skills/journal-export/SKILL.md +293 -0
- package/dist/lite/.claude/skills/jtbd-tasks/SKILL.md +203 -0
- package/dist/lite/.claude/skills/objectory-decompose/SKILL.md +256 -0
- package/dist/lite/.claude/skills/pick-luminaries/SKILL.md +100 -0
- package/dist/lite/.claude/skills/pre-mortem/SKILL.md +180 -0
- package/dist/lite/.claude/skills/prototype-gallery/SKILL.md +264 -0
- package/dist/lite/.claude/skills/provision-deploy-host/SKILL.md +257 -0
- package/dist/lite/.claude/skills/quick-fix/SKILL.md +273 -0
- package/dist/lite/.claude/skills/release/SKILL.md +311 -0
- package/dist/lite/.claude/skills/release-notes/SKILL.md +202 -0
- package/dist/lite/.claude/skills/rfc/SKILL.md +222 -0
- package/dist/lite/.claude/skills/riff-prototypes/SKILL.md +637 -0
- package/dist/lite/.claude/skills/secrets-bootstrap/SKILL.md +209 -0
- package/dist/lite/.claude/skills/skill/SKILL.md +304 -0
- package/dist/lite/.claude/skills/smoke-test/SKILL.md +100 -0
- package/dist/lite/.claude/skills/state/SKILL.md +204 -0
- package/dist/lite/.claude/skills/substrate-check/SKILL.md +218 -0
- package/dist/lite/.claude/skills/synthetic-user/SKILL.md +381 -0
- package/dist/lite/.claude/skills/task-scenarios/SKILL.md +105 -0
- package/dist/lite/.claude/skills/tier-dependency-audit/SKILL.md +139 -0
- package/dist/lite/.claude/skills/ux-migration/SKILL.md +424 -0
- package/dist/lite/.claude/skills/value-prop-canvas/SKILL.md +297 -0
- package/dist/lite/README.md +5 -1
- package/dist/lite/gitignore +6 -0
- package/dist/lite/lib/bassclef-dir-resolver.sh +85 -0
- package/dist/lite/lib/clone-failure-classifier.sh +59 -0
- package/dist/lite/lib/fixture-builder.sh +190 -0
- package/dist/lite/lib/fresh-install-check.sh +49 -0
- package/dist/lite/lib/hook-heartbeat.sh +0 -1
- package/dist/lite/lib/mechanism-fidelity.sh +569 -0
- package/dist/lite/lib/npm-version-check.sh +112 -0
- package/dist/lite/lib/preview-state.sh +229 -0
- package/dist/lite/lib/session-rescue.sh +0 -1
- package/dist/lite/scripts/generate-lite-manifest.sh +145 -4
- package/dist/lite/scripts/lite-manifest-drift-check.sh +5 -1
- package/dist/lite/standards/architect-review-discipline.md +222 -0
- package/dist/lite/standards/bassclef-platform.md +249 -0
- package/dist/lite/standards/bassclef-test-repos.md +97 -0
- package/dist/lite/standards/bassclef-wiring-manifest.json +25 -1
- package/dist/lite/standards/cold-adopter-harness.md +205 -0
- package/dist/lite/standards/data-management.md +135 -0
- package/dist/lite/standards/frontend-stack/nextjs-prisma.md +124 -0
- package/dist/lite/standards/lite-manifest-schema-changes.md +27 -0
- package/dist/lite/standards/lite-manifest.json +1456 -14
- package/dist/lite/standards/mechanism-fidelity.md +205 -0
- package/dist/lite/standards/operator-private-discipline.md +200 -0
- package/dist/lite/standards/operator-to-public-flow.md +195 -0
- package/dist/lite/standards/prototype-gallery.md +251 -0
- package/dist/lite/standards/pseudonym-key-schema.md +109 -0
- package/dist/lite/standards/sibling-validation-checklist.md +181 -0
- package/dist/lite/standards/slack-notifications.md +161 -0
- package/dist/lite/standards/synthetic-user-testing.md +173 -0
- package/dist/lite/standards/vendor-bindings.md +165 -0
- package/dist/lite/standards/vendor-plugins/frontend-design.md +66 -0
- package/dist/lite/standards/vpc-fit-validation.md +167 -0
- package/dist/lite/templates/gallery-yml.md +113 -0
- package/dist/lite/templates/product-canvas.md +169 -0
- package/dist/lite/templates/value-prop-canvas.md +180 -0
- package/package.json +3 -3
- /package/dist/lite/{whereami.md → docs/whereami.md} +0 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
---
|
|
2
|
+
tier: lite
|
|
3
|
+
name: state
|
|
4
|
+
description: "Inspect bassclef's saved state \u2014 get, list, count, or validate entries via lib/state.sh. Read-only. Writes happen through dedicated skills like /session-end and /chronicle."
|
|
5
|
+
problem: "Bassclef's saved state lives in state markers and JSON files. Read-only access is scattered."
|
|
6
|
+
value: "Inspects bassclef's saved state \u2014 get or list or count or validate entries via lib/state.sh."
|
|
7
|
+
inputs: [Verb — get or list or count or validate, Entity type and optional slug]
|
|
8
|
+
outputs: [State entry values, List of entries per type, Count, Validation report]
|
|
9
|
+
user_invocable: true
|
|
10
|
+
disable_model_invocation: false
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# /state — Ad-hoc state inspection
|
|
14
|
+
|
|
15
|
+
Operator-facing surface over `lib/state.sh` accessors. Answers: "what
|
|
16
|
+
does the spine show right now for entity X?" without spawning a heavier
|
|
17
|
+
skill. Read-only.
|
|
18
|
+
|
|
19
|
+
The skill is a thin dispatcher to `scripts/state.sh` (the CLI wrapper)
|
|
20
|
+
and `lib/state.sh` (the typed accessor library). Mutations live
|
|
21
|
+
elsewhere: `/session-end` writes whereami; `/chronicle` writes
|
|
22
|
+
chronicles; deferred-actions resolve via `git mv` per their own
|
|
23
|
+
protocol. This skill never writes.
|
|
24
|
+
|
|
25
|
+
## When to invoke
|
|
26
|
+
|
|
27
|
+
- Mid-session orientation: "what goal is active?" → `/state get iteration_bet active`
|
|
28
|
+
- Spot-check: "did the deferred-actions list rot?" → `/state list deferred_action`
|
|
29
|
+
- Audit: "how many gate markers fired?" → `/state count marker`
|
|
30
|
+
- Manual validation: "does this artifact validate against its schema?" → `/state validate <path>`
|
|
31
|
+
- New-skill scaffolding: "what's the shape of a Chronicle entity?" → `/state get chronicle <id>`
|
|
32
|
+
|
|
33
|
+
## What this skill is NOT
|
|
34
|
+
|
|
35
|
+
| Skill | Altitude | Output |
|
|
36
|
+
|-------|----------|--------|
|
|
37
|
+
| `/state` | **Spine inspection** | Typed entity data (read-only) |
|
|
38
|
+
| `/whereami` | Project state snapshot | Phase + iteration + freshness |
|
|
39
|
+
| `/sprint` | Ticket/scope level | Open issues, proposed next sprint |
|
|
40
|
+
| `/substrate-check` | Wiring validation | Symlinks, hooks, CLIs, CLAUDE.md health |
|
|
41
|
+
|
|
42
|
+
`/whereami` reads ONE entity (the singleton); `/state get whereami`
|
|
43
|
+
delivers the same data through the spine. Use `/whereami` for the
|
|
44
|
+
rendered narrative view, `/state` for the typed JSON.
|
|
45
|
+
|
|
46
|
+
## Procedure
|
|
47
|
+
|
|
48
|
+
The skill dispatches to `scripts/state.sh <subcommand> [args]` which
|
|
49
|
+
sources `lib/state.sh` and calls the appropriate `state_*` accessor.
|
|
50
|
+
Output is piped through `jq .` for pretty-printing JSON results;
|
|
51
|
+
scalars (counts) print raw.
|
|
52
|
+
|
|
53
|
+
### `/state get <entity> [<id>]`
|
|
54
|
+
|
|
55
|
+
Returns a single entity. For singletons (whereami, substrate-config),
|
|
56
|
+
no id is required. For collections (iteration_bet, marker, chronicle,
|
|
57
|
+
deferred_action, session, stack, roadmap, decomposition, persona, adr),
|
|
58
|
+
`<id>` is the slug/uuid/identifier.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
bash scripts/state.sh get whereami
|
|
62
|
+
bash scripts/state.sh get iteration_bet 2026-04-27-state-spine-v0
|
|
63
|
+
bash scripts/state.sh get iteration_bet active # special: active goal
|
|
64
|
+
bash scripts/state.sh get marker <uuid>
|
|
65
|
+
bash scripts/state.sh get chronicle 2026-04-27b-spine-v0-WU-1
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Exit code 0 = found; exit 1 = not found (empty stdout); exit 2 = bad
|
|
69
|
+
args (stderr message).
|
|
70
|
+
|
|
71
|
+
### `/state list <entity> [<filter>]`
|
|
72
|
+
|
|
73
|
+
Returns a JSON array of entities. Empty array `[]` if none found.
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
bash scripts/state.sh list iteration_bet
|
|
77
|
+
bash scripts/state.sh list deferred_action # default: pending
|
|
78
|
+
bash scripts/state.sh list deferred_action completed # completed only
|
|
79
|
+
bash scripts/state.sh list deferred_action all # both
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### `/state count <entity> [<filter>]`
|
|
83
|
+
|
|
84
|
+
Returns an integer count.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
bash scripts/state.sh count marker # all markers
|
|
88
|
+
bash scripts/state.sh count marker temperance # category filter
|
|
89
|
+
bash scripts/state.sh count iteration_bet # all bets
|
|
90
|
+
bash scripts/state.sh count deferred_action pending # pending only
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### `/state validate <path>`
|
|
94
|
+
|
|
95
|
+
Validates a state-spine file against its entity schema by invoking
|
|
96
|
+
`.claude/hooks/state-validate.sh` with a synthesized PreToolUse event.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
bash scripts/state.sh validate docs/whereami.json
|
|
100
|
+
bash scripts/state.sh validate docs/iteration-bets/2026-04-27-state-spine-v0.md
|
|
101
|
+
bash scripts/state.sh validate chronicle/2026-04-27b-spine-v0-WU-1.md
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Exit code 0 = validates clean (or legacy pass-through); 3 = schema
|
|
105
|
+
violation (structured BLOCK on stderr); 4 = file or hook missing.
|
|
106
|
+
|
|
107
|
+
### `/state help`
|
|
108
|
+
|
|
109
|
+
Lists supported entity / verb pairs and points at the contract:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
bash scripts/state.sh help
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Supported entity / verb matrix (v0)
|
|
116
|
+
|
|
117
|
+
| Entity | get | list | count | validate (via path) |
|
|
118
|
+
|---|---|---|---|---|
|
|
119
|
+
| whereami (singleton) | ✓ | n/a | n/a | ✓ (`docs/whereami.json`) |
|
|
120
|
+
| iteration_bet | ✓ (incl. `active`) | ✓ | derived from list | ✓ |
|
|
121
|
+
| stack | via reference resolver | — | — | ✓ |
|
|
122
|
+
| chronicle | via reference resolver | — | — | ✓ |
|
|
123
|
+
| marker | ✓ | — | ✓ (with category filter) | ✓ |
|
|
124
|
+
| deferred_action | via list filter | ✓ (pending/completed/all) | derived from list | ✓ |
|
|
125
|
+
| session | via reference resolver | — | — | ✓ |
|
|
126
|
+
| decomposition | via reference resolver | — | — | ✓ |
|
|
127
|
+
| persona | via reference resolver | — | — | ✓ |
|
|
128
|
+
| roadmap | via reference resolver | — | — | ✓ |
|
|
129
|
+
| adr | via reference resolver | — | — | n/a (markdown without frontmatter) |
|
|
130
|
+
| discovery | via reference resolver | — | — | ✓ |
|
|
131
|
+
|
|
132
|
+
`reference` is the universal resolver: `bash scripts/state.sh get reference <type> <id>`
|
|
133
|
+
returns whatever entity type is named. This covers entity types where
|
|
134
|
+
a dedicated `_get` accessor is not yet implemented.
|
|
135
|
+
|
|
136
|
+
## What `/state` does NOT support (deferred)
|
|
137
|
+
|
|
138
|
+
- **Mutation verbs** (`add`, `set`, `update_status`, `render`) — those
|
|
139
|
+
go through dedicated skills or accessor calls in scripts; exposing
|
|
140
|
+
them via `/state` would create a second mutation surface contradicting
|
|
141
|
+
this skill's read-only contract
|
|
142
|
+
- **Per-entity `list` for entities without dedicated accessors**
|
|
143
|
+
(chronicle, session, stack, etc.) — defer to spine v1 once usage
|
|
144
|
+
signal motivates per-entity list accessors; for now `find` + the
|
|
145
|
+
reference resolver covers the rare case
|
|
146
|
+
- **Filter expressions beyond category/scope** — full query language
|
|
147
|
+
is out of v0 scope; if N consumers need it, file a /promote
|
|
148
|
+
|
|
149
|
+
## Rules
|
|
150
|
+
|
|
151
|
+
- **Read-only.** This skill never writes. If an operator asks the agent
|
|
152
|
+
to mutate state via `/state`, redirect to the appropriate dedicated
|
|
153
|
+
skill (`/session-end` for whereami, `/chronicle` for chronicles, etc.).
|
|
154
|
+
- **No inventing accessors.** If the requested verb-entity pair isn't
|
|
155
|
+
in the matrix above, say so and point to the reference resolver or
|
|
156
|
+
to filing a /promote for the gap. Do not silently grep around the
|
|
157
|
+
spine.
|
|
158
|
+
- **Schema is the contract.** When `/state validate` BLOCKs, the BLOCK
|
|
159
|
+
message names the schema field that failed; report it verbatim. Do
|
|
160
|
+
not paraphrase or downgrade the failure.
|
|
161
|
+
- **Replay-determinism preserved.** All `state_*_count` accessors derive
|
|
162
|
+
from history on every call (no cached state). The skill MUST NOT add
|
|
163
|
+
caching layers between operator input and accessor output.
|
|
164
|
+
|
|
165
|
+
## Skipping / Aborting
|
|
166
|
+
|
|
167
|
+
- If the entity directory doesn't exist (e.g., fresh repo with no
|
|
168
|
+
iteration-bets/), the accessor returns empty array `[]` or count 0.
|
|
169
|
+
Report cleanly; do not invent state.
|
|
170
|
+
- If the accessor is not yet implemented for the requested verb-entity
|
|
171
|
+
pair, return a clear error pointing at the matrix above.
|
|
172
|
+
- If `state-validate.sh` hook is missing or not executable, `/state
|
|
173
|
+
validate` returns exit 4; report that the spine v0 wiring is
|
|
174
|
+
incomplete and point at the bassclef-sync hook.
|
|
175
|
+
|
|
176
|
+
## Relationship to other skills + standards
|
|
177
|
+
|
|
178
|
+
- `lib/state.sh` — the typed accessor library this skill dispatches to
|
|
179
|
+
- `scripts/state.sh` — the CLI wrapper this skill invokes (argv → accessor)
|
|
180
|
+
- `standards/state-spine.md` — entity catalog + storage shapes
|
|
181
|
+
- `standards/state-spine-contract.md` — accessor surface (what verbs +
|
|
182
|
+
modifiers exist)
|
|
183
|
+
- `.claude/rules/accessor-library-discipline.md` — paired discipline rule;
|
|
184
|
+
this skill IS one of the consumers that goes through the accessor
|
|
185
|
+
- `.claude/hooks/state-validate.sh` — wired PreToolUse hook; `/state
|
|
186
|
+
validate <path>` invokes it directly
|
|
187
|
+
- `/whereami` — uses Whereami singleton; `/state` exposes the same data
|
|
188
|
+
as typed JSON
|
|
189
|
+
- `/sprint` — composes whereami + iteration_bet; `/state` exposes the
|
|
190
|
+
same primitives at a lower altitude
|
|
191
|
+
|
|
192
|
+
## Enforcement
|
|
193
|
+
|
|
194
|
+
Methodology-level. The skill is registered via bassclef-sync symlink
|
|
195
|
+
(automatic per substrate distribution). No hook enforcement added by
|
|
196
|
+
this skill — read-only inspection requires no gate.
|
|
197
|
+
|
|
198
|
+
The reserved-skill-names check passes: `state` is NOT on the harness
|
|
199
|
+
built-in list per `standards/reserved-skill-names.md` (verified during
|
|
200
|
+
spine v0 goal shape).
|
|
201
|
+
|
|
202
|
+
## Output discipline
|
|
203
|
+
|
|
204
|
+
Dispatch `/kiss words --rewrite` on your skill output before you return it. See `standards/skill-output-discipline.md` for the contract.
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
---
|
|
2
|
+
tier: lite
|
|
3
|
+
name: substrate-check
|
|
4
|
+
description: "Check the bassclef wiring in this repo. Validates files, skills, hooks, CLIs, git remote, CLAUDE.md, and session dirs. Use before a fresh session. Use after a new setup. Renamed from /self-test on 2026-04-15."
|
|
5
|
+
problem: "Bassclef wiring drifts across environments. Broken files and missing hooks get discovered mid-session."
|
|
6
|
+
value: "Checks the bassclef wiring in this repo. Validates files and hooks and CLIs and git remote."
|
|
7
|
+
inputs: [Optional --verbose flag]
|
|
8
|
+
outputs: [8 check results with PASS/WARN/FAIL, Warnings list, Overall status]
|
|
9
|
+
user_invocable: true
|
|
10
|
+
disable_model_invocation: false
|
|
11
|
+
requires:
|
|
12
|
+
cli: [git, gh, node, npx]
|
|
13
|
+
network: true
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Substrate Self-Test
|
|
17
|
+
|
|
18
|
+
A 30-second check that validates the full substrate chain. Run it before
|
|
19
|
+
a fresh session. Run it after a new setup. Run it when something feels
|
|
20
|
+
broken.
|
|
21
|
+
|
|
22
|
+
## When to invoke
|
|
23
|
+
|
|
24
|
+
- Before `/autonomous start` in a new environment
|
|
25
|
+
- After `boot-bassclef.sh` or manual substrate setup
|
|
26
|
+
- When a skill, hook, or substrate file fails unexpectedly
|
|
27
|
+
- As part of `/autonomous dry-run` (automatically)
|
|
28
|
+
|
|
29
|
+
## Procedure
|
|
30
|
+
|
|
31
|
+
Run each check in order. Report PASS / WARN / FAIL for each.
|
|
32
|
+
|
|
33
|
+
### 1. Substrate files
|
|
34
|
+
|
|
35
|
+
Check that all `.claude/skills/` and `.claude/rules/` entries are present:
|
|
36
|
+
|
|
37
|
+
Since the 2026-07-29 npm pivot, bassclef ships as file copies. Files land
|
|
38
|
+
in `node_modules/@sunjlabs/bassclef-lite/`. `bassclef-sync` copies from
|
|
39
|
+
that location into the consumer's `.claude/` tree. Dev-mode local checkouts
|
|
40
|
+
may still use symlinks. Both shapes work.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# For each substrate file in .claude/skills/ and .claude/rules/
|
|
44
|
+
# Check: does the file exist and is it readable?
|
|
45
|
+
for f in .claude/skills/*/SKILL.md .claude/rules/*.md; do
|
|
46
|
+
if [ ! -r "$f" ]; then
|
|
47
|
+
echo "FAIL: missing or unreadable file: $f"
|
|
48
|
+
fi
|
|
49
|
+
done
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- PASS: all substrate files present and readable
|
|
53
|
+
- WARN: untracked files (expected from bassclef-sync, not a problem)
|
|
54
|
+
- FAIL: missing or unreadable files (sync did not complete, or file removed)
|
|
55
|
+
|
|
56
|
+
### 2. Skills
|
|
57
|
+
|
|
58
|
+
Validate all SKILL.md files:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
For each .claude/skills/*/SKILL.md:
|
|
62
|
+
- Does it have valid YAML frontmatter? (name, description required)
|
|
63
|
+
- Is user_invocable set? (informational, not a failure)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
- PASS: all skills parse correctly
|
|
67
|
+
- WARN: skill missing optional fields
|
|
68
|
+
- FAIL: skill with missing/broken frontmatter
|
|
69
|
+
|
|
70
|
+
### 3. Hooks
|
|
71
|
+
|
|
72
|
+
Check that hooks referenced in settings.json exist and are executable:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
Read .claude/settings.json (project) and ~/.claude/settings.json (user)
|
|
76
|
+
For each hook command:
|
|
77
|
+
- Does the script file exist?
|
|
78
|
+
- Does it have execute permission?
|
|
79
|
+
- Is the hook type valid? (PreToolUse, PostToolUse, Stop, etc.)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
- PASS: all hooks exist and are executable
|
|
83
|
+
- WARN: hook script exists but not executable (chmod +x needed)
|
|
84
|
+
- FAIL: hook references a script that doesn't exist
|
|
85
|
+
|
|
86
|
+
### 4. CLIs
|
|
87
|
+
|
|
88
|
+
Check for required command-line tools:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
Required: git, gh, node, npx
|
|
92
|
+
Optional: claude (for headless agent spawning)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
For each:
|
|
96
|
+
- PASS: command exists and responds to --version
|
|
97
|
+
- WARN: optional command missing
|
|
98
|
+
- FAIL: required command missing
|
|
99
|
+
|
|
100
|
+
### 5. Git remote
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
git remote -v # can we see origin?
|
|
104
|
+
gh auth status # is GitHub auth working?
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
- PASS: remote configured and auth working
|
|
108
|
+
- WARN: auth expired or not configured (push will fail)
|
|
109
|
+
- FAIL: no remote configured
|
|
110
|
+
|
|
111
|
+
### 6. CLAUDE.md
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
Does CLAUDE.md exist at project root?
|
|
115
|
+
Does it reference the correct directories?
|
|
116
|
+
Does the skills count match actual .claude/skills/ entries?
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
- PASS: CLAUDE.md exists and is consistent
|
|
120
|
+
- WARN: skills count mismatch (CLAUDE.md says N, actual is M)
|
|
121
|
+
- FAIL: CLAUDE.md missing
|
|
122
|
+
|
|
123
|
+
### 7. Session artifact directories
|
|
124
|
+
|
|
125
|
+
Check that required directories exist (or can be created):
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
Required:
|
|
129
|
+
- chronicle/ or docs/chronicle/ (session records)
|
|
130
|
+
- docs/operator-private/journals/ (journal entry drafts)
|
|
131
|
+
- docs/sdlc-traces/ (hook trace logs)
|
|
132
|
+
|
|
133
|
+
Conditional (standard/full level):
|
|
134
|
+
- docs/iteration-bets/ (iteration goals)
|
|
135
|
+
- docs/risk-register.md (risk register — file, not dir)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
- PASS: all required directories exist
|
|
139
|
+
- WARN: directory missing but can be created
|
|
140
|
+
- FAIL: parent directory doesn't exist (unusual)
|
|
141
|
+
|
|
142
|
+
### 7b. Whereami artifact
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
docs/whereami.md MUST exist and conform to standards/whereami-schema.md.
|
|
146
|
+
Check:
|
|
147
|
+
- File present
|
|
148
|
+
- YAML frontmatter `last_updated.at` field exists with ISO-8601 timestamp (legacy `## Last updated` section retired per goal 2026-09-06d Cure 3)
|
|
149
|
+
- Age of last_updated (days since)
|
|
150
|
+
- All 8 schema sections present (phase, active iteration, active
|
|
151
|
+
agents, subsystem phases, gate progress, risk register, last
|
|
152
|
+
updated, configuration)
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
- PASS: file present, schema-conformant, age <3 days
|
|
156
|
+
- WARN: schema non-conformance (missing section) OR age 3-7 days
|
|
157
|
+
- FAIL: file missing OR age ≥7 days OR last_updated unparseable
|
|
158
|
+
|
|
159
|
+
See `.claude/rules/whereami-load-bearing.md` for the freshness policy.
|
|
160
|
+
Fresh consumer repos should scaffold from
|
|
161
|
+
`templates/whereami-template.md`.
|
|
162
|
+
|
|
163
|
+
### 8. Hook idempotency spot-check
|
|
164
|
+
|
|
165
|
+
Check for common non-idempotent patterns in hook scripts:
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
For each hook script:
|
|
169
|
+
- Does it write a file then immediately check for that file?
|
|
170
|
+
(SESSION_LOCK write-then-detect pattern)
|
|
171
|
+
- Does it append without checking if content already exists?
|
|
172
|
+
- Does it use >> without dedup?
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
- PASS: no obvious idempotency issues
|
|
176
|
+
- WARN: potential non-idempotent pattern detected (list them)
|
|
177
|
+
- FAIL: (not used — idempotency issues are warnings, not blockers)
|
|
178
|
+
|
|
179
|
+
## Output format
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
## Substrate Self-Test Report
|
|
183
|
+
|
|
184
|
+
**Date**: YYYY-MM-DD
|
|
185
|
+
**Repo**: [repo name]
|
|
186
|
+
**Branch**: [current branch]
|
|
187
|
+
|
|
188
|
+
| Check | Status | Detail |
|
|
189
|
+
|-------|--------|--------|
|
|
190
|
+
| 1. Substrate files | PASS | 25 skills, 12 rules — all present |
|
|
191
|
+
| 2. Skills | PASS | 25 skills parsed, all valid frontmatter |
|
|
192
|
+
| 3. Hooks | PASS | 5 hooks registered, all executable |
|
|
193
|
+
| 4. CLIs | PASS | git 2.x, gh 2.x, node 22.x, npx 10.x |
|
|
194
|
+
| 5. Git remote | PASS | origin configured, gh auth valid |
|
|
195
|
+
| 6. CLAUDE.md | WARN | Skills table says 23, actual is 25 |
|
|
196
|
+
| 7. Artifact dirs | PASS | All directories present |
|
|
197
|
+
| 8. Hook idempotency | WARN | session-start: writes SESSION_LOCK then detects it |
|
|
198
|
+
|
|
199
|
+
**Overall: PASS** (2 warnings)
|
|
200
|
+
|
|
201
|
+
### Warnings
|
|
202
|
+
- CLAUDE.md skills count mismatch: update the skills table
|
|
203
|
+
- session-start hook: SESSION_LOCK write-then-detect pattern may cause
|
|
204
|
+
false "another session active" warnings on restart
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Rules
|
|
208
|
+
|
|
209
|
+
- Read-only. Do not create, modify, or delete any files.
|
|
210
|
+
- Report findings clearly. Do not fix issues — just identify them.
|
|
211
|
+
- If the operator wants to fix warnings, they can run the appropriate
|
|
212
|
+
tool (e.g., update CLAUDE.md, chmod +x a hook script).
|
|
213
|
+
- This skill can be integrated into `/autonomous dry-run` as an
|
|
214
|
+
additional validation layer.
|
|
215
|
+
|
|
216
|
+
## Output discipline
|
|
217
|
+
|
|
218
|
+
Dispatch `/kiss words --rewrite` on your skill output before you return it. See `standards/skill-output-discipline.md` for the contract.
|