This directory is the single source of truth for Zer0. Code is a mechanical translation of what's here. Two subfolders, two audiences:
product/— what Zer0 does. Read these to understand the system.engineering/— how contributors and AI agents write code that matches the product. Read these before making changes.
The foundational rule — change the spec first, then code — lives in
engineering/spec-driven.md. Read it before anything else.
Read in order:
product/01-vision.md— what Zer0 is and is notproduct/02-architecture.md— components, abstractions, data flow, module dependency graphproduct/03-tenancy.md— the multi-tenant model, isolation guarantees, credential lifecycleproduct/04-capabilities/— one file per discrete behaviour (discovery, enrichment, qualification, outreach, follow-up, reply handling)product/05-config.md— config hierarchy: env bootstrap → DB campaign config →ResolvedConfigproduct/06-cli.md— CLI command surface (zer0command group)product/07-data-model.md— full PostgreSQL schema: tables, columns, constraints, indexesproduct/08-prompts.md— LLM prompt contracts, variable lists, validationproduct/09-api.md— REST API contract: endpoints, request/response shapes, auth, error codesproduct/10-agent-graph.md— LangGraph design: state schema, nodes, edges, checkpointingproduct/11-ui-dashboard.md— operator web UI: onboarding, pipeline monitoring, approval queue, campaign builder
Rules that govern how code gets written. Every rule applies everywhere unless its Scope line says otherwise.
engineering/spec-driven.md— the rule: spec first, code secondengineering/phases.md— phased implementation model: 10 dependency-ordered phases, each with gate tests. Read before writing any code.engineering/tech-stack.md— language, runtime pin, canonical librariesengineering/code-style.md— structural conventions and patternsengineering/secret-hygiene.md— how secrets enter, travel, and exit the systemengineering/tenant-isolation.md— patterns that maintain tenant boundariesengineering/commits.md— commit and PR hygiene
Repeatable procedures invoked by Claude Code commands/agents and Copilot prompts. Change the workflow here; tool-specific files are thin pointers.
engineering/workflows/spec-check.md— audit code/spec driftengineering/workflows/spec-review.md— review spec-code coherence on a changeengineering/workflows/spec-new-capability.md— scaffold a new capability specengineering/workflows/dry-audit.md— audit for facts duplicated across filesengineering/workflows/plan.md— draft a plan before multi-file editsengineering/workflows/plan-review.md— staff-engineer review of a planengineering/workflows/link-validate.md— verify every internal markdown link resolves
When guidance conflicts:
- A rule here (engineering) overrides general convention.
- A product spec (in
product/) overrides a rule — if a rule's example disagrees with a product file, the product file is right and the rule needs fixing. - Tool-specific files (
CLAUDE.md,AGENTS.md,.github/copilot-instructions.md,.github/instructions/*,.claude/,.github/agents/,.github/prompts/) contain no policy — they are pointers into this directory. Change rules here, never there.
Every file declares a status near the top:
- STABLE — implemented and won't change without a version bump
- DRAFT — under active design, expect churn
- EXPERIMENTAL — implemented but may be removed
All docs are currently DRAFT.
Every file in product/04-capabilities/ uses this structure, in order:
- Purpose — one or two sentences. What and for whom.
- Trigger — what event or schedule initiates this capability.
- Behavior — numbered steps, describing observable behaviour not implementation.
- Inputs — config keys, state reads, external data.
- Outputs — side effects, state writes, API calls.
- Failure modes — named failure classes and how the system responds.
- Out of scope — explicit non-behaviours to prevent scope creep.
Use this template verbatim when adding a capability. Uniformity is what makes the spec mechanically translatable.
- Not platform API documentation.
- Not user documentation — see
README.mdat repo root. - Not implementation notes — behaviour, not chosen libraries, class names, or file layouts beyond what is contractually required.
- Not a roadmap — planned-but-unbuilt capabilities go in issues, not here. Only build what the spec says; only spec what you intend to build.