- Repository Structure: Single monorepo divided into two distinct operational scopes.
/backend: Python FastAPI application./frontend: Vue 3 + Vite + Shadcn-vue single-page application.
- Goal: Maintain professional, production-grade architecture, keeping abstractions clean, readable, and highly maintainable.
Before modifying, generating, or deleting any files, the agent MUST follow these steps in exact order:
- Plan First: Present a comprehensive architectural review, design summary, or pseudo-code strategy. Wait for explicit user greenlight.
- Git Branching: Checkout to a distinct feature or refactor branch from
mainusing the Conventional Commits specification (e.g.,feat(backend)/...,refactor(frontend)/...). - Execution: Apply code modifications within the tightly scoped workspace directory.
- Code Quality & Validation: Before asking for user confirmation, you must ensure the code is clean and passes all local checks. Run the following commands based on the affected workspace:
- If Backend changed: Run
make formatfollowed bymake lintinside the/backenddirectory. - If Frontend changed: Run
npm run formatfollowed bynpm run lintinside the/frontenddirectory.
- If Backend changed: Run
- Testing Suite Execution: Run the test suite to ensure zero regressions. You must invoke tests in non-interactive, run-once mode so the process does not hang:
- Backend: Run
make testfrom the/backendfolder. - Frontend: Run
npm run test:unit -- --run(or the equivalent non-watching continuous integration command) from the/frontendfolder.
- Backend: Run
- Test Coverage Prompt: Once checks pass, explicitly prompt the user: "Would you like me to prepare or update any unit tests specific to these changes before we commit?"
- Finalize: Upon user validation, stage and commit changes with concise, structured commit messages following the Conventional Commits format.
- Documentation: Auto-generate or update a pull request summary saving it directly to
pr_description.mdin the project root. The layout of this file must copy the formal structure defined in the repository's native GitHub file:.github/PULL_REQUEST_TEMPLATE.md.
Focus rules when operating within the backend directory:
- Framework: FastAPI utilizing Pydantic for data validation and configuration management (
pydantic-settings). - Isolation: Strictly separate environment settings (Dev, Demo, Prod) via an environment variable switch.
- Testing Requirements: Test configurations must run against completely isolated, non-destructive transactional test databases.
Focus rules when operating within the frontend directory:
- Framework Stack: Vue 3 (Composition API,
<script setup>), Vite, Tailwind CSS v4, and Shadcn-vue viareka-ui. - State Management: Server state must be tightly managed via TanStack Query (Vue Query). Pinia is strictly reserved for transient global application primitives like Authentication.
- Data Synchronization: UI component tables must synchronize filtering, sorting, and pagination state unidirectionally using TanStack Table's native state updaters feeding directly into
vue-routerquery parameters. Avoid redundant watchers or cyclical loop patterns.
When every protocol step is completely finished, your final output to the user MUST explicitly print this statement on a standalone line for tracking visibility:
🚀 Success! Pull Request documentation has been successfully generated/updated in pr_description.md.