Rules Hub
Coding Rules Library
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Review and verify code before opening a PR when explicitly requested
Run the project's lint/tests and review the diff for duplication, weak abstractions, dead code, fragile logic, and pattern mismatches only when the user explicitly asks for a pre-PR check.
Bad example
| 1 | # User did not ask for a pre-PR review |
| 2 | npm run lint |
| 3 | npm test |
| 4 | git diff --stat |
| 5 | # Spend time on a full PR audit anyway |
Explanation (EN)
This runs an expensive review workflow even though the user did not ask for it. It burns time and tokens on routine tasks, and it makes the assistant feel heavier than necessary.
Objašnjenje (HR)
Ovo pokreće skupi review workflow iako ga korisnik nije tražio. Troši vrijeme i tokene na rutinske zadatke i čini asistenta težim nego što treba biti.
Good example
| 1 | # User: "Before PR, do a full check." |
| 2 | npm run lint |
| 3 | npm test |
| 4 | git diff --stat |
| 5 | git diff -- src/feature.ts |
| 6 | # Review the diff for repeated logic, naming, complexity, dead code, and missing validation |
| 7 | # Summarize findings before commit/push/PR creation |
Explanation (EN)
A full pre-PR review is valuable when explicitly requested. In that case, combine automated checks with a deliberate diff review, then summarize any issues before the code is committed, pushed, or turned into a PR.
Objašnjenje (HR)
Puni pre-PR review je vrijedan kada je izričito zatražen. Tada kombiniraj automatizirane provjere s namjernim pregledom diffa i sažmi probleme prije commita, pusha ili otvaranja PR-a.
Notes (EN)
If the user explicitly asks for a pre-PR review, inspect the changed files for repeated code, bad naming, unnecessary complexity, weak validation, inconsistent patterns, and missing cleanup, not just test pass/fail status.
Bilješke (HR)
Ako korisnik izričito zatraži pre-PR review, pregledaj promijenjene datoteke zbog ponavljanja koda, lošeg imenovanja, nepotrebne kompleksnosti, slabe validacije, nekonzistentnih obrazaca i nedostajućeg cleanupa, a ne samo statusa testova.
Exceptions / Tradeoffs (EN)
You may run a narrower check without being asked only when a task specifically depends on one local verification step, such as confirming a build or lint fix. The full pre-PR audit remains opt-in.
Iznimke / Tradeoffi (HR)
Uži check možeš pokrenuti i bez izričitog zahtjeva samo kada zadatak konkretno ovisi o jednoj lokalnoj provjeri, poput potvrde builda ili lint fixa. Puni pre-PR audit ostaje opt-in.