|
| 1 | +# CLINERULES – Roo Code Execution Contract |
| 2 | + |
| 3 | +> **These rules are non‑negotiable. Every automated action performed by Roo Code **MUST** comply. Deviation will be treated as a defect.** |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## 1 Authoritative Source Files |
| 8 | + |
| 9 | +| Priority | File / Folder | Purpose | |
| 10 | +|----------|---------------|---------| |
| 11 | +|1|`docs/PRD/oidc-auth-demo.md`|Canonical functional specification (what to build).| |
| 12 | +|2|`docs/guidelines/architecture.md` & `docs/guidelines/coding-guidelines.md`|How the solution must be architected and coded.| |
| 13 | +|3|`docs/plan/00-high-level-plan.md`|Roadmap overview of all implementation steps.| |
| 14 | +|4|`docs/plan/0X-*.md` (Step files)|Detailed scope and acceptance criteria for each incremental deliverable.| |
| 15 | + |
| 16 | +**Read these files in the order shown before writing any code.** |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## 2 Execution Flow |
| 21 | +1. **Initialization** – Parse files 1 → 4 and cache relevant directives. |
| 22 | +2. **Iterative Development** – For *each* step file (`01-…`, `02-…`, …): |
| 23 | + 1. Inspect *Scope* and *Acceptance Criteria*. |
| 24 | + 2. Switch to "architect mode" and generate subtasks that fully satisfy both. One level of subtasks is sufficient. Write the subtasks to a file in the docs/implementation folder called <step-number>-tasks.md |
| 25 | + 3. Verify that the subtasks are aligned with docs/architecture.md and docs/coding-guidelines.md. If not, correct the subtasks until alignment is reached. |
| 26 | + 3. PAUSE and ask the human operator to review and confirm the plan. DO NOT start coding until the operator explicitly approves. |
| 27 | + 4. Once approved, switch to "Boomerang mode" and execute the subtasks one by one. Implement code, tests, configs, and docs as prescribed in the tasks file. |
| 28 | + 5. Switch to "Code mode" when done. |
| 29 | + 5. Run the complete test suite (`./mvnw test` + `pnpm test`). |
| 30 | + 6. Ensure CI workflow passes locally (`pnpm dlx github-actions-runner ...` not required but mimic). |
| 31 | + 7. Only when **all criteria are met and tests are green** may Roo Code mark the step *Done* and proceed to the next. |
| 32 | +3. **Documentation Discipline** – Every change ***must*** include the documentation updates listed in the step file before completion. |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +## 3 Coding & Architectural Compliance Checks |
| 37 | +* **Follow** all language, framework, and tooling versions mandated in the architecture and coding‑guidelines documents. |
| 38 | +* **Reject** any transitive dependency or configuration that violates these guidelines. |
| 39 | +* **Lint, format, and coverage gates** are mandatory. |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +## 4 Quality Gates |
| 44 | +| Category | Threshold | |
| 45 | +|----------|-----------| |
| 46 | +|Backend Jacoco coverage|≥ 80 % lines | |
| 47 | +|Frontend Vitest coverage|≥ 80 % lines | |
| 48 | +|ESLint/Spotless|0 errors | |
| 49 | +|CI Workflow|All jobs green | |
| 50 | + |
| 51 | +**If any gate fails, fix immediately before advancing.** |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## 5 Forbidden Actions |
| 56 | +* Skipping steps or merging multiple steps into one commit. |
| 57 | +* Modifying PRD or guidelines files without explicit human approval. |
| 58 | +* Lowering coverage thresholds or disabling linting. |
| 59 | + |
| 60 | +--- |
| 61 | + |
| 62 | +## 6 Success Definition |
| 63 | +Roo Code is successful when, after completing Step 10, **all acceptance criteria across every step are met**, the full CI pipeline passes, and documentation accurately reflects the implemented system. |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +*End of CLINERULES* |
| 68 | + |
0 commit comments