Rule-File Code Review Gates
Harness Engineering
60-90 minutes0/4 steps0%
Step 1 of 4
Write the initial rule set
Codify the review comments you keep repeating.
First time here? Paste the Context Pack first so the AI understands your project - open it from the header above.
Prompt Capsule
Author the first rules. Mine sources: recurring review comments on agent output, incident history, and the project's conventions doc. Rule types to implement: PATTERN rules (regex over diff text: no hardcoded credentials/URLs, no TODO-without-issue, no console.log in production paths), AST rules (structural: no bare except, no mutable default args, exported functions need types - use the language's parser), and DIFF-SHAPE rules (churn thresholds per file type, test files must change when src changes beyond a threshold, lockfile changes require dependency-change declarations). Each rule: id, severity (block/warn/info), rationale, matcher, fix guidance, and 2+ test cases (one firing, one passing). Start with 8-12 rules that would have caught real past issues.
Paste into EmergentFull Build: complete implementation prompt with explicit requirements
Quick is short. Full Build is recommended for most steps. Strict forces real logic when the AI keeps faking output.
Actual change check
Expected after this step
8-12 tested rules across pattern, AST, and diff-shape types.
Should NOT happen
- An existing feature broke
- A button only logs to console
- Data disappears after refresh
- Errors fail silently with no visible state
This is what should exist before you continue. If reality does not match, do not move on.
Track what changed, failed, or needs follow-up. Notes export with the flow.
Pass the Verify Gate to complete this step