@thebassclef/lite 0.1.2 → 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 +238 -127
- package/dist/cli.js +240 -129
- 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,292 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# tier: lite
|
|
3
|
-
# install-class: dual
|
|
4
|
-
# compound-noun-scrub.sh — PreToolUse Edit|Write gate on
|
|
5
|
-
# .claude/skills/*/SKILL.md and .claude/rules/*.md.
|
|
6
|
-
#
|
|
7
|
-
# V2 — reads blocklist from standards/bassclef-internal-jargon.md
|
|
8
|
-
# (single source of truth per bassclef-upstream#782). No hardcoded
|
|
9
|
-
# allowlist. No heuristic detection. Literal match against BLOCK-tier
|
|
10
|
-
# hyphenated compounds in the wordlist file. Standard tech compounds
|
|
11
|
-
# like pre-commit, real-time, data-driven pass automatically because
|
|
12
|
-
# they are not in the blocklist. New invented compounds pass by default
|
|
13
|
-
# until the operator adds them to the wordlist.
|
|
14
|
-
#
|
|
15
|
-
# Sister to skill-body-grade-gate.sh (FKGL) and turn-prose-kiss-check.sh
|
|
16
|
-
# (which reads the same wordlist file for Stop-event prose scrub).
|
|
17
|
-
#
|
|
18
|
-
# Input (stdin): JSON with tool_name + tool_input.file_path + content/new_string
|
|
19
|
-
# Exit: 0 pass, 2 block
|
|
20
|
-
#
|
|
21
|
-
# Override: SKIP_COMPOUND_NOUN_SCRUB=1
|
|
22
|
-
# Wordlist path override (tests): BASSCLEF_JARGON_WORDLIST=<path>
|
|
23
|
-
#
|
|
24
|
-
# Per @luminary kent-beck (Tier 0 strict TDD)
|
|
25
|
-
# + @luminary donald-norman (plain-English target)
|
|
26
|
-
# + @luminary john-ousterhout (single source of truth wordlist).
|
|
27
|
-
|
|
28
|
-
set +e
|
|
29
|
-
|
|
30
|
-
# === Override ===
|
|
31
|
-
if [ "${SKIP_COMPOUND_NOUN_SCRUB:-0}" = "1" ]; then
|
|
32
|
-
exit 0
|
|
33
|
-
fi
|
|
34
|
-
|
|
35
|
-
# === Parse stdin ===
|
|
36
|
-
STDIN_JSON=$(cat 2>/dev/null || echo '{}')
|
|
37
|
-
|
|
38
|
-
if ! echo "$STDIN_JSON" | jq -e . >/dev/null 2>&1; then
|
|
39
|
-
exit 0
|
|
40
|
-
fi
|
|
41
|
-
|
|
42
|
-
TOOL_NAME=$(echo "$STDIN_JSON" | jq -r '.tool_name // ""' 2>/dev/null)
|
|
43
|
-
FILE_PATH=$(echo "$STDIN_JSON" | jq -r '.tool_input.file_path // ""' 2>/dev/null)
|
|
44
|
-
|
|
45
|
-
# Only fire on Write or Edit
|
|
46
|
-
if [ "$TOOL_NAME" != "Write" ] && [ "$TOOL_NAME" != "Edit" ]; then
|
|
47
|
-
exit 0
|
|
48
|
-
fi
|
|
49
|
-
|
|
50
|
-
# Fire on SKILL.md, rule .md, OR bash source under scoped paths (bassclef-upstream#1051).
|
|
51
|
-
# Bash paths use ADVISORY mode by default; BASSCLEF_BASH_HEADER_STRICT=1 flips to BLOCK.
|
|
52
|
-
IS_BASH_PATH=0
|
|
53
|
-
case "$FILE_PATH" in
|
|
54
|
-
*".claude/skills/"*"/SKILL.md")
|
|
55
|
-
;;
|
|
56
|
-
*".claude/rules/"*.md)
|
|
57
|
-
;;
|
|
58
|
-
*".claude/hooks/"*.sh)
|
|
59
|
-
IS_BASH_PATH=1
|
|
60
|
-
;;
|
|
61
|
-
*"scripts/"*.sh)
|
|
62
|
-
IS_BASH_PATH=1
|
|
63
|
-
;;
|
|
64
|
-
*"lib/"*.sh)
|
|
65
|
-
IS_BASH_PATH=1
|
|
66
|
-
;;
|
|
67
|
-
*"presence/"*.sh)
|
|
68
|
-
IS_BASH_PATH=1
|
|
69
|
-
;;
|
|
70
|
-
*)
|
|
71
|
-
exit 0
|
|
72
|
-
;;
|
|
73
|
-
esac
|
|
74
|
-
|
|
75
|
-
# === Extract text ===
|
|
76
|
-
if [ "$TOOL_NAME" = "Write" ]; then
|
|
77
|
-
CONTENT=$(echo "$STDIN_JSON" | jq -r '.tool_input.content // ""' 2>/dev/null)
|
|
78
|
-
else
|
|
79
|
-
CONTENT=$(echo "$STDIN_JSON" | jq -r '.tool_input.new_string // ""' 2>/dev/null)
|
|
80
|
-
fi
|
|
81
|
-
|
|
82
|
-
[ -z "$CONTENT" ] && exit 0
|
|
83
|
-
|
|
84
|
-
# === Bash path handling (bassclef-upstream#1051) ===
|
|
85
|
-
# For bash paths, extract only the header comment block and require the
|
|
86
|
-
# `# tier:` header tag. Adopter files without the tier tag pass through
|
|
87
|
-
# untouched (Linus R2.1 adopter safety).
|
|
88
|
-
if [ "$IS_BASH_PATH" = "1" ]; then
|
|
89
|
-
# Extract header comment block — starting from the first line of #-comments
|
|
90
|
-
# (skipping shebang if present), stopping at first non-# non-blank line.
|
|
91
|
-
HEADER=$(printf '%s' "$CONTENT" | awk '
|
|
92
|
-
BEGIN { started=0 }
|
|
93
|
-
NR==1 && /^#!/ { next } # skip shebang
|
|
94
|
-
/^#/ { print; started=1; next }
|
|
95
|
-
/^[[:space:]]*$/ { if (started==0) next; else print; next }
|
|
96
|
-
{ exit }
|
|
97
|
-
')
|
|
98
|
-
|
|
99
|
-
# Adopter safety — require `# tier:` marker (bassclef convention).
|
|
100
|
-
# Absent tier tag → adopter-authored, pass through silently.
|
|
101
|
-
if ! echo "$HEADER" | grep -qE '^# ?tier:'; then
|
|
102
|
-
exit 0
|
|
103
|
-
fi
|
|
104
|
-
|
|
105
|
-
# Replace CONTENT with just the header block for the scan
|
|
106
|
-
CONTENT="$HEADER"
|
|
107
|
-
fi
|
|
108
|
-
|
|
109
|
-
# === Locate wordlist ===
|
|
110
|
-
# Test override wins; then repo-relative from hook location; then fail-safe.
|
|
111
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
112
|
-
WORDLIST="${BASSCLEF_JARGON_WORDLIST:-$SCRIPT_DIR/../../standards/bassclef-internal-jargon.md}"
|
|
113
|
-
|
|
114
|
-
if [ ! -f "$WORDLIST" ]; then
|
|
115
|
-
echo "" >&2
|
|
116
|
-
echo "compound-noun-scrub: wordlist file not found at $WORDLIST" >&2
|
|
117
|
-
echo " Fail-safe: passing through. Add wordlist file to enable blocklist scan." >&2
|
|
118
|
-
echo "" >&2
|
|
119
|
-
exit 0
|
|
120
|
-
fi
|
|
121
|
-
|
|
122
|
-
# === Scrub via python — reads blocklist + matches literal terms ===
|
|
123
|
-
SCRUB_OUTPUT=$(printf '%s' "$CONTENT" | WORDLIST="$WORDLIST" python3 -c '
|
|
124
|
-
import sys, re, os
|
|
125
|
-
|
|
126
|
-
text = sys.stdin.read()
|
|
127
|
-
|
|
128
|
-
# === Strip surfaces the scrub should ignore ===
|
|
129
|
-
|
|
130
|
-
# Strip YAML frontmatter
|
|
131
|
-
text = re.sub(r"^---\n.*?\n---\n", "", text, count=1, flags=re.DOTALL)
|
|
132
|
-
|
|
133
|
-
# Strip FKGL-EXEMPT blocks (matches skill-body-grade-gate.sh L77-L78 per #800)
|
|
134
|
-
text = re.sub(r"<!--\s*FKGL-EXEMPT:.*?-->.*?<!--\s*/FKGL-EXEMPT\s*-->",
|
|
135
|
-
"", text, flags=re.DOTALL)
|
|
136
|
-
|
|
137
|
-
# Strip code blocks (```...```)
|
|
138
|
-
text = re.sub(r"```.*?```", "", text, flags=re.DOTALL)
|
|
139
|
-
|
|
140
|
-
# Strip inline backticks
|
|
141
|
-
text = re.sub(r"`[^`]*`", "", text)
|
|
142
|
-
|
|
143
|
-
# Strip URLs (http:// or https:// through whitespace)
|
|
144
|
-
text = re.sub(r"https?://\S+", "", text)
|
|
145
|
-
|
|
146
|
-
# Strip slash-prefixed refs (/skill-name, /roadmap-reconcile) — proper nouns
|
|
147
|
-
text = re.sub(r"/[a-zA-Z]+(-[a-zA-Z]+)+", "", text)
|
|
148
|
-
|
|
149
|
-
# Strip file paths (foo/bar-baz.md) — proper nouns
|
|
150
|
-
text = re.sub(r"[a-zA-Z_./-]*/[a-zA-Z_.-]+\.[a-z]+", "", text)
|
|
151
|
-
|
|
152
|
-
# === Read blocklist from wordlist file ===
|
|
153
|
-
wordlist_path = os.environ.get("WORDLIST", "")
|
|
154
|
-
blocklist = set()
|
|
155
|
-
|
|
156
|
-
try:
|
|
157
|
-
with open(wordlist_path, "r") as f:
|
|
158
|
-
lines = f.readlines()
|
|
159
|
-
except (OSError, IOError):
|
|
160
|
-
print("PASS")
|
|
161
|
-
sys.exit(0)
|
|
162
|
-
|
|
163
|
-
# Parse markdown table — extract BLOCK-tier rows from column 1
|
|
164
|
-
# Row shape: | Term | Plain English | Tier |
|
|
165
|
-
# Tier column may be BLOCK, BLOCK-title, ADVISE, ALLOW
|
|
166
|
-
for line in lines:
|
|
167
|
-
line = line.strip()
|
|
168
|
-
if not line.startswith("|") or not line.endswith("|"):
|
|
169
|
-
continue
|
|
170
|
-
cells = [c.strip() for c in line.split("|")[1:-1]]
|
|
171
|
-
if len(cells) != 3:
|
|
172
|
-
continue
|
|
173
|
-
term_cell, _plain, tier = cells
|
|
174
|
-
|
|
175
|
-
# Only BLOCK tier — BLOCK-title is title-only scrub (different hook)
|
|
176
|
-
if tier != "BLOCK":
|
|
177
|
-
continue
|
|
178
|
-
|
|
179
|
-
# Extract the term BEFORE any parenthetical context.
|
|
180
|
-
# Row example: "OR hand-roll (soft-INSTEAD escape per bassclef-upstream#375)"
|
|
181
|
-
# Take "OR hand-roll" — then extract hyphenated compounds within.
|
|
182
|
-
term_part = term_cell.split("(", 1)[0].strip()
|
|
183
|
-
|
|
184
|
-
# Extract every lowercase-alpha hyphenated compound in the term part.
|
|
185
|
-
# Compound pattern: alpha (2+ chars) then one-or-more hyphenated alpha (2+ chars).
|
|
186
|
-
compounds = re.findall(r"\b[a-z][a-z]+(?:-[a-z][a-z]+)+\b", term_part.lower())
|
|
187
|
-
for c in compounds:
|
|
188
|
-
# Skip bassclef proper nouns that leak in (bassclef-upstream, bassclef-web, etc.)
|
|
189
|
-
if c.startswith("bassclef-"):
|
|
190
|
-
continue
|
|
191
|
-
blocklist.add(c)
|
|
192
|
-
|
|
193
|
-
if not blocklist:
|
|
194
|
-
# Empty blocklist → fail safe (do not block anything)
|
|
195
|
-
print("PASS")
|
|
196
|
-
sys.exit(0)
|
|
197
|
-
|
|
198
|
-
# === Match literal blocklist terms in scan text ===
|
|
199
|
-
flagged = []
|
|
200
|
-
seen = set()
|
|
201
|
-
|
|
202
|
-
text_lower = text.lower()
|
|
203
|
-
for term in sorted(blocklist):
|
|
204
|
-
# Word-boundary match, case-insensitive already via text_lower
|
|
205
|
-
if re.search(r"\b" + re.escape(term) + r"\b", text_lower):
|
|
206
|
-
if term not in seen:
|
|
207
|
-
flagged.append(term)
|
|
208
|
-
seen.add(term)
|
|
209
|
-
|
|
210
|
-
if flagged:
|
|
211
|
-
print("BLOCK", len(flagged))
|
|
212
|
-
for f in flagged[:10]:
|
|
213
|
-
print(f" FLAG {f}")
|
|
214
|
-
else:
|
|
215
|
-
print("PASS")
|
|
216
|
-
' 2>/dev/null)
|
|
217
|
-
|
|
218
|
-
# === Parse result ===
|
|
219
|
-
FIRST_LINE=$(echo "$SCRUB_OUTPUT" | head -1)
|
|
220
|
-
VERDICT=$(echo "$FIRST_LINE" | awk '{print $1}')
|
|
221
|
-
|
|
222
|
-
case "$VERDICT" in
|
|
223
|
-
PASS|"")
|
|
224
|
-
exit 0
|
|
225
|
-
;;
|
|
226
|
-
BLOCK)
|
|
227
|
-
COUNT=$(echo "$FIRST_LINE" | awk '{print $2}')
|
|
228
|
-
;;
|
|
229
|
-
*)
|
|
230
|
-
exit 0
|
|
231
|
-
;;
|
|
232
|
-
esac
|
|
233
|
-
|
|
234
|
-
# === Determine emit mode ===
|
|
235
|
-
# Bash paths use ADVISORY (exit 0 + stderr note) unless
|
|
236
|
-
# BASSCLEF_BASH_HEADER_STRICT=1 flips to BLOCK. Non-bash paths always BLOCK.
|
|
237
|
-
EMIT_MODE="BLOCK"
|
|
238
|
-
if [ "$IS_BASH_PATH" = "1" ] && [ "${BASSCLEF_BASH_HEADER_STRICT:-0}" != "1" ]; then
|
|
239
|
-
EMIT_MODE="ADVISORY"
|
|
240
|
-
fi
|
|
241
|
-
|
|
242
|
-
# === Emit ===
|
|
243
|
-
if [ "$EMIT_MODE" = "ADVISORY" ]; then
|
|
244
|
-
# ADVISORY — bash path header jargon (bassclef-upstream#1051)
|
|
245
|
-
echo "" >&2
|
|
246
|
-
echo "⚠️ COMPOUND-NOUN-SCRUB — ADVISORY (bash header)" >&2
|
|
247
|
-
echo "" >&2
|
|
248
|
-
echo " File: $FILE_PATH" >&2
|
|
249
|
-
echo " Found $COUNT jargon compound(s) in header comment from standards/bassclef-internal-jargon.md:" >&2
|
|
250
|
-
echo "$SCRUB_OUTPUT" | grep '^ FLAG' | while read -r _ compound; do
|
|
251
|
-
echo " - $compound (see wordlist for plain-English substitute)" >&2
|
|
252
|
-
done
|
|
253
|
-
echo "" >&2
|
|
254
|
-
echo " Advisory only — exit 0. Set BASSCLEF_BASH_HEADER_STRICT=1 to make bash headers block." >&2
|
|
255
|
-
echo " Override: SKIP_COMPOUND_NOUN_SCRUB=1 (logged via trace-helper)" >&2
|
|
256
|
-
echo "" >&2
|
|
257
|
-
|
|
258
|
-
# Trace
|
|
259
|
-
if [ -f "$SCRIPT_DIR/trace-helper.sh" ]; then
|
|
260
|
-
# shellcheck disable=SC1091
|
|
261
|
-
source "$SCRIPT_DIR/trace-helper.sh"
|
|
262
|
-
trace_log "compound-noun-scrub" "ADVISORY count=$COUNT file=$FILE_PATH"
|
|
263
|
-
fi
|
|
264
|
-
exit 0
|
|
265
|
-
fi
|
|
266
|
-
|
|
267
|
-
# === Emit BLOCK ===
|
|
268
|
-
echo "" >&2
|
|
269
|
-
echo "🛑 COMPOUND-NOUN-SCRUB — BLOCKED" >&2
|
|
270
|
-
echo "" >&2
|
|
271
|
-
echo " File: $FILE_PATH" >&2
|
|
272
|
-
echo " Found $COUNT invented compound(s) from standards/bassclef-internal-jargon.md:" >&2
|
|
273
|
-
echo "$SCRUB_OUTPUT" | grep '^ FLAG' | while read -r _ compound; do
|
|
274
|
-
echo " - $compound" >&2
|
|
275
|
-
done
|
|
276
|
-
echo "" >&2
|
|
277
|
-
echo " Cure paths:" >&2
|
|
278
|
-
echo " 1. Rewrite the sentence in plain SVO English per standards/bassclef-internal-jargon.md" >&2
|
|
279
|
-
echo " 2. If the term is genuinely needed as a proper noun, mark exempt via <!-- FKGL-EXEMPT -->" >&2
|
|
280
|
-
echo " 3. If the term should not be on the blocklist, propose a wordlist amendment" >&2
|
|
281
|
-
echo "" >&2
|
|
282
|
-
echo " Override: SKIP_COMPOUND_NOUN_SCRUB=1 (logged via trace-helper)" >&2
|
|
283
|
-
echo "" >&2
|
|
284
|
-
|
|
285
|
-
# === Trace ===
|
|
286
|
-
if [ -f "$SCRIPT_DIR/trace-helper.sh" ]; then
|
|
287
|
-
# shellcheck disable=SC1091
|
|
288
|
-
source "$SCRIPT_DIR/trace-helper.sh"
|
|
289
|
-
trace_log "compound-noun-scrub" "BLOCKED count=$COUNT file=$FILE_PATH"
|
|
290
|
-
fi
|
|
291
|
-
|
|
292
|
-
exit 2
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# tier: lite
|
|
3
|
-
# install-class: dual
|
|
4
|
-
# kiss-expansion-inject.sh — UserPromptExpansion hook that injects
|
|
5
|
-
# additionalContext when /kiss expands. Per bet 2026-07-01e WU-1 +
|
|
6
|
-
# ADR-035 lines 133 + 185 (UserPromptExpansion steering surface).
|
|
7
|
-
#
|
|
8
|
-
# Sources lib/hook-inject.sh + calls emit_base_pair_reminders (shared
|
|
9
|
-
# plain-English + assert-verify content) + adds kiss-specific reminders
|
|
10
|
-
# (substitution table + reminder that /kiss preserves claim shape).
|
|
11
|
-
#
|
|
12
|
-
# Sibling pattern: assert-verify-steering.sh + plain-english-steering.sh
|
|
13
|
-
# (UserPromptSubmit siblings — background steering at prompt start).
|
|
14
|
-
# This hook fires per-invocation at skill expansion — steering couples
|
|
15
|
-
# to skill intent, not background prompt-start reminders that go stale.
|
|
16
|
-
#
|
|
17
|
-
# Override per-call: SKIP_KISS_EXPANSION_INJECT=1
|
|
18
|
-
#
|
|
19
|
-
# Wired in .claude/settings.json under UserPromptExpansion matcher "kiss".
|
|
20
|
-
# Tier 0 strict TDD: .claude/hooks/tests/kiss-expansion-inject.test.sh
|
|
21
|
-
#
|
|
22
|
-
# Anchors: @luminary saltzer-schroeder (complete mediation — every /kiss
|
|
23
|
-
# invocation gets the discipline reminder) + @luminary john-ousterhout
|
|
24
|
-
# (deep module in lib/hook-inject.sh; five callers, one implementation).
|
|
25
|
-
|
|
26
|
-
set +e
|
|
27
|
-
|
|
28
|
-
# === Source install-class-aware lib (per standards/hook-install-class.md) ===
|
|
29
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
30
|
-
for _candidate in \
|
|
31
|
-
"${SCRIPT_DIR}/../../lib/hook-inject.sh" \
|
|
32
|
-
"${HOME_OVERRIDE:-${HOME:-/}}/lib/hook-inject.sh"; do
|
|
33
|
-
if [ -f "$_candidate" ]; then
|
|
34
|
-
# shellcheck disable=SC1090
|
|
35
|
-
source "$_candidate"
|
|
36
|
-
break
|
|
37
|
-
fi
|
|
38
|
-
done
|
|
39
|
-
|
|
40
|
-
# Defensive: if lib not loaded, exit silent (fail-soft per Nygard)
|
|
41
|
-
if ! declare -f emit_additional_context >/dev/null 2>&1; then
|
|
42
|
-
exit 0
|
|
43
|
-
fi
|
|
44
|
-
if ! declare -f emit_base_pair_reminders >/dev/null 2>&1; then
|
|
45
|
-
exit 0
|
|
46
|
-
fi
|
|
47
|
-
|
|
48
|
-
# Override per-call
|
|
49
|
-
if [ "${SKIP_KISS_EXPANSION_INJECT:-0}" = "1" ]; then
|
|
50
|
-
exit 0
|
|
51
|
-
fi
|
|
52
|
-
|
|
53
|
-
# === Compose steering content ===
|
|
54
|
-
BASE_PAIR="$(emit_base_pair_reminders)"
|
|
55
|
-
|
|
56
|
-
KISS_SPECIFIC="
|
|
57
|
-
|
|
58
|
-
**/kiss-specific reminders:**
|
|
59
|
-
|
|
60
|
-
- Read the substitution table at standards/bassclef-internal-jargon.md before rewriting. BLOCK-tier terms substitute per the table; ADVISE-tier terms rewrite when clean; ALLOW terms (substrate, bassclef, cameo, Studio, Band, bandleader) stay.
|
|
61
|
-
- /kiss preserves claim shape while swapping vocabulary. Assertion grounding still applies. If the input text carries a claim without cited Evidence + Why-supports, /kiss does not rescue it — surface the missing grounding.
|
|
62
|
-
- Grade level is a target, not a mask. Plain English exposes weak assertions. Prefer clarity over camouflage.
|
|
63
|
-
- Every rewrite passes back through assert-verify: the plain-English version still needs My claim + Evidence + Why the evidence supports the claim for any operator-facing assertion the input carried."
|
|
64
|
-
|
|
65
|
-
STEERING_CONTENT="${BASE_PAIR}${KISS_SPECIFIC}"
|
|
66
|
-
|
|
67
|
-
# === Emit envelope ===
|
|
68
|
-
emit_additional_context "UserPromptExpansion" "$STEERING_CONTENT"
|
|
69
|
-
exit 0
|