@thebassclef/lite 0.0.1 → 0.1.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.
- package/LICENSE +202 -0
- package/README.md +85 -4
- package/dist/cli.cjs +1612 -0
- package/dist/cli.js +1589 -0
- package/dist/index.cjs +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/package.json +51 -3
- package/substrate/.bassclef/lite-manifest.json +2701 -0
- package/substrate/.claude/agents/architect.md +70 -0
- package/substrate/.claude/agents/builder.md +114 -0
- package/substrate/.claude/agents/designer.md +156 -0
- package/substrate/.claude/agents/reviewer.md +88 -0
- package/substrate/.claude/hooks/artifact-ingestion-gate.sh +357 -0
- package/substrate/.claude/hooks/assert-verify-steering.sh +77 -0
- package/substrate/.claude/hooks/bassclef-source-config-validate.sh +215 -0
- package/substrate/.claude/hooks/bassclef-sync.sh +634 -0
- package/substrate/.claude/hooks/compound-noun-scrub.sh +292 -0
- package/substrate/.claude/hooks/kiss-expansion-inject.sh +69 -0
- package/substrate/.claude/hooks/longrun-prep-compounding-axis-check.sh +492 -0
- package/substrate/.claude/hooks/longrun-prep-compounding-sequence-check.sh +492 -0
- package/substrate/.claude/hooks/plain-english-steering.sh +156 -0
- package/substrate/.claude/hooks/post-skill-friction-check.sh +177 -0
- package/substrate/.claude/hooks/post-skill-telemetry.sh +62 -0
- package/substrate/.claude/hooks/pre-build-gate.sh +511 -0
- package/substrate/.claude/hooks/pre-commit-gate.sh +451 -0
- package/substrate/.claude/hooks/session-end.sh +433 -0
- package/substrate/.claude/hooks/session-reflection.sh +303 -0
- package/substrate/.claude/hooks/skill-body-grade-gate.sh +219 -0
- package/substrate/.claude/hooks/skill-body-intent-drift.sh +107 -0
- package/substrate/.claude/hooks/skill-step-list-check.sh +171 -0
- package/substrate/.claude/hooks/state-validate.sh +271 -0
- package/substrate/.claude/hooks/substrate-clarity-gate.sh +1110 -0
- package/substrate/.claude/hooks/temperance-gate.sh +147 -0
- package/substrate/.claude/hooks/testing-tier-enforce.sh +233 -0
- package/substrate/.claude/hooks/turn-prose-grade-measure.sh +219 -0
- package/substrate/.claude/hooks/turn-prose-kiss-check.sh +463 -0
- package/substrate/.claude/hooks/vocabulary-migration-check.sh +171 -0
- package/substrate/.claude/hooks/whereami-utc-gate.sh +142 -0
- package/substrate/.claude/luminaries/alan-cooper.md +170 -0
- package/substrate/.claude/luminaries/alistair-cockburn.md +140 -0
- package/substrate/.claude/luminaries/amazon-pr-faq.md +34 -0
- package/substrate/.claude/luminaries/ash-maurya.md +121 -0
- package/substrate/.claude/luminaries/bill-buxton.md +210 -0
- package/substrate/.claude/luminaries/charles-sanders-peirce.md +150 -0
- package/substrate/.claude/luminaries/david-ogilvy.md +192 -0
- package/substrate/.claude/luminaries/don-norman.md +173 -0
- package/substrate/.claude/luminaries/edward-tufte.md +179 -0
- package/substrate/.claude/luminaries/eric-evans.md +160 -0
- package/substrate/.claude/luminaries/frederick-brooks.md +50 -0
- package/substrate/.claude/luminaries/gang-of-four.md +157 -0
- package/substrate/.claude/luminaries/glenford-myers.md +230 -0
- package/substrate/.claude/luminaries/hunt-thomas.md +115 -0
- package/substrate/.claude/luminaries/hyrum-wright.md +94 -0
- package/substrate/.claude/luminaries/jason-fried-dhh.md +46 -0
- package/substrate/.claude/luminaries/jesse-james-garrett.md +154 -0
- package/substrate/.claude/luminaries/john-ousterhout.md +94 -0
- package/substrate/.claude/luminaries/karl-popper.md +132 -0
- package/substrate/.claude/luminaries/kent-beck.md +168 -0
- package/substrate/.claude/luminaries/linus-torvalds.md +218 -0
- package/substrate/.claude/luminaries/martin-fowler.md +164 -0
- package/substrate/.claude/luminaries/michael-feathers.md +125 -0
- package/substrate/.claude/luminaries/michael-nygard.md +118 -0
- package/substrate/.claude/luminaries/robert-c-martin.md +164 -0
- package/substrate/.claude/luminaries/saltzer-schroeder.md +194 -0
- package/substrate/.claude/luminaries/sophia-prater.md +193 -0
- package/substrate/.claude/luminaries/stephen-toulmin.md +131 -0
- package/substrate/.claude/luminaries/tony-hoare.md +170 -0
- package/substrate/.claude/luminaries/vaughn-vernon.md +50 -0
- package/substrate/.claude/luminaries/w-edwards-deming.md +158 -0
- package/substrate/.claude/rules/accessor-library-discipline.md +138 -0
- package/substrate/.claude/rules/adr-discipline.md +120 -0
- package/substrate/.claude/rules/api-conventions.md +125 -0
- package/substrate/.claude/rules/artifact-ingestion.md +179 -0
- package/substrate/.claude/rules/assert-only-after-verify.md +137 -0
- package/substrate/.claude/rules/blocked-items.md +146 -0
- package/substrate/.claude/rules/bootstrap-pair-discipline.md +141 -0
- package/substrate/.claude/rules/branching.md +28 -0
- package/substrate/.claude/rules/cold-adopter-harness-discipline.md +129 -0
- package/substrate/.claude/rules/commit-conventions.md +22 -0
- package/substrate/.claude/rules/compounding-axis-fresh-analysis.md +188 -0
- package/substrate/.claude/rules/compounding-sequence-fresh-analysis.md +188 -0
- package/substrate/.claude/rules/context-engineering.md +202 -0
- package/substrate/.claude/rules/context-management.md +85 -0
- package/substrate/.claude/rules/defensive-bash.md +68 -0
- package/substrate/.claude/rules/deferred-actions.md +233 -0
- package/substrate/.claude/rules/destructive-operations.md +69 -0
- package/substrate/.claude/rules/diagnosis.md +38 -0
- package/substrate/.claude/rules/github-issue-flash-tweet.md +156 -0
- package/substrate/.claude/rules/guardrails.md +73 -0
- package/substrate/.claude/rules/hook-wire-on-author.md +103 -0
- package/substrate/.claude/rules/identifier-leak-prevention.md +104 -0
- package/substrate/.claude/rules/iteration-bet-brief-completeness.md +54 -0
- package/substrate/.claude/rules/lite-manifest-schema-change-discipline.md +98 -0
- package/substrate/.claude/rules/longrun-prep-plan-doc-compression.md +89 -0
- package/substrate/.claude/rules/loop-discipline.md +81 -0
- package/substrate/.claude/rules/manual-prod-approval.md +100 -0
- package/substrate/.claude/rules/marker-enrichment-discipline.md +99 -0
- package/substrate/.claude/rules/mobile-ephemeral-session.md +109 -0
- package/substrate/.claude/rules/new-dependency-check.md +51 -0
- package/substrate/.claude/rules/oo-ad-entry-point.md +117 -0
- package/substrate/.claude/rules/operator-facing-prose.md +196 -0
- package/substrate/.claude/rules/option-label-discipline.md +108 -0
- package/substrate/.claude/rules/pattern-annotation.md +100 -0
- package/substrate/.claude/rules/plain-english-discipline.md +156 -0
- package/substrate/.claude/rules/plan-enumeration-needs-value-props.md +211 -0
- package/substrate/.claude/rules/pr-body-shape.md +317 -0
- package/substrate/.claude/rules/pr-strategy.md +167 -0
- package/substrate/.claude/rules/pr-title-shape.md +161 -0
- package/substrate/.claude/rules/prototype-workflow.md +65 -0
- package/substrate/.claude/rules/reserved-skill-names.md +123 -0
- package/substrate/.claude/rules/schema-management.md +49 -0
- package/substrate/.claude/rules/sdlc-gates.md +149 -0
- package/substrate/.claude/rules/security.md +37 -0
- package/substrate/.claude/rules/session-artifacts.md +236 -0
- package/substrate/.claude/rules/skill-composition-declarations.md +124 -0
- package/substrate/.claude/rules/skill-description-clarity.md +247 -0
- package/substrate/.claude/rules/skill-procedure-step-list.md +137 -0
- package/substrate/.claude/rules/state-schema-validation.md +162 -0
- package/substrate/.claude/rules/stuck-signal-diagnostic.md +140 -0
- package/substrate/.claude/rules/substrate-config-schema.md +98 -0
- package/substrate/.claude/rules/test-list-discipline.md +175 -0
- package/substrate/.claude/rules/test-sufficiency.md +210 -0
- package/substrate/.claude/rules/testing-tier-config.md +145 -0
- package/substrate/.claude/rules/testing.md +38 -0
- package/substrate/.claude/rules/turn-estimate-grounding.md +134 -0
- package/substrate/.claude/rules/visual-hierarchy.md +437 -0
- package/substrate/.claude/rules/we-dont-break-adopters.md +126 -0
- package/substrate/.claude/rules/whereami-load-bearing.md +202 -0
- package/substrate/.claude/rules/writing-craft-discipline.md +92 -0
- package/substrate/.claude/rules/wu-sequencing-compounds.md +145 -0
- package/substrate/.claude/skills/build/SKILL.md +640 -0
- package/substrate/.claude/skills/chronicle/SKILL.md +55 -0
- package/substrate/.claude/skills/clean-artifacts/SKILL.md +249 -0
- package/substrate/.claude/skills/decompose/SKILL.md +280 -0
- package/substrate/.claude/skills/diagnose/SKILL.md +297 -0
- package/substrate/.claude/skills/feynman/SKILL.md +90 -0
- package/substrate/.claude/skills/howdoi/SKILL.md +105 -0
- package/substrate/.claude/skills/ia-model/SKILL.md +108 -0
- package/substrate/.claude/skills/interaction-design/SKILL.md +112 -0
- package/substrate/.claude/skills/interpret-input/SKILL.md +180 -0
- package/substrate/.claude/skills/journal/SKILL.md +209 -0
- package/substrate/.claude/skills/kiss/SKILL.md +449 -0
- package/substrate/.claude/skills/launch/SKILL.md +915 -0
- package/substrate/.claude/skills/lean-canvas/SKILL.md +332 -0
- package/substrate/.claude/skills/longrun/SKILL.md +463 -0
- package/substrate/.claude/skills/luminary/SKILL.md +481 -0
- package/substrate/.claude/skills/ogilvy-writing-audit/SKILL.md +177 -0
- package/substrate/.claude/skills/onboard-repo/SKILL.md +1624 -0
- package/substrate/.claude/skills/pattern-review/SKILL.md +99 -0
- package/substrate/.claude/skills/personas/SKILL.md +207 -0
- package/substrate/.claude/skills/promote/SKILL.md +283 -0
- package/substrate/.claude/skills/requirement/SKILL.md +98 -0
- package/substrate/.claude/skills/retro/SKILL.md +117 -0
- package/substrate/.claude/skills/riff/SKILL.md +114 -0
- package/substrate/.claude/skills/roadmap-reconcile/SKILL.md +163 -0
- package/substrate/.claude/skills/session-end/SKILL.md +309 -0
- package/substrate/.claude/skills/session-log/SKILL.md +299 -0
- package/substrate/.claude/skills/skills/SKILL.md +228 -0
- package/substrate/.claude/skills/spec/SKILL.md +105 -0
- package/substrate/.claude/skills/sprint/SKILL.md +392 -0
- package/substrate/.claude/skills/stage/SKILL.md +384 -0
- package/substrate/.claude/skills/state-a-problem/SKILL.md +185 -0
- package/substrate/.claude/skills/temperance/SKILL.md +108 -0
- package/substrate/.claude/skills/use-case/SKILL.md +417 -0
- package/substrate/.claude/skills/user-stories/SKILL.md +268 -0
- package/substrate/.claude/skills/value-prop/SKILL.md +251 -0
- package/substrate/.claude/skills/verify/SKILL.md +160 -0
- package/substrate/.claude/skills/visual-review/SKILL.md +503 -0
- package/substrate/.claude/skills/whats-the-plan/SKILL.md +202 -0
- package/substrate/.claude/skills/whereami/SKILL.md +307 -0
- package/substrate/AGENTS.md +79 -0
- package/substrate/CLAUDE-lite.md +85 -0
- package/substrate/CODE_OF_CONDUCT.md +28 -0
- package/substrate/CONTRIBUTING.md +177 -0
- package/substrate/README.md +173 -0
- package/substrate/SECURITY.md +19 -0
- package/substrate/architecture/decisions/ADR-029-release-pipeline.md +79 -0
- package/substrate/architecture/decisions/ADR-031-non-breaking-changes-adopter-discipline.md +139 -0
- package/substrate/architecture/decisions/ADR-032-adopter-sync-dispatcher-architecture.md +192 -0
- package/substrate/architecture/decisions/ADR-039-release-tagging-scheme.md +145 -0
- package/substrate/architecture/decisions/ADR-040-planning-skill-vocabulary-and-lite-profile.md +155 -0
- package/substrate/architecture/decisions/ADR-044-unified-skill-body-template.md +162 -0
- package/substrate/lib/clean-artifacts-sweep.sh +112 -0
- package/substrate/lib/code-comment-discipline.sh +144 -0
- package/substrate/lib/composer-preflight.sh +459 -0
- package/substrate/lib/hook-inject.sh +255 -0
- package/substrate/lib/luminary-pick.sh +96 -0
- package/substrate/lib/output-discipline.sh +143 -0
- package/substrate/lib/prose-scan-boundary.sh +171 -0
- package/substrate/lib/rewrite-check.sh +214 -0
- package/substrate/lib/state.sh +1372 -0
- package/substrate/lib/telemetry.sh +205 -0
- package/substrate/lib/tier-check.sh +187 -0
- package/substrate/lib/tier-dependency-audit.sh +1088 -0
- package/substrate/presence/install/bassclef-hook-connect.sh +178 -0
- package/substrate/presence/install/bassclef-sync.dispatcher.template.sh +841 -0
- package/substrate/presence/install/bassclef-sync.template.sh +2076 -0
- package/substrate/presence/install/schedule-auto-save.cron.sh +88 -0
- package/substrate/presence/install/schedule-auto-save.taskscheduler.md +122 -0
- package/substrate/scripts/aggregate-telemetry.sh +217 -0
- package/substrate/scripts/analyze-tier-dependencies.sh +239 -0
- package/substrate/scripts/generate-lite-manifest.sh +505 -0
- package/substrate/scripts/generate-tier-manifest.sh +28 -0
- package/substrate/scripts/intent-drift-check.sh +456 -0
- package/substrate/scripts/lite-manifest-drift-check.sh +146 -0
- package/substrate/scripts/render-lite-manifest-doc.sh +150 -0
- package/substrate/standards/adr-template.md +86 -0
- package/substrate/standards/api-conventions/nextjs.md +84 -0
- package/substrate/standards/artifact-composition.md +209 -0
- package/substrate/standards/bash-hook-safety.md +246 -0
- package/substrate/standards/bassclef-configs-schema.md +232 -0
- package/substrate/standards/bassclef-evolution.md +143 -0
- package/substrate/standards/bassclef-internal-jargon.md +244 -0
- package/substrate/standards/bassclef-managed-sentinel.md +96 -0
- package/substrate/standards/bassclef-source-config.md +228 -0
- package/substrate/standards/branch-stacking.md +408 -0
- package/substrate/standards/code-safety-principles.md +176 -0
- package/substrate/standards/composer-prerequisites.md +155 -0
- package/substrate/standards/deferred-actions-schema.md +204 -0
- package/substrate/standards/dependency-discipline/cargo.md +39 -0
- package/substrate/standards/dependency-discipline/gem.md +43 -0
- package/substrate/standards/dependency-discipline/go-mod.md +41 -0
- package/substrate/standards/dependency-discipline/npm.md +42 -0
- package/substrate/standards/dependency-discipline/pip.md +42 -0
- package/substrate/standards/deployment-topology/ec2-tailscale.md +225 -0
- package/substrate/standards/deployment-topology.md +69 -0
- package/substrate/standards/docs-sync-allowlist.md +76 -0
- package/substrate/standards/domain-and-dns.md +145 -0
- package/substrate/standards/frontend-stack.md +67 -0
- package/substrate/standards/frontmatter-schema.md +154 -0
- package/substrate/standards/graceful-exit.md +227 -0
- package/substrate/standards/hook-idempotency.md +102 -0
- package/substrate/standards/hook-injection-discipline.md +202 -0
- package/substrate/standards/hook-install-class.md +215 -0
- package/substrate/standards/input-handler-interface.md +152 -0
- package/substrate/standards/lite-manifest-schema-changes.md +135 -0
- package/substrate/standards/luminary-matching.md +105 -0
- package/substrate/standards/luminary-problem-patterns.md +481 -0
- package/substrate/standards/migration-discipline/active-record.md +50 -0
- package/substrate/standards/migration-discipline/alembic.md +43 -0
- package/substrate/standards/migration-discipline/gorm.md +50 -0
- package/substrate/standards/migration-discipline/prisma.md +53 -0
- package/substrate/standards/migration-discipline/sqlalchemy.md +51 -0
- package/substrate/standards/mobile-ephemeral-session.md +167 -0
- package/substrate/standards/model-routing-discipline.md +160 -0
- package/substrate/standards/ogilvy-writing-rules.md +225 -0
- package/substrate/standards/opener-discipline.md +96 -0
- package/substrate/standards/operator-facing-prose-discipline.md +201 -0
- package/substrate/standards/persona-schema.md +229 -0
- package/substrate/standards/pluggable-luminaries.md +323 -0
- package/substrate/standards/pr-body-discipline.md +115 -0
- package/substrate/standards/preview-state-schema.md +189 -0
- package/substrate/standards/project-directory-layout.md +276 -0
- package/substrate/standards/release-tagging.md +137 -0
- package/substrate/standards/reserved-skill-names.md +120 -0
- package/substrate/standards/scannable-multi-option-output.md +261 -0
- package/substrate/standards/sdlc-compliance.md +286 -0
- package/substrate/standards/sdlc-gates/typescript.md +57 -0
- package/substrate/standards/secrets-lifecycle.md +210 -0
- package/substrate/standards/security-scanner-adapter.md +145 -0
- package/substrate/standards/session-board.md +256 -0
- package/substrate/standards/skill-output-discipline.md +90 -0
- package/substrate/standards/state-spine-contract.md +255 -0
- package/substrate/standards/state-spine.md +511 -0
- package/substrate/standards/steering-hints/kiss-words.md +11 -0
- package/substrate/standards/substrate-config-schema.md +267 -0
- package/substrate/standards/tech-stack-config.md +109 -0
- package/substrate/standards/tier-dependency-analysis.md +167 -0
- package/substrate/standards/tier-runtime-deps/lite.md +57 -0
- package/substrate/standards/tier-tag-schema.md +155 -0
- package/substrate/standards/two-layer-config.md +99 -0
- package/substrate/standards/use-case-format.md +292 -0
- package/substrate/standards/user-story-invest.md +268 -0
- package/substrate/standards/velocity-and-appetite.md +229 -0
- package/substrate/standards/voice-input-pattern.md +119 -0
- package/substrate/standards/whereami-schema.md +301 -0
- package/substrate/standards/worktree-management.md +211 -0
- package/substrate/standards/writing-guide.md +213 -0
- package/substrate/templates/chronicle-template.md +75 -0
- package/substrate/templates/deferred-action-template.md +45 -0
- package/substrate/templates/memory-proposal-template.md +77 -0
- package/substrate/templates/persona-template.md +200 -0
- package/substrate/templates/pr-faq.md +45 -0
- package/substrate/templates/secret-rotation-template.md +162 -0
- package/substrate/templates/spec-template.md +131 -0
- package/substrate/templates/use-case-template.md +194 -0
- package/substrate/templates/user-story-template.md +107 -0
- package/substrate/templates/whereami-template.md +101 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
---
|
|
2
|
+
tier: lite
|
|
3
|
+
description: "Every skill's frontmatter description field must be parseable by an engineer with no bassclef context in under 60 seconds."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill-Description Clarity
|
|
7
|
+
|
|
8
|
+
Every skill's frontmatter `description` field must be parseable by an
|
|
9
|
+
engineer with no bassclef context in under 60 seconds. Outcome-first.
|
|
10
|
+
≤280 chars. Plain language. INSTEAD-block discipline.
|
|
11
|
+
|
|
12
|
+
This rule sits at the entry surface. It parallels bassclef#357 (which governs autonomous-run output). It applies `.claude/rules/context-engineering.md` at the description field: write for what the model can access. For this rule, that means write what a fresh engineer can read in 60 seconds.
|
|
13
|
+
|
|
14
|
+
**Mechanical enforcement**: `.claude/hooks/substrate-clarity-gate.sh` fires at PreToolUse Edit|Write on substrate paths. It BLOCKs skill descriptions past 280 chars or without verb-first openers. The rule + luminary INSTEAD-block check runs ADVISORY today. It flips to BLOCK once the rule + luminary audits ship (tracked under bassclef-upstream#303). The allowlist at `.claude/hooks/substrate-clarity-allowlist.txt` grandfathers existing violators during the grace window. Per bassclef#382.
|
|
15
|
+
|
|
16
|
+
## The bar
|
|
17
|
+
|
|
18
|
+
Anthropic's frontend-design description (per Welch's revision):
|
|
19
|
+
|
|
20
|
+
> "Create distinctive, production-grade frontend interfaces with
|
|
21
|
+
> high design quality. Avoids generic AI aesthetics."
|
|
22
|
+
|
|
23
|
+
That's the bar. Outcome ("create distinctive interfaces"), one-line
|
|
24
|
+
how ("with high design quality"), one-line why-distinct ("avoids
|
|
25
|
+
generic AI aesthetics"). 117 chars. Engineer reads it; knows what
|
|
26
|
+
the skill produces; knows when to use it.
|
|
27
|
+
|
|
28
|
+
Compare to bassclef's pre-rule descriptions (representative):
|
|
29
|
+
|
|
30
|
+
> "BUILD-tier composer (Construction transition). Chains the
|
|
31
|
+
> prototype pipeline (input → variants → gallery → bind-subdomain)
|
|
32
|
+
> PLUS the buildable-spec pipeline (use-case → user-stories →
|
|
33
|
+
> ia-model → interaction-design → decompose → spec → ux-migration)."
|
|
34
|
+
|
|
35
|
+
571 chars. Methodology-laden. Requires knowing what every named
|
|
36
|
+
component is. Engineer can't grok in 60 seconds.
|
|
37
|
+
|
|
38
|
+
## Format
|
|
39
|
+
|
|
40
|
+
Every skill's frontmatter `description` field follows:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
<verb> <outcome>. <one-line how>. <one-line why-distinct>.
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- **Verb**: imperative — "Create," "Generate," "Run," "Compose," "Audit"
|
|
47
|
+
- **Outcome**: what the skill PRODUCES (not how it works internally)
|
|
48
|
+
- **One-line how**: the most distinguishing mechanism, in plain language
|
|
49
|
+
- **One-line why-distinct**: what makes it different from adjacent skills (or what it specifically AVOIDS)
|
|
50
|
+
|
|
51
|
+
Total ≤280 chars including spaces.
|
|
52
|
+
|
|
53
|
+
## INSTEAD-block discipline
|
|
54
|
+
|
|
55
|
+
Every "DON'T" / "AVOID" / "NEVER" in the description gets paired with
|
|
56
|
+
the actionable substitute, per `.claude/rules/context-engineering.md`.
|
|
57
|
+
|
|
58
|
+
INSTEAD of bare negation: state the actionable substitute the engineer
|
|
59
|
+
or model can verify in their current context. Bare "DON'T X" without
|
|
60
|
+
"INSTEAD: Y" is a no-op for a stateless reader.
|
|
61
|
+
|
|
62
|
+
In a description, this shows up in the why-distinct clause:
|
|
63
|
+
|
|
64
|
+
- **Anti**: "Don't use this for short prompts."
|
|
65
|
+
- **INSTEAD**: "Use for prompts ≥3 sentences; for one-liners, see /value-prop flash."
|
|
66
|
+
|
|
67
|
+
The negation lives in context (when not to use). The substitute names the actionable path (which skill to use instead).
|
|
68
|
+
|
|
69
|
+
## Plain language (per /kiss words)
|
|
70
|
+
|
|
71
|
+
Grade-10 reading level. Common substitutions bassclef-substrate writers should make:
|
|
72
|
+
|
|
73
|
+
| Replace | With |
|
|
74
|
+
|---|---|
|
|
75
|
+
| "composer" | "runs" / "chains" / "combines" |
|
|
76
|
+
| "primitive" | "building block" |
|
|
77
|
+
| "tier-preset" | "preset" / "size" |
|
|
78
|
+
| "operationalize" | "do" / "ship" |
|
|
79
|
+
| "load-bearing" | "required" / "must work" |
|
|
80
|
+
| "blast radius" | "impact" / "what it can break" |
|
|
81
|
+
| "substrate" | "system" / "framework" |
|
|
82
|
+
| "bassclef" (in description body) | use sparingly; prefer "the framework" |
|
|
83
|
+
| "compose-with" | "uses" / "builds on" |
|
|
84
|
+
| "scope-bounded" | "small" / "tight" |
|
|
85
|
+
|
|
86
|
+
If the description still uses bassclef jargon after substitution,
|
|
87
|
+
the description was assuming context the engineer doesn't have.
|
|
88
|
+
Rewrite further.
|
|
89
|
+
|
|
90
|
+
## What MUST NOT appear in a description
|
|
91
|
+
|
|
92
|
+
- References to other skills the engineer hasn't read yet (skill names OK; methodology references aren't)
|
|
93
|
+
- Methodology chains ("X → Y → Z → ...")
|
|
94
|
+
- Tier specifications without explaining what the tier does
|
|
95
|
+
- Citations to bassclef issues (those go in the body)
|
|
96
|
+
- Dates / versions / "renamed from X on Y" (those go in the body)
|
|
97
|
+
- Assumed pipeline knowledge ("Phase 14 of the buildable-spec chain")
|
|
98
|
+
|
|
99
|
+
## What MUST appear in a description
|
|
100
|
+
|
|
101
|
+
- The verb-outcome opener
|
|
102
|
+
- A concrete sense of what the user gets back
|
|
103
|
+
- A distinguishing characteristic vs. adjacent skills
|
|
104
|
+
- **Modes / tiers / sizes named inline when frontmatter declares them** (bassclef#535) — see next section
|
|
105
|
+
|
|
106
|
+
## Description-mirrors-modes (bassclef#535)
|
|
107
|
+
|
|
108
|
+
When a skill's frontmatter declares structured `modes:` / `tiers:` / `sizes:` (per bassclef#515), the description **text** MUST name each declared value inline. Operators see Claude Code's type-ahead BEFORE invoking `/skills`; type-ahead reads only the `description` field. Frontmatter `modes:` is machine-readable for bassclef's audit + render pipeline but invisible to type-ahead.
|
|
109
|
+
|
|
110
|
+
**The discipline:**
|
|
111
|
+
|
|
112
|
+
- If frontmatter has `modes: [scope, words]`, description must contain "scope" AND "words" (typically as "Two modes — scope ... and words ..." or similar)
|
|
113
|
+
- If frontmatter has `tiers: [quick, light, medium, full]`, description must name all four
|
|
114
|
+
- If frontmatter has `sizes: [flash, tweet, brief, verbose]`, description must name all four
|
|
115
|
+
- Skills with `no_user_modes: true` (opt-out) are exempt
|
|
116
|
+
- The 280-char ceiling still applies — naming N modes that won't fit means the description is over-claiming; collapse the verbiage around them
|
|
117
|
+
|
|
118
|
+
**Why mirror, not auto-render?**
|
|
119
|
+
|
|
120
|
+
Type-ahead reads `description`. bassclef doesn't control the harness; we control the data we put in `description`. Mirroring is the cheap fix that makes type-ahead useful for mode-bearing skills today. Frontmatter `modes:` stays machine-readable for `/skills` catalog rendering + audit + future structured uses; description text stays human-readable for type-ahead.
|
|
121
|
+
|
|
122
|
+
**Conformance examples (all 7 skills with modes today):**
|
|
123
|
+
|
|
124
|
+
| Skill | Frontmatter | Description names them? |
|
|
125
|
+
|---|---|---|
|
|
126
|
+
| `/value-prop` | `sizes: [flash, tweet, brief, verbose]` | ✓ "Four sizes — flash ... tweet ... brief ... verbose" |
|
|
127
|
+
| `/kiss` | `modes: [scope, words]` | ✓ "Two modes — scope ... and words ..." |
|
|
128
|
+
| `/stage` | `sizes: [quick, light]` | ✓ "Two sizes: quick ... and light ..." |
|
|
129
|
+
| `/launch` | `sizes: [medium, full]` | ✓ "Two sizes: medium ... and full ..." |
|
|
130
|
+
| `/shape` | `tiers: [quick, light, medium, full]` | ✓ "four sizes — quick, light, medium, full" |
|
|
131
|
+
| `/longrun` | `modes: [prep, checkpoint, closeout]` | ✓ "three modes — prep, checkpoint, closeout" (after bassclef#535) |
|
|
132
|
+
| `/interpret-input` | `modes: [text, url, image, repo, transcript, napkin, mixed]` | ✓ types listed in parens |
|
|
133
|
+
| `/onboard-repo` | `modes: [default, --with-deploy-host, --with-secrets, --full]` | ❌ pending — fold into LR8.6 PR #526 amendment |
|
|
134
|
+
|
|
135
|
+
**Mechanical enforcement (deferred follow-on):**
|
|
136
|
+
|
|
137
|
+
- `scripts/audit-skills-modes.sh` (bassclef#515 PR #519) extends with `description-doesnt-mirror-modes` finding type
|
|
138
|
+
- `.claude/hooks/substrate-clarity-gate.sh` extends with the same check at PreToolUse Edit/Write time
|
|
139
|
+
- Both gated behind bassclef#515 + bassclef#382 landing first; until then, this rule is methodology-level + the operator runs the audit manually
|
|
140
|
+
|
|
141
|
+
**Override:**
|
|
142
|
+
|
|
143
|
+
`SKIP_DESCRIPTION_MIRRORS_MODES=1` per-call override (logged via trace-helper). Use only when the frontmatter declares modes that are too numerous to mention inline (>5) AND a higher-level grouping description suffices.
|
|
144
|
+
|
|
145
|
+
## Worked examples — applying the rule
|
|
146
|
+
|
|
147
|
+
### /sprint (before)
|
|
148
|
+
|
|
149
|
+
> "Show current iteration goal, open issues by priority, and proposed next sprint. Quick orientation for any session."
|
|
150
|
+
|
|
151
|
+
132 chars. Decent — verb opener, outcome named. Could be tighter on
|
|
152
|
+
why-distinct. **Score: B+. Acceptable.**
|
|
153
|
+
|
|
154
|
+
### /sprint (after)
|
|
155
|
+
|
|
156
|
+
> "Show what's in flight and what's next. Reads project state, open issues, and the active iteration goal; proposes the next sprint. Run at session start to orient."
|
|
157
|
+
|
|
158
|
+
161 chars. Verb-outcome stronger. Why-distinct (when to use) explicit. **Score: A.**
|
|
159
|
+
|
|
160
|
+
### /longrun (before)
|
|
161
|
+
|
|
162
|
+
> "Self-checkpointing long-session lifecycle (prep / checkpoint / closeout). Orchestrator-gated sequential by default. Use when ≥2 active goals OR estimated >50 turns OR session crosses compaction. Composes /temperance, /retro, /promote, /session-end. Replaces manual mid-session reflection that defeats fire-and-forget intent."
|
|
163
|
+
|
|
164
|
+
322 chars. Methodology-laden. "Orchestrator-gated sequential" is jargon. Composes-list dumps internal references. **Score: D.**
|
|
165
|
+
|
|
166
|
+
### /longrun (after)
|
|
167
|
+
|
|
168
|
+
> "Run a long autonomous session that paces itself — prepares scope, checkpoints at phase boundaries, closes with chronicle + journal entry + retro. Use for sessions over 50 turns or with multiple bets. Replaces mid-session manual reflection."
|
|
169
|
+
|
|
170
|
+
249 chars. Outcome-first. Plain language. When-to-use explicit. **Score: A-.**
|
|
171
|
+
|
|
172
|
+
### /launch (formerly /preview-build) (before)
|
|
173
|
+
|
|
174
|
+
> "BUILD-tier composer (Construction transition). Chains the prototype pipeline (input → variants → gallery → bind-subdomain) PLUS the buildable-spec pipeline (use-case → user-stories → ia-model → interaction-design → decompose → spec → ux-migration). Tiers: medium (~1 day, 3 variants + buildable spec + INVEST stories + GRASP matrix) and full..."
|
|
175
|
+
|
|
176
|
+
571 chars (truncated). Methodology dump. Tier specs without context.
|
|
177
|
+
**Score: F.**
|
|
178
|
+
|
|
179
|
+
### /launch (after)
|
|
180
|
+
|
|
181
|
+
> "Turn an idea into a buildable plan. Produces a clickable mock gallery PLUS the spec, decomposition, and migration plan needed to actually build the chosen direction. Two sizes: medium (~1 day) and full (~audit-grade). Operator dispatches when ready to ship."
|
|
182
|
+
|
|
183
|
+
275 chars. Outcome-first. The "PLUS" makes the differentiator vs.
|
|
184
|
+
/stage (formerly /preview) clear. Tiers framed by time budget, not internal methodology.
|
|
185
|
+
**Score: A.**
|
|
186
|
+
|
|
187
|
+
## Application
|
|
188
|
+
|
|
189
|
+
### Per skill (rewrites)
|
|
190
|
+
|
|
191
|
+
1. Read existing description
|
|
192
|
+
2. Score against rule (Verb? Outcome? ≤280 chars? Jargon? Plain language?)
|
|
193
|
+
3. Rewrite if score < B
|
|
194
|
+
4. Test the rewrite: would a senior engineer with no bassclef context understand it in 60 seconds?
|
|
195
|
+
|
|
196
|
+
### Per longrun (audit)
|
|
197
|
+
|
|
198
|
+
The audit issue (bassclef#375 + sister WU-3 issues) tracks
|
|
199
|
+
per-skill rewrites. WU-6 of this longrun ships top-7 (data + judgment
|
|
200
|
+
based) as in-scope examples; rest filed as follow-up.
|
|
201
|
+
|
|
202
|
+
### Per new skill
|
|
203
|
+
|
|
204
|
+
Every new skill's description goes through this rule before merge.
|
|
205
|
+
Test: paste the description into a Slack DM to a senior engineer
|
|
206
|
+
without bassclef context. If they ask "what does this DO?" you
|
|
207
|
+
violated the rule.
|
|
208
|
+
|
|
209
|
+
INSTEAD of testing against a bassclef-savvy reader: test against
|
|
210
|
+
a fresh reader who carries no internal vocabulary. That's the
|
|
211
|
+
audience the description has to serve.
|
|
212
|
+
|
|
213
|
+
## Relationship to other rules
|
|
214
|
+
|
|
215
|
+
- `.claude/rules/context-engineering.md` — the foundational rule; this is one application
|
|
216
|
+
- bassclef#357 (autonomous-run flash + kiss) — sibling discipline at output surface; this rule is at description surface
|
|
217
|
+
- bassclef#367 (section-heading standardization) — sibling specificity discipline
|
|
218
|
+
- bassclef#339 (plan-enumeration-needs-value-props) — sibling at choice-presentation surface
|
|
219
|
+
|
|
220
|
+
## Override
|
|
221
|
+
|
|
222
|
+
There is no override. Skill descriptions are an entry surface for
|
|
223
|
+
engineers and operators. Violating the rule means engineers won't
|
|
224
|
+
adopt the skill, regardless of how good the skill itself is.
|
|
225
|
+
|
|
226
|
+
If you can't write the description per the rule, the skill's job
|
|
227
|
+
isn't clear enough — clarify the skill before clarifying the
|
|
228
|
+
description.
|
|
229
|
+
|
|
230
|
+
## Audit pattern
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# Find skills whose descriptions exceed 280 chars
|
|
234
|
+
grep -r "^description:" .claude/skills/*/SKILL.md | awk -F: '{ if (length($0) > 280) print $0 }'
|
|
235
|
+
|
|
236
|
+
# Find skills whose descriptions use bassclef jargon
|
|
237
|
+
git grep -niE 'composer|primitive|tier-preset|operationalize|load-bearing|blast radius|compose-with' .claude/skills/*/SKILL.md | grep -E '^.*:description:'
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## Sources read
|
|
241
|
+
|
|
242
|
+
- `.claude/rules/context-engineering.md` (bassclef#371) — foundational rule
|
|
243
|
+
- bassclef#357 — sibling output-surface rule
|
|
244
|
+
- bassclef#367 — sibling specificity rule
|
|
245
|
+
- `.claude/skills/value-prop/SKILL.md` — flash mode (≤180 chars analog)
|
|
246
|
+
- `.claude/skills/kiss/SKILL.md` — words mode (plain-language analog)
|
|
247
|
+
- Anthropic `frontend-design` skill description — direct exemplar; bassclef declares this as baseline-composes-with in `/frontend-design`, `/riff-prototypes`, `/launch`, `/visual-review` skill frontmatter rather than carrying it as a luminary entry
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
tier: lite
|
|
3
|
+
description: Before executing any SKILL procedure, I write the numbered step list into the response.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill-procedure step-list
|
|
7
|
+
|
|
8
|
+
Before executing any SKILL procedure, I write the numbered step list into the response. Each step is marked `[x]` executed with source cited OR `[~]` explicitly deferred with reason. No `[ ]` unchecked lines ship at output time. Silence is not deferral.
|
|
9
|
+
|
|
10
|
+
This rule extends `.claude/rules/assert-only-after-verify.md` from the assertion surface to the SKILL-procedure surface. It is the methodology layer. The mechanical layer is `.claude/hooks/skill-step-list-check.sh` — Stop hook that scans the transcript for a Skill dispatch followed by an assistant response without a step-list block.
|
|
11
|
+
|
|
12
|
+
## Why this rule exists
|
|
13
|
+
|
|
14
|
+
Session 2026-08-05a dispatched `/roadmap-reconcile --dry-run` during `/longrun` prep. The SKILL procedure names 5 steps. I ran Step 1 (enumerate surfaces), skipped Step 2 (read shipping reality), and jumped to Step 3 (build a diff). I substituted whereami queue narrative for the actual `gh pr view` + `gh issue view` cross-check Step 2 requires. Four stale drift rows shipped. Operator caught the class in one turn — three closed tickets (#1050, #1051, #1054) shown as pending because whereami queue said so and no cross-check verified.
|
|
15
|
+
|
|
16
|
+
Memory alone catches nothing at write time. Two existing rule + hook pairs prove the pattern holds at scale — `.claude/rules/assert-only-after-verify.md` + `.claude/hooks/assert-verify-steering.sh`, and `.claude/rules/plain-english-discipline.md` + `.claude/hooks/turn-prose-kiss-check.sh`. This rule is the third pair, at the SKILL-procedure surface.
|
|
17
|
+
|
|
18
|
+
## When this rule fires
|
|
19
|
+
|
|
20
|
+
Every SKILL dispatch. Agents self-check before writing the response. Hook fires at Stop event as the write-time backstop.
|
|
21
|
+
|
|
22
|
+
Fires on:
|
|
23
|
+
|
|
24
|
+
- Any Skill tool dispatch in the current turn
|
|
25
|
+
- Any SKILL body whose procedure names 2+ steps
|
|
26
|
+
|
|
27
|
+
Passes through on:
|
|
28
|
+
|
|
29
|
+
- Non-Skill tool calls (Bash, Read, Edit, Write, Grep, etc.) — those follow their own discipline rules
|
|
30
|
+
- SKILL body procedures with 0 or 1 step (no list needed)
|
|
31
|
+
- Tool-output relays (test output, git output) that carry no assertions of their own
|
|
32
|
+
|
|
33
|
+
## What the rule requires
|
|
34
|
+
|
|
35
|
+
Before shipping any response following a SKILL dispatch:
|
|
36
|
+
|
|
37
|
+
1. **Read the SKILL body Procedure section.** Enumerate the numbered steps.
|
|
38
|
+
2. **Write the step list at the top of the response.** Format: `Step N — <name>` followed by a status marker.
|
|
39
|
+
3. **Execute each step.** Cite the source inline as it runs.
|
|
40
|
+
4. **Mark each step's status:**
|
|
41
|
+
- `[x]` executed with source cited
|
|
42
|
+
- `[~]` explicitly deferred with reason (silence is not deferral)
|
|
43
|
+
- Do not ship `[ ]` unchecked at output time.
|
|
44
|
+
INSTEAD: mark every step `[x]` or `[~]` before the response ships. Unchecked shipped equals silent skip.
|
|
45
|
+
5. **Loaded context is a hint, not a substitute for a source read named by a step.** The context feels full. That is when the skip is easiest and the drift is worst.
|
|
46
|
+
INSTEAD: cite the source per the SKILL step. Loaded context is a hint, not a substitute.
|
|
47
|
+
|
|
48
|
+
## Format contract
|
|
49
|
+
|
|
50
|
+
Each step line matches one of these shapes:
|
|
51
|
+
|
|
52
|
+
- `Step N — <name> — [x] <source cited>`
|
|
53
|
+
- `Step N — <name> — [~] <deferral reason>`
|
|
54
|
+
|
|
55
|
+
Or a block header + list format:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
Steps:
|
|
59
|
+
- Step 1 — <name> — [x] <source>
|
|
60
|
+
- Step 2 — <name> — [~] <reason>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The hook scans for two markers together: the token `Step\s+\d+` AND either `[x]` or `[~]` bracketed. Both must appear in the assistant text following a Skill dispatch.
|
|
64
|
+
|
|
65
|
+
## Anti-patterns
|
|
66
|
+
|
|
67
|
+
These shapes fail this rule.
|
|
68
|
+
|
|
69
|
+
**Dispatch skill; write results with no step list.** The response ships without any `Step N` markers. Hook fires ADVISORY (or BLOCK under strict toggle).
|
|
70
|
+
INSTEAD: enumerate the SKILL procedure steps at the top of the response before running them.
|
|
71
|
+
|
|
72
|
+
**Silent skip.** A step gets no `[x]` and no `[~]` line — the response simply omits it.
|
|
73
|
+
INSTEAD: every step from the SKILL procedure appears in the response, either done or explicitly deferred with reason.
|
|
74
|
+
|
|
75
|
+
**Context as substitute.** Loaded context carries a plausible answer. Skip the SKILL step; use the context.
|
|
76
|
+
INSTEAD: cite the source per the SKILL step. Loaded context is a hint, not a substitute for the read the step names.
|
|
77
|
+
|
|
78
|
+
**Half-written list.** Some steps carry markers; others do not.
|
|
79
|
+
INSTEAD: every step marked before response ships. Half-written lists cause reviewer confusion + trigger the hook.
|
|
80
|
+
|
|
81
|
+
## When this rule does NOT fire
|
|
82
|
+
|
|
83
|
+
- Tool-output relays (test output, git output) — no assertion of the agent's own
|
|
84
|
+
- SKILL body with 0 or 1 step — no list needed
|
|
85
|
+
- Skill invoked purely for its output display (e.g., `/whereami` for a status snapshot)
|
|
86
|
+
- Chat responses that do not follow a Skill dispatch
|
|
87
|
+
|
|
88
|
+
## Override
|
|
89
|
+
|
|
90
|
+
`SKIP_SKILL_STEP_LIST=1 <command>` — per-call bypass, logged via trace-helper. Use rarely:
|
|
91
|
+
|
|
92
|
+
- One-shot migration scripts that dispatch many SKILLs at once
|
|
93
|
+
- Emergency rescue when the hook itself misbehaves
|
|
94
|
+
- Explicitly-deferred rework where the step list ships in a follow-up response
|
|
95
|
+
|
|
96
|
+
For routine SKILL dispatches, write the step list. The cost is small; the audit trail compounds.
|
|
97
|
+
|
|
98
|
+
## Toggle
|
|
99
|
+
|
|
100
|
+
The hook reads `SKILL_STEP_LIST_TOGGLE` from env OR `skill_step_list.toggle` from `.claude/bassclef-configs.jsonc`:
|
|
101
|
+
|
|
102
|
+
- `true` (default) — advisory (exit 0, findings to stderr)
|
|
103
|
+
- `strict` — strict (exit 2, blocks the stop event, forces a rewrite)
|
|
104
|
+
- `false` — silent (exit 0, no scan)
|
|
105
|
+
|
|
106
|
+
V1 ships advisory. V2 may flip to strict after a calibration cycle observes drift stays under 10%.
|
|
107
|
+
|
|
108
|
+
## Anchor luminaries
|
|
109
|
+
|
|
110
|
+
- `.claude/luminaries/saltzer-schroeder.md` (Saltzer & Schroeder 1975, IEEE 63(9)) — complete mediation. Every access to protected state is checked. Whereami narrative was a cached authorization. Rule + hook forces mediation at every SKILL dispatch.
|
|
111
|
+
- `.claude/luminaries/tony-hoare.md` (Hoare 1969, CACM 12(10)) — pre/postcondition triple. Each step's postcondition is the next step's precondition. Skip breaks the chain.
|
|
112
|
+
- `.claude/luminaries/michael-feathers.md` (Feathers 2004) — characterization tests. Pin actual behavior via source of record before naming it.
|
|
113
|
+
- `.claude/luminaries/kent-beck.md` (Beck 2002) — list-before-execute. Sister discipline at test surface applied to SKILL surface.
|
|
114
|
+
|
|
115
|
+
## Composes with
|
|
116
|
+
|
|
117
|
+
- `.claude/rules/assert-only-after-verify.md` — parent discipline at claim surface; this rule extends to SKILL-procedure surface
|
|
118
|
+
- `.claude/rules/bootstrap-pair-discipline.md` — pair-shape pattern (rule + hook + Tier 0 test)
|
|
119
|
+
- `.claude/rules/substrate-as-system.md` — ADR-035 tenet
|
|
120
|
+
- `.claude/rules/test-list-discipline.md` — Beck's list-before-execute sister rule at test surface
|
|
121
|
+
- `.claude/rules/testing-tier-config.md` — Tier 0 strict TDD on hook + tests
|
|
122
|
+
- `.claude/rules/we-dont-break-adopters.md` — V1 ADVISORY default preserves adopter behavior
|
|
123
|
+
- `.claude/rules/blocked-items.md` — BLOCK protocol the hook fires under strict toggle
|
|
124
|
+
- `.claude/hooks/skill-step-list-check.sh` — mechanical implementation
|
|
125
|
+
- `.claude/hooks/tests/skill-step-list-check.test.sh` — Tier 0 test coverage (10 tests)
|
|
126
|
+
|
|
127
|
+
## Refs
|
|
128
|
+
|
|
129
|
+
- sunj-labs/bassclef-upstream#1119 — parent ticket
|
|
130
|
+
- Session 2026-08-05a `/diagnose` output — root cause named (SKILL step skip + context-as-substitute)
|
|
131
|
+
- Memory `feedback_skill_procedure_step_list_before_execute` — evidence anchor
|
|
132
|
+
- Goal doc `docs/iteration-bets/2026-08-05a-skill-step-list-plus-whereami-hygiene.md` — bet frame
|
|
133
|
+
- Sister ticket sunj-labs/bassclef-upstream#1121 — in-turn error stream subsystem (broader observability)
|
|
134
|
+
|
|
135
|
+
## Retirement condition
|
|
136
|
+
|
|
137
|
+
This rule retires only if SKILL dispatch stops being the primary agent-to-substrate composition path. The mechanical layer may evolve (additional detection heuristics, integration with error-stream subsystem #1121). The discipline of write-time step verification persists.
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
tier: lite
|
|
3
|
+
description: State-spine entity writes MUST conform to their JSON Schema.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# State Schema Validation
|
|
7
|
+
|
|
8
|
+
State-spine entity writes MUST conform to their JSON Schema. The
|
|
9
|
+
`state-validate.sh` PreToolUse hook enforces this mechanically: any
|
|
10
|
+
Edit/Write to a state-spine path is validated against the entity's
|
|
11
|
+
schema; failure BLOCKs the write.
|
|
12
|
+
|
|
13
|
+
This rule is the methodology layer. The hook is the mechanical layer.
|
|
14
|
+
Both load-bearing.
|
|
15
|
+
|
|
16
|
+
## When this rule fires
|
|
17
|
+
|
|
18
|
+
Any Edit/Write/MultiEdit to a path matching a state-spine entity per
|
|
19
|
+
`standards/state-spine.md` §"Storage format — four shapes":
|
|
20
|
+
|
|
21
|
+
- **Shape A** (singleton JSON authoritative): `docs/whereami.json`,
|
|
22
|
+
`substrate.config.json`, `docs/preview-state/<slug>.json`
|
|
23
|
+
- **Shape B** (markdown + YAML frontmatter): `docs/iteration-bets/*.md`,
|
|
24
|
+
`docs/roadmaps/*.md`, `docs/stacks/*.md`, `docs/decompositions/*.md`,
|
|
25
|
+
`docs/personas/*.md`, `docs/deferred-actions/*.md`, `chronicle/*.md`,
|
|
26
|
+
`docs/chronicle/*.md`
|
|
27
|
+
- **Shape C** (pure JSON): `state/markers/*/*.json`,
|
|
28
|
+
`docs/sessions/*.json`, `docs/input-artifacts/*.json`,
|
|
29
|
+
`state/template-instances/*.json`, `state/inbox/*.json`,
|
|
30
|
+
`state/stack-templates/*.json`
|
|
31
|
+
- **Shape D** (pure YAML at sibling-repo root): `*/bassclef-platform.yml`
|
|
32
|
+
(typically `~/src/<github_org>/platform-config/bassclef-platform.yml`)
|
|
33
|
+
|
|
34
|
+
Non-spine paths pass through (e.g., README, source code, narrative
|
|
35
|
+
markdown without YAML frontmatter, docs that aren't governed by the
|
|
36
|
+
spine).
|
|
37
|
+
|
|
38
|
+
## What the hook validates
|
|
39
|
+
|
|
40
|
+
| Storage shape | Extraction | Schema validates |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| A | reads whole JSON file | the entity object |
|
|
43
|
+
| B | extracts YAML frontmatter, converts to JSON | the frontmatter object |
|
|
44
|
+
| C | reads whole JSON file | the entity object |
|
|
45
|
+
| D | reads whole YAML file, converts to JSON | the entity object |
|
|
46
|
+
|
|
47
|
+
In all four cases, validator: `ajv-cli` draft-2020-12 with format
|
|
48
|
+
support (per ADR-015 single-format).
|
|
49
|
+
|
|
50
|
+
## What the hook does NOT validate
|
|
51
|
+
|
|
52
|
+
- **Markdown body content** of Shape B entities. Body sections (Procedure,
|
|
53
|
+
Acceptance, Sources read, narrative descriptions) are operator-readable
|
|
54
|
+
documentation; the schema doesn't constrain them.
|
|
55
|
+
- **Cross-entity reference dangling.** `state_reference_check` (in
|
|
56
|
+
`lib/state.sh`) is the read-time check; the hook validates that the
|
|
57
|
+
`references` array's items conform to the reference shape (typed
|
|
58
|
+
`{type, id, anchor?}`), not that every referenced entity exists. A
|
|
59
|
+
dangling reference is a read-time concern, not a write-time one.
|
|
60
|
+
- **Hash-as-index integrity.** Deferred to spine v1 per bassclef#316.
|
|
61
|
+
- **Migration scripts** writing to state files during one-shot
|
|
62
|
+
migrations (e.g., WU-4) — these explicitly bypass via
|
|
63
|
+
`SKIP_STATE_VALIDATE=1` because they're bootstrapping prior shapes
|
|
64
|
+
into the spine.
|
|
65
|
+
|
|
66
|
+
## What happens when validation fails
|
|
67
|
+
|
|
68
|
+
The hook BLOCKs the write (exit code 3, structured stderr message).
|
|
69
|
+
Output includes:
|
|
70
|
+
|
|
71
|
+
- Entity type (which schema was applied)
|
|
72
|
+
- Path being written
|
|
73
|
+
- ajv error details (which field, which constraint, which line)
|
|
74
|
+
- Three resolution paths:
|
|
75
|
+
1. Fix the data to match the schema (preferred)
|
|
76
|
+
2. Update the schema if it's wrong (requires PR review)
|
|
77
|
+
3. Override with `SKIP_STATE_VALIDATE=1` (logged; rare; not for normal work)
|
|
78
|
+
|
|
79
|
+
The agent receiving the BLOCK should treat it as a `BLOCKED:` per
|
|
80
|
+
`.claude/rules/blocked-items.md` — surface to operator, resolve, do
|
|
81
|
+
not silently retry without diagnosis.
|
|
82
|
+
|
|
83
|
+
## When to override
|
|
84
|
+
|
|
85
|
+
`SKIP_STATE_VALIDATE=1 <command>` is logged to stderr. Use only:
|
|
86
|
+
|
|
87
|
+
- **One-shot migration scripts** (WU-4 pattern) — bootstrapping prior
|
|
88
|
+
shapes into the spine; the data may not yet conform until migration
|
|
89
|
+
completes
|
|
90
|
+
- **Schema is genuinely wrong** AND a fix-the-schema PR is in flight
|
|
91
|
+
AND blocking on validation would block the schema fix itself
|
|
92
|
+
- **Emergency rescue** when the hook itself is broken (substrate-defect
|
|
93
|
+
recovery)
|
|
94
|
+
|
|
95
|
+
NOT for:
|
|
96
|
+
|
|
97
|
+
- "I'll fix the data later" — fix it now or document as a deferred
|
|
98
|
+
action
|
|
99
|
+
- "The schema is too strict" — file an amendment PR, don't bypass
|
|
100
|
+
- Routine work that happens to fail validation — the validation
|
|
101
|
+
failure is the signal that something's wrong
|
|
102
|
+
|
|
103
|
+
## When to update the schema
|
|
104
|
+
|
|
105
|
+
If the hook BLOCKs and the data is genuinely correct (the schema is
|
|
106
|
+
overly restrictive), open a PR amending the schema:
|
|
107
|
+
|
|
108
|
+
1. Edit `standards/state-spine/schemas/<entity>.schema.json`
|
|
109
|
+
2. Update `standards/state-spine.md` if the entity catalog or
|
|
110
|
+
storage-shape table changes
|
|
111
|
+
3. Validate the schema itself compiles cleanly under
|
|
112
|
+
`ajv compile --spec=draft2020 --strict`
|
|
113
|
+
4. Re-run `bash .claude/hooks/tests/state-validate.test.sh` to ensure
|
|
114
|
+
no regressions
|
|
115
|
+
5. Note the rationale in the PR body (what the schema previously
|
|
116
|
+
forbade that should be allowed; why)
|
|
117
|
+
|
|
118
|
+
Schema changes are themselves state changes — review accordingly.
|
|
119
|
+
|
|
120
|
+
## Relationship to other rules + standards
|
|
121
|
+
|
|
122
|
+
- `standards/state-spine.md` — entity catalog + storage shapes (defines
|
|
123
|
+
what gets validated and how)
|
|
124
|
+
- `standards/state-spine/schemas/*.schema.json` — the schemas this
|
|
125
|
+
rule enforces
|
|
126
|
+
- `standards/state-spine-contract.md` — accessor contract; mutations
|
|
127
|
+
via `state_<entity>_add/set/update_status` accessors invoke this
|
|
128
|
+
validator before writing
|
|
129
|
+
- `.claude/rules/accessor-library-discipline.md` — paired with this
|
|
130
|
+
rule; together they enforce read-side + write-side discipline
|
|
131
|
+
- `.claude/rules/blocked-items.md` — BLOCK protocol the hook fires
|
|
132
|
+
(resolve or explicitly defer)
|
|
133
|
+
- `.claude/hooks/state-validate.sh` — the mechanical implementation
|
|
134
|
+
- `.claude/hooks/tests/state-validate.test.sh` — test coverage
|
|
135
|
+
- `architecture/decisions/ADR-015-state-schema-format.md` — JSON Schema
|
|
136
|
+
only for v0; this hook uses ajv-cli per that decision
|
|
137
|
+
- bassclef#298 — chronicle Gate Evidence drops; this hook + Chronicle
|
|
138
|
+
schema together make that failure class structurally impossible
|
|
139
|
+
- bassclef#295, #296 — other defects from the four-incident set that
|
|
140
|
+
the spine v0 (incl. this rule) retires
|
|
141
|
+
|
|
142
|
+
## Enforcement
|
|
143
|
+
|
|
144
|
+
- **Hook**: `.claude/hooks/state-validate.sh` — fires on PreToolUse
|
|
145
|
+
with matcher `Edit|Write|MultiEdit`; wired in `.claude/settings.json`
|
|
146
|
+
- **Methodology**: this rule loads in every session; agents
|
|
147
|
+
self-check before writing state
|
|
148
|
+
- **Test coverage**: `.claude/hooks/tests/state-validate.test.sh` (14
|
|
149
|
+
tests covering all three shapes, override path, tool-name filter,
|
|
150
|
+
pass-through for non-state files)
|
|
151
|
+
|
|
152
|
+
## Override
|
|
153
|
+
|
|
154
|
+
`SKIP_STATE_VALIDATE=1 <command>` — logged to stderr per existing
|
|
155
|
+
bassclef hook idiom. Use sparingly; document rationale in commit
|
|
156
|
+
message.
|
|
157
|
+
|
|
158
|
+
## Retirement condition
|
|
159
|
+
|
|
160
|
+
This rule retires only if the state spine retires. The schemas may
|
|
161
|
+
evolve (v1 adds Persona accessor methods; v2+ adds template entities)
|
|
162
|
+
but the discipline of write-time validation persists.
|