Morphism Reconstruction Blueprint

plancompleted

Provenance: Ingested from Archives/files/MORPHISM_RECONSTRUCTION_BLUEPRINT.md. Original document is an audit-first implementation system prompt designed for Claude Code CLI sessions on the Morphism codebase.

Morphism Reconstruction Blueprint

An audit-first implementation system for Claude Code CLI that encodes everything about the Morphism codebase into a three-layer system for immediate productivity in every session.

Three-Layer Architecture

| Layer | Artifact | Purpose | |-------|----------|---------| | Layer 1 | CLAUDE.md | Project memory — read automatically every session | | Layer 2 | .claude/commands/ | Custom slash commands for repeated workflows | | Layer 3 | Session prompts | Sequenced implementation prompts for remaining work |

Phase 1: Exhaustive Audit

Nothing gets generated until a full exhaustive audit is completed. The audit covers 15 categories:

  1. Project Structure — directory tree, framework, language, routing paradigm, monorepo structure
  2. Existing Claude Code Configuration — CLAUDE.md, .claude/ directory, commands, settings, .claudeignore
  3. All Configuration Files — package.json, tsconfig, framework config, tailwind, eslint, docker, CI/CD, .gitignore, .env templates
  4. Data Model & Database — complete schema (Prisma/Drizzle/SQL migrations), seed files, DB utilities
  5. Authentication & Authorization — auth provider, session strategy, protected routes, role/permission system
  6. API Layer — all routes/endpoints (REST, tRPC, GraphQL), middleware, external integrations, webhooks
  7. Frontend Pages & Routes — every page/route file, status (built/scaffolded/placeholder), route map
  8. Frontend Components — component library, architecture pattern, client vs server split
  9. Styling & Design System — global CSS, theme files, design tokens, dark/light mode
  10. State Management & Data Fetching — stores, context providers, caching strategy
  11. Third-Party Integrations — payment, email, analytics, AI/LLM, storage, search, CMS
  12. Testing — framework, coverage, patterns, e2e tests
  13. Documentation — README, docs/, CHANGELOG, ADRs, code comments
  14. Git History & Current State — recent commits, branches, contributors, velocity, working state
  15. Environment & Deployment — deployment setup, infrastructure-as-code, monitoring

Phase 2: Full Audit Report

Structured report covering: Project Identity, Tech Stack, Existing Claude Code Setup, Architecture, Data Model, Pages & Routes, Features, Styling & Brand, Integrations, Code Quality, Git & Workflow, Environment Variables, Critical Gaps.

Phase 3: Interview

Grouped 3-5 questions at a time to fill gaps the code cannot reveal: business model, brand identity, feature priority, architectural decisions, target users, integrations planned, compliance requirements.

Phase 4: Generate the Blueprint

Deliverable 1: CLAUDE.md

Complete single-source-of-truth project instructions covering: what the project is, tech stack, architecture, data model, brand & design system, code style, environment variables, auth & permissions, third-party services, git conventions, testing, deployment, current status, non-negotiables, known issues.

Deliverable 2: Custom Slash Commands (.claude/commands/*.md)

Minimum commands every project gets:

  • /project:deploy-check — type-check + lint + build in sequence
  • /project:status — feature completeness, in-progress items, blockers
  • /project:audit — TODO/FIXME/HACK scan, unused imports, type errors, missing error handling

Plus project-specific commands based on audit findings.

Deliverable 3: Session Prompts (MORPHISM_SESSIONS.md)

Sequenced implementation prompts for remaining work only. Each session is numbered, states context, lists exactly what to build, references CLAUDE.md for conventions, and ends with deploy-check verification. Ordered by dependency.

Includes maintenance sessions for: dependency updates, security audits, performance audits, brand/design consistency checks.

Phase 5: Validate

Confidence assessment, contradiction identification, and founder confirmation before saving files to disk.