@thebassclef/lite 0.0.1 → 0.1.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.
Files changed (182) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +85 -4
  3. package/dist/cli.cjs +1610 -0
  4. package/dist/cli.js +1587 -0
  5. package/dist/index.cjs +4 -0
  6. package/dist/index.d.ts +2 -0
  7. package/dist/index.js +4 -0
  8. package/package.json +51 -3
  9. package/substrate/.bassclef/lite-manifest.json +1794 -0
  10. package/substrate/.claude/agents/architect.md +70 -0
  11. package/substrate/.claude/agents/builder.md +114 -0
  12. package/substrate/.claude/agents/designer.md +156 -0
  13. package/substrate/.claude/agents/reviewer.md +88 -0
  14. package/substrate/.claude/hooks/artifact-ingestion-gate.sh +357 -0
  15. package/substrate/.claude/hooks/assert-verify-steering.sh +77 -0
  16. package/substrate/.claude/hooks/bassclef-source-config-validate.sh +215 -0
  17. package/substrate/.claude/hooks/bassclef-sync.sh +634 -0
  18. package/substrate/.claude/hooks/compound-noun-scrub.sh +292 -0
  19. package/substrate/.claude/hooks/kiss-expansion-inject.sh +69 -0
  20. package/substrate/.claude/hooks/plain-english-steering.sh +156 -0
  21. package/substrate/.claude/hooks/post-skill-friction-check.sh +177 -0
  22. package/substrate/.claude/hooks/post-skill-telemetry.sh +62 -0
  23. package/substrate/.claude/hooks/pre-build-gate.sh +511 -0
  24. package/substrate/.claude/hooks/pre-commit-gate.sh +452 -0
  25. package/substrate/.claude/hooks/session-end.sh +433 -0
  26. package/substrate/.claude/hooks/session-reflection.sh +303 -0
  27. package/substrate/.claude/hooks/skill-body-grade-gate.sh +219 -0
  28. package/substrate/.claude/hooks/skill-body-intent-drift.sh +107 -0
  29. package/substrate/.claude/hooks/skill-step-list-check.sh +171 -0
  30. package/substrate/.claude/hooks/state-validate.sh +271 -0
  31. package/substrate/.claude/hooks/substrate-clarity-gate.sh +1110 -0
  32. package/substrate/.claude/hooks/temperance-gate.sh +147 -0
  33. package/substrate/.claude/hooks/testing-tier-enforce.sh +233 -0
  34. package/substrate/.claude/hooks/turn-prose-grade-measure.sh +219 -0
  35. package/substrate/.claude/hooks/turn-prose-kiss-check.sh +434 -0
  36. package/substrate/.claude/hooks/vocabulary-migration-check.sh +171 -0
  37. package/substrate/.claude/hooks/whereami-utc-gate.sh +142 -0
  38. package/substrate/.claude/luminaries/alan-cooper.md +170 -0
  39. package/substrate/.claude/luminaries/alistair-cockburn.md +140 -0
  40. package/substrate/.claude/luminaries/amazon-pr-faq.md +34 -0
  41. package/substrate/.claude/luminaries/ash-maurya.md +121 -0
  42. package/substrate/.claude/luminaries/bill-buxton.md +210 -0
  43. package/substrate/.claude/luminaries/charles-sanders-peirce.md +150 -0
  44. package/substrate/.claude/luminaries/david-ogilvy.md +192 -0
  45. package/substrate/.claude/luminaries/don-norman.md +173 -0
  46. package/substrate/.claude/luminaries/edward-tufte.md +179 -0
  47. package/substrate/.claude/luminaries/eric-evans.md +160 -0
  48. package/substrate/.claude/luminaries/frederick-brooks.md +50 -0
  49. package/substrate/.claude/luminaries/gang-of-four.md +157 -0
  50. package/substrate/.claude/luminaries/jason-fried-dhh.md +46 -0
  51. package/substrate/.claude/luminaries/jesse-james-garrett.md +154 -0
  52. package/substrate/.claude/luminaries/john-ousterhout.md +94 -0
  53. package/substrate/.claude/luminaries/karl-popper.md +132 -0
  54. package/substrate/.claude/luminaries/kent-beck.md +168 -0
  55. package/substrate/.claude/luminaries/linus-torvalds.md +218 -0
  56. package/substrate/.claude/luminaries/martin-fowler.md +164 -0
  57. package/substrate/.claude/luminaries/michael-feathers.md +125 -0
  58. package/substrate/.claude/luminaries/michael-nygard.md +118 -0
  59. package/substrate/.claude/luminaries/robert-c-martin.md +164 -0
  60. package/substrate/.claude/luminaries/saltzer-schroeder.md +194 -0
  61. package/substrate/.claude/luminaries/sophia-prater.md +193 -0
  62. package/substrate/.claude/luminaries/stephen-toulmin.md +131 -0
  63. package/substrate/.claude/rules/artifact-ingestion.md +179 -0
  64. package/substrate/.claude/rules/assert-only-after-verify.md +137 -0
  65. package/substrate/.claude/rules/blocked-items.md +146 -0
  66. package/substrate/.claude/rules/branching.md +28 -0
  67. package/substrate/.claude/rules/commit-conventions.md +22 -0
  68. package/substrate/.claude/rules/context-engineering.md +202 -0
  69. package/substrate/.claude/rules/context-management.md +85 -0
  70. package/substrate/.claude/rules/destructive-operations.md +69 -0
  71. package/substrate/.claude/rules/diagnosis.md +38 -0
  72. package/substrate/.claude/rules/guardrails.md +73 -0
  73. package/substrate/.claude/rules/identifier-leak-prevention.md +104 -0
  74. package/substrate/.claude/rules/lite-manifest-schema-change-discipline.md +98 -0
  75. package/substrate/.claude/rules/oo-ad-entry-point.md +117 -0
  76. package/substrate/.claude/rules/operator-facing-prose.md +196 -0
  77. package/substrate/.claude/rules/plain-english-discipline.md +154 -0
  78. package/substrate/.claude/rules/pr-body-shape.md +317 -0
  79. package/substrate/.claude/rules/pr-strategy.md +167 -0
  80. package/substrate/.claude/rules/sdlc-gates.md +149 -0
  81. package/substrate/.claude/rules/session-artifacts.md +236 -0
  82. package/substrate/.claude/rules/state-schema-validation.md +162 -0
  83. package/substrate/.claude/rules/whereami-load-bearing.md +202 -0
  84. package/substrate/.claude/rules/writing-craft-discipline.md +92 -0
  85. package/substrate/.claude/skills/build/SKILL.md +640 -0
  86. package/substrate/.claude/skills/decompose/SKILL.md +280 -0
  87. package/substrate/.claude/skills/diagnose/SKILL.md +297 -0
  88. package/substrate/.claude/skills/howdoi/SKILL.md +105 -0
  89. package/substrate/.claude/skills/ia-model/SKILL.md +108 -0
  90. package/substrate/.claude/skills/interaction-design/SKILL.md +112 -0
  91. package/substrate/.claude/skills/interpret-input/SKILL.md +180 -0
  92. package/substrate/.claude/skills/kiss/SKILL.md +449 -0
  93. package/substrate/.claude/skills/launch/SKILL.md +924 -0
  94. package/substrate/.claude/skills/lean-canvas/SKILL.md +332 -0
  95. package/substrate/.claude/skills/longrun/SKILL.md +426 -0
  96. package/substrate/.claude/skills/luminary/SKILL.md +481 -0
  97. package/substrate/.claude/skills/ogilvy-writing-audit/SKILL.md +177 -0
  98. package/substrate/.claude/skills/onboard-repo/SKILL.md +2190 -0
  99. package/substrate/.claude/skills/pattern-review/SKILL.md +99 -0
  100. package/substrate/.claude/skills/personas/SKILL.md +207 -0
  101. package/substrate/.claude/skills/promote/SKILL.md +283 -0
  102. package/substrate/.claude/skills/requirement/SKILL.md +98 -0
  103. package/substrate/.claude/skills/retro/SKILL.md +117 -0
  104. package/substrate/.claude/skills/riff/SKILL.md +114 -0
  105. package/substrate/.claude/skills/roadmap-reconcile/SKILL.md +163 -0
  106. package/substrate/.claude/skills/session-end/SKILL.md +309 -0
  107. package/substrate/.claude/skills/session-log/SKILL.md +299 -0
  108. package/substrate/.claude/skills/skills/SKILL.md +228 -0
  109. package/substrate/.claude/skills/spec/SKILL.md +105 -0
  110. package/substrate/.claude/skills/sprint/SKILL.md +392 -0
  111. package/substrate/.claude/skills/stage/SKILL.md +384 -0
  112. package/substrate/.claude/skills/state-a-problem/SKILL.md +185 -0
  113. package/substrate/.claude/skills/temperance/SKILL.md +108 -0
  114. package/substrate/.claude/skills/use-case/SKILL.md +417 -0
  115. package/substrate/.claude/skills/user-stories/SKILL.md +268 -0
  116. package/substrate/.claude/skills/value-prop/SKILL.md +251 -0
  117. package/substrate/.claude/skills/verify/SKILL.md +160 -0
  118. package/substrate/.claude/skills/whereami/SKILL.md +307 -0
  119. package/substrate/AGENTS.md +79 -0
  120. package/substrate/CLAUDE-lite.md +85 -0
  121. package/substrate/CODE_OF_CONDUCT.md +28 -0
  122. package/substrate/CONTRIBUTING.md +177 -0
  123. package/substrate/README.md +173 -0
  124. package/substrate/SECURITY.md +19 -0
  125. package/substrate/architecture/decisions/ADR-029-release-pipeline.md +79 -0
  126. package/substrate/architecture/decisions/ADR-031-non-breaking-changes-adopter-discipline.md +139 -0
  127. package/substrate/architecture/decisions/ADR-032-adopter-sync-dispatcher-architecture.md +192 -0
  128. package/substrate/architecture/decisions/ADR-039-release-tagging-scheme.md +145 -0
  129. package/substrate/architecture/decisions/ADR-040-planning-skill-vocabulary-and-lite-profile.md +155 -0
  130. package/substrate/architecture/decisions/ADR-044-unified-skill-body-template.md +162 -0
  131. package/substrate/lib/clean-artifacts-sweep.sh +112 -0
  132. package/substrate/lib/code-comment-discipline.sh +144 -0
  133. package/substrate/lib/composer-preflight.sh +459 -0
  134. package/substrate/lib/hook-inject.sh +255 -0
  135. package/substrate/lib/luminary-pick.sh +96 -0
  136. package/substrate/lib/output-discipline.sh +143 -0
  137. package/substrate/lib/rewrite-check.sh +214 -0
  138. package/substrate/lib/state.sh +1372 -0
  139. package/substrate/lib/telemetry.sh +205 -0
  140. package/substrate/lib/tier-check.sh +138 -0
  141. package/substrate/lib/tier-dependency-audit.sh +933 -0
  142. package/substrate/presence/install/bassclef-hook-connect.sh +178 -0
  143. package/substrate/presence/install/bassclef-sync.dispatcher.template.sh +841 -0
  144. package/substrate/presence/install/bassclef-sync.template.sh +2076 -0
  145. package/substrate/presence/install/schedule-auto-save.cron.sh +88 -0
  146. package/substrate/presence/install/schedule-auto-save.taskscheduler.md +122 -0
  147. package/substrate/scripts/aggregate-telemetry.sh +217 -0
  148. package/substrate/scripts/analyze-tier-dependencies.sh +239 -0
  149. package/substrate/scripts/generate-lite-manifest.sh +489 -0
  150. package/substrate/scripts/generate-tier-manifest.sh +28 -0
  151. package/substrate/scripts/intent-drift-check.sh +456 -0
  152. package/substrate/scripts/lite-manifest-drift-check.sh +146 -0
  153. package/substrate/scripts/render-lite-manifest-doc.sh +150 -0
  154. package/substrate/standards/bassclef-configs-schema.md +232 -0
  155. package/substrate/standards/bassclef-evolution.md +143 -0
  156. package/substrate/standards/bassclef-internal-jargon.md +244 -0
  157. package/substrate/standards/bassclef-managed-sentinel.md +96 -0
  158. package/substrate/standards/bassclef-source-config.md +228 -0
  159. package/substrate/standards/deferred-actions-schema.md +204 -0
  160. package/substrate/standards/docs-sync-allowlist.md +76 -0
  161. package/substrate/standards/graceful-exit.md +227 -0
  162. package/substrate/standards/hook-idempotency.md +102 -0
  163. package/substrate/standards/lite-manifest-schema-changes.md +75 -0
  164. package/substrate/standards/luminary-problem-patterns.md +481 -0
  165. package/substrate/standards/ogilvy-writing-rules.md +225 -0
  166. package/substrate/standards/opener-discipline.md +96 -0
  167. package/substrate/standards/operator-facing-prose-discipline.md +201 -0
  168. package/substrate/standards/project-directory-layout.md +276 -0
  169. package/substrate/standards/release-tagging.md +137 -0
  170. package/substrate/standards/sdlc-compliance.md +286 -0
  171. package/substrate/standards/secrets-lifecycle.md +210 -0
  172. package/substrate/standards/security-scanner-adapter.md +145 -0
  173. package/substrate/standards/skill-output-discipline.md +90 -0
  174. package/substrate/standards/state-spine.md +511 -0
  175. package/substrate/standards/tech-stack-config.md +109 -0
  176. package/substrate/standards/tier-dependency-analysis.md +167 -0
  177. package/substrate/standards/tier-runtime-deps/lite.md +57 -0
  178. package/substrate/standards/tier-tag-schema.md +155 -0
  179. package/substrate/standards/whereami-schema.md +301 -0
  180. package/substrate/standards/writing-guide.md +213 -0
  181. package/substrate/templates/deferred-action-template.md +45 -0
  182. package/substrate/templates/whereami-template.md +101 -0
@@ -0,0 +1,150 @@
1
+ #!/usr/bin/env bash
2
+ # tier: lite
3
+ # Render human-readable companion doc from lite-manifest.json.
4
+ #
5
+ # Reads lite-manifest.json at repo root by default; writes docs/lite-manifest.md.
6
+ # The companion doc IS the human-readable projection of the machine-readable
7
+ # manifest — same source of truth, two projections per Ousterhout deep-modules.
8
+ #
9
+ # Per bassclef-upstream#1020 Step 4. Session 2026-08-01d option b.
10
+ #
11
+ # Cures per pre-mortem risk ledger docs/risk-ledgers/2026-08-01c-lite-manifest.md:
12
+ # F3.4 — prominent version banner at top; every regeneration bumps timestamp
13
+ # F-b.N3 — anchor on schema file (stable path) not manifest file (may move)
14
+ #
15
+ # Usage:
16
+ # scripts/render-lite-manifest-doc.sh # reads root manifest, writes docs/lite-manifest.md
17
+ # scripts/render-lite-manifest-doc.sh --dry-run # prints to stdout
18
+ # scripts/render-lite-manifest-doc.sh --input PATH # read manifest from PATH
19
+ # scripts/render-lite-manifest-doc.sh --output PATH # write to PATH
20
+ # scripts/render-lite-manifest-doc.sh --root PATH # override repo root
21
+
22
+ set -euo pipefail
23
+
24
+ DRY_RUN=0
25
+ INPUT_PATH=""
26
+ OUTPUT_PATH=""
27
+ REPO_ROOT_OVERRIDE=""
28
+
29
+ while [[ $# -gt 0 ]]; do
30
+ case "$1" in
31
+ --dry-run) DRY_RUN=1; shift ;;
32
+ --input) INPUT_PATH="${2:-}"; shift 2 ;;
33
+ --output) OUTPUT_PATH="${2:-}"; shift 2 ;;
34
+ --root) REPO_ROOT_OVERRIDE="${2:-}"; shift 2 ;;
35
+ -h|--help)
36
+ grep -E '^# ' "$0" | sed 's/^# \?//'
37
+ exit 0
38
+ ;;
39
+ *) echo "Unknown arg: $1 (use --help)" >&2; exit 1 ;;
40
+ esac
41
+ done
42
+
43
+ if [[ -n "$REPO_ROOT_OVERRIDE" ]]; then
44
+ REPO_ROOT="$REPO_ROOT_OVERRIDE"
45
+ else
46
+ REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || true)"
47
+ fi
48
+
49
+ if [[ -z "$REPO_ROOT" || ! -d "$REPO_ROOT" ]]; then
50
+ echo "render-lite-manifest-doc: cannot resolve repo root" >&2
51
+ exit 1
52
+ fi
53
+
54
+ [[ -z "$INPUT_PATH" ]] && INPUT_PATH="${REPO_ROOT}/lite-manifest.json"
55
+ [[ -z "$OUTPUT_PATH" ]] && OUTPUT_PATH="${REPO_ROOT}/docs/lite-manifest.md"
56
+
57
+ if [[ ! -f "$INPUT_PATH" ]]; then
58
+ echo "render-lite-manifest-doc: manifest not found at $INPUT_PATH" >&2
59
+ echo "Run scripts/generate-lite-manifest.sh first." >&2
60
+ exit 1
61
+ fi
62
+
63
+ if ! command -v jq >/dev/null 2>&1; then
64
+ echo "render-lite-manifest-doc: missing dependency: jq" >&2
65
+ exit 1
66
+ fi
67
+
68
+ VERSION=$(jq -r '.manifest_version' "$INPUT_PATH")
69
+ GENERATED=$(jq -r '.generated_at' "$INPUT_PATH")
70
+ COMMIT=$(jq -r '.upstream_commit' "$INPUT_PATH")
71
+ SHORT_COMMIT="${COMMIT:0:7}"
72
+ TOTAL=$(jq '.entries | length' "$INPUT_PATH")
73
+
74
+ # Emit doc to stdout via function; caller decides where to redirect.
75
+ render_doc() {
76
+ echo "# Lite manifest — v${VERSION}"
77
+ echo ""
78
+ echo "<!-- Auto-generated by scripts/render-lite-manifest-doc.sh from lite-manifest.json. Do not edit by hand. -->"
79
+ echo ""
80
+ echo "**Version:** \`${VERSION}\` "
81
+ echo "**Generated:** \`${GENERATED}\` "
82
+ echo "**Upstream commit:** \`${SHORT_COMMIT}\` "
83
+ echo "**Total entries:** ${TOTAL} "
84
+ echo "**Schema:** [\`standards/lite-manifest.schema.json\`](../standards/lite-manifest.schema.json) "
85
+ echo "**Machine-readable:** [\`lite-manifest.json\`](../lite-manifest.json) (at repo root)"
86
+ echo ""
87
+ echo "> Partners pin against \`manifest_version\`. Membership changes ship as manifest bumps with a changelog entry. Adding an entry is a minor bump; removing is a major bump (breaks partners); description or content-hash change without membership change is a patch bump."
88
+
89
+ render_section "skill" "Skills"
90
+ render_section "rule" "Rules"
91
+ render_section "hook" "Hooks"
92
+ render_section "luminary" "Luminaries"
93
+ render_section "agent" "Agents"
94
+ render_section "standard" "Standards"
95
+ render_section "adr" "Architecture Decision Records"
96
+ # Per #1392 Shape 3 (goal 2026-08-27a) — 5 install surfaces bassclef-cli needs
97
+ render_section "lib" "Shared Libraries"
98
+ render_section "script" "Scripts"
99
+ render_section "presence-template" "Install Templates"
100
+ render_section "template" "Content Templates"
101
+ render_section "root-doc" "Root Documentation"
102
+
103
+ echo ""
104
+ echo "---"
105
+ echo ""
106
+ echo "## For partners"
107
+ echo ""
108
+ echo "- Fetch the manifest from repo root: \`lite-manifest.json\`"
109
+ echo "- Validate against the schema at \`standards/lite-manifest.schema.json\` (JSON Schema draft 2020-12 strict)"
110
+ echo "- Pin your build to a specific \`manifest_version\`; upgrade deliberately"
111
+ echo "- Every \`entries[].path\` is repo-relative; the source file at that path is the authoritative content"
112
+ echo "- Use \`entries[].content_hash\` to cache-invalidate"
113
+ echo ""
114
+ echo "## Semver bump policy"
115
+ echo ""
116
+ echo "| Change | Bump |"
117
+ echo "|---|---|"
118
+ echo "| Entry added to \`entries[]\` | Minor |"
119
+ echo "| Entry removed from \`entries[]\` | Major (breaks partners) |"
120
+ echo "| Description or content_hash change without membership change | Patch |"
121
+ echo "| Schema shape change (new field added) | Minor |"
122
+ echo "| Schema shape change (field removed or type changed) | Major |"
123
+ echo ""
124
+ echo "Refs — bassclef-upstream#1020 (this manifest) + bassclef-upstream#1030 (root location) + ADR-040 (lite profile) + ADR-031 (we don't break adopters)."
125
+ }
126
+
127
+ render_section() {
128
+ local surface_type="$1"
129
+ local title="$2"
130
+ local count
131
+ count=$(jq --arg t "$surface_type" '[.entries[] | select(.type == $t)] | length' "$INPUT_PATH")
132
+ [[ "$count" -eq "0" ]] && return
133
+
134
+ echo ""
135
+ echo "## ${title} (${count})"
136
+ echo ""
137
+ jq -r --arg t "$surface_type" '
138
+ .entries[] | select(.type == $t) |
139
+ "- **" + .slug + "** — `" + .path + "`" +
140
+ (if .description then " \n " + .description else "" end)
141
+ ' "$INPUT_PATH"
142
+ }
143
+
144
+ if [[ "$DRY_RUN" == "1" ]]; then
145
+ render_doc
146
+ else
147
+ mkdir -p "$(dirname "$OUTPUT_PATH")"
148
+ render_doc > "$OUTPUT_PATH"
149
+ echo "Wrote $OUTPUT_PATH ($TOTAL entries; commit $SHORT_COMMIT)" >&2
150
+ fi
@@ -0,0 +1,232 @@
1
+ ---
2
+ tier: lite
3
+ description: .claude/bassclef-configs.jsonc is the unified configuration discovery surface for bassclef adoption.
4
+ ---
5
+
6
+ # bassclef-configs Schema
7
+
8
+ `.claude/bassclef-configs.jsonc` is the **unified configuration discovery surface** for bassclef adoption. One file. Read the inline comments. Edit the values.
9
+
10
+ ## Why this exists
11
+
12
+ Before this standard, adopter configuration lived in four places:
13
+
14
+ | Surface | What it holds | Adopter discovery cost |
15
+ |---|---|---|
16
+ | `.claude/settings.json` | hooks, permissions, environment | high (Claude Code platform format) |
17
+ | `substrate.config.md` | resource references (Doc IDs, URLs) | medium (markdown frontmatter) |
18
+ | `.claude/agents/<role>.md` frontmatter | per-agent `model_tier` | low (already structured) |
19
+ | Hook env vars | per-session disables | high (no central registry) |
20
+
21
+ The new file consolidates substrate-level configuration into one surface. `substrate.config.md` keeps resource references (its existing job). `.claude/bassclef-configs.jsonc` holds the bassclef-adoption settings.
22
+
23
+ ## File format — JSONC
24
+
25
+ JSON with comments. Standard tooling supports it directly (VS Code, IntelliJ, most editors). Strict JSON parsers strip comments first:
26
+
27
+ ```bash
28
+ perl -pe 's,^\s*//.*$,,; s,/\*.*?\*/,,g' .claude/bassclef-configs.jsonc | jq .
29
+ ```
30
+
31
+ The hook layer (`bassclef-sync.sh` and others reading the file) handles the comment strip before passing to `jq`.
32
+
33
+ ## Three-question comment discipline
34
+
35
+ Every setting carries a comment block answering three questions:
36
+
37
+ 1. **What does this setting do** — plain English, /kiss-passed for grade-11 readability. One paragraph max.
38
+ 2. **What's the default + why** — adopter vs operator distinction where audiences diverge. State both defaults inline.
39
+ 3. **Which substrate component does this control** — file path or skill name or ADR reference. Adopter can read deeper.
40
+
41
+ Optional fourth line:
42
+
43
+ 4. **Schema reference** — bassclef ticket or ADR governing the setting.
44
+
45
+ ## Concrete shape
46
+
47
+ ```jsonc
48
+ {
49
+ // Whether bassclef's substrate (skills, rules, hooks, agents) syncs from
50
+ // the upstream bassclef repo to your local .claude/ directory at session start.
51
+ // Adopter default: false (opt-in trust posture; you control when updates land).
52
+ // Operator default: true (substrate maintainers want always-latest).
53
+ // Pairs with: .claude/hooks/bassclef-sync.sh
54
+ // Schema reference: bassclef#900 sync opt-in default
55
+ "sync": { "enabled": true },
56
+
57
+ // Per-agent LLM model routing. Maps agent role to capability tier.
58
+ // Pairs with: .claude/agents/<role>.md frontmatter (model_tier field)
59
+ // Schema reference: bassclef#873 model_tier dogfood
60
+ "model_tier": { "Builder": "balanced" },
61
+
62
+ // Adopter plan tier. Caps concurrent parallel agent dispatch per Anthropic plan limits.
63
+ // Pairs with: .claude/skills/longrun/SKILL.md parallel-dispatch logic
64
+ // Schema reference: bassclef#877 parallel-dispatch ceiling per adopter plan tier
65
+ "plan_tier": "tier-1"
66
+ }
67
+ ```
68
+
69
+ ## Adopter vs operator default distinction
70
+
71
+ Two roles, two defaults. The mechanism for runtime resolution:
72
+
73
+ | Context | File state | Defaults applied |
74
+ |---|---|---|
75
+ | Operator (bassclef's own repo) | file present with operator-default values | `sync.enabled: true`, etc. |
76
+ | Adopter clone | file absent OR present with adopter defaults | `sync.enabled: false`, etc. |
77
+ | Adopter clone after `/onboard-repo` | file written by skill with adopter defaults | adopter defaults applied |
78
+
79
+ Adopter-mode detection (basic version): hook checks if current repo's `origin` remote URL is `sunj-labs/bassclef`. If yes → operator. If no → adopter.
80
+
81
+ Per-setting runtime resolution detail in each setting's comment block. Hook layer (`bassclef-sync.sh` and others) implements the resolution.
82
+
83
+ ## What this is NOT
84
+
85
+ - **Not a replacement for `settings.json`** — `.claude/settings.json` stays as the Claude Code platform format (hooks array, permissions, environment). This new file is bassclef's adoption layer above it.
86
+ - **Not a replacement for `substrate.config.md`** — `substrate.config.md` stays as the resource-reference single source (Doc IDs, URLs, env-var names). This new file holds bassclef-adoption settings.
87
+ - **JSON-Schema-validated as of bassclef#1135** — Shape contract at `standards/state-spine/schemas/bassclef-configs.schema.json`. Tier 0 strict-TDD tests under `standards/state-spine/schemas/tests/bassclef-configs.test.sh`. Per-block `additionalProperties:false` catches typos; root-level `additionalProperties:true` keeps the file forward-compat for downstream T3-T24 work.
88
+
89
+ ## Adopter-default vs operator-default per field
90
+
91
+ Adopters and operators get different defaults from the same surface. `/onboard-repo` writes the adopter-default seed; bassclef's own repo ships operator-default values. Per-field summary:
92
+
93
+ | Block / field | Adopter default | Operator default | Why the difference |
94
+ |---|---|---|---|
95
+ | `sync.enabled` | `false` | `true` | Adopters control update cadence; operators want always-latest |
96
+ | `model_tier.Builder` | `balanced` | `balanced` | Code quality matters everywhere |
97
+ | `model_tier.<reviewer-class>` | `cheap-fast` | `cheap-fast` | Checklist work; Haiku handles it cleanly |
98
+ | `model_tier.Shaper` | `capable` | `capable` | Problem framing is highest-leverage; Opus earns its keep |
99
+ | `plan_tier` | `tier-1` | `tier-1` | Single-agent serial is the safe default for both |
100
+ | `prose_discipline.kiss_words_turn_prose` | `true` | `true` | Plain prose helps everyone reading agent output |
101
+ | `testing.global_floor` | `1` (WARN) | `1` (WARN) | Both audiences want the test-with prompt by default |
102
+ | `testing.path_matchers` | `[]` | seed list (hooks Tier 0, etc.) | Operators carry bassclef's substrate-internal matchers; adopters add their own at `/onboard-repo` Phase 2.x |
103
+ | `tech_stack` | declared at onboarding | reference operator stack | Per-adopter; bassclef declares its own as reference |
104
+ | `longrun.orchestrator_merge.mode` | `operator-gated` | `operator-gated` | Safest mode wins by default for both |
105
+ | `hook_chain.<hook>` | `true` for foundation hooks; explicit opt-in for new layers | `true` for everything substrate ships | Adopters layer in disciplines; operators run the full chain |
106
+ | `discipline_layers.<layer>` | `"advisory"` for new disciplines | `true` / strict for shipped disciplines | Adopters get the easier on-ramp; operators dogfood the strict path |
107
+ | `security_scanning.stack` | auto-detected at `/onboard-repo` Phase 2.5 | per repo | Both pick a stack; off by default until adopter confirms |
108
+ | `security_scanning.block_on_high_severity` | `true` | `true` | Production-bound work blocks on highs; early exploratory opts down |
109
+
110
+ Adopter-mode detection (basic version): hook checks if the current repo's `origin` remote URL points at `sunj-labs/bassclef`. If yes → operator. If no → adopter. Per-setting comments in the JSONC file restate the distinction inline for adopter discoverability.
111
+
112
+ ## When to add a setting
113
+
114
+ A new setting belongs in `bassclef-configs.jsonc` when:
115
+
116
+ 1. It controls bassclef's adoption behavior (not Claude Code platform behavior — that's `settings.json`)
117
+ 2. Multiple hooks or skills read it (not just one — single-hook settings stay in hook env vars)
118
+ 3. It has a clear three-question comment block answer
119
+ 4. It pairs with a substrate component the adopter can read
120
+
121
+ If the setting fails any of those, file an issue first and discuss before adding.
122
+
123
+ ## Migration path
124
+
125
+ Settings currently scattered across other surfaces migrate into `bassclef-configs.jsonc` over time:
126
+
127
+ | Setting | Current home | Migration target | Tracking |
128
+ |---|---|---|---|
129
+ | Per-agent `model_tier` | `.claude/agents/<role>.md` frontmatter | `model_tier` block in bassclef-configs | bassclef#873 → afternoon work |
130
+ | Sync enabled / disabled | `.no-bassclef-sync` sentinel + env vars | `sync.enabled` block | bassclef#900 |
131
+ | Parallel-dispatch ceiling | not yet implemented | `plan_tier` block | bassclef#877 |
132
+ | Testing tier per path | not yet implemented (honor-system `.claude/rules/testing.md`) | `testing` block (global_floor + path_matchers) | bassclef#1037 |
133
+ | Hook enable flags | scattered across per-hook env vars | `hook_chain` block (named boolean fields, forward-compat) | bassclef#1135 (T2 seed; T3-T24 wire individual hooks to read) |
134
+ | Discipline enable / mode | scattered across per-rule env vars | `discipline_layers` block (bool or "advisory"/"strict"/"off" mode) | bassclef#1135 (T2 seed) |
135
+ | Security scanner adapter | inline at `/onboard-repo` Phase 2.5 | `security_scanning` block (stack + additional_scanners + block_on_high_severity) | bet 2026-06-17a Phase Y + bassclef#1135 |
136
+
137
+ Migration preserves backward compatibility — old surfaces continue working during the migration window; the new file becomes the source of truth as each setting migrates.
138
+
139
+ ## Composes with
140
+
141
+ - `standards/substrate-config-schema.md` — sibling for resource references (Doc IDs, URLs)
142
+ - `.claude/bassclef-configs.jsonc` — the file itself (this standard's primary subject)
143
+ - `standards/state-spine/schemas/bassclef-configs.schema.json` — JSON Schema shape contract (bassclef#1135 WU-4)
144
+ - `.claude/skills/onboard-repo/SKILL.md` — writes adopter-default file on first install
145
+ - `.claude/hooks/bassclef-sync.sh` — first consumer (per bassclef#900)
146
+ - `.claude/rules/testing-tier-config.md` — owns the `testing` section reasoning (bassclef#1037)
147
+ - `.claude/hooks/testing-tier-enforce.sh` — testing-section consumer (bassclef#1037 WU-3)
148
+ - `standards/state-spine/schemas/testing-tier-overrides.schema.json` — per-file override entries that take precedence over the testing.path_matchers array (bassclef#1037)
149
+ - `standards/security-scanner-adapter.md` — owns the `security_scanning` section reasoning (bet 2026-06-17a Phase Y); supplies per-stack scanner default sets
150
+ - `config/security-scanners/<stack>.yml` — per-stack reference workflows (Phase Y-3); adopter copies + customizes
151
+
152
+ ## Settings reference
153
+
154
+ ### `testing` (bassclef#1037)
155
+
156
+ Per-path testing-tier enforcement. Four tiers — 0 strict TDD / 1 test-with / 2 smoke / 3 manual verify — pick by blast radius. Most-specific path-matcher wins; `global_floor` applies when no entry matches.
157
+
158
+ | Field | Type | Default (adopter) | Default (operator) | What it does |
159
+ |---|---|---|---|---|
160
+ | `global_floor` | integer 0-3 | 1 | 1 | Tier applied when no path_matcher matches. Tier 1 (WARN on missing test) is the cautious default — adopters add stricter tiers per surface as discipline matures. |
161
+ | `path_matchers` | array of `{match, tier}` | `[]` | seeded list (hooks Tier 0, schemas Tier 0, scripts Tier 1, narrative Tier 3) | Per-path tier overrides. Array order is most-specific to least-specific; first match wins. Glob patterns supported via shell-glob matching. |
162
+
163
+ Per-file overrides live in `state/testing-tier-overrides.jsonl` (append-only JSONL; schema at `standards/state-spine/schemas/testing-tier-overrides.schema.json`). The hook walks overrides first, then path_matchers, then global_floor. Overrides carry a timestamp and optional expiry to time-bound relief.
164
+
165
+ The rule `.claude/rules/testing-tier-config.md` carries the full reasoning, per-tier semantics, and override discipline. The hook `.claude/hooks/testing-tier-enforce.sh` (WU-3) is the mechanical enforcement layer.
166
+
167
+ ### `security_scanning` (bassclef bet 2026-06-17a Phase Y)
168
+
169
+ Per-stack security scanner adapter configuration. Adopter declares the stack; bassclef-supplied reference workflows use the default scanner set from `standards/security-scanner-adapter.md` stack reference matrix.
170
+
171
+ | Field | Type | Default (adopter) | Default (operator) | What it does |
172
+ |---|---|---|---|---|
173
+ | `stack` | string OR null | `null` | adopter-set when bassclef onboards | Stack name from the matrix in `standards/security-scanner-adapter.md` — one of `node-typescript`, `python`, `ruby`, `java`, `go`, `custom`, or `null` (OFF). `null` = no scanners configured; `/onboard-repo` prompts at next session. |
174
+ | `additional_scanners` | array of strings | `[]` | `[]` | Names of additional scanners beyond the stack defaults (e.g., commercial tools like `snyk`, `veracode`). Names are advisory; adopter writes their own workflow steps. |
175
+ | `block_on_high_severity` | boolean | `true` | `true` | Block CI on high-severity findings (workflow exits non-zero). When `false`, findings post as advisory comments only. Recommended `true` for production-bound work. |
176
+
177
+ Stack-gated opt-in: the reference workflow's `if: hashFiles('.claude/bassclef-configs.jsonc') == '' || fromJSON(...).security_scanning.stack == null` skips the entire job when `stack` is null. New adopters get OFF-by-default; explicit stack choice activates scanners.
178
+
179
+ The block name `security_scanning` is intentionally independent of `.claude/bassclef-configs.jsonc`'s file name. If the file is later renamed (per the deferred bassclef rename event under ADR-022), this block's semantics persist; only the file path changes.
180
+
181
+ The standard `standards/security-scanner-adapter.md` carries the per-stack default scanner set + adapter pattern. The skill `/onboard-repo` (Phase Y-4) writes the stack value at install time.
182
+
183
+ ### `longrun` (bassclef#1064)
184
+
185
+ Configures /longrun's autonomous PR merge cadence. Two modes, with hard ceilings the mode cannot relax. Pairs with `.claude/skills/longrun/SKILL.md` (procedure reads this block) and `.claude/rules/guardrails.md` (hard ceilings).
186
+
187
+ | Field | Type | Default (adopter) | Default (operator) | What it does |
188
+ |---|---|---|---|---|
189
+ | `orchestrator_merge.mode` | string enum | `operator-gated` | `operator-gated` | `operator-gated` — every PR opened during /longrun pauses for operator review + merge (safest; default for adopters learning bassclef). `agent-merges-within-scope` — orchestrator merges PRs autonomously when the change is within the goal's declared scope AND does not hit a hard ceiling (operator-sleep mode; for solo operators with full-time jobs running /longrun overnight). |
190
+ | `orchestrator_merge.hard_ceilings` | array of strings | `[auth, schema, security, prod-deploy, blast-radius-floor]` | `[auth, schema, security, prod-deploy, blast-radius-floor]` | Non-overridable list of change categories that ALWAYS pause for operator regardless of mode. Operators can ADD entries; the SKILL refuses removals. Hard ceilings are the guardrails bassclef#1064 made explicit so adopters see the trade-off. |
191
+
192
+ Three motivations baked into the schema:
193
+
194
+ 1. **Operator-sleep mode** — solo operators with full-time jobs run /longrun overnight; orchestrator-merge mode keeps the queue moving while they sleep. Validated 2026-06-17 (17 PRs / 64 min via verbal authorization during Phase B); bassclef#1064 codifies the configuration surface so adopters opt in per-/longrun.
195
+ 2. **Discipline-teaching surface** — the toggle exposes WHY orchestrator-merge is constrained. Pair the surface with a teaching panel mapping hard ceilings to bassclef's discipline principles. Adopters learn what bassclef considers safe-to-automate vs requires-human.
196
+ 3. **Trust gradient** — adopters new to bassclef pick `operator-gated` while learning the substrate; adopters deep in bassclef pick `agent-merges-within-scope` for velocity. Same primitive serves both.
197
+
198
+ Backwards-compatible: missing `longrun` block defaults to `operator-gated` (per /longrun SKILL.md procedure). Existing /longrun invocations continue working without config changes.
199
+
200
+ Per-PR override syntax (a single PR pauses regardless of mode) is out of scope for V1; the hard-ceiling list covers the safety case. Operator can name a one-off pause via verbal interjection ("pause on this one").
201
+
202
+ ### `wiki_sync` (bassclef#1265)
203
+
204
+ Configures whether the adopter's repo runs the bassclef-docs-sync workflow that syncs allowlisted docs to the GitHub Wiki on push-to-main. Pairs with `.claude/skills/docs-sync/SKILL.md` (reads this block at runtime), `.claude/rules/session-artifacts.md` § Wiki-as-we-go discipline (methodology rule), `presence/install/bassclef-docs-sync.template.yml` (the workflow adopters vendor), `presence/install/docs-sync-allowlist.template.md` (the allowlist seed).
205
+
206
+ | Field | Type | Default (adopter) | Default (operator) | What it does |
207
+ |---|---|---|---|---|
208
+ | `enabled` | boolean | `false` | `false` | When `true`, /onboard-repo Phase 2.3.8 surfaces the vendoring stub. Phase 2 of bet 2026-06-20b ships full auto-vendoring of the workflow + allowlist templates. Bassclef itself runs the workflow directly (not via template) because it's the bassclef source; the operator-default `false` is correct for bassclef's own repo. |
209
+ | `target_wiki_repo` | string | `""` | `""` | Override target — owner/repo of the GitHub wiki to sync to. Empty string defaults to current repo's wiki (the `.wiki` suffix on the repo URL). Most adopters leave empty. |
210
+ | `allowlist_path` | string | `standards/docs-sync-allowlist.md` | `standards/docs-sync-allowlist.md` | Adopter-side path to the docs-sync allowlist. Used by /docs-sync skill to locate the operator-readable contract. |
211
+
212
+ Three motivations:
213
+
214
+ 1. **Discipline-mechanism pairing** — `wiki-as-we-go` rule (bassclef#1208) propagates to adopters via `additionalDirectories` but the workflow that enforces it does not — it lives in bassclef's own `.github/` and its allowlist names bassclef paths. Adopters answering "yes" to the closeout question have nowhere for the mechanism to fire. This block lets them opt in.
215
+ 2. **Cold-adopter friction** — without this toggle + template, adopters who want wiki-sync have to hand-author the workflow + allowlist, multiplying the cost of adopting bassclef's documentation discipline.
216
+ 3. **Discoverability** — the toggle appears at /onboard-repo Phase 2.3.8 (Phase 1 stub today; full vendoring in Phase 2 of bet 2026-06-20b). Adopters see the option exists; they decide when to flip it.
217
+
218
+ Backwards-compatible: missing `wiki_sync` block defaults to `enabled: false`; bassclef's existing workflow keeps running for bassclef-public docs.
219
+
220
+ ## Refs
221
+
222
+ - bassclef#898 — adopter configuration discovery parent
223
+ - bassclef#899 — this standard's parent ticket
224
+ - bassclef#900 — sync opt-in default (first consumer)
225
+ - bassclef#873 — model_tier dogfood (migrating into schema)
226
+ - bassclef#877 — parallel-dispatch ceiling per plan tier
227
+ - bassclef#643 — substrate.config.md → YAML schema (sibling discipline)
228
+ - bassclef#1037 — testing-tier-config primitive (testing section + rule + hook)
229
+ - bassclef#1064 — /longrun orchestrator-merge toggle (longrun section)
230
+ - bassclef#1036 — Ousterhout luminary stub (sibling rule citation source)
231
+ - bassclef#1265 — wiki-sync mechanism adopter inheritance (wiki_sync section)
232
+ - bassclef#1208 — wiki-as-we-go discipline rule (methodology layer wiki_sync mechanizes)
@@ -0,0 +1,143 @@
1
+ ---
2
+ tier: lite
3
+ description: Bassclef evolves from three sources. Each source has a defined path to promotion. No standard enters bassclef without review.
4
+ ---
5
+
6
+ # Bassclef Evolution Standard
7
+
8
+ ## Principle
9
+
10
+ Bassclef evolves from three sources. Each source has a defined path
11
+ to promotion. No standard enters bassclef without review.
12
+
13
+ ## Three Sources
14
+
15
+ ### 1. User-proposed (explicit)
16
+
17
+ The operator identifies a pattern worth standardizing and invokes
18
+ `/promote` in an app repo.
19
+
20
+ **Path**: User runs `/promote` → issue created in app repo with
21
+ `bassclef-evolution` label → bassclef session reviews → accept/defer/reject.
22
+
23
+ **Examples**:
24
+ - "This hook pattern solved a real problem, other repos should have it"
25
+ - "I wrote a better diagnosis workflow, promote it"
26
+ - "This skill works, make it bassclef"
27
+
28
+ **Signal quality**: Highest. The operator saw the value firsthand.
29
+
30
+ ### 2. Hook-driven (automated detection)
31
+
32
+ Hooks detect patterns that suggest bassclef should evolve:
33
+ - Pre-build gate fires on a file type with no matching diagram check
34
+ - Session-end finds a new artifact type being written consistently
35
+ - Self-test discovers a skill requirement pattern across repos
36
+
37
+ **Path**: Hook logs the observation to `docs/sdlc-traces/` → bassclef
38
+ session-start hook aggregates traces → patterns with ≥3 occurrences
39
+ surface as promotion candidates.
40
+
41
+ **Examples**:
42
+ - "pre-build-gate triggered for .py files but has no Python-specific
43
+ diagram loading — should bassclef support Python projects?"
44
+ - "session-end wrote a new artifact type (design-token.json) in 3
45
+ consecutive sessions — should this be in the artifact chain?"
46
+
47
+ **Signal quality**: Medium. Frequency ≠ importance, but repeated
48
+ patterns are worth investigating.
49
+
50
+ ### 3. Agent-proposed (discovered during work)
51
+
52
+ An agent working in an app repo discovers that a local pattern should
53
+ be general. This happens during Construction when the Builder writes
54
+ something that the sdlc-gates checkpoint flags.
55
+
56
+ **Path**: Agent runs `/promote` (same as user-proposed, but agent-initiated)
57
+ → issue created with `bassclef-evolution` label + `agent-proposed` tag
58
+ → bassclef session reviews with extra scrutiny (agents over-promote).
59
+
60
+ **Examples**:
61
+ - Builder writes a hook in POA, sdlc-gates asks "Is this general?"
62
+ - Architect writes an ADR pattern that could be a template
63
+ - Reviewer flags a testing pattern that should be a standard
64
+
65
+ **Signal quality**: Variable. Agents tend to over-generalize. Review
66
+ with skepticism: "Would this actually help in a DIFFERENT repo?"
67
+
68
+ ## Ingestion Protocol (bassclef sessions)
69
+
70
+ The bassclef session-start hook scans for `bassclef-evolution` issues
71
+ across all child repos. During a bassclef session:
72
+
73
+ ### Triage
74
+
75
+ For each promotion candidate:
76
+
77
+ 1. **Is it general?** Would it help in a repo we haven't built yet?
78
+ If it only makes sense for POA's domain, reject.
79
+
80
+ 2. **Does it conflict?** Does it contradict an existing standard, ADR,
81
+ or design principle? If yes, the conflict must be resolved — either
82
+ the new pattern supersedes the old (update the ADR) or it's rejected.
83
+
84
+ 3. **Is it bassclef-shaped?** Does it fit as a skill, rule, standard,
85
+ hook, or agent definition? Or is it application logic wearing a
86
+ governance hat?
87
+
88
+ ### Actions
89
+
90
+ | Decision | Action | Issue |
91
+ |----------|--------|-------|
92
+ | Accept | Promote content to bassclef. Commit with `feat:` or `docs:`. | Close source issue |
93
+ | Defer | Not ready — needs more evidence or refinement | Keep open, add rationale |
94
+ | Reject | Not general enough, conflicts with existing standards, or app-specific | Close with explanation |
95
+
96
+ ### After acceptance
97
+
98
+ 1. Add the new content to bassclef (skill, rule, standard, etc.)
99
+ 2. Update CLAUDE.md counts if a new skill/standard was added
100
+ 3. Run `/substrate-check` to verify the substrate is still consistent
101
+ 4. Child repos pick up the change on next `boot-bassclef.sh` sync
102
+
103
+ ## Tracking
104
+
105
+ The bassclef session-start hook outputs a "BASSCLEF EVOLUTION — PENDING
106
+ PROMOTIONS" section showing all open `bassclef-evolution` issues across
107
+ child repos. This ensures promotions are never silently ignored.
108
+
109
+ Each child repo is registered in the session-start hook:
110
+ ```bash
111
+ CHILD_REPOS="sunj-labs/poa" # add new repos here
112
+ ```
113
+
114
+ ## What Triggers a Promotion Check
115
+
116
+ Not just `.claude/` changes — any change that establishes a pattern
117
+ other repos might need. The pre-commit hook flags these automatically.
118
+
119
+ | Change type | Examples | Hook detects |
120
+ |-------------|----------|-------------|
121
+ | Substrate files | skills, rules, hooks, agents in `.claude/` | yes |
122
+ | Settings | `settings.json`, model routing, hook config | yes |
123
+ | Package scripts | `package.json` script additions or changes | yes |
124
+ | Tooling config | `.eslintrc`, `tsconfig`, `.prettierrc`, `.env.example` | yes |
125
+ | Workflow patterns | testing approaches, deployment scripts, seed patterns | no — agent judgment |
126
+
127
+ Settings changes are the most commonly missed. When an app repo modifies
128
+ agent behavior or hook configuration in `settings.json`, that's almost
129
+ always a global decision. The hook flags it — don't dismiss the warning.
130
+
131
+ When unsure: promote. It's cheaper to reject a promotion in bassclef
132
+ than to rediscover the same pattern in a second repo.
133
+
134
+ ## Rules
135
+
136
+ - Promotions always originate in the SOURCE repo, never directly on bassclef
137
+ - App repos never need write access to bassclef
138
+ - The `bassclef-evolution` label is the signal — use it consistently
139
+ - Don't block app work on promotion decisions — log and move on
140
+ - Agent-proposed promotions get extra scrutiny (agents over-generalize)
141
+ - Hook-driven patterns need ≥3 occurrences before surfacing
142
+ - User-proposed patterns can be promoted immediately if clearly general
143
+ - When unsure whether a change is local or global → promote (default to global)