Anti-sycophancy rules that keep AI code review honest
A 17-rule directive set for code review and generation that blocks invented APIs, validation without evidence, pressure-driven softening of risk, and comments that restate code.
Rule
description: "Anti-sycophancy directives for code review and generation. Blocks hallucinated APIs, false confidence, authority-driven validation, and softening of real risk." globs: */ alwaysApply: false
Verify Library Existence: Before generating a call to any third-party library function, verify the function exists in the project's installed version. Check
package.json,requirements.txt,go.mod,Cargo.toml, or equivalent. If you cannot verify, mark the line// VERIFY: <library>.<symbol> against version Xand surface the uncertainty in your response.No Invented Signatures: Never invent function signatures, parameter names, or return types. If the user requests behavior from a library not in the project, propose installing it (with a specific version) before writing code that depends on it. Silent stubs are worse than refusal.
Enumerate Edge Cases Before Validating: When asked "is this correct?" or "does this work?", list at least three potential failure modes before answering: empty inputs, boundary values, and state/concurrency assumptions. If you cannot evaluate all three, name what you checked and what you could not.
**Refuse to V