evidence-first-agent-rules/README.md
SHA-256 2e93b69cd8eb415c51c341698c29e70a4220c41884a1be6f38a3d63b09efa891 · 5,255 bytes
# Evidence-First Agent Rules
Five short instruction files that push AI coding agents away from five expensive habits:
- saying "fixed" when the code only compiles;
- guessing at regressions instead of diffing;
- trying fix after fix without researching;
- hardcoding guessed numbers;
- quietly dropping parts of a request, or slipping in unrequested changes.
They are written for **Claude Code**. Each rule is a plain Markdown file you can read in a minute.
## Where these come from
The StackPlug team's own working instructions, used daily in Claude Code across several projects since spring 2026. Every
rule exists because the failure it describes actually happened and cost real time. The examples in the files are
those incidents with project details removed. We are not claiming any measured improvement; these are habits we rely
on, written down.
## Components
| Component | File | What it does | Needs |
|---|---|---|---|
| Verify before claiming | `.claude/rules/evidence-verify-before-claiming.md` | No "fixed" or "done" without runtime evidence or an explicit caveat; tests must fail on the buggy code | Nothing |
| Debug by diffing | `.claude/rules/evidence-debug-by-diffing.md` | For regressions: find the last good version and read the diff before writing a fix | Nothing (uses git if present) |
| Research after one failure | `.claude/rules/evidence-research-after-one-failure.md` | After one failed fix, research before the next attempt; asks for a yes before any web search that uses details from your project, and secrets never go into a query; records lessons | Debug by diffing (it refers to it) |
| Calculate before hardcoding | `.claude/rules/evidence-calculate-before-hardcoding.md` | Derive numeric values and show the arithmetic in a comment | Nothing |
| Scope every change | `.claude/rules/evidence-scope-every-change.md` | Checklist first for 3+ changes; every changed line must trace to the request | Verify before claiming (it refers to it) |
The rules are independent text files; installing one never changes another. There are no scripts, hooks or settings
in this package.
## Install
All five rules are **always-on instructions**: once installed they load into every Claude Code session. Read them
first (each is under a minute) and consider trying them in a separate project before adding them to real work.
- **Downloaded from StackPlug:** follow `SETUP-INSTALL.md`. `sh SETUP-install.sh trial <new folder>` creates a separate
trial project to try the rules safely; `apply --include-always-on` installs them into a project once you're happy.
- **By hand:** follow `INSTALL.md` (about five commands).
- **With your AI assistant:** paste the prompt in `INSTALL-WITH-AI.md`. It makes the assistant inspect first, propose
exact changes and wait for your approval. A prompt is not a security boundary, so read the plan it shows you.
## Compatibility
| Tool | Status |
|---|---|
| Claude Code 2.1.x, project rules (`<project>/.claude/rules/`) | Tested: the rules load and the assistant follows them |
| Claude Code, user rules (`~/.claude/rules/`) | Same mechanism; not separately tested for this release |
| Codex, Cursor and others | **Not tested.** The rules are plain Markdown; you can paste them into `AGENTS.md` or your tool's rules file, but we make no claim about how well they are followed |
## Limitations
- These are instructions, not enforcement. A model can still ignore a rule, especially in very long sessions.
- Rule files that share a name with files you already have will conflict. Every file here starts with `evidence-` to
make that unlikely.
## Uninstall
Every method removes only files it installed that are still identical to the package copies, and keeps anything you
changed:
- **Installed with StackPlug's installer:** run `sh SETUP-install.sh uninstall` from the same download.
- **Installed by hand or with your AI assistant:** use the uninstall commands in `INSTALL.md`.
Files that existed before you installed are never removed.
## Upgrading from version 1
Version 1 also included an optional git hook (`.claude/hooks/block_no_verify.py`). Version 2 removes it. If you enabled that hook, remove it in this order: first delete its entry from your Claude Code settings
(`.claude/settings.json` or `.claude/settings.local.json`), then delete the file. Deleting the file while the settings
entry still points at it makes Claude Code block every shell command until the entry is removed.
## Version 2.0.2
- The research rule cleans anything taken from your project out of search queries, asks for an explicit yes before
every such search; secrets never go into a query. Searches with nothing from your project still run normally.
- Lessons go to `LEARNINGS.md`; the assistant asks before changing `CLAUDE.md`, `AGENTS.md` or other always-on rules.
- The manual uninstall keeps changed files on its record.
- The diffing rule protects uncommitted work before any git command that changes the checked-out files.
- The scope and verification rules say plainly that they never authorize production operations, destructive commands
or reverting someone else's changes.
- The manual uninstall now removes only this package's unchanged files.
## License
MIT. See `LICENSE`.
Shown as plain text. Invisible or direction-changing characters are displayed as <U+XXXX>.