agentleFS
Agents4Academia-AIAgents4Academia-AI/citation_verification/AGENTS.md

citation_verification

AGENTS.md8 starsChanged 10 days agoMITView on GitHub

Keep this short — every line costs attention each session. Deep rationale lives in docs/architecture.md and docs/DECISIONS.md; the verification method and the frozen output table live in .claude/skills/verify-citations/SKILL.md. - Install (offline floor): uv pip install -e '.[dev]' (or make install). No claude-agent-sdk, no API key, no network needed for the core. - Test: make test (full pytest suite, offline) · make smoke (tests + run_eval on the in-repo smoke gold). - Lint: make lint (ruff). - Verify a paper (needs…

  • Reads credentials
  • Installs packages
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,040 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Don't commit anything under .env* (except .env.example), secrets/, or *.key.

    line 45
  2. Distinctive:

    Don't push directly to main — open a PR.

    line 47
  3. Distinctive:

    Ask a clarifying question before generating code.

    line 80
  4. Distinctive:

    Prefer surgical changes over big refactors.

    line 81
  5. Distinctive:

    If a change touches a contract file, raise it with the team first.

    line 82

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md — what an agent/contributor reads at session start

Keep this short — every line costs attention each session. Deep rationale lives in docs/architecture.md and docs/DECISIONS.md; the verification method and the frozen output table live in .claude/skills/verify-citations/SKILL.md.

How to run

  • Install (offline floor): uv pip install -e '.[dev]' (or make install). No claude-agent-sdk, no API key, no network needed for the core.
  • Test: make test (full pytest suite, offline) · make smoke (tests + run_eval on the in-repo smoke gold).
  • Lint: make lint (ruff).
  • Verify a paper (needs LLM backend + .env): cverify <arxiv-id | arxiv-url | path.pdf> --backend agentic|claude_code.
  • Verify only the comparison tables: cverify <source> --tables only (--tables off skips them; default is on, with the citations).
  • Check one reference (no LLM): python -m citation_verifier.grounding.paper_lookup "<reference string>".
  • Regenerate / check the schema spec: make schema.
  • Build the dataset: chbench build (full) — see docs/DATASET.md.

Conventions

  • Python 3.11+. pydantic v2 for the schema.
  • Functions are short. If something needs a paragraph of comment to explain, refactor it.
  • Type-hint module boundaries (the Protocols in interfaces.py are the seams); internal code can be lighter.
  • snake_case functions, PascalCase classes, ALL_CAPS constants.
  • The core (schema + render + eval + grounding floor) MUST import and run without the SDK and without network. claude-agent-sdk is a lazy, optional import; network calls fail soft.

What's off-limits (the frozen seams — changes need team sign-off)

  • src/citation_verifier/schema.py, interfaces.py, __init__.py, spec/v0.1/record.schema.json, and .claude/skills/verify-citations/SKILL.md are the contract. The 8-column table and the four enum vocabularies must stay token-for-token in sync (the tests in tests/test_schema.py enforce this).
  • evals/ is the scoring boundary: the agent never imports evals/ and vice versa. Gold is built by a different resolver than the agent uses (anti-circularity).
  • Don't commit anything under .env* (except .env.example), secrets/, or *.key. Per-paper artifacts under papers/<id>/ are gitignored.
  • Don't push directly to main — open a PR.

Where the important stuff lives

  • src/citation_verifier/schema.py — CitationRecord (the contract) + enums + derive_severity.
  • src/citation_verifier/interfaces.py — Extractor / Resolver / VerificationBackend / StageFn Protocols + PaperSource / RunUsage / VerificationResult.
  • src/citation_verifier/orchestrator.py — run_verification(source, backend=...).
  • src/citation_verifier/{ingest,extract,grounding,stages,backends,render,cli} — the pipeline modules (see the structure table in README.md).
  • src/chbench/ — CitationHallucinationBench (dataset).
  • evals/ — run_eval.py, metrics.py, smoke/gold.jsonl.
  • config/{sources,venues}.yaml — source params + chbench harvest scope (no secrets).
  • src/citation_verifier/data/venues.yaml — the venue alias table (every spelling of a conference/journal → one key), read by citation_verifier/venues.py for the cited-vs-canonical venue check. Add a venue or a spelling there; inspect a pair with python -m citation_verifier.venues "<cited>" "<canonical>".
  • papers/ — per-paper input/artifact dirs.

Operating principles

  1. Think before coding — state assumptions; surface confusion first.
  2. Respect the seam — depend only on schema + interfaces, never another module's internals.
  3. Degrade, don't crash — a stuck (claim, citation) pair becomes one unverified row; the run continues.
  4. Never decide correctness from memory — ground every verdict in retrieved evidence, or mark it unverified.

When in doubt

  • Ask a clarifying question before generating code.
  • Prefer surgical changes over big refactors.
  • If a change touches a contract file, raise it with the team first.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.