@thebassclef/lite 0.1.0 → 0.1.3

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 (163) hide show
  1. package/dist/cli.cjs +40 -6
  2. package/dist/cli.js +40 -6
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +1 -1
  6. package/package.json +1 -1
  7. package/substrate/.bassclef/lite-manifest.json +999 -92
  8. package/substrate/.claude/hooks/longrun-prep-compounding-axis-check.sh +492 -0
  9. package/substrate/.claude/hooks/longrun-prep-compounding-sequence-check.sh +492 -0
  10. package/substrate/.claude/hooks/pre-commit-gate.sh +1 -2
  11. package/substrate/.claude/hooks/turn-prose-kiss-check.sh +30 -1
  12. package/substrate/.claude/luminaries/glenford-myers.md +230 -0
  13. package/substrate/.claude/luminaries/hunt-thomas.md +115 -0
  14. package/substrate/.claude/luminaries/hyrum-wright.md +94 -0
  15. package/substrate/.claude/luminaries/michael-feathers.md +2 -2
  16. package/substrate/.claude/luminaries/tony-hoare.md +170 -0
  17. package/substrate/.claude/luminaries/vaughn-vernon.md +50 -0
  18. package/substrate/.claude/luminaries/w-edwards-deming.md +158 -0
  19. package/substrate/.claude/rules/accessor-library-discipline.md +138 -0
  20. package/substrate/.claude/rules/adr-discipline.md +120 -0
  21. package/substrate/.claude/rules/api-conventions.md +125 -0
  22. package/substrate/.claude/rules/bootstrap-pair-discipline.md +141 -0
  23. package/substrate/.claude/rules/cold-adopter-harness-discipline.md +129 -0
  24. package/substrate/.claude/rules/compounding-axis-fresh-analysis.md +188 -0
  25. package/substrate/.claude/rules/compounding-sequence-fresh-analysis.md +188 -0
  26. package/substrate/.claude/rules/defensive-bash.md +68 -0
  27. package/substrate/.claude/rules/deferred-actions.md +233 -0
  28. package/substrate/.claude/rules/github-issue-flash-tweet.md +156 -0
  29. package/substrate/.claude/rules/hook-wire-on-author.md +103 -0
  30. package/substrate/.claude/rules/iteration-bet-brief-completeness.md +54 -0
  31. package/substrate/.claude/rules/lite-manifest-schema-change-discipline.md +3 -3
  32. package/substrate/.claude/rules/longrun-prep-plan-doc-compression.md +89 -0
  33. package/substrate/.claude/rules/loop-discipline.md +81 -0
  34. package/substrate/.claude/rules/manual-prod-approval.md +100 -0
  35. package/substrate/.claude/rules/marker-enrichment-discipline.md +99 -0
  36. package/substrate/.claude/rules/mobile-ephemeral-session.md +109 -0
  37. package/substrate/.claude/rules/new-dependency-check.md +51 -0
  38. package/substrate/.claude/rules/option-label-discipline.md +108 -0
  39. package/substrate/.claude/rules/pattern-annotation.md +100 -0
  40. package/substrate/.claude/rules/plain-english-discipline.md +11 -9
  41. package/substrate/.claude/rules/plan-enumeration-needs-value-props.md +211 -0
  42. package/substrate/.claude/rules/pr-title-shape.md +161 -0
  43. package/substrate/.claude/rules/prototype-workflow.md +65 -0
  44. package/substrate/.claude/rules/reserved-skill-names.md +123 -0
  45. package/substrate/.claude/rules/schema-management.md +49 -0
  46. package/substrate/.claude/rules/security.md +37 -0
  47. package/substrate/.claude/rules/skill-composition-declarations.md +124 -0
  48. package/substrate/.claude/rules/skill-description-clarity.md +247 -0
  49. package/substrate/.claude/rules/skill-procedure-step-list.md +137 -0
  50. package/substrate/.claude/rules/stuck-signal-diagnostic.md +140 -0
  51. package/substrate/.claude/rules/substrate-config-schema.md +98 -0
  52. package/substrate/.claude/rules/test-list-discipline.md +175 -0
  53. package/substrate/.claude/rules/test-sufficiency.md +210 -0
  54. package/substrate/.claude/rules/testing-tier-config.md +145 -0
  55. package/substrate/.claude/rules/testing.md +38 -0
  56. package/substrate/.claude/rules/turn-estimate-grounding.md +134 -0
  57. package/substrate/.claude/rules/visual-hierarchy.md +437 -0
  58. package/substrate/.claude/rules/we-dont-break-adopters.md +126 -0
  59. package/substrate/.claude/rules/wu-sequencing-compounds.md +145 -0
  60. package/substrate/.claude/skills/build/SKILL.md +1 -1
  61. package/substrate/.claude/skills/chronicle/SKILL.md +55 -0
  62. package/substrate/.claude/skills/clean-artifacts/SKILL.md +249 -0
  63. package/substrate/.claude/skills/decompose/SKILL.md +1 -1
  64. package/substrate/.claude/skills/diagnose/SKILL.md +1 -1
  65. package/substrate/.claude/skills/feynman/SKILL.md +90 -0
  66. package/substrate/.claude/skills/howdoi/SKILL.md +1 -1
  67. package/substrate/.claude/skills/ia-model/SKILL.md +1 -1
  68. package/substrate/.claude/skills/interaction-design/SKILL.md +1 -1
  69. package/substrate/.claude/skills/interpret-input/SKILL.md +8 -8
  70. package/substrate/.claude/skills/journal/SKILL.md +209 -0
  71. package/substrate/.claude/skills/kiss/SKILL.md +1 -1
  72. package/substrate/.claude/skills/launch/SKILL.md +14 -23
  73. package/substrate/.claude/skills/lean-canvas/SKILL.md +1 -1
  74. package/substrate/.claude/skills/longrun/SKILL.md +45 -8
  75. package/substrate/.claude/skills/luminary/SKILL.md +1 -1
  76. package/substrate/.claude/skills/ogilvy-writing-audit/SKILL.md +1 -1
  77. package/substrate/.claude/skills/onboard-repo/SKILL.md +143 -709
  78. package/substrate/.claude/skills/pattern-review/SKILL.md +1 -1
  79. package/substrate/.claude/skills/personas/SKILL.md +5 -5
  80. package/substrate/.claude/skills/promote/SKILL.md +1 -1
  81. package/substrate/.claude/skills/requirement/SKILL.md +1 -1
  82. package/substrate/.claude/skills/retro/SKILL.md +1 -1
  83. package/substrate/.claude/skills/riff/SKILL.md +1 -1
  84. package/substrate/.claude/skills/roadmap-reconcile/SKILL.md +1 -1
  85. package/substrate/.claude/skills/session-end/SKILL.md +1 -1
  86. package/substrate/.claude/skills/session-log/SKILL.md +3 -3
  87. package/substrate/.claude/skills/skills/SKILL.md +1 -1
  88. package/substrate/.claude/skills/spec/SKILL.md +1 -1
  89. package/substrate/.claude/skills/sprint/SKILL.md +1 -1
  90. package/substrate/.claude/skills/stage/SKILL.md +1 -1
  91. package/substrate/.claude/skills/state-a-problem/SKILL.md +1 -1
  92. package/substrate/.claude/skills/temperance/SKILL.md +1 -1
  93. package/substrate/.claude/skills/use-case/SKILL.md +1 -1
  94. package/substrate/.claude/skills/user-stories/SKILL.md +1 -1
  95. package/substrate/.claude/skills/value-prop/SKILL.md +1 -1
  96. package/substrate/.claude/skills/verify/SKILL.md +1 -1
  97. package/substrate/.claude/skills/visual-review/SKILL.md +503 -0
  98. package/substrate/.claude/skills/whats-the-plan/SKILL.md +202 -0
  99. package/substrate/.claude/skills/whereami/SKILL.md +2 -2
  100. package/substrate/CONTRIBUTING.md +1 -1
  101. package/substrate/README.md +5 -5
  102. package/substrate/lib/prose-scan-boundary.sh +171 -0
  103. package/substrate/lib/tier-check.sh +50 -1
  104. package/substrate/lib/tier-dependency-audit.sh +159 -4
  105. package/substrate/presence/install/bassclef-sync.template.sh +1 -1
  106. package/substrate/scripts/generate-lite-manifest.sh +21 -5
  107. package/substrate/standards/adr-template.md +86 -0
  108. package/substrate/standards/api-conventions/nextjs.md +84 -0
  109. package/substrate/standards/artifact-composition.md +209 -0
  110. package/substrate/standards/bash-hook-safety.md +246 -0
  111. package/substrate/standards/branch-stacking.md +408 -0
  112. package/substrate/standards/code-safety-principles.md +176 -0
  113. package/substrate/standards/composer-prerequisites.md +155 -0
  114. package/substrate/standards/dependency-discipline/cargo.md +39 -0
  115. package/substrate/standards/dependency-discipline/gem.md +43 -0
  116. package/substrate/standards/dependency-discipline/go-mod.md +41 -0
  117. package/substrate/standards/dependency-discipline/npm.md +42 -0
  118. package/substrate/standards/dependency-discipline/pip.md +42 -0
  119. package/substrate/standards/deployment-topology/ec2-tailscale.md +225 -0
  120. package/substrate/standards/deployment-topology.md +69 -0
  121. package/substrate/standards/docs-sync-allowlist.md +4 -4
  122. package/substrate/standards/domain-and-dns.md +145 -0
  123. package/substrate/standards/frontend-stack.md +67 -0
  124. package/substrate/standards/frontmatter-schema.md +154 -0
  125. package/substrate/standards/hook-injection-discipline.md +202 -0
  126. package/substrate/standards/hook-install-class.md +215 -0
  127. package/substrate/standards/input-handler-interface.md +152 -0
  128. package/substrate/standards/lite-manifest-schema-changes.md +60 -0
  129. package/substrate/standards/luminary-matching.md +105 -0
  130. package/substrate/standards/migration-discipline/active-record.md +50 -0
  131. package/substrate/standards/migration-discipline/alembic.md +43 -0
  132. package/substrate/standards/migration-discipline/gorm.md +50 -0
  133. package/substrate/standards/migration-discipline/prisma.md +53 -0
  134. package/substrate/standards/migration-discipline/sqlalchemy.md +51 -0
  135. package/substrate/standards/mobile-ephemeral-session.md +167 -0
  136. package/substrate/standards/model-routing-discipline.md +160 -0
  137. package/substrate/standards/persona-schema.md +229 -0
  138. package/substrate/standards/pluggable-luminaries.md +323 -0
  139. package/substrate/standards/pr-body-discipline.md +115 -0
  140. package/substrate/standards/preview-state-schema.md +189 -0
  141. package/substrate/standards/reserved-skill-names.md +120 -0
  142. package/substrate/standards/scannable-multi-option-output.md +261 -0
  143. package/substrate/standards/sdlc-gates/typescript.md +57 -0
  144. package/substrate/standards/session-board.md +256 -0
  145. package/substrate/standards/state-spine-contract.md +255 -0
  146. package/substrate/standards/steering-hints/kiss-words.md +11 -0
  147. package/substrate/standards/substrate-config-schema.md +267 -0
  148. package/substrate/standards/tier-dependency-analysis.md +1 -1
  149. package/substrate/standards/tier-tag-schema.md +1 -1
  150. package/substrate/standards/two-layer-config.md +99 -0
  151. package/substrate/standards/use-case-format.md +292 -0
  152. package/substrate/standards/user-story-invest.md +268 -0
  153. package/substrate/standards/velocity-and-appetite.md +229 -0
  154. package/substrate/standards/voice-input-pattern.md +119 -0
  155. package/substrate/standards/worktree-management.md +211 -0
  156. package/substrate/templates/chronicle-template.md +75 -0
  157. package/substrate/templates/memory-proposal-template.md +77 -0
  158. package/substrate/templates/persona-template.md +200 -0
  159. package/substrate/templates/pr-faq.md +45 -0
  160. package/substrate/templates/secret-rotation-template.md +162 -0
  161. package/substrate/templates/spec-template.md +131 -0
  162. package/substrate/templates/use-case-template.md +194 -0
  163. package/substrate/templates/user-story-template.md +107 -0
@@ -0,0 +1,225 @@
1
+ ---
2
+ tier: lite
3
+ description: "The operator's reference deployment. Stack-specific instantiation of standards/deployment-topology.md for adopters who pick the same target."
4
+ ---
5
+
6
+ # Deployment Topology — EC2 + Docker Compose + Tailscale + GHA-SSH
7
+
8
+ The operator's reference deployment. Stack-specific instantiation of `standards/deployment-topology.md` for adopters who pick the same target.
9
+
10
+ ## When this sibling fires
11
+
12
+ When adopter's `.claude/bassclef-configs.jsonc` has `tech_stack.deploy: ec2-tailscale`. The loader (future ticket) reads this sibling and applies the platform-specific guidance below in addition to the universal principles in the parent standard.
13
+
14
+ ---
15
+
16
+
17
+ **Single EC2 instance + Docker Compose + Tailscale mesh + GHA-SSH deploy.**
18
+
19
+ ```
20
+ ┌────────────────────────────────────────────────────────┐
21
+ │ EC2 Instance (on Tailscale) │
22
+ │ ┌──────────────────────────────────────────────────┐ │
23
+ │ │ docker-compose.prod.yml │ │
24
+ │ │ • app (Next.js / API) │ │
25
+ │ │ • worker (queue processor) │ │
26
+ │ │ • postgres (local volume) │ │
27
+ │ │ • redis (local volume) │ │
28
+ │ └──────────────────────────────────────────────────┘ │
29
+ │ ┌──────────────────────────────────────────────────┐ │
30
+ │ │ docker-compose.staging.yml (optional, same box)│ │
31
+ │ │ • app on different port │ │
32
+ │ │ • worker │ │
33
+ │ │ • SHARES postgres (different DB) │ │
34
+ │ │ • SHARES redis (different namespace) │ │
35
+ │ └──────────────────────────────────────────────────┘ │
36
+ │ /opt/backups/ (pg_dump on every deploy) │
37
+ │ .env.production, .env.staging (on-box, gitignored) │
38
+ └────────────────────────────────────────────────────────┘
39
+ ↑ ↑
40
+ │ Tailscale SSH │ Tailscale HTTPS
41
+ GitHub Actions (CI) Users + operator phone
42
+ ```
43
+
44
+ ## When this pattern fits
45
+
46
+ - Small team (≤10 users)
47
+ - Trusted user set (all known, on Tailscale)
48
+ - Cost-sensitive (~$15-30/mo infra per environment)
49
+ - Low-to-moderate traffic (< ~50 concurrent users)
50
+ - Solo or small-team ops (no dedicated SRE)
51
+ - Private / internal tool (not public-facing)
52
+
53
+ ## When to graduate beyond
54
+
55
+ | Signal | Graduate to |
56
+ |--------|-------------|
57
+ | Public-facing with >100 concurrent users | ALB + auto-scaling group, or managed Platform-as-Service |
58
+ | Multi-region / geo-redundancy required | Terraform-defined multi-region; managed DB |
59
+ | Compliance requires isolation (SOC2, HIPAA) | Dedicated network / VPC + managed services |
60
+ | >1 developer pushing concurrently | Per-PR preview environments |
61
+ | Data loss intolerant (RPO < 1 hour) | Managed DB with PITR (RDS, Aurora) + offsite backups |
62
+
63
+ **Graduation is a conscious choice, not default.** Most products never
64
+ need it. Starting simple and graduating under pressure is cheaper than
65
+ over-architecting up front.
66
+
67
+ ## Environment separation rules
68
+
69
+ ### Topology choices
70
+
71
+ **Option A — Same box, multiple Compose stacks** (cheapest, default)
72
+
73
+ - Prod stack on `docker-compose.prod.yml` at port 3001
74
+ - Staging stack on `docker-compose.staging.yml` at port 3002
75
+ - Shared Postgres, different DBs (`{app}_prod`, `{app}_staging`)
76
+ - Shared Redis, different namespaces (`prod:*`, `staging:*`)
77
+ - Shared box = resource contention risk; monitor
78
+
79
+ **Option B — Separate boxes, same pattern** (isolation, ~$15-20/mo more)
80
+
81
+ - Prod box + staging box, both on Tailscale mesh
82
+ - Separate Postgres + Redis per box
83
+ - Clean isolation at cost of second instance
84
+
85
+ Default is Option A. Upgrade to B if contention manifests.
86
+
87
+ ### Required separation
88
+
89
+ Regardless of topology choice:
90
+ - **Separate `.env.{environment}` files** — never share credentials
91
+ - **Separate DBs / namespaces** — never share data
92
+ - **Separate backup paths** — `/opt/backups/prod/`, `/opt/backups/staging/`
93
+ - **Separate API keys** — staging uses test-tier keys where providers
94
+ support (Anthropic, Resend, etc.)
95
+ - **No PII in staging** — synthetic fixtures or anonymized seed,
96
+ never a raw prod copy
97
+
98
+ ## Deploy workflow shape (bassclef)
99
+
100
+ Every deploy workflow (`.github/workflows/deploy.yml`) follows this sequence:
101
+
102
+ 1. **Test** — unit + integration tests must pass
103
+ 2. **Build** — Docker image → push to GHCR with SHA tag
104
+ 3. **Pre-deploy backup** — SSH to box, `pg_dump` current DB to
105
+ `/opt/backups/{env}/`
106
+ 4. **Deploy** — pull image, run migrations in temporary container,
107
+ `docker compose up -d` with maintenance-mode flag during restart
108
+ 5. **Smoke test** — curl health endpoint + one critical path; fail
109
+ the job if anything breaks
110
+ 6. **Alert on failure** — auto-create GitHub issue labeled priority:high
111
+
112
+ Staging runs this sequence on PR open/push. Prod runs on merge to main
113
+ **with manual approval gate** (see Manual approval rule below).
114
+
115
+ ## Manual approval gate (MUST)
116
+
117
+ Prod deploys always require manual human approval. Mechanism: GitHub
118
+ Environments with `required_reviewers`.
119
+
120
+ ```yaml
121
+ # In deploy.yml
122
+ jobs:
123
+ deploy-prod:
124
+ environment:
125
+ name: prod # configured with required_reviewers in repo settings
126
+ ...
127
+ ```
128
+
129
+ No app repo may skip this gate. Per `.claude/rules/manual-prod-approval.md`,
130
+ absence of this configuration is a rule violation.
131
+
132
+ ## Backup protocol
133
+
134
+ - `pg_dump` before every deploy, compressed, timestamped
135
+ - Stored locally on the box at `/opt/backups/{env}/`
136
+ - Retention: 30 days on-box, longer offsite if compliance requires
137
+ - Weekly rotation to offsite (S3, separate account) if data is
138
+ business-critical
139
+
140
+ ## Rollback
141
+
142
+ - Docker image tagged by SHA at every push to GHCR
143
+ - Rollback = redeploy previous SHA: `docker compose -f docker-compose.prod.yml`
144
+ with image tag swapped
145
+ - Database rollback via `pg_restore` from pre-deploy backup (last resort;
146
+ most migrations should be expand-and-contract so rollback ≠ restore)
147
+ - Runbook lives at `docs/runbooks/rollback.md` per app repo
148
+
149
+ ## Maintenance mode
150
+
151
+ During restart, users should see a holding page, not a broken UI.
152
+ Implementation: env flag `MAINTENANCE_MODE=1` set in `.env.{env}`
153
+ during the deploy window, read by the app's request handler, renders
154
+ a simple HTML holding page for all paths.
155
+
156
+ Deploy sequence:
157
+ 1. Set `MAINTENANCE_MODE=1` in env
158
+ 2. Run migrations (in temporary container)
159
+ 3. Restart app + worker containers
160
+ 4. Health-check loop: up to N retries
161
+ 5. Unset `MAINTENANCE_MODE`, restart to pick up env change
162
+
163
+ ## Mobile / ephemeral safety
164
+
165
+ Deploy flows NEVER run from an ephemeral session (mobile, CI-nested
166
+ agent, etc.). Ephemeral sessions open PRs; CI handles the deploy on
167
+ merge after approval gate. See `standards/mobile-ephemeral-session.md`.
168
+
169
+ ## Templates
170
+
171
+ Working templates for instantiation into new app repos:
172
+
173
+ ```
174
+ presence/install/deployment/
175
+ docker-compose.prod.template.yml
176
+ docker-compose.staging.template.yml
177
+ env.prod.template
178
+ env.staging.template
179
+ github-workflows-deploy.template.yml
180
+ ```
181
+
182
+ Parameterized on: `{{APP_NAME}}`, `{{APP_PORT_PROD}}`, `{{APP_PORT_STAGING}}`,
183
+ `{{DB_NAME_PROD}}`, `{{DB_NAME_STAGING}}`, `{{GHCR_IMAGE}}`,
184
+ `{{DEPLOY_HOST}}`, `{{DEPLOY_USER}}`, `{{DEPLOY_PATH}}`, `{{TAILSCALE_TAG}}`.
185
+
186
+ Values come from `substrate.config.md` fields (per
187
+ `standards/substrate-config-schema.md`).
188
+
189
+ ## Substrate config fields required for deployment
190
+
191
+ ```yaml
192
+ deploy_host: [Tailscale hostname]
193
+ deploy_user: [SSH user]
194
+ deploy_path: [absolute path on box]
195
+ staging_deploy_host: [optional; same or different]
196
+ staging_deploy_path: [optional]
197
+ tailscale_tag: [e.g., tag:ci]
198
+ backup_path: [absolute path]
199
+ prod_approval_reviewers: [comma-separated GitHub usernames]
200
+ ```
201
+
202
+ ## Anti-patterns
203
+
204
+ - **Hardcoded host/user/path in deploy.yml** — always pull from
205
+ `substrate.config.md` via GHA secrets or variables
206
+ - **Same `.env.production` on staging** — never. Separate files,
207
+ always.
208
+ - **Prod data copied to staging** — PII leak + violates substrate
209
+ separation rule
210
+ - **Auto-deploy to prod without approval gate** — violates guardrails
211
+ - **Deploy from ephemeral session** — violates mobile-ephemeral rules
212
+ - **Skipping pre-deploy backup** — no recovery path if deploy breaks
213
+
214
+ ## Related
215
+
216
+ - `standards/mobile-ephemeral-session.md` — ephemeral constraints
217
+ - `standards/substrate-config-schema.md` — resource reference schema
218
+ - `.claude/rules/manual-prod-approval.md` — prod gate enforcement
219
+ - `.claude/rules/guardrails.md` — prod deploy always human-approved
220
+
221
+ ## Refs
222
+
223
+ - Parent standard: `standards/deployment-topology.md`
224
+ - ARCH-T0 #1133 — operator-stack-leakage audit + remediation
225
+ - bassclef#1315 — this sibling (deployment-topology Path A WU-9 of bet 2026-06-20e)
@@ -0,0 +1,69 @@
1
+ ---
2
+ tier: lite
3
+ description: Document the deployment target your project actually uses, so substrate-side hooks + rules + skills load the right per-platform siblings via the loader (future ticket) reading tech_stack.deploy from .claude/bassclef-configs.jsonc.
4
+ ---
5
+
6
+ # Deployment Topology Standard
7
+
8
+ ## Purpose
9
+
10
+ Document the deployment target your project actually uses, so substrate-side hooks + rules + skills load the right per-platform siblings via the loader (future ticket) reading `tech_stack.deploy` from `.claude/bassclef-configs.jsonc`.
11
+
12
+ This standard is universal — it instructs you to declare your deployment target, not which platform to adopt. The operator's deployment (single EC2 + Docker Compose + Tailscale + GHA-SSH) is documented as one example under `standards/deployment-topology/ec2-tailscale.md`; adopters on Vercel, Netlify, Fly, Render, Cloud Run, Amplify add their own siblings.
13
+
14
+ ## Why declare your deployment
15
+
16
+ Bassclef's deploy-side discipline (prod approval gates, environment isolation, secret handling, observability hooks, rollback procedures) ships as universal principles with per-platform siblings. The loader matches your declared deploy target to the relevant sibling; without one, the universal principles still apply but platform-specific specifics are skipped.
17
+
18
+ Declare your deployment in `.claude/bassclef-configs.jsonc` `tech_stack.deploy`:
19
+
20
+ ```jsonc
21
+ "tech_stack": {
22
+ "deploy": "ec2-tailscale" | "vercel" | "netlify" | "fly" | "render" | "gcp-cloud-run" | "amplify" | "none"
23
+ }
24
+ ```
25
+
26
+ ## Per-platform siblings
27
+
28
+ | Adopter's `tech_stack.deploy` | Sibling location |
29
+ |---|---|
30
+ | `ec2-tailscale` (operator's deployment) | `standards/deployment-topology/ec2-tailscale.md` |
31
+ | `vercel` | `standards/deployment-topology/vercel.md` *(future — file `/promote` to author)* |
32
+ | `netlify` | `standards/deployment-topology/netlify.md` *(future)* |
33
+ | `fly` | `standards/deployment-topology/fly.md` *(future)* |
34
+ | `render` | `standards/deployment-topology/render.md` *(future)* |
35
+ | `gcp-cloud-run` | `standards/deployment-topology/gcp-cloud-run.md` *(future)* |
36
+ | `amplify` | `standards/deployment-topology/amplify.md` *(future)* |
37
+ | `none` or unset | universal principles only; no platform-specific guidance |
38
+
39
+ ## Universal principles
40
+
41
+ Whichever deployment target you pick:
42
+
43
+ - **Production deploys require human approval** — never auto-deploy to prod without explicit gate per `.claude/rules/manual-prod-approval.md`. Hard ceiling regardless of platform.
44
+ - **Environment isolation** — local / staging / prod are distinct; secrets, data, and config never cross boundaries
45
+ - **ENV vars and secrets** — never committed; live in your platform's secret-management mechanism (GitHub Actions Secrets, Vercel env vars, AWS Secrets Manager, 1Password, etc.). Reference by name in code; never inline values.
46
+ - **Backups before destructive operations** — DB backup before any migration that drops columns / changes types / renames tables. Backup retention policy declared in your sibling.
47
+ - **Rollback procedure** — documented per platform. Know your N-1 deployable artifact at all times.
48
+ - **Observability** — health endpoint + error reporting + log aggregation. Platform-specific tooling varies; the obligation is universal.
49
+ - **Secret rotation** — declared cadence per secret type. Per `standards/secrets-lifecycle.md`.
50
+
51
+ ## Operator's deployment reference
52
+
53
+ The operator's reference deployment is single EC2 + Docker Compose + Tailscale mesh + GHA-SSH deploy. Full architecture diagram + capacity bounds + when to graduate + setup walkthrough + key commands live in `standards/deployment-topology/ec2-tailscale.md`.
54
+
55
+ This is one example among many valid patterns. Adopters on cloud-platform deployments (Vercel, Netlify, Fly, Render, Cloud Run, Amplify) read their own sibling once it exists; until then, the universal principles above apply.
56
+
57
+ ## When to graduate from your declared deployment
58
+
59
+ Each platform sibling documents capacity bounds + graduation triggers (when single-instance bottlenecks force migration to multi-region / managed services / Kubernetes / etc.). The operator's EC2-Tailscale sibling carries the original graduation triggers for that pattern; adopters on cloud platforms document their own.
60
+
61
+ ## Refs
62
+
63
+ - ARCH-T0 #1133 — operator-stack-leakage audit + remediation (parent)
64
+ - bassclef#1315 — this Path A WU-9 of bet 2026-06-20e
65
+ - bassclef#1309 + bassclef#1311 + bassclef#1313 — sister Path A passes
66
+ - bassclef#1127 — tech_stack vocabulary
67
+ - `.claude/rules/manual-prod-approval.md` — prod approval gate (universal)
68
+ - `standards/secrets-lifecycle.md` — secret rotation discipline
69
+ - `standards/deployment-topology/ec2-tailscale.md` — operator's deployment reference
@@ -30,16 +30,16 @@ When any of these paths change in a push to `main`, the docs-sync workflow fires
30
30
  - `.claude/skills/*/SKILL.md` (any new file OR `deprecated: true` flip in frontmatter)
31
31
  - `.claude/rules/*.md` (any new file)
32
32
  - `standards/bassclef-source-config.md`
33
- - `standards/vendor-bindings.md`
33
+ - `standards/vendor-bindings.md` (standard tier — substrate reference)
34
34
  - `standards/bassclef-configs-schema.md` (added 2026-06-20 — bassclef#1284 closeout; covers the schema doc updated when new bassclef-configs blocks ship)
35
- - `standards/sibling-validation-checklist.md` (added 2026-06-20 — bassclef#1284 closeout; operator-runnable end-to-end validation procedure for adopter inheritance)
35
+ - `standards/sibling-validation-checklist.md` (standard tier; added 2026-06-20 — bassclef#1284 closeout; operator-runnable end-to-end validation procedure for adopter inheritance)
36
36
  - `standards/bassclef-internal-jargon.md` → `Bassclef-Internal-Jargon.md` (added 2026-06-20 — bassclef#1298 / WU-13 of bet 2026-06-20e; the BLOCK / ADVISE / ALLOW wordlist read by turn-prose-kiss-check.sh + pr-body-scrub-check.sh; amended frequently — every wordlist addition should sync to wiki so adopters see current catalog)
37
37
  - `standards/adr-template.md` → `ADR-Template.md` (added 2026-06-20 — bassclef#1208 / WU-14 of bet 2026-06-20e; 14-day wiki-as-we-go sweep — ADR template for adopter architecture-record discipline)
38
38
  - `standards/bash-hook-safety.md` → `Bash-Hook-Safety.md` (added 2026-06-20 — same; 7 defensive-bash disciplines)
39
39
  - `standards/code-safety-principles.md` → `Code-Safety-Principles.md` (added 2026-06-20 — same; language-agnostic safety principles)
40
40
  - `standards/frontmatter-schema.md` → `Frontmatter-Schema.md` (added 2026-06-20 — same; required/optional fields for rules + skills)
41
41
  - `standards/model-routing-discipline.md` → `Model-Routing-Discipline.md` (added 2026-06-20 — same; per-agent model_tier discipline)
42
- - `standards/pseudonym-key-schema.md` → `Pseudonym-Key-Schema.md` (added 2026-06-20 — same; operator-private pseudonym registry schema)
42
+ - `standards/pseudonym-key-schema.md` → `Pseudonym-Key-Schema.md` (standard tier; added 2026-06-20 — same; operator-private pseudonym registry schema)
43
43
  - `standards/security-scanner-adapter.md` → `Security-Scanner-Adapter.md` (added 2026-06-20 — same; per-stack security scanner integration)
44
44
  - `standards/tech-stack-config.md` → `Tech-Stack-Config.md` (added 2026-06-20 — same; tech_stack vocabulary bassclef#1127 drives)
45
45
 
@@ -69,7 +69,7 @@ When a new file should be synced, edit this allowlist + the workflow's `paths:`
69
69
 
70
70
  - `docs/iteration-bets/2026-05-13-s3-retirement-docs-sync-hooks-index.md` — parent bet
71
71
  - `docs/roadmaps/2026-05-07-7-phase-staircase.md` — current `last_event` = `phase_v_mvd_substrate_shipped` at `2026-05-12T01:30:00Z`
72
- - `.claude/rules/bassclef-workflow-parity.md` — sibling-grep discipline when adding workflows
72
+ - `.claude/rules/bassclef-workflow-parity.md` (standard tier) — sibling-grep discipline when adding workflows
73
73
 
74
74
  ## Closes
75
75
 
@@ -0,0 +1,145 @@
1
+ ---
2
+ tier: lite
3
+ description: - .claude/skills/bind-subdomain/SKILL.md — operationalizes this standard - scripts/bind-subdomain.sh + scripts/adapters/* — the implementation - standards/substrate-config-schema.md — field conventions used by the script -…
4
+ ---
5
+
6
+ ## Sources read
7
+
8
+ - `.claude/skills/bind-subdomain/SKILL.md` — operationalizes this standard
9
+ - `scripts/bind-subdomain.sh` + `scripts/adapters/*` — the implementation
10
+ - `standards/substrate-config-schema.md` — field conventions used by the script
11
+ - bassclef #254 — shaping ticket this standard closes
12
+ - `docs/learnings/2026-04-19-mobile-to-preview.md` — source of the manual pattern now automated
13
+
14
+ ## What I'm NOT reading (with reason)
15
+
16
+ - `standards/deployment-topology.md` — orthogonal (that's EC2 + Docker Compose; this is DNS/TLS for any managed platform)
17
+ - Route 53-specific DNS management — out of scope v1; Phase 2 of automation path
18
+
19
+ # Domain + DNS Standard
20
+
21
+ Bassclef decision for how sunj-labs apps get friendly URLs:
22
+ subdomain convention, TLS ownership, and DNS automation.
23
+
24
+ ## The four coupled decisions
25
+
26
+ ### 1. Subdomain convention: `<app>.apps.fivepandas.com`
27
+
28
+ - **Apex (`fivepandas.com`)** — reserved for marketing/brand
29
+ - **`apps.fivepandas.com`** — bassclef subtree for sunj-labs apps
30
+ - **`<app>.apps.fivepandas.com`** — one per app
31
+
32
+ Per-environment subdomains (e.g., `quorum.preview.apps.fivepandas.com`) are **deferred**. Single binding per app until multi-environment needs emerge. When they do, the pattern extends to `<app>.<env>.apps.fivepandas.com`.
33
+
34
+ **Why `apps.` bucket:** leaves apex + first-level untouched for brand; centralizes app surfaces under one predictable subtree; matches the bassclef-as-operating-system frame.
35
+
36
+ ### 2. TLS / cert ownership: Amplify-managed (Phase 1) → Route 53 delegation (Phase 2)
37
+
38
+ | Phase | Approach | Trigger |
39
+ |-------|----------|---------|
40
+ | **Phase 1 (current)** | Amplify-managed cert (ACM); validation records live in Cloudflare | First 1-2 apps; before IaC lands |
41
+ | **Phase 2 (future)** | Route 53 delegation — delegate `apps.fivepandas.com` NS to Route 53; Amplify manages DNS + cert end-to-end | Triggered by #250 (IaC: CDK vs Gen 2) |
42
+
43
+ Phase 2 is the target because only Route 53 composes cleanly with AWS-native IaC. But Phase 1 is correct today — the cost of Route 53 delegation isn't justified for 1-2 apps.
44
+
45
+ ### 3. DNS automation: `/bind-subdomain` skill
46
+
47
+ All DNS binding goes through `/bind-subdomain` — no manual clickops. The skill:
48
+
49
+ - Reads `substrate.config.md` for the consumer repo
50
+ - Dispatches to deploy-host adapter (Amplify v1; Netlify/Vercel/CF-Pages future)
51
+ - Dispatches to DNS-provider adapter (Cloudflare v1; Route 53 future)
52
+ - Creates domain association + validation records idempotently
53
+ - Polls cert validation (up to 20 min)
54
+ - Enables auto-build on the bound branch
55
+
56
+ **Idempotency** is mandatory. Re-running the skill against an already-bound app returns the current binding without modification. Script failure mid-way is recoverable by re-run.
57
+
58
+ ### 4. Prototype gallery URL pattern: path-based, under the app subdomain
59
+
60
+ Per ADR-016 (bassclef#441 resolution): `/preview-build` and `/prototype-variants` dispatches expose variants under the app's existing subdomain at:
61
+
62
+ ```
63
+ https://<app>.apps.fivepandas.com/prototypes/<dispatch-slug>/<variant-slug>/
64
+ ```
65
+
66
+ Examples (live):
67
+
68
+ - `https://quorum.apps.fivepandas.com/prototypes/<historical-example-bet>/variant-tufte/` — Quorum's 22-variant gallery
69
+ - `https://twodo.apps.fivepandas.com/prototypes/2026-05-02-twodo/variant-a-tufte/` — TwoDo PR #269 (pending bind)
70
+
71
+ **Per-variant routing is the consumer app's responsibility**, not bassclef's `/bind-subdomain` skill. Static folder under `public/prototypes/` works on every supported deploy host (Amplify, Vercel, Netlify); Next.js App Router with `app/prototypes/[...slug]/page.tsx` works for dynamic galleries.
72
+
73
+ **One subdomain per app, regardless of variant count.** A 22-variant gallery binds the same way a single page does — one cert validation cycle, one DNS record. The path-based pattern preserves §1's "one subdomain per app" rule without amendment.
74
+
75
+ **`/launch-preview` (bassclef#448) operationalizes this convention.** The composer provisions exactly one subdomain per app via `/bind-subdomain`; variants ride along under `/prototypes/`.
76
+
77
+ **Production exclusion is the consumer's responsibility.** `/prototypes/*` routes should be gated behind a build-time flag (`NODE_ENV === 'development'`, `PREVIEW_TIER === '1'`, etc.) so production builds strip them. `standards/prototype-gallery.md` codifies the exclusion expectation.
78
+
79
+ Alternatives considered + rejected (subdomain-prefix, sub-subdomain) and full rationale: see ADR-016.
80
+
81
+ ## Required config fields
82
+
83
+ Consumer repo's `substrate.config.md` declares:
84
+
85
+ ```yaml
86
+ hosting_platform: amplify # amplify (bassclef default) | ec2-tailscale | vercel | netlify | cloudflare-pages | none
87
+ amplify_app_id: d154l5usyc80nk
88
+ amplify_region: eu-north-1
89
+ amplify_branch: main # optional, defaults to main
90
+ subdomain: quorum.apps.fivepandas.com
91
+ dns_provider: cloudflare # cloudflare | route53
92
+ dns_zone: fivepandas.com
93
+ cloudflare_token_env: CLOUDFLARE_API_TOKEN
94
+ ```
95
+
96
+ Secret values NEVER live in `substrate.config.md`. The field
97
+ `cloudflare_token_env` names an environment variable; the value is
98
+ set in the operator's shell (`~/.zshrc`, `~/.bashrc`, 1Password CLI
99
+ integration, etc.).
100
+
101
+ ## Zone ownership + account topology
102
+
103
+ - `fivepandas.com` zone lives in Cloudflare (operator-owned)
104
+ - AWS Amplify apps live in AWS account `515820372344` (sunj-labs)
105
+ - TLS cert issuance happens in AWS (ACM); validation happens in CF
106
+ - No AWS-side DNS today (Phase 2 changes this for the `apps.` subtree)
107
+
108
+ ## Security posture
109
+
110
+ - Cloudflare API token: least-privilege — Zone:Read + DNS:Edit, scoped to `fivepandas.com` zone only
111
+ - TTL on CF token: 90-day rotation recommended (forces rotation discipline early)
112
+ - AWS CLI: existing operator creds; narrowing IAM to Amplify-only is future hardening
113
+ - No tokens in source control, ever
114
+
115
+ ## When to graduate beyond this standard
116
+
117
+ - **Multi-environment per app** (preview/staging/prod) → extend subdomain pattern to `<app>.<env>.apps.fivepandas.com`; `/bind-subdomain` learns a new optional arg
118
+ - **Non-Amplify hosting target** → add adapter at `scripts/adapters/deploy/<host>.sh`; no changes to main script
119
+ - **Non-Cloudflare DNS** → add adapter at `scripts/adapters/dns/<provider>.sh`; migrate to Route 53 per Phase 2
120
+ - **Per-PR preview URLs** → couples to IaC work (#250); likely Amplify-native feature set + new subdomain pattern
121
+
122
+ ## Relationship to adjacent standards
123
+
124
+ - `substrate-config-schema.md` — field definitions the script reads
125
+ - `deployment-topology.md` — orthogonal (that's the POA EC2 pattern; this is DNS/TLS for any managed platform)
126
+ - `bassclef-evolution.md` — this standard shipped as the resolution of #254
127
+
128
+ ## Relationship to adjacent skills
129
+
130
+ | Skill | Role |
131
+ |-------|------|
132
+ | `/bind-subdomain` | Implements this standard |
133
+ | `/onboard-repo` | Peer — provisions bassclef substrate for a new repo; binding happens after deploy host exists |
134
+ | `/deploy-prod` | Peer — POA's EC2+Tailscale deploy pattern; doesn't use this skill |
135
+ | `/substrate-check` | Validates `substrate.config.md` schema coverage |
136
+
137
+ ## Evolution
138
+
139
+ - **v1.0 (2026-04-23)** — initial standard + skill + scripts + adapter
140
+ pattern. Amplify + Cloudflare v1 only. First consumer: quorum.
141
+
142
+ ## Closes
143
+
144
+ - bassclef #254 (shaping)
145
+ - bassclef iteration goal 2026-04-23a-bind-subdomain (this ship)
@@ -0,0 +1,67 @@
1
+ ---
2
+ tier: lite
3
+ description: Document the stack your project actually uses, so substrate-side hooks + rules + skills load the right per-stack siblings via the loader (future ticket) reading tech_stack from .claude/bassclef-configs.jsonc.
4
+ ---
5
+
6
+ # Application Stack Standard
7
+
8
+ ## Purpose
9
+
10
+ Document the stack your project actually uses, so substrate-side hooks + rules + skills load the right per-stack siblings via the loader (future ticket) reading `tech_stack` from `.claude/bassclef-configs.jsonc`.
11
+
12
+ This standard is universal — it instructs you to declare your stack, not which stack to adopt. The operator's stack is documented as one example under `standards/frontend-stack/nextjs-prisma.md`; adopters on other stacks add their own sibling.
13
+
14
+ ## Why declare your stack
15
+
16
+ Bassclef's substrate carries cross-cutting discipline (testing tiers, SDLC gates, API conventions, schema management, dependency discipline, deployment topology). Each ships a universal rule with per-stack siblings. The loader matches your declared stack to the relevant siblings; without a declared stack, the universal principles still apply but the stack-specific specifics are skipped.
17
+
18
+ Declare your stack in `.claude/bassclef-configs.jsonc` `tech_stack` block:
19
+
20
+ ```jsonc
21
+ "tech_stack": {
22
+ "frontend": "nextjs" | "react-vite" | "vue" | "svelte" | "fastapi" | "django" | "rails" | "none",
23
+ "backend": "nodejs" | "python" | "ruby" | "go" | "rust" | "deno",
24
+ "orm": "prisma" | "sqlalchemy" | "active-record" | "gorm" | "alembic" | "none",
25
+ "pkg_manager": "npm" | "pip" | "cargo" | "gem" | "go-mod",
26
+ "deploy": "ec2-tailscale" | "vercel" | "netlify" | "fly" | "render" | "gcp-cloud-run" | "amplify" | "none"
27
+ }
28
+ ```
29
+
30
+ ## Per-stack siblings
31
+
32
+ | Adopter's stack | Sibling location |
33
+ |---|---|
34
+ | Next.js + Prisma + Postgres + EC2-Tailscale (operator's stack) | `standards/frontend-stack/nextjs-prisma.md` |
35
+ | FastAPI + SQLAlchemy + Postgres | `standards/frontend-stack/fastapi-sqlalchemy.md` *(future — file `/promote` to author)* |
36
+ | Rails + ActiveRecord | `standards/frontend-stack/rails.md` *(future)* |
37
+ | Other | document yours under `standards/frontend-stack/<name>.md` |
38
+
39
+ When no sibling matches your declared stack, the universal principle below applies; sibling-specific guidance is skipped.
40
+
41
+ ## Universal principle
42
+
43
+ Whichever stack you pick:
44
+
45
+ - One declared stack per project — mixing N stacks for parts of one app produces drift; pick one and document it
46
+ - Type safety from boundary to boundary where the language supports it (TypeScript strict, Python type hints + mypy, etc.)
47
+ - Single source of truth for DB schema (an ORM schema file, a migration history, or a generated artifact — your call, but ONE source)
48
+ - ENV vars never committed; live in `.env.local` (local) and your deployment platform's env mechanism (production)
49
+ - Testing tiers per `.claude/rules/testing-tier-config.md` (Tier 0 strict TDD for substrate; Tier 1/2/3 by blast radius)
50
+ - Migrations per `.claude/rules/schema-management.md` (never auto-apply; never use `db push`-style tools that bypass migration files)
51
+
52
+ ## Operator's stack reference
53
+
54
+ The operator's reference stack is Next.js + TypeScript + Prisma + Postgres + EC2-Tailscale. Full details + project structure + conventions + key commands live in `standards/frontend-stack/nextjs-prisma.md`.
55
+
56
+ See [ADR-008](../architecture/decisions/ADR-008-full-typescript-stack.md) for the original operator-side rationale. ADR-008 is operator-specific by nature (it documents one project's architecture decision); adopters on other stacks make their own ADRs.
57
+
58
+ ## Refs
59
+
60
+ - ARCH-T0 #1133 — operator-stack-leakage audit + remediation (parent)
61
+ - bassclef#1313 — this Path A WU-8 of bet 2026-06-20e
62
+ - bassclef#1309 + bassclef#1311 — sister Path A passes
63
+ - bassclef#1127 — tech_stack vocabulary
64
+ - `.claude/rules/testing-tier-config.md` — testing tier discipline
65
+ - `.claude/rules/schema-management.md` — migration discipline (Path A precedent)
66
+ - `.claude/rules/new-dependency-check.md` — dependency discipline (Path A precedent)
67
+ - `standards/frontend-stack/nextjs-prisma.md` — operator's stack reference