AGENTS.md
AGENTS.mdAGENTS.mdroot
Quality
100/100
Scores the file, not the repository.Length
861 words
23 headings · 2 code blocksRepository
111
— · pushed 23 days agoLast changed
3 days ago
First indexed 3 days ago.1# AGENTS.md23> Read this if you are an AI coding agent and the user has pointed you4> at this repo. This file tells you what to do.56## What this repo is78A collection of self-contained drop-in fixes for prompt-caching bugs9in popular LLM agent harnesses (Cline, Roo Code, Continue, OpenCode,10Aider). Each fix lives at `skills/<slug>/SKILL.md` and is everything11you need to land the patch: target file, symptom, diff, verification.1213## What you should do1415When the user asks you to apply this repo:1617### Step 1 — identify which harnesses are in their project1819Quick checks:2021| Harness | Detection |22|---------|-----------|23| Cline | `package.json` contains `"name": "claude-dev"` or `"cline"`; or path contains `src/core/api/providers/anthropic.ts` |24| Roo Code | `package.json` contains `"roo-cline"` or `"roo-code"`; path `src/api/providers/` |25| Aider | `pyproject.toml` or `setup.py` declares `aider`; path `aider/coders/` |26| OpenCode | path `packages/opencode/src/provider/transform.ts` |27| Continue | path `packages/openai-adapters/src/apis/Anthropic.ts` or `core/llm/llms/Bedrock.ts` |2829If none match, the user may want you to apply skills to their *own*30agent harness using these as templates. Ask them.3132### Step 2 — for each matching harness, check each relevant skill3334For every `skills/<slug>/SKILL.md`:35361. Read the YAML frontmatter:37 - `target_harness` — matches user's project?38 - `target_files` — exist at those paths?39 - `target_commit` — is the user's checkout near that commit, or40 have things drifted?412. Read the "Symptom" section. Verify the symptom exists in the42 user's code before applying. If it doesn't (e.g. user is on a43 newer version where the bug is fixed), SKIP that skill and report.443. If symptom present, apply the diff in the "Fix" section. If the45 diff doesn't apply cleanly (line drift), do the equivalent edit46 manually preserving the intent.474. Run the "Verify" section. Most verifications require capturing48 the wire (mitmproxy or harness debug log) and inspecting response49 `usage` fields. If you can't run a live verify, at minimum confirm50 the syntax of the patched file is valid (compile/type-check).5152### Step 3 — report back5354Tell the user:5556- Which skills applied cleanly57- Which skipped and why (symptom not present / file moved / etc.)58- Which failed verification and were reverted59- Estimated savings based on the per-skill `estimated_savings` field6061### Step 4 — don't bundle skills into one commit6263One skill = one commit (or PR). Easy to review and easy to revert64individually if one regresses. Use the skill name as the commit65message subject.6667## What you should NOT do6869- **Don't modify the skills themselves** unless the user explicitly70 asks. If you spot a bug in a skill, write it up as a comment or71 patch and stop there.72- **Don't apply skills speculatively.** Every skill has a target73 file + symptom check; verify before applying. The fixes are74 surgical, not heuristic.75- **Don't replace `cache_control` with random UUIDs or session IDs76 thinking it'll "randomize the cache".** That's the #1 footgun. See77 `docs/gotchas.md` #9b.78- **Don't combine skills into one mega-fix.** Each one is atomic for79 a reason — separate bugs can have separate reviewers and separate80 upstream PRs.81- **Don't open upstream PRs without the user's explicit go-ahead.**82 The skills are written to be applied locally; pushing them upstream83 is a separate decision the user owns.8485## Useful reference paths8687If you need to understand WHY a fix matters before applying:8889- `docs/concepts/anthropic.md` — Anthropic prompt caching mechanics90- `docs/concepts/openai.md` — OpenAI prompt caching + `prompt_cache_key`91- `docs/concepts/gemini.md` — Gemini implicit + explicit caching92- `docs/concepts/bedrock.md` — Bedrock `cachePoint` semantics93- `docs/gotchas.md` — 16 numbered failure modes94- `docs/verification.md` — how to confirm caching is working9596For the audit evidence behind each skill:9798- `audits/<harness>.md` — full source audit + permalinks99100## Verifying your work101102The repo ships `tools/check_cache.py` — a zero-dependency Python103script that fires any request body twice and dumps the cache token104diff. Use it as a smoke test:105106```bash107# After applying a skill that targets Anthropic:108python3 tools/check_cache.py --provider anthropic --body /tmp/req.json109# Expect: warm.cache_read > 0 and significantly larger than warm.input110```111112If `cache_read` is 0 on the warm call, the fix didn't land or there's113a second upstream issue. Stop and report rather than retrying blindly.114115## Development setup116117### Prerequisites118119- Python 3.11+ (stdlib only — no pip install needed)120- Node.js 18+ (for `markdownlint-cli2` via npx)121122### Build / lint / test commands123124```bash125# Python syntax check (CI job: python-syntax)126python3 -m py_compile tools/check_cache.py tools/check_docs_consistency.py127128# Docs consistency guard (CI job: consistency)129python3 tools/check_docs_consistency.py130131# Markdown lint (CI job: markdown-lint)132npx markdownlint-cli2 '**/*.md' '!**/node_modules/**'133134# Python unit tests (CI job: python-tests)135python3 -m pytest tests/ -v136137# Python type check (CI job: python-typecheck)138python3 -m mypy tools/ --strict139140# Secrets scan (CI job: secrets-scan — requires gitleaks binary)141gitleaks dir . --no-banner142```143144### CI145146GitHub Actions workflow at `.github/workflows/ci.yml` runs on every147push and PR: gitleaks, markdownlint, python syntax, docs consistency,148pytest, mypy, and link check.149150## When in doubt151152Read the SKILL.md fully. They're written to be self-explanatory for153agents. If a skill is ambiguous, treat that as a bug in the skill154and ask the user how to proceed rather than guessing.155
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 2 days ago | |
| wpscanteam/wpscanAGENTS.md · 9.7k | AGENTS.md | setupbuildteststyle+6 | 100/100 | 2 days ago | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 3 days ago |
