Use these rules to keep a POC easy for engineers to take over. The canonical
architecture evidence belongs in a completed handoff file based on
docs/templates/ENGINEER_HANDOFF.md.
A POC is architected well enough for review when a fresh engineer can identify:
- Entry points.
- Layer boundaries.
- Data ownership.
- External dependencies.
- Typed input/output contracts.
- Known exceptions and risks.
For handoff-bound POCs, maintain:
AGENTS.mdor equivalent repository map.docs/ARCHITECTURE.mdwith the project-specific layer map.- Design docs in
docs/designs/<feature>/before implementation. - Architecture boundary table.
- Data model notes for persisted, session-only, and derived data.
- ADRs or a decision log for major choices.
- Handoff evidence in a completed engineer handoff packet.
Keep boundary layers thin:
- API/CLI handles request parsing and response formatting.
- Services own business logic and orchestration.
- Models define typed domain objects.
- Infrastructure owns database and external API access.
- Foundation owns config, logging, and security utilities.
Lower layers must not import from upper layers. Customize and keep
tests/test_architecture.py aligned with the project structure.
Parse external data at the boundary:
- API requests and responses.
- LLM outputs.
- Config and env vars.
- Database rows.
- External API responses.
- Tool-call payloads.
Avoid raw dict blobs across layers. If a dictionary crosses more than one function or layer, replace it with a dataclass or Pydantic model.
Review and split when:
- A source file approaches 500 lines.
- A function does validation, business logic, persistence, and presentation.
- A class has unrelated responsibilities.
- A PR mixes feature work, refactors, formatting, generated files, and cleanup.
Use docs/VIBE_CODING_SMELLS.md for plain-language examples, especially god
objects, mega files, hidden global state, premature abstractions, and
unreviewable changes.
Required:
- Use
logger = logging.getLogger(__name__). - Log safe summaries, not full request bodies, prompts, secrets, or PII.
- Include
exc_info=Trueon warning/error logs that handle exceptions. - Return user-safe errors that do not leak internals.
In the completed engineer handoff packet, record:
- Architecture summary.
- Entry points.
- Directory or module map.
- Data model.
- Persisted, session-only, and derived data.
- External boundaries and typed inputs/outputs.
- Rollback/delete instructions, if relevant.
docs/ARCHITECTURE.md— Project layer mapdocs/CONVENTIONS.md— Coding standardsdocs/VIBE_CODING_SMELLS.md— Plain-language design smellsdocs/templates/ENGINEER_HANDOFF.md— Template for canonical architecture evidence