devkit/: Python package and CLI commands (Typer + Rich). Key modules:cli.py,services.py,postgres.py,rails.py,iofmt.py.docs/: MkDocs site sources;scripts/generate_reference.pyautogeneratesdocs/commands.md.scripts/: Utility scripts used by Make targets.- Top-level:
pyproject.toml(Poetry, Ruff, scripts),Makefile,README.md.
make dev: Install dependencies via Poetry.make test: Run pytest quietly.make lint: Ruff lint + format check.make fmt: Apply Ruff formatting.make docs/make docs-serve: Build or serve docs athttp://localhost:8000.make build: Build the package;make install: Install viapipx.- Run CLI:
poetry run devkit --helporpoetry run devkit meta reference --format json.
- Python 3.11+. Prefer type hints and small, focused functions.
- Indentation: 4 spaces for Python. Line length: 100 (Ruff).
- Use Ruff for lint/format; fix issues with
make fmtbefore PRs. - Naming: modules
snake_case.py, classesPascalCase, functions/varssnake_case. - Output: keep CLI text predictable; support
--format jsonand--quiet/--verboseconsistently.
- Framework: pytest. Place tests in
tests/, name filestest_*.pyand functionstest_*. - Favor unit tests around
devkit/*behaviors; mock external tools (Rails, Postgres). - Run locally with
make test. Add regression tests for bug fixes.
- History currently lacks a convention. Use Conventional Commits (e.g.,
feat: add db reset validation). - Branches:
feat/<slug>,fix/<slug>,docs/<slug>. - PRs: clear description, rationale, screenshots or logs when UX changes, link issues, checklist:
make lint,make test,make docspass.
- No secrets in code or docs. Prefer env vars. Honor
DEVKIT_SAFE=1and destructive flags (--yes,--safe). - External CLIs (Rails, Postgres) must be present when relevant; guard with helpful errors.