|
| 1 | +## PLAN FORMAT |
| 2 | + |
| 3 | +EARS (Easy Approach to Requirements Syntax) is used in plans for specifying *system behavior* (requirements), not for describing the agent's implementation to-do list. |
| 4 | + |
| 5 | +Use the structure below for code-change plans. |
| 6 | + |
| 7 | +### REQUIREMENTS FORMAT (EARS) |
| 8 | + |
| 9 | +Write compact, testable requirements about the system/component under change (not the agent). Name the system explicitly (e.g. `InkNewWizard`, `bep new`, `WizardState`). |
| 10 | + |
| 11 | +- Ubiquitous (always true): `The <system> shall <response>.` |
| 12 | +- State-driven: `While <precondition(s)>, the <system> shall <response>.` |
| 13 | +- Event-driven: `When <trigger>, the <system> shall <response>.` |
| 14 | +- Optional feature/scope: `Where <feature/scope applies>, the <system> shall <response>.` |
| 15 | +- Unwanted behavior: `If <unwanted condition>, then the <system> shall <mitigation>.` |
| 16 | +- Complex: `While <precondition(s)>, when <trigger>, the <system> shall <response>.` |
| 17 | + |
| 18 | +Practical rules: |
| 19 | + |
| 20 | +- Use requirement IDs (`R1`, `R2`, ...) so implementation and verification can reference them. |
| 21 | +- Prefer observable behavior and invariants; avoid file/function names unless they are part of the external contract. |
| 22 | + |
| 23 | +### IMPLEMENTATION PLAN FORMAT |
| 24 | + |
| 25 | +Describe *how* you'll satisfy the requirements as concrete steps (agent actions), chunked into small git-committable units when appropriate. |
| 26 | + |
| 27 | +- Size the steps to the change: use as few steps as needed for small fixes, and break larger changes into multiple git-committable chunks. |
| 28 | +- Keep one concrete outcome per step (code change, test addition, verification, or user checkpoint). |
| 29 | +- Include a USER checkpoint step for major or risky changes, consistent with the workflow above. |
| 30 | + |
| 31 | +### VERIFICATION FORMAT |
| 32 | + |
| 33 | +Include explicit checks that map back to the requirements. |
| 34 | + |
| 35 | +- Each verification item should reference one or more requirement IDs (`R#`) and name the check (`npm test`, `npm run build`, or targeted manual validation). |
| 36 | + |
| 37 | +Template (shape only): |
| 38 | + |
| 39 | +- Requirements: |
| 40 | +- `R1: When <trigger>, the <system> shall <response>.` |
| 41 | +- `R2: While <state>, the <system> shall <response>.` |
| 42 | +- Implementation: |
| 43 | +- `S1: <edit(s) that satisfy R1/R2>.` |
| 44 | +- `S2: USER checkpoint: review/commit chunk 1.` |
| 45 | +- Verification: |
| 46 | +- `V1 (R1,R2): npm test` |
| 47 | + |
| 48 | +## Cursor Cloud specific instructions |
| 49 | + |
| 50 | +### Architecture |
| 51 | + |
| 52 | +SiteBuilder is a Symfony 7.4 / PHP 8.4 web app with a TypeScript/Stimulus frontend. It runs inside Docker containers (app, mariadb, nginx, messenger). See `docs/archbook.md` for vertical architecture details and `docs/frontendbook.md` for frontend conventions. |
| 53 | + |
| 54 | +### Running the dev environment |
| 55 | + |
| 56 | +All commands go through `mise run` (see `.cursor/rules/07-workflow.mdc` for the full task list). Key commands: |
| 57 | + |
| 58 | +- `mise run setup` — idempotent full bootstrap (builds containers, installs deps, migrates DB, builds frontend, runs quality + tests) |
| 59 | +- `mise run quality` — lint/format checks (required before commit) |
| 60 | +- `mise run tests` — PHP tests (architecture, unit, integration, application) |
| 61 | +- `mise run tests:frontend` — Vitest frontend tests |
| 62 | +- `mise run frontend` — build frontend assets (Tailwind + TypeScript via SWC) |
| 63 | + |
| 64 | +### Docker-in-Docker (Cloud VM specific) |
| 65 | + |
| 66 | +The Cloud VM is itself a container inside a Firecracker VM. Docker must be installed with `fuse-overlayfs` storage driver and `iptables-legacy`. After installing Docker, run `sudo chmod 666 /var/run/docker.sock` so commands work without `sudo`. The update script handles starting `dockerd` if it's not already running. |
| 67 | + |
| 68 | +### Composer private repositories |
| 69 | + |
| 70 | +The `composer.json` references private GitHub VCS repos (`dx-tooling/etfs-*`). Composer needs a GitHub token: pass it via `COMPOSER_AUTH` env var or run `composer config --global github-oauth.github.com "$(gh auth token)"` inside the app container before `composer install`. The update script handles this automatically. |
| 71 | + |
| 72 | +### Nginx port |
| 73 | + |
| 74 | +The nginx container binds to a random host port (`127.0.0.1::80`). Find the assigned port with `docker compose ps` and look at the nginx PORTS column. |
| 75 | + |
| 76 | +### `.env.local` |
| 77 | + |
| 78 | +Must contain `HOST_PROJECT_PATH="/workspace"`. The setup script creates this if missing. This value is used by the messenger service for Docker-in-Docker volume mounts (not critical for basic dev). |
0 commit comments