Facility Pipeline — development handoff
Signal-driven business development: turn the 576 NY prospect facilities into a worked, prioritized pipeline. This folder is the spec set for building it. It was produced from a multi-agent design review grounded in this codebase; the pure logic, migration, and ADR are already in the tree.
Read in this order
- ADR-0040 — the decision record (what & why, one page).
- 01-design-spec.md — the feature design: the three layers (signals, scoring, follow-up), the revised scoring model, the BD operating procedure, KPIs.
- 02-review-synthesis.md — the four critiques distilled, what changed in this revision, and the open decisions for the owner.
- 03-implementation-plan.md — the file manifest, function signatures, repo-specific gotchas, and the phased build order. This is the build checklist.
- 04-ux-spec.md — page-by-page states, the full modal inventory, and the exact existing components to reuse.
- mockups/facility-pipeline-mockups.html — an annotated gallery of every board, page, and modal with explanations. Open in a browser.
Already in the tree (done, verified)
src/db/migrations/0053_facility_pipeline.sql— additive migration (parses against the PG grammar; incorporates the schema-review fixes). Not yet applied.src/lib/pipeline/{types,job-signal,score,match-facility}.ts— pure logic (role classification, urgency, the revised facility score, entity resolution). Passestsc --strict(noUncheckedIndexedAccess,exactOptionalPropertyTypes); 13/13 logic checks green.tests/lib/pipeline/*.test.ts— Vitest unit tests (runpnpm teston macOS — the sandbox couldn't run vitest becausenode_modulesholds darwin-native Rollup/Biome binaries).
To resume development (VS Code Claude)
git checkout -b feat/facility-pipeline- Apply
0053to a Supabase dev branch, thensupabase gen types typescript … > src/db/types.ts. - Widen the
facility_contactsroleenum insrc/types/schemas/(see implementation plan §3.11). - Follow the phased build order in
03-implementation-plan.md(pure core is already done — start at Phase 2/3). Runpnpm check && pnpm typecheck && pnpm guardrails && pnpm test && pnpm buildat the end of each phase.
Status
Design + review complete. Migration, pure lib, tests, ADR, and mockups landed. Server actions, queries, cron routes, AI extractors, and UI components are specified but not yet built.