Team-shared operating rules for AI coding agents in ph-travel-app.
- Owner: Hans
- Last reviewed: 2026-03-19
- Review cadence: Monthly and on workflow/tooling changes
- Monorepo with frontend (
frontend/atla) and backend (backend) plus docs/workflows (docs/,.github/) (fromREADME.md,docs/CONTRIBUTING.md). - Frontend stack: React 19 + TypeScript + Vite + TanStack Router + Tailwind CSS (from
README.md,frontend/atla/package.json). - Backend stack: FastAPI + Python 3.11+ + SQLModel + Alembic + PostgreSQL/Supabase + LangChain + Gemini integrations (from
README.md,ARCH.md,backend/requirements.txt). - CI in repo: frontend PR workflow only, scoped to frontend/workflow changes on PRs targeting
mainanddevelop(from.github/workflows/frontend-ci.yml). - Development appears cross-platform (Windows and macOS/Linux instructions exist) (from
README.md,SETUP.md,docs/CONTRIBUTING.md).
-
Install
- Frontend Node version:
cd frontend/atla && nvm use 20(fromfrontend/atla/.nvmrc,.github/workflows/frontend-ci.yml). - Frontend dependencies (CI-reproducible):
cd frontend/atla && npm ci(from.github/workflows/frontend-ci.yml). - Backend env + deps:
cd backend && python -m venv venv && pip install -r requirements.txt(fromREADME.md,SETUP.md,docs/CONTRIBUTING.md). - Backend venv activate (Windows):
cd backend && venv\Scripts\activate(fromREADME.md,SETUP.md). - Backend venv activate (macOS/Linux):
cd backend && source venv/bin/activate(fromREADME.md,SETUP.md).
- Frontend Node version:
-
Lint
- Frontend:
cd frontend/atla && npm run lint(fromfrontend/atla/package.json,README.md). - Backend:
cd backend && ruff check app(fromREADME.md,backend/pyproject.toml).
- Frontend:
-
Typecheck
- Frontend:
cd frontend/atla && npm run generate:routes && npm run typecheck(from.github/workflows/frontend-ci.yml,frontend/atla/package.json). - Backend: no documented dedicated static typecheck command (gap confirmed from
backend/pyproject.toml,README.md,docs/CONTRIBUTING.md).
- Frontend:
-
Test
- Frontend:
cd frontend/atla && npm run test(fromfrontend/atla/package.json). - Backend:
cd backend && pytest(fromREADME.md,SETUP.md,docs/PULL_REQUESTS.md).
- Frontend:
-
Verify (before PR or done claim)
- Frontend:
cd frontend/atla && npm run generate:routes && npm run typecheck && npm run build && npm run lint(from.github/workflows/frontend-ci.ymlplus local lint note in same workflow anddocs/CONTRIBUTING.md). - Backend:
cd backend && ruff check app && pytest(assumption based on documented backend lint + test commands; no single canonical verify command documented).
- Frontend:
MUST: blocking requirement; do not mark work complete if unmet.SHOULD: strong default; deviations require explicit rationale in completion report.MAY: optional guidance when useful and low-risk.
- Safety and data integrity
- Security
- User intent
- Workflow/process rules
- Style preferences
MUSTstate exact impact and wait for confirmation before destructive actions (delete/overwrite unrelated content, force push, reset, dropping schema/tables).MUSTcreate a short, checkable plan before non-trivial work (3+ steps, cross-file edits, architecture-impacting changes).MUSTstop and re-plan if new evidence invalidates the current plan.MUSTuse ambiguity protocol: ask exactly one focused question when critical context is missing; if unanswered, apply the safest explicit default and record it under assumptions.MUSTstop after 2 failed attempts and return exactly:
Blocked Report
1) What I tried:
2) Evidence (error/log/output):
3) Current hypothesis:
4) Exact blocker:
5) Recommended next step:
SHOULDexecute directly for normal implementation and small scoped tasks.MUSTroute to a specialist capability when the task matches the capability model below.MUSTuse explicit@subagentrouting syntax if auto-routing fails once.MUSTnot block delivery if alias tooling is unavailable; use command-driven fallback.
- Canonical capabilities:
GitHub Ops(optional alias:@gh-operator)Product Discovery(optional alias:@product-reviewer)Architecture Decision(optional alias:@architect)Phased Planning(optional alias:@planner)Research(optional alias:@researcher)Test Validation(optional alias:@tester)Test Repair(optional alias:@debugger)Security Review(optional alias:@security-auditor)Peer PR Review(optional alias:@pr-reviewer)
| Scenario | Risk | Route |
|---|---|---|
| Failing tests/checks with unclear root cause | High | Test Repair (optional @debugger) |
| Behavior changes before handoff | Medium | Test Validation (optional @tester) |
| Create/update PRs, issues, labels, metadata | Medium | GitHub Ops (optional @gh-operator) |
| Ambiguous feature request or unclear UX intent | Medium | Product Discovery (optional @product-reviewer) |
| Multi-step implementation with dependencies | Medium | Phased Planning (optional @planner) |
| Security/auth/data-model/CI workflow changes | High | Security Review + Peer PR Revie w (optional @security-auditor, @pr-reviewer) |
| Tradeoff-heavy architectural choices | High | Architecture Decision (optional @architect) |
| Version-sensitive external docs/tool behavior | Medium | Research (optional @researcher) |
- If
GitHub Opsalias/tooling is unavailable: useghCLI directly for issue/PR/check/workflow operations. - If
Test RepairorTest Validationalias/tooling is unavailable: run the documented lint/typecheck/test/verify commands, capture failures, fix, and re-run. - If
Product Discovery,Architecture Decision,Phased Planning, orResearchalias/tooling is unavailable: produce an explicit written plan/tradeoff analysis with repo evidence and assumptions before coding. - If
Security Review/Peer PR Reviewalias/tooling is unavailable: run a manual changed-files security and risk review, then record findings in the completion report.
MUSTmake the smallest correct change with minimal blast radius.MUSTfix root causes, not symptoms, unless a temporary workaround is explicitly requested.MUSTavoid unrelated refactors while delivering scoped fixes/features.SHOULDprefer explicit, readable code and guard clauses over deep nesting.MUSThandle errors intentionally; no silent failure paths.MUSTremove dead code instead of commenting it out.
MUSTinclude a completion report with all of: commands run, key results, verified vs not verified, and residual risks/limitations.MUSTinclude expected before/after behavior when behavior changes were made.MUSTnot claim "done" or "fixed" without command evidence.
MUSTrun relevant verify commands for touched areas and report outcomes.MUSTverify UI changes on desktop and mobile (manual verification allowed; include what was checked).SHOULDrun frontend tests (npm run test) when frontend behavior changes are introduced (fromfrontend/atla/package.json).SHOULDcall out skipped checks with a concrete reason (for example missing secrets/services).
MUSTnever commit secrets/credential files (.env*,*.pem,*.key,credentials*.json).MUSTscan staged changes for secrets/tokens before commit.MUSTtreat these keys as high sensitivity:SUPABASE_SERVICE_ROLE_KEY,SUPABASE_JWT_SECRET,GOOGLE_API_KEY,BRAVE_API_KEY,REDIS_URL,SECRET_KEY(fromSETUP.md,backend/.env.example).MUSTavoid unsafe dynamic execution with unsanitized input (eval, equivalent patterns).MUSTuse parameterized ORM/query patterns; never concatenate raw user input into SQL.
MUSTfollow GitHub Flow: branch frommain; never commit directly tomain(fromdocs/BRANCHING.md,docs/CONTRIBUTING.md).MUSTuse branch prefixes:feat/,fix/,docs/,chore/,refactor/,test/,hotfix/(fromdocs/BRANCHING.md).MUSTuse Conventional Commitstype(scope): descriptionand keep subject under 72 chars (fromdocs/COMMITS.md).MUSTinclude issue linkage in PR body (for exampleCloses #123) (from.github/PULL_REQUEST_TEMPLATE.md,docs/PULL_REQUESTS.md).MUSTnot force-push tomainor rewrite shared history (fromdocs/PULL_REQUESTS.md).
MUSTkeep bugfix PRs free of unrelated refactors.MUSTkeep one concern per PR (feature/fix/docs/chore) (fromdocs/BRANCHING.md,docs/PULL_REQUESTS.md).MUSTpropose split PRs when changes touch more than 3 unrelated concerns (assumption-based safeguard).
- Sensitive paths requiring extra care:
- Auth/session:
backend/app/api/auth.py,backend/app/api/deps.py,backend/app/db/supabase.py,frontend/atla/src/routes/login.tsx,frontend/atla/src/routes/signup.tsx(from repo structure + auth context inREADME.md,ARCH.md). - Secrets/config:
backend/app/config.py,backend/.env.example,frontend/atla/.env.example(fromSETUP.md, repo structure). - Data model/schema:
backend/app/models/*.py,backend/alembic/versions/*.py(fromARCH.md). - AI behavior/tooling:
backend/app/ai/**,backend/app/services/chat_service.py(fromARCH.md, repo structure). - CI policy/workflows:
.github/workflows/*.yml(from repo structure).
- Auth/session:
- Extra review trigger:
SHOULDrequest at least one human review when any sensitive path above changes (assumption-based safeguard; standard reviewers are optional per docs).
- Required reviewers for standard PRs: none (from
docs/PULL_REQUESTS.md). - CI expectation for merge: frontend
Type CheckandBuildjobs must pass whenfrontend-ci.ymlis triggered (from.github/workflows/frontend-ci.yml). - CI trigger scope: PRs to
mainordevelopwith changes underfrontend/atla/**or.github/workflows/frontend-ci.yml(from.github/workflows/frontend-ci.yml). - Lint expectation: frontend lint is disabled in CI; run
npm run lintlocally and report status in testing notes (from.github/workflows/frontend-ci.yml). - PR scope expectation: keep one concern per PR and complete issue-link/testing sections in the PR template (from
docs/BRANCHING.md,.github/PULL_REQUEST_TEMPLATE.md).
- Baseline sections included directly in this file: Rule precedence, Agent behavior, Subagent invocation policy, Execution quality, Verification before done, Security non-negotiables, Git and PR standards.
- Intentional deviations:
- Added explicit
MUST/SHOULD/MAYtiers for enforceability in this monorepo. - Added a command matrix with evidence notes to keep execution checkable.
- Added capability-first model, routing matrix, and fallback rules to avoid tool-alias lock-in.
- Added assumption-based split threshold (>3 unrelated concerns) and extra review trigger for sensitive paths.
- Added explicit
- Assumption: backend local verify gate is
ruff check app && pytest; no canonical single backend verify command is documented. - Gap:
docs/PULL_REQUESTS.mdmentions backend CI checks, but only.github/workflows/frontend-ci.ymlexists in the repository. - Gap: backend dedicated static typecheck command is not documented.
- Assumption: review trigger for sensitive paths and >3-concern PR split threshold are local safeguards adopted here.
- Self-check: all required baseline sections are present; commands/policies are evidence-backed or marked assumption; canonical capability names are used with aliases marked optional; practical fallbacks are defined; no personal local paths are included.