Infrastructure module
Natural invoke
- "Add infrastructure/foo/ package with CLI and tests"
- "Extend infrastructure/validation with a new gate"
- "New generic utility reusable across projects"
Inputs to confirm
- Module name — under
infrastructure/<package>/. - Public API — functions/classes to export in
__init__.pyand__all__.
Workflow
Layout —
__init__.py, core logic module(s), optionalcli.py,AGENTS.md,README.md,SKILL.mdwith YAML frontmatter.Implement — generic (no project-specific paths hard-coded); type hints;
TemplateErrorhierarchy.Tests —
tests/infra_tests/<package>/; no mocks; ≥60% oninfrastructure/.Exports — re-exporting
__init__.pymust declare__all__(MED5).Register skill —
uv run python -m infrastructure.skills writeafter addingSKILL.md.Wire docs — update
infrastructure/AGENTS.mdmodule map if significant.
Deliverables
- Package tree + test path
- Coverage snippet from pytest
Verification commands
uv run pytest tests/infra_tests/<area>/ -v --cov=infrastructure --cov-fail-under=60
uv run python -m infrastructure.skills check
uv run python -m infrastructure.skills check --all-exports
When NOT to use
- Project-specific domain code → code-development in
projects/*/src/
References
infrastructure/AGENTS.mddocs/rules/api_design.md—__all__for re-exporters