f539d4313668bc6734cb04a68155259362fe6fbd
Adds db/schema.sql (12 tables), db/policies.sql (RLS on all 12,
audit_log append-only), db/auth-hook.sql (role/org_id into JWT per
AD-2), db/seed.sql (org + 3 departments, part 2 deferred to M1 auth).
Wires lib/supabase/{client,server,service}.ts per AD-3 and adds
/db-check page confirming DB connectivity and RLS deny-by-default.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FcktbLXSSXzx23GCue813e
SOP Governance Tool — Spec Pack (Stage 1)
Complete specification suite for the single-tenant SOP governance tool, written to be dropped into the project repository and used by Claude Code.
Reading order (human)
| # | File | What it answers |
|---|---|---|
| 1 | docs/01-PRD.md |
What we're building, for whom, and what we're deliberately NOT building |
| 2 | docs/02-FRD.md |
Every functional requirement with testable acceptance criteria (FR-x.x) |
| 3 | docs/03-architecture.md |
Stack, directory layout, and the 6 architectural decisions (AD-1…AD-6) |
| 4 | docs/04-database-schema.md |
Full Postgres DDL, JSON shapes, RLS policy matrix, seed plan |
| 5 | docs/05-api-spec.md |
Every mutation & AI route with request/response examples and error codes |
| 6 | docs/06-ui-ux.md |
Screen-by-screen specs, design tokens, mobile staff experience |
| 7 | docs/07-development-plan.md |
M0–M7 milestones, weekly rhythm, scope-cut order |
| 8 | CLAUDE.md |
Session-by-session implementation plan + working rules for Claude Code |
How to use with Claude Code
- Create your repo, copy this whole folder in (
CLAUDE.mdat repo root,docs/alongside). - Open Claude Code in the repo. It reads
CLAUDE.mdautomatically. - Say: "Read CLAUDE.md and docs/07-development-plan.md, then start Session S1."
- One session at a time. Run each milestone's ✅ checklist before moving on.
Scope guardrails
- Stage 1 only: one company, fixed roles, 1-level approval, minimal incident log (report + review, no escalation workflows), no billing, no WhatsApp API (share links manually).
- Stage-2 ready by design:
org_idon every table + RLS from day one — multi-tenant SaaS later is an evolution, not a rewrite. - If a feature isn't in
02-FRD.md, it is out of scope. Add it to a "later" list, don't build it.
Parent documents: BRD v1.1 · Solo-Founder Roadmap (Stage 0 → 1 → 2).
Languages
TypeScript
54.3%
CSS
24.8%
PLpgSQL
17.7%
JavaScript
3.2%