AGENTS.md@skills/agent-rules/references/examples/fastapi-app · git:20260225.a190152 · 2026-02-25 · sha256 b38376b6178b3184
AGENTS.md@skills/agent-rules/references/examples/fastapi-app git:20260225.a190152A
Immutable. This exact content is served forever at /api/v1/blob/b38376b6178b3184.
<!-- FOR AI AGENTS - Human readability is a side effect, not a goal --> <!-- Managed by agent: keep sections and order; edit content, not structure --> <!-- Last updated: 2026-02-05 | Last verified: never --> # AGENTS.md **Precedence:** the **closest `AGENTS.md`** to the files you're changing wins. Root holds global defaults only. ## Commands (unverified) > Source: pyproject.toml — CI-sourced commands are most reliable <!-- AGENTS-GENERATED:START commands --> | Task | Command | ~Time | |------|---------|-------| | Typecheck | mypy . | ~15s | | Lint | ruff check . | ~10s | | Format | ruff format . | ~5s | | Test (single) | pytest | ~2s | | Test (all) | pytest | ~30s | <!-- AGENTS-GENERATED:END commands --> > If commands fail, verify against Makefile/package.json/composer.json or ask user to update. ## Workflow 1. **Before coding**: Read nearest `AGENTS.md` + check Golden Samples for the area you're touching 2. **After each change**: Run the smallest relevant check (lint → typecheck → single test) 3. **Before committing**: Run full test suite if changes affect >2 files or touch shared code ## File Map <!-- AGENTS-GENERATED:START filemap --> ``` src/ → application source code ``` <!-- AGENTS-GENERATED:END filemap --> ## Golden Samples (follow these patterns) <!-- AGENTS-GENERATED:START golden-samples --> | For | Reference | Key patterns | |-----|-----------|--------------| | Entrypoint | `src/main.py` | (async) | | Service | `src/services/item_service.py` | (class) | <!-- AGENTS-GENERATED:END golden-samples --> ## Heuristics (quick decisions) <!-- AGENTS-GENERATED:START heuristics --> | When | Do | |------|-----| | Adding dependency | Update `pyproject.toml` | | Adding env var | Add to `.env.example` first | | Committing | Use Conventional Commits (feat:, fix:, docs:, etc.) | | Merging PRs | Squash and merge | | Adding dependency | Ask first - we minimize deps | | Unsure about pattern | Check Golden Samples above | <!-- AGENTS-GENERATED:END heuristics --> ## Repository Settings <!-- AGENTS-GENERATED:START repo-settings --> - **Default branch:** `main` - **Merge strategy:** squash, merge, rebase <!-- AGENTS-GENERATED:END repo-settings --> ## Boundaries ### Always Do - Run pre-commit checks before committing - Add tests for new code paths - Use conventional commit format: `type(scope): subject` - Follow PEP 8 style guide and Python >=3.11 features ### Ask First - Adding new dependencies - Modifying CI/CD configuration - Changing public API signatures - Running full e2e test suites - Repo-wide refactoring or rewrites ### Never Do - Commit secrets, credentials, or sensitive data - Modify vendor/, node_modules/, or generated files - Push directly to main/master branch - Delete migration files or schema changes - Commit requirements.txt without pyproject.toml changes - Use print() for logging in production code ## Index of scoped AGENTS.md <!-- AGENTS-GENERATED:START scope-index --> - `./src/AGENTS.md` — Backend services (Python) <!-- AGENTS-GENERATED:END scope-index --> ## When instructions conflict The nearest `AGENTS.md` wins. Explicit user prompts override files. - For Python-specific patterns, follow PEP 8 and project tooling (ruff/black)