Code development
Natural invoke
- "Implement gradient descent in template_code_project src/"
- "Add a generic CSV validator in infrastructure/"
- "New analysis method with tests and logging"
Inputs to confirm
- Task — what to implement.
- Layer —
infrastructure(generic, 60% cov) vsproject(domain, 90% cov). - Project — if layer is project, from
docs/_generated/active_projects.md.
Workflow
Place logic correctly — computation in
infrastructure/orprojects/<n>/src/; scripts only orchestrate I/O and plotting.Implement — type hints on public APIs;
get_logger(__name__); custom exceptions extendingTemplateError; Google docstrings.Tests — real data, temp files, subprocess, or pytest-httpserver; no mocks (
docs/rules/testing_standards.md).Docs — update module/folder AGENTS.md + README.md when adding public surface.
Verify — ruff/mypy on touched paths; pytest with coverage gate.
Deliverables
- Module(s) with tests meeting coverage floor
- List of files touched and verification command output
Verification commands
uv run python -m infrastructure.project.public_scope lint-paths | xargs uv run ruff check
uv run python -m infrastructure.project.public_scope source-paths | xargs uv run mypy
uv run pytest projects/<project>/tests/ --cov=projects/<project>/src --cov-fail-under=90 -q
# or infra:
uv run pytest tests/infra_tests/ --cov=infrastructure --cov-fail-under=60 -q
When NOT to use
- End-to-end feature spanning manuscript + pipeline → feature-addition
- Tests only for existing code → test-creation
- New infrastructure package skeleton → infrastructure-module
References
docs/rules/— normative standardsdocs/core/architecture.md— two layers, thin orchestrator- Code patterns: references/patterns.md