@thebassclef/lite 0.1.3 → 1.0.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 +216 -137
- package/dist/cli.js +218 -139
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lite/.bassclef-source.json +10 -0
- package/dist/lite/.claude/settings.json +212 -0
- package/dist/lite/CLAUDE.md +41 -0
- package/dist/lite/gitignore +58 -0
- package/dist/lite/standards/bassclef-wiring-manifest.json +497 -0
- package/dist/lite/whereami.md +24 -0
- package/package.json +8 -2
- package/substrate/.bassclef/lite-manifest.json +0 -2701
- package/substrate/.claude/agents/architect.md +0 -70
- package/substrate/.claude/agents/builder.md +0 -114
- package/substrate/.claude/agents/designer.md +0 -156
- package/substrate/.claude/agents/reviewer.md +0 -88
- package/substrate/.claude/hooks/artifact-ingestion-gate.sh +0 -357
- package/substrate/.claude/hooks/assert-verify-steering.sh +0 -77
- package/substrate/.claude/hooks/bassclef-source-config-validate.sh +0 -215
- package/substrate/.claude/hooks/bassclef-sync.sh +0 -634
- package/substrate/.claude/hooks/compound-noun-scrub.sh +0 -292
- package/substrate/.claude/hooks/kiss-expansion-inject.sh +0 -69
- package/substrate/.claude/hooks/longrun-prep-compounding-axis-check.sh +0 -492
- package/substrate/.claude/hooks/longrun-prep-compounding-sequence-check.sh +0 -492
- package/substrate/.claude/hooks/plain-english-steering.sh +0 -156
- package/substrate/.claude/hooks/post-skill-friction-check.sh +0 -177
- package/substrate/.claude/hooks/post-skill-telemetry.sh +0 -62
- package/substrate/.claude/hooks/pre-build-gate.sh +0 -511
- package/substrate/.claude/hooks/pre-commit-gate.sh +0 -451
- package/substrate/.claude/hooks/session-end.sh +0 -433
- package/substrate/.claude/hooks/session-reflection.sh +0 -303
- package/substrate/.claude/hooks/skill-body-grade-gate.sh +0 -219
- package/substrate/.claude/hooks/skill-body-intent-drift.sh +0 -107
- package/substrate/.claude/hooks/skill-step-list-check.sh +0 -171
- package/substrate/.claude/hooks/state-validate.sh +0 -271
- package/substrate/.claude/hooks/substrate-clarity-gate.sh +0 -1110
- package/substrate/.claude/hooks/temperance-gate.sh +0 -147
- package/substrate/.claude/hooks/testing-tier-enforce.sh +0 -233
- package/substrate/.claude/hooks/turn-prose-grade-measure.sh +0 -219
- package/substrate/.claude/hooks/turn-prose-kiss-check.sh +0 -463
- package/substrate/.claude/hooks/vocabulary-migration-check.sh +0 -171
- package/substrate/.claude/hooks/whereami-utc-gate.sh +0 -142
- package/substrate/.claude/luminaries/alan-cooper.md +0 -170
- package/substrate/.claude/luminaries/alistair-cockburn.md +0 -140
- package/substrate/.claude/luminaries/amazon-pr-faq.md +0 -34
- package/substrate/.claude/luminaries/ash-maurya.md +0 -121
- package/substrate/.claude/luminaries/bill-buxton.md +0 -210
- package/substrate/.claude/luminaries/charles-sanders-peirce.md +0 -150
- package/substrate/.claude/luminaries/david-ogilvy.md +0 -192
- package/substrate/.claude/luminaries/don-norman.md +0 -173
- package/substrate/.claude/luminaries/edward-tufte.md +0 -179
- package/substrate/.claude/luminaries/eric-evans.md +0 -160
- package/substrate/.claude/luminaries/frederick-brooks.md +0 -50
- package/substrate/.claude/luminaries/gang-of-four.md +0 -157
- package/substrate/.claude/luminaries/glenford-myers.md +0 -230
- package/substrate/.claude/luminaries/hunt-thomas.md +0 -115
- package/substrate/.claude/luminaries/hyrum-wright.md +0 -94
- package/substrate/.claude/luminaries/jason-fried-dhh.md +0 -46
- package/substrate/.claude/luminaries/jesse-james-garrett.md +0 -154
- package/substrate/.claude/luminaries/john-ousterhout.md +0 -94
- package/substrate/.claude/luminaries/karl-popper.md +0 -132
- package/substrate/.claude/luminaries/kent-beck.md +0 -168
- package/substrate/.claude/luminaries/linus-torvalds.md +0 -218
- package/substrate/.claude/luminaries/martin-fowler.md +0 -164
- package/substrate/.claude/luminaries/michael-feathers.md +0 -125
- package/substrate/.claude/luminaries/michael-nygard.md +0 -118
- package/substrate/.claude/luminaries/robert-c-martin.md +0 -164
- package/substrate/.claude/luminaries/saltzer-schroeder.md +0 -194
- package/substrate/.claude/luminaries/sophia-prater.md +0 -193
- package/substrate/.claude/luminaries/stephen-toulmin.md +0 -131
- package/substrate/.claude/luminaries/tony-hoare.md +0 -170
- package/substrate/.claude/luminaries/vaughn-vernon.md +0 -50
- package/substrate/.claude/luminaries/w-edwards-deming.md +0 -158
- package/substrate/.claude/rules/accessor-library-discipline.md +0 -138
- package/substrate/.claude/rules/adr-discipline.md +0 -120
- package/substrate/.claude/rules/api-conventions.md +0 -125
- package/substrate/.claude/rules/artifact-ingestion.md +0 -179
- package/substrate/.claude/rules/assert-only-after-verify.md +0 -137
- package/substrate/.claude/rules/blocked-items.md +0 -146
- package/substrate/.claude/rules/bootstrap-pair-discipline.md +0 -141
- package/substrate/.claude/rules/branching.md +0 -28
- package/substrate/.claude/rules/cold-adopter-harness-discipline.md +0 -129
- package/substrate/.claude/rules/commit-conventions.md +0 -22
- package/substrate/.claude/rules/compounding-axis-fresh-analysis.md +0 -188
- package/substrate/.claude/rules/compounding-sequence-fresh-analysis.md +0 -188
- package/substrate/.claude/rules/context-engineering.md +0 -202
- package/substrate/.claude/rules/context-management.md +0 -85
- package/substrate/.claude/rules/defensive-bash.md +0 -68
- package/substrate/.claude/rules/deferred-actions.md +0 -233
- package/substrate/.claude/rules/destructive-operations.md +0 -69
- package/substrate/.claude/rules/diagnosis.md +0 -38
- package/substrate/.claude/rules/github-issue-flash-tweet.md +0 -156
- package/substrate/.claude/rules/guardrails.md +0 -73
- package/substrate/.claude/rules/hook-wire-on-author.md +0 -103
- package/substrate/.claude/rules/identifier-leak-prevention.md +0 -104
- package/substrate/.claude/rules/iteration-bet-brief-completeness.md +0 -54
- package/substrate/.claude/rules/lite-manifest-schema-change-discipline.md +0 -98
- package/substrate/.claude/rules/longrun-prep-plan-doc-compression.md +0 -89
- package/substrate/.claude/rules/loop-discipline.md +0 -81
- package/substrate/.claude/rules/manual-prod-approval.md +0 -100
- package/substrate/.claude/rules/marker-enrichment-discipline.md +0 -99
- package/substrate/.claude/rules/mobile-ephemeral-session.md +0 -109
- package/substrate/.claude/rules/new-dependency-check.md +0 -51
- package/substrate/.claude/rules/oo-ad-entry-point.md +0 -117
- package/substrate/.claude/rules/operator-facing-prose.md +0 -196
- package/substrate/.claude/rules/option-label-discipline.md +0 -108
- package/substrate/.claude/rules/pattern-annotation.md +0 -100
- package/substrate/.claude/rules/plain-english-discipline.md +0 -156
- package/substrate/.claude/rules/plan-enumeration-needs-value-props.md +0 -211
- package/substrate/.claude/rules/pr-body-shape.md +0 -317
- package/substrate/.claude/rules/pr-strategy.md +0 -167
- package/substrate/.claude/rules/pr-title-shape.md +0 -161
- package/substrate/.claude/rules/prototype-workflow.md +0 -65
- package/substrate/.claude/rules/reserved-skill-names.md +0 -123
- package/substrate/.claude/rules/schema-management.md +0 -49
- package/substrate/.claude/rules/sdlc-gates.md +0 -149
- package/substrate/.claude/rules/security.md +0 -37
- package/substrate/.claude/rules/session-artifacts.md +0 -236
- package/substrate/.claude/rules/skill-composition-declarations.md +0 -124
- package/substrate/.claude/rules/skill-description-clarity.md +0 -247
- package/substrate/.claude/rules/skill-procedure-step-list.md +0 -137
- package/substrate/.claude/rules/state-schema-validation.md +0 -162
- package/substrate/.claude/rules/stuck-signal-diagnostic.md +0 -140
- package/substrate/.claude/rules/substrate-config-schema.md +0 -98
- package/substrate/.claude/rules/test-list-discipline.md +0 -175
- package/substrate/.claude/rules/test-sufficiency.md +0 -210
- package/substrate/.claude/rules/testing-tier-config.md +0 -145
- package/substrate/.claude/rules/testing.md +0 -38
- package/substrate/.claude/rules/turn-estimate-grounding.md +0 -134
- package/substrate/.claude/rules/visual-hierarchy.md +0 -437
- package/substrate/.claude/rules/we-dont-break-adopters.md +0 -126
- package/substrate/.claude/rules/whereami-load-bearing.md +0 -202
- package/substrate/.claude/rules/writing-craft-discipline.md +0 -92
- package/substrate/.claude/rules/wu-sequencing-compounds.md +0 -145
- package/substrate/.claude/skills/build/SKILL.md +0 -640
- package/substrate/.claude/skills/chronicle/SKILL.md +0 -55
- package/substrate/.claude/skills/clean-artifacts/SKILL.md +0 -249
- package/substrate/.claude/skills/decompose/SKILL.md +0 -280
- package/substrate/.claude/skills/diagnose/SKILL.md +0 -297
- package/substrate/.claude/skills/feynman/SKILL.md +0 -90
- package/substrate/.claude/skills/howdoi/SKILL.md +0 -105
- package/substrate/.claude/skills/ia-model/SKILL.md +0 -108
- package/substrate/.claude/skills/interaction-design/SKILL.md +0 -112
- package/substrate/.claude/skills/interpret-input/SKILL.md +0 -180
- package/substrate/.claude/skills/journal/SKILL.md +0 -209
- package/substrate/.claude/skills/kiss/SKILL.md +0 -449
- package/substrate/.claude/skills/launch/SKILL.md +0 -915
- package/substrate/.claude/skills/lean-canvas/SKILL.md +0 -332
- package/substrate/.claude/skills/longrun/SKILL.md +0 -463
- package/substrate/.claude/skills/luminary/SKILL.md +0 -481
- package/substrate/.claude/skills/ogilvy-writing-audit/SKILL.md +0 -177
- package/substrate/.claude/skills/onboard-repo/SKILL.md +0 -1624
- package/substrate/.claude/skills/pattern-review/SKILL.md +0 -99
- package/substrate/.claude/skills/personas/SKILL.md +0 -207
- package/substrate/.claude/skills/promote/SKILL.md +0 -283
- package/substrate/.claude/skills/requirement/SKILL.md +0 -98
- package/substrate/.claude/skills/retro/SKILL.md +0 -117
- package/substrate/.claude/skills/riff/SKILL.md +0 -114
- package/substrate/.claude/skills/roadmap-reconcile/SKILL.md +0 -163
- package/substrate/.claude/skills/session-end/SKILL.md +0 -309
- package/substrate/.claude/skills/session-log/SKILL.md +0 -299
- package/substrate/.claude/skills/skills/SKILL.md +0 -228
- package/substrate/.claude/skills/spec/SKILL.md +0 -105
- package/substrate/.claude/skills/sprint/SKILL.md +0 -392
- package/substrate/.claude/skills/stage/SKILL.md +0 -384
- package/substrate/.claude/skills/state-a-problem/SKILL.md +0 -185
- package/substrate/.claude/skills/temperance/SKILL.md +0 -108
- package/substrate/.claude/skills/use-case/SKILL.md +0 -417
- package/substrate/.claude/skills/user-stories/SKILL.md +0 -268
- package/substrate/.claude/skills/value-prop/SKILL.md +0 -251
- package/substrate/.claude/skills/verify/SKILL.md +0 -160
- package/substrate/.claude/skills/visual-review/SKILL.md +0 -503
- package/substrate/.claude/skills/whats-the-plan/SKILL.md +0 -202
- package/substrate/.claude/skills/whereami/SKILL.md +0 -307
- package/substrate/AGENTS.md +0 -79
- package/substrate/CLAUDE-lite.md +0 -85
- package/substrate/CODE_OF_CONDUCT.md +0 -28
- package/substrate/CONTRIBUTING.md +0 -177
- package/substrate/README.md +0 -173
- package/substrate/SECURITY.md +0 -19
- package/substrate/architecture/decisions/ADR-029-release-pipeline.md +0 -79
- package/substrate/architecture/decisions/ADR-031-non-breaking-changes-adopter-discipline.md +0 -139
- package/substrate/architecture/decisions/ADR-032-adopter-sync-dispatcher-architecture.md +0 -192
- package/substrate/architecture/decisions/ADR-039-release-tagging-scheme.md +0 -145
- package/substrate/architecture/decisions/ADR-040-planning-skill-vocabulary-and-lite-profile.md +0 -155
- package/substrate/architecture/decisions/ADR-044-unified-skill-body-template.md +0 -162
- package/substrate/lib/clean-artifacts-sweep.sh +0 -112
- package/substrate/lib/code-comment-discipline.sh +0 -144
- package/substrate/lib/composer-preflight.sh +0 -459
- package/substrate/lib/hook-inject.sh +0 -255
- package/substrate/lib/luminary-pick.sh +0 -96
- package/substrate/lib/output-discipline.sh +0 -143
- package/substrate/lib/prose-scan-boundary.sh +0 -171
- package/substrate/lib/rewrite-check.sh +0 -214
- package/substrate/lib/state.sh +0 -1372
- package/substrate/lib/telemetry.sh +0 -205
- package/substrate/lib/tier-check.sh +0 -187
- package/substrate/lib/tier-dependency-audit.sh +0 -1088
- package/substrate/presence/install/bassclef-hook-connect.sh +0 -178
- package/substrate/presence/install/bassclef-sync.dispatcher.template.sh +0 -841
- package/substrate/presence/install/bassclef-sync.template.sh +0 -2076
- package/substrate/presence/install/schedule-auto-save.cron.sh +0 -88
- package/substrate/presence/install/schedule-auto-save.taskscheduler.md +0 -122
- package/substrate/scripts/aggregate-telemetry.sh +0 -217
- package/substrate/scripts/analyze-tier-dependencies.sh +0 -239
- package/substrate/scripts/generate-lite-manifest.sh +0 -505
- package/substrate/scripts/generate-tier-manifest.sh +0 -28
- package/substrate/scripts/intent-drift-check.sh +0 -456
- package/substrate/scripts/lite-manifest-drift-check.sh +0 -146
- package/substrate/scripts/render-lite-manifest-doc.sh +0 -150
- package/substrate/standards/adr-template.md +0 -86
- package/substrate/standards/api-conventions/nextjs.md +0 -84
- package/substrate/standards/artifact-composition.md +0 -209
- package/substrate/standards/bash-hook-safety.md +0 -246
- package/substrate/standards/bassclef-configs-schema.md +0 -232
- package/substrate/standards/bassclef-evolution.md +0 -143
- package/substrate/standards/bassclef-internal-jargon.md +0 -244
- package/substrate/standards/bassclef-managed-sentinel.md +0 -96
- package/substrate/standards/bassclef-source-config.md +0 -228
- package/substrate/standards/branch-stacking.md +0 -408
- package/substrate/standards/code-safety-principles.md +0 -176
- package/substrate/standards/composer-prerequisites.md +0 -155
- package/substrate/standards/deferred-actions-schema.md +0 -204
- package/substrate/standards/dependency-discipline/cargo.md +0 -39
- package/substrate/standards/dependency-discipline/gem.md +0 -43
- package/substrate/standards/dependency-discipline/go-mod.md +0 -41
- package/substrate/standards/dependency-discipline/npm.md +0 -42
- package/substrate/standards/dependency-discipline/pip.md +0 -42
- package/substrate/standards/deployment-topology/ec2-tailscale.md +0 -225
- package/substrate/standards/deployment-topology.md +0 -69
- package/substrate/standards/docs-sync-allowlist.md +0 -76
- package/substrate/standards/domain-and-dns.md +0 -145
- package/substrate/standards/frontend-stack.md +0 -67
- package/substrate/standards/frontmatter-schema.md +0 -154
- package/substrate/standards/graceful-exit.md +0 -227
- package/substrate/standards/hook-idempotency.md +0 -102
- package/substrate/standards/hook-injection-discipline.md +0 -202
- package/substrate/standards/hook-install-class.md +0 -215
- package/substrate/standards/input-handler-interface.md +0 -152
- package/substrate/standards/lite-manifest-schema-changes.md +0 -135
- package/substrate/standards/luminary-matching.md +0 -105
- package/substrate/standards/luminary-problem-patterns.md +0 -481
- package/substrate/standards/migration-discipline/active-record.md +0 -50
- package/substrate/standards/migration-discipline/alembic.md +0 -43
- package/substrate/standards/migration-discipline/gorm.md +0 -50
- package/substrate/standards/migration-discipline/prisma.md +0 -53
- package/substrate/standards/migration-discipline/sqlalchemy.md +0 -51
- package/substrate/standards/mobile-ephemeral-session.md +0 -167
- package/substrate/standards/model-routing-discipline.md +0 -160
- package/substrate/standards/ogilvy-writing-rules.md +0 -225
- package/substrate/standards/opener-discipline.md +0 -96
- package/substrate/standards/operator-facing-prose-discipline.md +0 -201
- package/substrate/standards/persona-schema.md +0 -229
- package/substrate/standards/pluggable-luminaries.md +0 -323
- package/substrate/standards/pr-body-discipline.md +0 -115
- package/substrate/standards/preview-state-schema.md +0 -189
- package/substrate/standards/project-directory-layout.md +0 -276
- package/substrate/standards/release-tagging.md +0 -137
- package/substrate/standards/reserved-skill-names.md +0 -120
- package/substrate/standards/scannable-multi-option-output.md +0 -261
- package/substrate/standards/sdlc-compliance.md +0 -286
- package/substrate/standards/sdlc-gates/typescript.md +0 -57
- package/substrate/standards/secrets-lifecycle.md +0 -210
- package/substrate/standards/security-scanner-adapter.md +0 -145
- package/substrate/standards/session-board.md +0 -256
- package/substrate/standards/skill-output-discipline.md +0 -90
- package/substrate/standards/state-spine-contract.md +0 -255
- package/substrate/standards/state-spine.md +0 -511
- package/substrate/standards/steering-hints/kiss-words.md +0 -11
- package/substrate/standards/substrate-config-schema.md +0 -267
- package/substrate/standards/tech-stack-config.md +0 -109
- package/substrate/standards/tier-dependency-analysis.md +0 -167
- package/substrate/standards/tier-runtime-deps/lite.md +0 -57
- package/substrate/standards/tier-tag-schema.md +0 -155
- package/substrate/standards/two-layer-config.md +0 -99
- package/substrate/standards/use-case-format.md +0 -292
- package/substrate/standards/user-story-invest.md +0 -268
- package/substrate/standards/velocity-and-appetite.md +0 -229
- package/substrate/standards/voice-input-pattern.md +0 -119
- package/substrate/standards/whereami-schema.md +0 -301
- package/substrate/standards/worktree-management.md +0 -211
- package/substrate/standards/writing-guide.md +0 -213
- package/substrate/templates/chronicle-template.md +0 -75
- package/substrate/templates/deferred-action-template.md +0 -45
- package/substrate/templates/memory-proposal-template.md +0 -77
- package/substrate/templates/persona-template.md +0 -200
- package/substrate/templates/pr-faq.md +0 -45
- package/substrate/templates/secret-rotation-template.md +0 -162
- package/substrate/templates/spec-template.md +0 -131
- package/substrate/templates/use-case-template.md +0 -194
- package/substrate/templates/user-story-template.md +0 -107
- package/substrate/templates/whereami-template.md +0 -101
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
tier: lite
|
|
3
|
-
status: live
|
|
4
|
-
date: 2026-06-27
|
|
5
|
-
authority: ADR-035
|
|
6
|
-
references:
|
|
7
|
-
- {type: adr, id: ADR-035, anchor: hooks as steering surfaces}
|
|
8
|
-
- {type: rule, id: .claude/rules/cold-adopter-harness-discipline.md, anchor: per-PR harness gate}
|
|
9
|
-
- {type: rule, id: .claude/rules/testing-tier-config.md, anchor: Tier 0 strict-TDD on .claude/hooks/*.sh}
|
|
10
|
-
- {type: rule, id: .claude/rules/bootstrap-pair-discipline.md, anchor: hook ships with paired test + settings entry}
|
|
11
|
-
- {type: standard, id: standards/hook-install-class.md, anchor: install-class header pairs with this discipline}
|
|
12
|
-
- {type: standard, id: standards/mechanism-fidelity.md, anchor: audit verifies injection hooks fire correctly}
|
|
13
|
-
- {type: external, id: code.claude.com/docs/en/hooks, anchor: hook event taxonomy as of 2026-06-27}
|
|
14
|
-
luminaries:
|
|
15
|
-
primary: [hyrum-wright, tony-hoare]
|
|
16
|
-
supporting: [john-ousterhout, kent-beck, michael-nygard]
|
|
17
|
-
description: - ADR-035 (just shipped, 8632d15) — 9-surface hook taxonomy + block-vs-inject menu; this standard names the contract for the inject side - code.claude.com/docs/en/hooks (WebFetch 2026-06-27) — additionalContext injection JSON shape; 10K char limit…
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
# Hook injection discipline
|
|
21
|
-
|
|
22
|
-
> **Anthropic docs reference:** Cites code.claude.com/docs/en/hooks as of 2026-06-27. Hook events and capabilities evolve. Before authoring a new injection hook, verify the event taxonomy and `additionalContext` capability against the current docs. The 10,000-character limit + JSON envelope shape + per-event injection support documented here may shift in future Claude Code releases.
|
|
23
|
-
|
|
24
|
-
## Sources read
|
|
25
|
-
|
|
26
|
-
- ADR-035 (just shipped, `8632d15`) — 9-surface hook taxonomy + block-vs-inject menu; this standard names the contract for the inject side
|
|
27
|
-
- `code.claude.com/docs/en/hooks` (WebFetch 2026-06-27) — `additionalContext` injection JSON shape; 10K char limit; six events that support injection
|
|
28
|
-
- `.claude/hooks/turn-prose-kiss-check.sh` (existing pattern) — example of a Stop hook that emits stderr (block) but does not yet inject `additionalContext`
|
|
29
|
-
- `.claude/hooks/pr-body-scrub-check.sh` (sibling pattern) — example of structured stderr + exit code 2
|
|
30
|
-
- `standards/bash-hook-safety.md` (sibling standard) — seven defensive disciplines for bash hooks
|
|
31
|
-
|
|
32
|
-
## What this standard covers
|
|
33
|
-
|
|
34
|
-
The contract for hooks that **inject context** into Claude's working memory rather than **block** a tool call. Six of nine Anthropic hook events accept an `additionalContext` field that becomes a system reminder attached to the agent's next turn. Bassclef has used hooks mostly as blockers; this standard names the contract for the other shape.
|
|
35
|
-
|
|
36
|
-
Companion standards:
|
|
37
|
-
- `standards/hook-install-class.md` — every hook declares whether it installs operator-class (`$HOME`) or project-class (`$CLAUDE_PROJECT_DIR`); injection hooks honor the declaration
|
|
38
|
-
- `standards/mechanism-fidelity.md` — the audit method that verifies an injection hook actually fires + produces observable effect
|
|
39
|
-
- `standards/bash-hook-safety.md` — seven defensive bash disciplines that injection hooks follow
|
|
40
|
-
|
|
41
|
-
## When to inject vs block
|
|
42
|
-
|
|
43
|
-
Per ADR-035 decision menu:
|
|
44
|
-
|
|
45
|
-
| Discipline shape | Output mechanism | Hook event |
|
|
46
|
-
|---|---|---|
|
|
47
|
-
| **Refuse** the tool call (the gate must have authority) | `exit 2` | PreToolUse (also Stop for post-write rewrite) |
|
|
48
|
-
| **Steer** the agent (rule sits at recency edge of context) | `additionalContext` injection | UserPromptSubmit, UserPromptExpansion, PostToolUse, PostToolBatch, Stop, SubagentStop, SessionStart |
|
|
49
|
-
| **Verify** the hook works | Tier 0 strict-TDD per `testing-tier-config.md` | n/a — applies to all hook types |
|
|
50
|
-
| **End-to-end test** the hook's stated effect | cold-adopter harness check class | n/a — applies to all hook types |
|
|
51
|
-
|
|
52
|
-
Pick block when the gate's job is to refuse. Pick inject when the gate's job is to remind, prime, or shape the next generation step. Use both when both apply (block + inject in the same hook).
|
|
53
|
-
|
|
54
|
-
## JSON envelope contract
|
|
55
|
-
|
|
56
|
-
Every injection hook returns valid JSON on stdout with this shape:
|
|
57
|
-
|
|
58
|
-
```json
|
|
59
|
-
{
|
|
60
|
-
"hookSpecificOutput": {
|
|
61
|
-
"hookEventName": "<EventName>",
|
|
62
|
-
"additionalContext": "<text that becomes a system reminder>"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Event-specific fields (per Anthropic docs):
|
|
68
|
-
|
|
69
|
-
| Event | Additional fields allowed |
|
|
70
|
-
|---|---|
|
|
71
|
-
| `SessionStart` | `sessionTitle`, `initialUserMessage`, `watchPaths`, `reloadSkills` |
|
|
72
|
-
| `UserPromptSubmit` | `decision: "block"`, `reason` |
|
|
73
|
-
| `UserPromptExpansion` | `decision: "block"`, `reason` |
|
|
74
|
-
| `PreToolUse` | `permissionDecision`, `permissionDecisionReason`, `updatedInput` |
|
|
75
|
-
| `PostToolUse` | `updatedToolOutput`, `decision: "block"` |
|
|
76
|
-
| `PostToolBatch` | `decision: "block"` |
|
|
77
|
-
| `Stop` | `decision: "block"` (the special pattern that lets the rewrite turn continue) |
|
|
78
|
-
| `SubagentStop` | `decision: "block"` |
|
|
79
|
-
|
|
80
|
-
When in doubt, verify against the latest Anthropic docs. The verify-latest header at the top of this standard names the reference.
|
|
81
|
-
|
|
82
|
-
## 10,000-character rule
|
|
83
|
-
|
|
84
|
-
`additionalContext` is capped at 10,000 characters by Anthropic. Excess is saved to file with a preview shown to the agent. For a hook that injects a wordlist + reminder text, this is ample (a 30-term wordlist + per-term gloss + 2-3 sentences of framing typically lands under 2,000 chars).
|
|
85
|
-
|
|
86
|
-
If a hook's intended injection exceeds the cap, restructure rather than truncate — either inject the index + write the full content to a file the agent can Read, OR split across multiple injection surfaces (SessionStart for full wordlist; UserPromptSubmit for compressed reminder).
|
|
87
|
-
|
|
88
|
-
## Marker-driven injection
|
|
89
|
-
|
|
90
|
-
When a hook should fire injection only on specific surfaces (e.g., turn-prose check only on /longrun-dispatched surfaces), it reads a marker file from `state/markers/<surface-type>/<surface-name>.marker`. Marker presence = the surface applies; marker absence = pass-through silently.
|
|
91
|
-
|
|
92
|
-
Two marker conventions:
|
|
93
|
-
|
|
94
|
-
- **Persistent markers** (per session or across sessions) — committed to git. Examples: `state/markers/temperance/`, `state/markers/luminary/`, `state/markers/arc-walk/`, `state/markers/adr/`, `state/markers/reviewer/`. These form audit trail.
|
|
95
|
-
- **Transient markers** (per turn or per surface, expire after the hook reads) — gitignored. Examples: `state/markers/turn-prose-surface/`. These signal the NEXT hook firing only and must not persist in committed state. Persisting them breaks tests that assume clean repo state (see bet 2026-06-27c WU-1 chronicle for the live failure example).
|
|
96
|
-
|
|
97
|
-
Per `standards/hook-install-class.md`, the marker location is consistent across install classes: hooks read from `$CLAUDE_PROJECT_DIR/state/markers/` if the dir exists, falling back to `$HOME/state/markers/` for operator-class hooks.
|
|
98
|
-
|
|
99
|
-
## Fail-soft contract
|
|
100
|
-
|
|
101
|
-
Every injection hook fails soft on missing prerequisites. Order of fallback (per ADR-035 Class A cure pattern):
|
|
102
|
-
|
|
103
|
-
1. Read project-relative path (`$CLAUDE_PROJECT_DIR/<resource>`) — preferred
|
|
104
|
-
2. Read env-var override (`$<HOOK_PREFIX>_<RESOURCE>` — e.g., `KISS_STANDARDS_FILE`)
|
|
105
|
-
3. Read user-level path (`$HOME/.claude/<resource>`) — operator-class fallback
|
|
106
|
-
4. Use inline defaults — last resort
|
|
107
|
-
|
|
108
|
-
If all four fail, the hook still exits 0 (silent pass) but emits a structured stderr message describing the fallback chain that failed. Adopters running the cold-adopter harness see the stderr in the harness output; the harness check class catches silent fallbacks per `standards/mechanism-fidelity.md`.
|
|
109
|
-
|
|
110
|
-
The shared helper library `lib/hook-inject.sh` (lands in WU-3 of bet 2026-06-27c) implements this fallback chain so individual hooks call `resolve_<resource>_path` rather than repeating the logic.
|
|
111
|
-
|
|
112
|
-
## Tier 0 testing requirement
|
|
113
|
-
|
|
114
|
-
Per `.claude/rules/testing-tier-config.md`, every hook in `.claude/hooks/*.sh` lands Tier 0 strict TDD. For injection hooks specifically, the test asserts:
|
|
115
|
-
|
|
116
|
-
1. **JSON output validity** — stdout parses as JSON
|
|
117
|
-
2. **Event name correctness** — `hookSpecificOutput.hookEventName` matches the wired event
|
|
118
|
-
3. **Injection content presence** — `additionalContext` non-empty when expected
|
|
119
|
-
4. **Fail-soft behavior** — missing inputs produce exit 0 + structured stderr (not exit 2)
|
|
120
|
-
5. **Both install classes** — test runs under project-class install layout AND operator-class install layout (per `standards/hook-install-class.md`)
|
|
121
|
-
6. **10,000-char ceiling** — injection content does not exceed the cap
|
|
122
|
-
|
|
123
|
-
The cold-adopter harness `hook-end-to-end-smoke` check class (lands in WU-5 of bet 2026-06-27c) re-runs steps 1-5 in adopter-shaped fixtures so the contract holds end-to-end.
|
|
124
|
-
|
|
125
|
-
## Worked example
|
|
126
|
-
|
|
127
|
-
A hypothetical UserPromptSubmit hook that injects the BLOCK wordlist on every operator turn (the cure pattern for bassclef-upstream#1027 / #1051):
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
#!/bin/bash
|
|
131
|
-
# tier: standard
|
|
132
|
-
# install-class: dual
|
|
133
|
-
# user-prompt-submit-kiss-prime.sh — inject BLOCK wordlist as additionalContext
|
|
134
|
-
set -euo pipefail
|
|
135
|
-
|
|
136
|
-
# Source the shared helper
|
|
137
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
138
|
-
source "${SCRIPT_DIR}/_lib/hook-inject.sh" 2>/dev/null \
|
|
139
|
-
|| source "${CLAUDE_PROJECT_DIR:-}/lib/hook-inject.sh" 2>/dev/null \
|
|
140
|
-
|| { echo "lib/hook-inject.sh missing" >&2; exit 0; }
|
|
141
|
-
|
|
142
|
-
# Resolve wordlist path (project → env → user → inline defaults)
|
|
143
|
-
WORDLIST=$(resolve_standards_path "bassclef-internal-jargon.md") || exit 0
|
|
144
|
-
|
|
145
|
-
# Build the injection
|
|
146
|
-
TERMS=$(extract_block_terms "$WORDLIST")
|
|
147
|
-
INJECTION="REMINDER: scan your draft against these BLOCK terms before posting:
|
|
148
|
-
${TERMS}
|
|
149
|
-
Substitute per the grade-10 plain-English table. Reserved-name allowlist: substrate, bassclef, cameo, Studio, Band, bandleader."
|
|
150
|
-
|
|
151
|
-
# Emit the JSON envelope (10K char-safe; structured stderr on failure)
|
|
152
|
-
emit_additional_context "UserPromptSubmit" "$INJECTION"
|
|
153
|
-
exit 0
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
Tier 0 test asserts the hook produces valid JSON envelope + non-empty `additionalContext` + exit 0 under both install layouts.
|
|
157
|
-
|
|
158
|
-
## Anti-patterns
|
|
159
|
-
|
|
160
|
-
### Inject when you should block
|
|
161
|
-
|
|
162
|
-
If a discipline genuinely requires refusing the action (e.g., destructive-command-guard), inject is wrong. The agent reads the injection and can still proceed. INSTEAD use PreToolUse exit 2.
|
|
163
|
-
|
|
164
|
-
### Block when you should inject
|
|
165
|
-
|
|
166
|
-
If a discipline benefits from steering the agent's generation rather than refusing the action (e.g., remind about the wordlist before the agent drafts a PR body), block is wrong — the agent sees the block AFTER drafting; the draft is already in transcript. INSTEAD use UserPromptSubmit injection so the rule sits at the recency edge BEFORE generation.
|
|
167
|
-
|
|
168
|
-
### Read project resources via SCRIPT_DIR/../.. under operator-class install
|
|
169
|
-
|
|
170
|
-
Per the Class A cure pattern (`turn-prose-kiss-check.sh` live failure example), a hook authored with project-relative reads but wired at `$HOME` resolves paths to `~/standards/` (nonexistent). INSTEAD use `lib/hook-inject.sh`'s resolve-helpers which honor declared install-class.
|
|
171
|
-
|
|
172
|
-
### Inject without test
|
|
173
|
-
|
|
174
|
-
A hook that injects but has no Tier 0 test isn't verified to produce its claimed effect. Per ADR-035 substrate-as-system tenet, this is legacy code. INSTEAD: ship the Tier 0 test in the same PR as the hook.
|
|
175
|
-
|
|
176
|
-
### Persist a transient marker
|
|
177
|
-
|
|
178
|
-
Committing a `state/markers/turn-prose-surface/*.marker` to git makes the hook see a marker that should expire per-turn. Tests that check "no marker → no advisory" break. INSTEAD: per the gitignore convention in `.gitignore`, transient marker directories are excluded.
|
|
179
|
-
|
|
180
|
-
## Composes with
|
|
181
|
-
|
|
182
|
-
- `standards/hook-install-class.md` — every injection hook declares install-class header; `lib/hook-inject.sh` honors it
|
|
183
|
-
- `standards/mechanism-fidelity.md` — audit verifies injection hooks fire + produce observable effect
|
|
184
|
-
- `standards/bash-hook-safety.md` — seven defensive bash disciplines that injection hooks follow
|
|
185
|
-
- `standards/cold-adopter-harness.md` — `hook-end-to-end-smoke` check class re-verifies injection contract
|
|
186
|
-
- `.claude/rules/testing-tier-config.md` — Tier 0 strict-TDD on `.claude/hooks/*.sh`
|
|
187
|
-
- `.claude/rules/bootstrap-pair-discipline.md` — every hook ships with paired test + settings.json entry
|
|
188
|
-
- `.claude/rules/blocked-items.md` — protocol when an injection hook surfaces a `BLOCKED:` condition
|
|
189
|
-
|
|
190
|
-
## Refs
|
|
191
|
-
|
|
192
|
-
- ADR-035 — hooks-as-steering-surfaces decision
|
|
193
|
-
- bassclef-upstream#417 — umbrella tracking for bet 2026-06-27c
|
|
194
|
-
- bassclef-upstream#1027 / #1051 / #1304 — prior lineage of turn-prose-kiss-check (Class B steering layer)
|
|
195
|
-
- `code.claude.com/docs/en/hooks` — Anthropic hook reference
|
|
196
|
-
- Michael Nygard — *Release It!* (stability patterns; fail-soft framing)
|
|
197
|
-
- Tony Hoare — pre/postcondition contract programming
|
|
198
|
-
- Hyrum Wright — Hyrum's Law (observable behavior becomes contract)
|
|
199
|
-
|
|
200
|
-
## Retirement condition
|
|
201
|
-
|
|
202
|
-
This standard retires only if Claude Code's hook event surface changes shape enough that `additionalContext` is no longer the injection mechanism. The verify-latest header is the cue: every reader checks the Anthropic reference before authoring; if the surface has shifted, the standard amends or supersedes.
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
tier: lite
|
|
3
|
-
status: live
|
|
4
|
-
date: 2026-06-27
|
|
5
|
-
authority: ADR-035
|
|
6
|
-
references:
|
|
7
|
-
- {type: adr, id: ADR-035, anchor: substrate-as-system tenet + hooks as steering surfaces}
|
|
8
|
-
- {type: adr, id: ADR-032, anchor: adopter sync dispatcher architecture}
|
|
9
|
-
- {type: adr, id: ADR-034, anchor: operator-class two-stage bootstrap}
|
|
10
|
-
- {type: standard, id: standards/hook-injection-discipline.md, anchor: injection hooks honor install-class}
|
|
11
|
-
- {type: standard, id: standards/cold-adopter-harness.md, anchor: harness verifies install-class matches actual wiring}
|
|
12
|
-
- {type: rule, id: .claude/rules/bootstrap-pair-discipline.md, anchor: new hook ships with install-class declaration}
|
|
13
|
-
- {type: rule, id: .claude/rules/cold-adopter-harness-discipline.md, anchor: per-PR harness gate}
|
|
14
|
-
luminaries:
|
|
15
|
-
primary: [john-ousterhout, linus-torvalds]
|
|
16
|
-
supporting: [hyrum-wright, frederick-brooks]
|
|
17
|
-
description: "- ADR-035 — names the install-class declaration as a foundational invariant (# install-class: operator | project | dual header) - ADR-032 — adopter sync dispatcher architecture (operator-class hooks wired at $HOME; project-class hooks wired at…"
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
# Hook install class
|
|
21
|
-
|
|
22
|
-
> **Anthropic docs reference:** This standard does not depend on a specific Anthropic surface — it is a bassclef convention layered over the Claude Code hook system. The convention applies regardless of future Claude Code hook event additions.
|
|
23
|
-
|
|
24
|
-
## Sources read
|
|
25
|
-
|
|
26
|
-
- ADR-035 — names the install-class declaration as a foundational invariant (`# install-class: operator | project | dual` header)
|
|
27
|
-
- ADR-032 — adopter sync dispatcher architecture (operator-class hooks wired at `$HOME`; project-class hooks wired at `$CLAUDE_PROJECT_DIR`)
|
|
28
|
-
- ADR-034 — extends ADR-032 to operator's own machine; both hook types now exist
|
|
29
|
-
- `.claude/hooks/turn-prose-kiss-check.sh` — the live Class A failure: code reads `$SCRIPT_DIR/../..` (project-relative); wiring at `$HOME` (operator-class); paths resolve to nonexistent locations
|
|
30
|
-
- `presence/install/bassclef-sync.template.sh` — the install template that copies hooks; will read install-class headers to decide where each goes
|
|
31
|
-
- `scripts/cold-adopter-harness-sync.sh` — runs structural checks today; will gain `hook-path-resolution-under-install-class` check class in WU-5
|
|
32
|
-
|
|
33
|
-
## What this standard covers
|
|
34
|
-
|
|
35
|
-
Every hook in `.claude/hooks/*.sh` declares its install class via a header line:
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
# install-class: operator | project | dual
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
The install class tells the install template (`presence/install/bassclef-sync.template.sh`) where to install the hook + tells the hook's code which path resolution layout to use + tells the cold-adopter harness which install layout to verify against.
|
|
42
|
-
|
|
43
|
-
This standard exists because the 2026-06-27 /diagnose of `turn-prose-kiss-check.sh` surfaced the Class A failure: hook authored project-relative reads but wired operator-class. Declared install-class makes the mismatch a declarative property the harness can verify rather than a latent bug.
|
|
44
|
-
|
|
45
|
-
## Install classes
|
|
46
|
-
|
|
47
|
-
### `operator`
|
|
48
|
-
|
|
49
|
-
The hook lives at `$HOME/.claude/hooks/<name>.sh` and is invoked by the operator's user-level Claude Code settings. Examples (current):
|
|
50
|
-
|
|
51
|
-
- `bassclef-sync.sh` — adopter sync engine; operator runs it; updates ride to adopters via the install template
|
|
52
|
-
- `session-end.sh` — session lifecycle; operator-scope
|
|
53
|
-
- `bug-diagnosis.sh` — diagnosis trigger; operator-scope
|
|
54
|
-
- `tool-failure-diagnosis.sh` — failure trigger; operator-scope
|
|
55
|
-
- `deploy-guard.sh` — deploy gate; operator-scope
|
|
56
|
-
- `memory-write-audit.sh` — memory write trigger; operator-scope
|
|
57
|
-
|
|
58
|
-
Operator-class hooks resolve project resources via the fallback chain (per `standards/hook-injection-discipline.md` fail-soft contract):
|
|
59
|
-
1. `$CLAUDE_PROJECT_DIR/<resource>` — when the active session has a project
|
|
60
|
-
2. Env-var override
|
|
61
|
-
3. `$HOME/.claude/<resource>` — operator-scope fallback
|
|
62
|
-
4. Inline defaults
|
|
63
|
-
|
|
64
|
-
Operator-class hooks MUST NOT read via `$SCRIPT_DIR/../../<project-resource>` because under `$HOME` install layout, that resolves to `~/<project-resource>` (nonexistent).
|
|
65
|
-
|
|
66
|
-
### `project`
|
|
67
|
-
|
|
68
|
-
The hook lives at `$CLAUDE_PROJECT_DIR/.claude/hooks/<name>.sh` and is invoked by the project's `.claude/settings.json`. Examples (current):
|
|
69
|
-
|
|
70
|
-
- `artifact-ingestion-gate.sh` — fires on Edit/Write of generative artifacts in the project
|
|
71
|
-
- `atomic-pr-check.sh` — fires on `git push` for this project
|
|
72
|
-
- `bet-doc-gate.sh` — fires on Edit/Write of `docs/iteration-bets/*.md`
|
|
73
|
-
- `destructive-command-guard.sh` — fires on Bash for destructive commands
|
|
74
|
-
- `pre-build-gate.sh` — fires on Edit/Write before first edit per branch
|
|
75
|
-
- `pre-commit-gate.sh` — fires on Bash matching git commit
|
|
76
|
-
- `pre-gh-pr-body-scrub.sh` — fires on Bash matching gh pr create
|
|
77
|
-
- `pre-gh-pr-title-scrub.sh` — fires on same
|
|
78
|
-
- `pre-git-commit-msg-scrub.sh` — fires on git commit messages
|
|
79
|
-
- `reviewer-dispatch-check.sh` — fires at Stop event
|
|
80
|
-
- `session-reflection.sh` — fires at SessionStart for the project
|
|
81
|
-
- `state-validate.sh` — fires on Edit/Write of state-spine entities
|
|
82
|
-
- `temperance-gate.sh` — fires per-branch
|
|
83
|
-
- `testing-tier-enforce.sh` — fires on Edit/Write of substrate-internal paths
|
|
84
|
-
|
|
85
|
-
Project-class hooks can use `$SCRIPT_DIR/../..` to reach project resources because under `$CLAUDE_PROJECT_DIR` install layout, that resolves correctly to the project root.
|
|
86
|
-
|
|
87
|
-
### `dual`
|
|
88
|
-
|
|
89
|
-
The hook works correctly under both install classes. Either:
|
|
90
|
-
- Code uses `lib/hook-inject.sh` resolve-helpers (preferred — always works regardless of install layout)
|
|
91
|
-
- Code reads only its own directory + env-var overrides + inline defaults (no project-resource reads)
|
|
92
|
-
|
|
93
|
-
Examples that should be `dual`:
|
|
94
|
-
- `turn-prose-kiss-check.sh` — needs to fire at Stop for operator-class scenarios (Stop is session-level) AND for project-class scenarios (cure work in follow-on goal)
|
|
95
|
-
- Future injection hooks that ship to adopters
|
|
96
|
-
|
|
97
|
-
## Header convention
|
|
98
|
-
|
|
99
|
-
Position: top of file, after the shebang + tier declaration, before the description.
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
#!/bin/bash
|
|
103
|
-
# tier: standard
|
|
104
|
-
# install-class: dual
|
|
105
|
-
# <one-line description>
|
|
106
|
-
#
|
|
107
|
-
# <rest of header comment>
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
The header is parseable by simple grep:
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
INSTALL_CLASS=$(grep -m1 '^# install-class:' .claude/hooks/<name>.sh | sed 's/^# install-class: *//')
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
If the header is missing, the hook is treated as `project` (current default).
|
|
117
|
-
|
|
118
|
-
## Install template enforcement
|
|
119
|
-
|
|
120
|
-
The install template (`presence/install/bassclef-sync.template.sh`) reads the install-class header at sync time. For each hook in the source tree:
|
|
121
|
-
|
|
122
|
-
| Declared install-class | Action |
|
|
123
|
-
|---|---|
|
|
124
|
-
| `operator` | Copy to `$HOME/.claude/hooks/<name>.sh`. Refuse to copy into `$CLAUDE_PROJECT_DIR/.claude/hooks/`. |
|
|
125
|
-
| `project` | Refuse to copy into `$HOME/.claude/hooks/`. Project-class hooks land via bassclef-sync's project file resolution, not via copy. |
|
|
126
|
-
| `dual` | Copy to `$HOME` AND make available under `$CLAUDE_PROJECT_DIR`. |
|
|
127
|
-
| `missing` | Treat as `project` (backwards-compatible default). |
|
|
128
|
-
|
|
129
|
-
This enforcement closes the failure mode where an operator-class hook copy + project-relative reads produce silent fallbacks.
|
|
130
|
-
|
|
131
|
-
(The actual template amendment lands in a follow-on goal; the standard documents the contract now so future authors honor it from the start.)
|
|
132
|
-
|
|
133
|
-
## Cold-adopter harness verification
|
|
134
|
-
|
|
135
|
-
The cold-adopter harness check class `hook-path-resolution-under-install-class` (lands in WU-5 of bet 2026-06-27c) verifies that declared install-class matches actual behavior. Per hook:
|
|
136
|
-
|
|
137
|
-
1. Read declared install-class from header
|
|
138
|
-
2. Install the hook fresh under the declared layout (operator-class → `$HOME`; project-class → `$CLAUDE_PROJECT_DIR`; dual → both)
|
|
139
|
-
3. Run the hook against a fixture trigger
|
|
140
|
-
4. Assert all path resolutions succeed (no `falls back to defaults` warnings in stderr)
|
|
141
|
-
5. Fail the check if any path lookup misses
|
|
142
|
-
|
|
143
|
-
This is the mechanical layer that catches future instances of the Class A failure at PR time.
|
|
144
|
-
|
|
145
|
-
## Worked example
|
|
146
|
-
|
|
147
|
-
### Operator-class hook (existing)
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
#!/bin/bash
|
|
151
|
-
# tier: standard
|
|
152
|
-
# install-class: operator
|
|
153
|
-
# bassclef-sync.sh — adopter sync engine; invoked by user-level Claude Code settings.
|
|
154
|
-
# ...
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
### Project-class hook (existing)
|
|
158
|
-
|
|
159
|
-
```bash
|
|
160
|
-
#!/bin/bash
|
|
161
|
-
# tier: standard
|
|
162
|
-
# install-class: project
|
|
163
|
-
# bet-doc-gate.sh — PreToolUse Edit/Write on docs/iteration-bets/*.md.
|
|
164
|
-
# Fires arc-walk + produces/consumes checks per goal doc discipline.
|
|
165
|
-
# ...
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### Dual hook (the cure for turn-prose-kiss-check.sh in follow-on goal)
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
#!/bin/bash
|
|
172
|
-
# tier: standard
|
|
173
|
-
# install-class: dual
|
|
174
|
-
# turn-prose-kiss-check.sh — Stop hook that scans assistant prose against
|
|
175
|
-
# BLOCK wordlist. Uses lib/hook-inject.sh resolve-helpers so path resolution
|
|
176
|
-
# works under both operator-class wiring at $HOME and project-class wiring
|
|
177
|
-
# at $CLAUDE_PROJECT_DIR.
|
|
178
|
-
# ...
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
## Anti-patterns
|
|
182
|
-
|
|
183
|
-
### Author project-relative reads + wire operator-class
|
|
184
|
-
|
|
185
|
-
The Class A failure pattern from bet 2026-06-27c /diagnose. INSTEAD: declare `# install-class: dual` + use `lib/hook-inject.sh` resolve-helpers.
|
|
186
|
-
|
|
187
|
-
### Decline to declare install-class
|
|
188
|
-
|
|
189
|
-
A hook without the header defaults to `project` and the install template refuses to copy it to `$HOME`. INSTEAD: pick `operator` / `project` / `dual` deliberately at author time.
|
|
190
|
-
|
|
191
|
-
### Mix install-class with hard-coded `$HOME` or `$CLAUDE_PROJECT_DIR` references
|
|
192
|
-
|
|
193
|
-
Defeats the abstraction. INSTEAD: source `lib/hook-inject.sh` + call its resolve-helpers; the helpers do the install-class-aware lookup.
|
|
194
|
-
|
|
195
|
-
## Composes with
|
|
196
|
-
|
|
197
|
-
- `standards/hook-injection-discipline.md` — injection hooks honor install-class via the fallback chain
|
|
198
|
-
- `standards/cold-adopter-harness.md` (standard tier) — `hook-path-resolution-under-install-class` check class verifies declared header matches actual behavior
|
|
199
|
-
- `presence/install/bassclef-sync.template.sh` — install template reads the header to decide install path
|
|
200
|
-
- `.claude/rules/bootstrap-pair-discipline.md` — new hook ships with install-class header in its bootstrap pair
|
|
201
|
-
- `.claude/rules/cold-adopter-harness-discipline.md` — per-PR harness gate runs the verification
|
|
202
|
-
|
|
203
|
-
## Refs
|
|
204
|
-
|
|
205
|
-
- ADR-035 — names install-class as a foundational invariant
|
|
206
|
-
- ADR-032 — adopter sync dispatcher architecture (operator-class vs project-class distinction)
|
|
207
|
-
- ADR-034 — operator-class two-stage bootstrap (where the operator-class hooks fold in)
|
|
208
|
-
- bassclef-upstream#417 — umbrella tracking for bet 2026-06-27c
|
|
209
|
-
- `architecture/audits/2026-06-27-mechanism-fidelity.md` (lands in WU-6) — first audit run will classify each hook by install-class + flag Class A mismatches
|
|
210
|
-
- @luminary john-ousterhout — deep modules: declared install-class is the small interface that hides path-resolution complexity
|
|
211
|
-
- @luminary linus-torvalds — we-don't-break-adopters: install-class declaration prevents a hook from silently breaking under adopter install layout
|
|
212
|
-
|
|
213
|
-
## Retirement condition
|
|
214
|
-
|
|
215
|
-
This standard retires only if bassclef stops distinguishing operator-class vs project-class hooks. The `dual` class may become the default if all future hooks are authored to use `lib/hook-inject.sh` resolve-helpers from the start, but the discipline of declaring install-class persists as audit trail.
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
tier: lite
|
|
3
|
-
description: "The interface contract between operator inputs (text / URL / image / repo / transcript / napkin / mixed) and the cameo pipeline's extraction layer."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Input Handler Interface
|
|
7
|
-
|
|
8
|
-
The interface contract between operator inputs (text / URL / image /
|
|
9
|
-
repo / transcript / napkin / mixed) and the cameo pipeline's
|
|
10
|
-
extraction layer. `/interpret-input` produces a normalized `InputArtifact`
|
|
11
|
-
from any input shape; downstream skills (`/objectory-decompose`,
|
|
12
|
-
`/value-prop`, `/personas`) consume the normalized artifact, never raw
|
|
13
|
-
operator input.
|
|
14
|
-
|
|
15
|
-
This standard is the contract. The implementation is
|
|
16
|
-
`.claude/skills/interpret-input/SKILL.md` + `scripts/interpret-input.sh`.
|
|
17
|
-
Schema lives at `standards/state-spine/schemas/input-artifact.schema.json`.
|
|
18
|
-
|
|
19
|
-
## Why this exists
|
|
20
|
-
|
|
21
|
-
Without an input-handler interface, every input shape requires its own
|
|
22
|
-
extraction code path. Adding a new input mode (e.g., PowerPoint slides,
|
|
23
|
-
PRD documents) means re-shaping the entire chain. The interface lets us:
|
|
24
|
-
|
|
25
|
-
- Implement extractors as ADAPTERS to the same downstream contract
|
|
26
|
-
- Test each extractor independently against the same schema
|
|
27
|
-
- Add new extractors without changing core extraction semantics
|
|
28
|
-
- Validate inputs structurally at the boundary
|
|
29
|
-
|
|
30
|
-
Per parent bet's amendment 2026-04-26c: original Phase B baked text-only
|
|
31
|
-
into `/objectory-decompose --text`, deferring abstraction to Phase C.
|
|
32
|
-
This forced a Phase B → Phase C refactor. The current shape establishes
|
|
33
|
-
the interface from day one with text as the first extractor implementation.
|
|
34
|
-
|
|
35
|
-
## Sources read
|
|
36
|
-
|
|
37
|
-
- `docs/iteration-bets/2026-04-25-example-pipeline.md` Phase B amendment 2026-04-26c — interface-establishing rationale
|
|
38
|
-
- `docs/iteration-bets/2026-04-27d-example-pipeline-phase-b-mvp.md` WU-A — implementation scope
|
|
39
|
-
- `standards/state-spine/schemas/input-artifact.schema.json` — schema this contract references
|
|
40
|
-
- `standards/state-spine.md` §"Storage format" — InputArtifact is Shape C (pure JSON at `docs/input-artifacts/<slug>.json`)
|
|
41
|
-
- `.claude/luminaries/martin-fowler.md` — Adapter pattern (each extractor adapts a source shape to the InputArtifact contract)
|
|
42
|
-
|
|
43
|
-
## Auto-detection heuristic
|
|
44
|
-
|
|
45
|
-
When `--type` is `auto` (default), `/interpret-input` infers type from
|
|
46
|
-
the source string:
|
|
47
|
-
|
|
48
|
-
| Pattern | Detected type |
|
|
49
|
-
|---|---|
|
|
50
|
-
| `^https?://` (URL prefix) | `url` |
|
|
51
|
-
| `\.(png\|jpg\|jpeg\|gif\|webp\|svg)$` (image extension) | `image` |
|
|
52
|
-
| `\.git$` or `github\.com` (repo URL/path) | `repo` |
|
|
53
|
-
| (default) | `text` |
|
|
54
|
-
|
|
55
|
-
Operator overrides by passing `--type=transcript` / `--type=napkin` /
|
|
56
|
-
`--type=mixed` explicitly. Auto-detection cannot distinguish a typed
|
|
57
|
-
transcript from prose, nor a hand-drawn napkin from a regular image —
|
|
58
|
-
both default to `text` and `image` respectively without explicit override.
|
|
59
|
-
|
|
60
|
-
## Extractor responsibilities
|
|
61
|
-
|
|
62
|
-
Each extractor implements one input type. Common responsibilities:
|
|
63
|
-
|
|
64
|
-
| Step | What | Required |
|
|
65
|
-
|---|---|---|
|
|
66
|
-
| 1. Receive raw input | Accept `source` argument verbatim | yes |
|
|
67
|
-
| 2. Validate / normalize | Trim, decode, check existence (for paths) | yes |
|
|
68
|
-
| 3. Populate `extracted_text` | Produce normalized prose for downstream | yes |
|
|
69
|
-
| 4. Populate `structural_hints` | Extract type-specific signals when available | optional |
|
|
70
|
-
| 5. Populate `external_urls` | URL regex matches in source / extracted text | optional |
|
|
71
|
-
| 6. Schema validate | Output must conform to InputArtifact schema | yes |
|
|
72
|
-
|
|
73
|
-
`extracted_text` is the load-bearing output — `/objectory-decompose`
|
|
74
|
-
operates on it. `structural_hints` are best-effort enrichment.
|
|
75
|
-
|
|
76
|
-
## Phase B vs Phase C scope
|
|
77
|
-
|
|
78
|
-
**Phase B (this MVP, WU-A)**: text mode is fully implemented. Other
|
|
79
|
-
modes return stub `InputArtifact` with:
|
|
80
|
-
|
|
81
|
-
- `type: <name>` (correct)
|
|
82
|
-
- `source: <input>` (correct)
|
|
83
|
-
- `extracted_text: "deferred to Phase C"` (sentinel value)
|
|
84
|
-
- All structural_hints empty
|
|
85
|
-
- `external_urls: []`
|
|
86
|
-
|
|
87
|
-
This lets downstream skills (`/objectory-decompose`, `/preview`)
|
|
88
|
-
exercise the interface against any input type without breaking on
|
|
89
|
-
"extractor not implemented." Stub artifacts are still schema-valid.
|
|
90
|
-
|
|
91
|
-
**Phase C (follow-up goal)**: implements remaining extractors as ADAPTERS
|
|
92
|
-
against this contract. No core extraction changes; only new extractor
|
|
93
|
-
implementations.
|
|
94
|
-
|
|
95
|
-
| Type | Extractor approach | Phase |
|
|
96
|
-
|---|---|---|
|
|
97
|
-
| text | Identity (extracted_text = source); URL regex for external_urls | B (this MVP) |
|
|
98
|
-
| url | Fetch + readable-text scrape; cite references | C |
|
|
99
|
-
| image | Vision-based UI-element extraction → boundary_objects | C |
|
|
100
|
-
| repo | Read README + top-level structure + open issues | C |
|
|
101
|
-
| transcript | Speaker-tagged actor → verb mapping | C |
|
|
102
|
-
| napkin | Hand-drawn diagram → entities + boundary_objects | C |
|
|
103
|
-
| mixed | Compose multiple extractors over multi-source input | C |
|
|
104
|
-
|
|
105
|
-
## Storage shape
|
|
106
|
-
|
|
107
|
-
InputArtifact is Shape C (pure JSON) per `standards/state-spine.md`
|
|
108
|
-
§"Storage format":
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
docs/input-artifacts/<slug>.json
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Validated at write by `state-validate.sh` PreToolUse hook against
|
|
115
|
-
`input-artifact.schema.json`. Operator-readable narrative belongs in
|
|
116
|
-
chronicles + decompositions, not in InputArtifact bodies.
|
|
117
|
-
|
|
118
|
-
## Slug convention
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
<YYYY-MM-DD>-<type>-<6-char-hash-of-source>
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
Examples:
|
|
125
|
-
- `2026-04-27-text-3a1b2c` (text input from operator paragraph)
|
|
126
|
-
- `2026-04-27-url-9f8e7d` (URL extraction)
|
|
127
|
-
- `2026-04-27-repo-1a2b3c` (repo extraction)
|
|
128
|
-
|
|
129
|
-
Operator may override via `--slug=<custom>` for memorable fixtures
|
|
130
|
-
(e.g., `2026-04-27-poa-five-pandas-rework`).
|
|
131
|
-
|
|
132
|
-
## Naming convention
|
|
133
|
-
|
|
134
|
-
Skills using InputArtifacts read via `state_reference_get input-artifact <slug>`
|
|
135
|
-
per `standards/state-spine-contract.md`. Direct `cat docs/input-artifacts/<slug>.json`
|
|
136
|
-
is forbidden by `accessor-library-discipline.md`.
|
|
137
|
-
|
|
138
|
-
## Relationship to other standards
|
|
139
|
-
|
|
140
|
-
- `standards/state-spine.md` §"Storage format" — InputArtifact is Shape C
|
|
141
|
-
- `standards/state-spine/schemas/input-artifact.schema.json` — formal schema
|
|
142
|
-
- `standards/state-spine-contract.md` — accessor surface for reading
|
|
143
|
-
- `.claude/rules/accessor-library-discipline.md` — read-discipline applies
|
|
144
|
-
- `.claude/skills/interpret-input/SKILL.md` — the skill that produces InputArtifacts
|
|
145
|
-
- `.claude/skills/objectory-decompose/SKILL.md` — primary downstream consumer
|
|
146
|
-
- `.claude/skills/preview/SKILL.md` — composer that orchestrates the chain
|
|
147
|
-
|
|
148
|
-
## Versioning
|
|
149
|
-
|
|
150
|
-
This contract is v0. New extractor additions are non-breaking (additive).
|
|
151
|
-
Schema changes (new required fields, removed properties) are v1; ship as
|
|
152
|
-
parallel `input-artifact-v1.schema.json` per Fowler expand-and-contract.
|