wanshuiyin/HERO-Anti-OverDefense

HERO = Hashing · Edge cases · Rubrics · Overbuild — the four shapes coding agents over-defend in. A paste-in contract that stops them. Works with Claude Code, Codex, Antigravity, Cursor, Copilot, Windsurf, Gemini CLI.

HERO – Anti‑OverDefense

What it is

  • A tiny, copy‑and‑paste configuration block (plus documentation) that you add to the prompt/config file of an AI coding assistant (Claude Code, GitHub Copilot, Cursor, Gemini CLI, etc.).
  • The block contains nine “rules” that tell the model what not to do when it writes code, documentation, or other deliverables.
  • The repository also ships a catalogue of real‑world examples (the cases folder) that illustrate the four problem families the rules target:
    1. H – Hashing – adding checksums or digests that nobody reads.
    2. E – Edge cases – defending against inputs that never occur in the project.
    3. R – Rubrics – replacing human judgement with exhaustive scoring tables or audit loops.
    4. O – Overbuild – scaffolding, feature‑flags, migration layers that never get used.
  • The idea is to give developers a concrete, language‑agnostic way to keep LLM‑based agents focused on the requested work instead of building defensive “fortresses” around it.

How you use it

  1. Pick the file your agent automatically reads (e.g., CLAUDE.md, AGENTS.md, .github/copilot‑instructions.md).
  2. Run the one‑liner provided in the README; it fetches the RULES.md block from the repo and appends it to your file, guarded so it won’t duplicate.
  3. When the agent later produces output, the nine rules act as a contract: the model should reject adding unnecessary hashes, ignore irrelevant edge‑cases, avoid endless checklists, and not generate scaffolding that isn’t needed.
  4. If the model still over‑defends, you can quote a matching entry from the cases/ catalogue to point out the specific “shape” (e.g., HERO‑R‑006), making the feedback precise.

Why it matters

  • LLM‑based code assistants often try to “cover all bases” – they sprinkle hashes, add defensive wrappers, or produce long audit trails that delay delivery.
  • HERO’s rules are distilled from real incidents observed in the author’s own research (the ARIS project) and from community contributions.
  • By codifying the anti‑defensive stance in a plain‑text block, the approach works with any model that respects a prompt file, without needing a separate library or runtime.

What you get from the repo

  • RULES.md – the nine‑rule contract (full and a short version).
  • cases/ – a markdown catalogue of concrete over‑defense examples, each with what was asked, what the model did, why it’s disproportionate, and the proportionate solution.
  • hosts/ – a table that tells you exactly which filename each supported agent reads.
  • examples/ – optional community‑contributed config snippets showing how people have integrated the block in real projects.
  • A tiny changelog documenting rule updates (e.g., the “press‑release principle” added in Sep 2026).

Who it’s for

  • Teams that rely on LLM code assistants for day‑to‑day development and want to keep the assistants from generating unnecessary boilerplate.
  • Researchers or hobbyists running long, unattended AI‑driven code generation pipelines (the “sleep” research in ARIS) who need a lightweight guard against the model’s tendency to over‑defend.

Limitations

  • The block is a soft instruction; a more powerful model or a higher‑priority system constraint can still override it.
  • It does not enforce security or migration work – those rules explicitly defer to higher‑priority requirements.
  • Effectiveness is modest: community feedback says it “helps a little” but does not guarantee the model will obey every rule.

License

  • MIT – you can copy, modify, and redistribute the block and documentation freely.

In short, HERO‑Anti‑OverDefense is a minimal, model‑agnostic prompt‑file that tells AI coding assistants to stop building unnecessary “fortresses” around a feature and stay focused on delivering the actual work.

Related

  • Project
  • Project
  • Project
  • Project
  • Project