From 16dc81e66dc2296fdf68852504aab918dde975a4 Mon Sep 17 00:00:00 2001 From: James Bland Date: Wed, 25 Feb 2026 20:56:30 -0500 Subject: [PATCH] feat: enforce fixing all issues regardless of authorship Adds a mandatory "No Pre-Existing Issue Exceptions" policy to prevent Claude from dismissing errors, warnings, or linting failures it didn't write. Also extends the code-reviewer agent with an Issue Ownership Policy requiring concrete fixes rather than passive reporting. Co-Authored-By: Claude Sonnet 4.6 --- .claude/CLAUDE.md | 28 ++++++++++++++++++++++++++++ .claude/agents/code-reviewer.md | 10 ++++++++++ 2 files changed, 38 insertions(+) diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index d941030..b4806d0 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -81,6 +81,34 @@ terraform plan # Preview changes **This is not optional. Treat refactor-scan invocation with the same priority as running tests.** +## No "Pre-Existing Issue" Exceptions (MANDATORY) + +**There is no such thing as a pre-existing issue that can be skipped.** + +If you encounter any error, warning, linting failure, type error, or test failure — regardless of whether you wrote the code — you MUST fix it. + +**These phrases are banned:** +- "This is an existing issue, not part of my change" +- "This was already present before my changes" +- "Out of scope for this task" +- "I'll leave this for a separate PR" + +**What to do instead:** +1. Fix it immediately in the same session +2. If the fix is genuinely large (e.g. a systemic architecture problem), create a tracked TODO comment in the code AND note it explicitly to the user — but still fix any small instances you can +3. Never add suppression comments (`# noqa`, `// eslint-disable`, `@ts-ignore`, `#[allow(...)]`) to hide an issue rather than fix it +4. If a suppression is genuinely warranted (e.g. a known upstream bug), document exactly why in the suppression comment + +**This applies to:** +- Test failures discovered while running the suite +- Linting errors and warnings in files you open or modify +- Type errors surfaced by the type checker +- Compiler/interpreter warnings +- Security issues found incidentally +- Deprecation warnings + +**The codebase is your responsibility, not just the lines you added this session.** + ## Coverage Requirements | Layer | Target | Notes | diff --git a/.claude/agents/code-reviewer.md b/.claude/agents/code-reviewer.md index 08451ad..f78a4bb 100644 --- a/.claude/agents/code-reviewer.md +++ b/.claude/agents/code-reviewer.md @@ -170,6 +170,16 @@ grep -rn "\`.*SELECT" src/ --include="*.ts" [Explanation of why this matters] ``` +## Issue Ownership Policy + +When you find any issue during review — regardless of whether it was introduced by the current PR — you must: + +1. Flag it in the review output with file and line reference +2. Provide a concrete fix, not just a description of the problem +3. **Never** write "pre-existing" or "out of scope" as a reason to skip fixing something + +If an issue is too large to fix within the current review scope, escalate it explicitly to the user with a clear explanation of what is needed. Do not silently drop it. + ## Special Considerations ### For Python Code