Machine-readable operating guidance for AI coding agents in drone-tm.
Project: drone-tm Accountability: human maintainers are responsible for all merged changes.
Drone-TM is currently split into:
- FastAPI backend
- React + Vite frontend
- Shared/backend workspace packages (notably
drone-flightplan) - Docker Compose-based local integration environment
Primary active paths:
src/backend/app/src/backend/tests/src/backend/packages/drone-flightplan/src/frontend/src/docs/decisions/
Secondary/legacy path (edit only when task requires it):
src/qfield-plugin/
Before non-trivial changes:
docs/decisions/README.md- Relevant ADRs in
docs/decisions/
If ADRs conflict with newer accepted direction in code, follow current implementation direction and document assumptions in PR notes.
Use this execution loop:
- Discover
- Inspect current code paths first.
- Prefer existing patterns over inventing new ones.
- Plan
- Keep edits minimal and task-scoped.
- Identify tests to update/add before coding.
- Implement
- Keep route handlers thin.
- Put domain logic in
*_crud.py/ service-style modules.
- Verify
- Run targeted tests first, then broader checks.
- Report what you could and could not verify.
- Summarize
- List changed files and behavioral impact.
- List risks and follow-up actions if any.
For large work, deliver in safe incremental commits/patches rather than one monolith.
Install backend deps:
cd src/backend && uv syncRun backend tests locally:
cd src/backend && uv run pytest -vRun backend integration test stack (Docker):
just test backendRun lint/format hooks:
just lintStart full docker stack:
just start allStart backend service only (Docker):
just start backendRun frontend locally:
cd src/frontend && pnpm dev- Prefer explicit, simple, readable code.
- Avoid unnecessary abstractions.
- Keep functions focused and small.
- Add comments only where intent is non-obvious.
- Reuse existing schemas/routes/crud patterns.
- Keep API routes focused on HTTP concerns; move data logic out of route files.
All new behavior must be tested.
- Cover success and failure paths.
- Favor route/integration behavior tests for HTTP flows.
- Add unit tests for isolated service/crud logic as needed.
- Do not weaken/delete tests to "make CI pass".
If environment constraints block test execution, state the exact blocker.
Never:
- Commit
.envor credentials - Hardcode secrets/tokens
- Bypass auth/permission checks
- Introduce unparameterized SQL
Ask first before:
- New dependencies
- Auth model changes
- DB schema changes not aligned with current migration strategy
- Deployment/infrastructure changes
- CI workflow changes
Database schema changes are tracked with Alembic migrations under:
src/backend/app/migrations/versions/
Expected workflow:
- Update SQLAlchemy models in
src/backend/app/models/(and related modules). - Generate a migration revision (typically with autogenerate) from
src/backend. - Review and adjust the generated migration script before committing.
Do not rely on manual base-SQL edits as the primary migration path.
Default edit scope:
src/backend/**src/frontend/**docs/**tasks/**/Justfile(only when needed for task alignment)
Do not modify these unless explicitly requested:
.env- Helm chart under
chart/ - CI workflows under
.github/workflows/
- Use Conventional Commits.
- Keep dependency diffs minimal and justified.
- Respect Renovate flow (
renovate.json). - Avoid opportunistic upgrades unrelated to the task.
- Use
uvfor backend Python dependency work andpnpmfor frontend JS dependency work.
If requested by maintainers, include:
Assisted-by: <Tool Name>
- Large refactors without staged validation
- Mixing old and new architectural styles in one feature
- Putting business logic directly in route handlers when existing CRUD/service pattern is available
Consistency and maintainability are higher priority than novelty.
A change is "done" when all are true:
- Behavior implemented and documented in code/tests.
- Relevant tests pass (or blockers are explicitly reported).
- Lint/format checks run for changed scope.
- File-level summary and risk notes are provided.
When uncertain, ask instead of assuming.