Agent skill

Repo Agent Context Audit

by majiayu000 in majiayu000/spellbook

Audits a repository's agent-readable context, from AGENTS.md and CLAUDE.md to skills and PRODUCT or TECH specs, and recommends the smallest useful improvements.

MITAuto-check passedAgent Workflows

Install Repo Agent Context Audit

skills CLI
$ npx skills add majiayu000/spellbook --skill repo-agent-context-audit -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install majiayu000/spellbook repo-agent-context-audit --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/majiayu000/spellbook.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/repo-agent-context-audit .claude/skills/repo-agent-context-audit && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
repo-agent-context-audit
GitHub stars
287
Token cost
~1.9k tokens
SKILL.md length
866 words
Files
4 (incl. scripts, references)
Skills in repo
97
Repo updated
First seen
Licence
MIT

At a glance

Audits a repository's agent-readable context, from AGENTS.md and CLAUDE.md to skills and PRODUCT or TECH specs, and recommends the smallest useful improvements.

  • Works in 5 steps: Discover → Classify → Score → …
  • Reviewing how well a repository's AGENTS.md and related files guide coding agents
  • SKILL.md covers Overview, Default Standard, Workflow and Decision Gates, plus 4 more sections
  • Runs Python scripts from its folder; calls python3

What it does

This skill audits whether a repository gives coding agents a small, usable context stack: a short top-level instruction file, task-specific skills, and behavior and implementation specs for larger work. It covers files such as `AGENTS.md`, `CLAUDE.md`, `WARP.md`, `CONTRIBUTING.md`, `.agents/skills` and `specs/` with PRODUCT and TECH files. The audit is read-only by default with minimal recommendations; it edits high-context files only when you explicitly ask.

The default standard has three layers: a top-level `AGENTS.md` of 80 to 150 lines that only routes, reusable skill workflows for fragile tasks, and checked-in product and tech contracts for each substantial feature. A coherent existing equivalent is mapped onto these layers instead of forced into them. The flow is discover, using the read-only scanner `scan_repo_context.py` plus direct inspection that records scope and precedence when files overlap, then classify, then score.

Classification uses six states: healthy, missing a top-level router, overloaded top-level file, complex repo without specs, stale or divergent instructions, and unsafe to modify. Scoring follows a rubric in `references/standards.md` covering routing quality, progressive disclosure, procedural workflows, decision gates, production examples and spec quality. Generating or applying `AGENTS.md` files is handed to the separate `agentsmd-scaffold` skill, and the text available here ends within the scoring step.

When your agent uses it

  • Reviewing how well a repository's AGENTS.md and related files guide coding agents
  • Scoring agent onboarding documentation across repositories with one rubric
  • Deciding whether a repo needs task skills or PRODUCT and TECH specs
  • Standardizing agent-context conventions across repositories

Example prompts

  • “Audit this repo's agent context and tell me what is missing or overloaded.”
  • “Score our AGENTS.md and CLAUDE.md against the standard and list the smallest useful fixes.”
  • “Does this repo need task skills or specs? Check without editing anything.”

Requirements

  • Python, for the optional scanner script

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Discover
  2. Classify
  3. Score
  4. Recommend
  5. Handoff Or Scaffold Only On Request

What it can do on your machine

Read from SKILL.md and the folder at commit ed52af7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Repo Agent Context Audit loads about 1.9k tokens when it runs, and up to ~3.7k if it reads all its reference files. Until then it costs about 117 tokens; SKILL.md has 866 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~117
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from majiayu000/spellbook at commit ed52af7, republished under its MIT licence (© majiayu000). 866 words, ~1,919 tokens.

Download SKILL.mdSave it as .claude/skills/repo-agent-context-audit/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
repo-agent-context-audit
description
Audit and recommend improvements for a repository's agent-readable context, including AGENTS.md, CLAUDE.md, WARP.md, CONTRIBUTING.md, .agents/skills, and specs/ PRODUCT.md and TECH.md contracts. Use when asked to review, score, assess, or standardize repo instructions, agent onboarding, spec workflows, or cross-repo agent-context conventions. Use agentsmd-scaffold instead when the user wants to generate or apply root/scoped AGENTS.md files.

Repo Agent Context Audit

Overview

Assess whether a repository has a small, usable agent context stack: a short top-level instruction file, task-specific skills, and behavior/implementation specs for substantial work. Default to a read-only audit and minimal recommendations; create or edit high-context files only when the user explicitly asks.

If the user asks to generate, split, or apply root/scoped AGENTS.md files, handoff to agentsmd-scaffold. This skill may identify that scaffold as the smallest useful change, but should not duplicate the generation workflow.

Default Standard

Prefer this three-layer shape:

  1. AGENTS.md or repo-equivalent: 80-150 lines, top-level routing only.
  2. .agents/skills/<task>/SKILL.md: reusable workflows for common fragile tasks.
  3. specs/<id>/PRODUCT.md and specs/<id>/TECH.md: checked-in contracts for substantial features.

Do not force this exact layout when a repo already has a coherent equivalent, such as WARP.md, CLAUDE.md, CONTRIBUTING.md, or framework-specific instruction files. Map existing files to the layers first, then fill only the real gaps.

Workflow

1. Discover

Run the read-only scanner when possible:

bash
# From this skill directory:
python3 scripts/scan_repo_context.py <repo-root>

Then inspect the important files directly. Always search before creating:

  • AGENTS.md, CLAUDE.md, WARP.md, .claude/instructions.md
  • CONTRIBUTING.md, README.md, .github/copilot-instructions.md
  • .agents/skills/*/SKILL.md
  • specs/**/{PRODUCT,product,TECH,tech}.md

If multiple instruction files overlap, record their scopes and precedence instead of merging them by default.

2. Classify

Classify the repo into one of these states:

  • Healthy: short top-level guidance, task workflows, and specs are discoverable.
  • Missing top-level router: useful docs exist but agents lack an entrypoint.
  • Overloaded top-level file: one file mixes rules, workflows, architecture, and reference data.
  • Specless complex repo: substantial work happens without PRODUCT/TECH contracts.
  • Stale or divergent: instructions contradict code, scripts, or observed repo conventions.
  • Unsafe to modify: high-context files are generated, externally owned, or conflict across scopes.
3. Score

Use the rubric in references/standards.md for:

  • top-level routing quality
  • progressive disclosure
  • procedural workflows
  • decision gates
  • production examples
  • spec quality
  • validation mapping
  • stale or conflicting guidance risk
4. Recommend

Lead with the smallest useful change. Good recommendations usually look like:

  • Add a short AGENTS.md that points to existing docs instead of duplicating them.
  • Split a long top-level file into a router plus references or skills.
  • Add .agents/skills/write-product-spec and .agents/skills/write-tech-spec only if spec writing is repeated.
  • Add specs/<id>/PRODUCT.md and TECH.md templates only if the repo ships substantial features.
  • Remove or rewrite stale instructions only after citing the conflict.
5. Handoff Or Scaffold Only On Request

When the user explicitly asks to generate, split, or apply root/scoped AGENTS.md files, use agentsmd-scaffold instead of duplicating that workflow.

When the user asks for exact PRODUCT/TECH spec templates or non-AGENTS context scaffolding, read references/templates.md and adapt the templates to the repo. Before editing:

  • identify every AGENTS.md or equivalent whose scope covers the target path
  • preserve existing high-context files unless the user asked for a rewrite
  • keep generated docs small
  • include actual repo commands, paths, and test gates
  • leave placeholders only when the repo truly lacks the fact

Decision Gates

CaseAction
Small bugfix repo with README and clear testsNo spec system; maybe add a short AGENTS.md router
Repeated feature work with review churnAdd PRODUCT/TECH spec workflow
User asks to generate or apply root/scoped AGENTS.md filesUse agentsmd-scaffold
Existing CLAUDE.md or WARP.md is goodLink it from AGENTS.md or leave it as the repo-equivalent
Multiple teams or nested packagesUse scoped nested AGENTS.md only where rules genuinely differ
High-context file over 200 linesSplit into top-level router plus referenced skills/docs
User asks for bulk normalizationAudit first; do not batch edit until 2-3 repos have been manually validated
Show full SKILL.md (302 more words)Show less

Operating Contract

Direct actions:

  • Run read-only discovery, scoring, and scanner commands.
  • Produce an audit report with cited files and smallest useful changes.
  • Draft exact non-AGENTS scaffold content when the user asks for proposed text.
  • Handoff AGENTS.md generation or application to agentsmd-scaffold.

Escalate before:

  • Creating or editing AGENTS.md, CLAUDE.md, WARP.md, hooks, settings, or generated docs.
  • Rewriting existing repo instructions instead of adding a short router or pointer.
  • Batch-normalizing multiple repositories.

Evidence-backed pushback:

  • Challenge new skill/spec scaffolding when the repo is small, has no repeated workflow, or already has a coherent equivalent.
  • Challenge edits when the only evidence is style preference rather than a real agent failure, review bottleneck, or missing workflow.

Feedback loop:

  • Promote repeated audit findings into the target repo's router, a task skill, or a spec template.
  • Keep this skill's rubric and templates updated when multiple repos expose the same false positive or missing decision gate.

Gotchas

  • Do not treat every README as an agent instruction file. Top-level README files are usually entrypoints; nested README files are supporting evidence unless a repo explicitly routes agents there.
  • Do not add AGENTS.md just because it is missing. If CLAUDE.md, WARP.md, or CONTRIBUTING.md already works as a coherent router, recommend a pointer or no change.
  • Do not create PRODUCT/TECH specs for small bugfix repos. Specs are for ambiguity, cross-module risk, and repeated review churn.
  • Do not silently normalize naming across repos. First report drift such as PRODUCT.md vs product.md, then ask before changing conventions.
  • Do not edit high-context files during an audit. Scaffold only after the user asks to create or apply files.

Report Format

Return concise findings:

markdown
## Agent Context Audit
- state: <classification>
- top-level router: <present/missing/overloaded>
- reusable skills: <present/missing/not needed>
- specs: <present/missing/inconsistent/not needed>
- main risk: <one sentence>

## Smallest Useful Change
1. <change> - <why> - <estimated effort>

## Evidence
- <file>:<line> - <what it proves>

## Optional Scaffold
- <files to create or update, only if requested>

Resources

  • scripts/scan_repo_context.py: read-only repo scanner for high-context files, skills, and specs.
  • references/standards.md: scoring rubric and design rules. Read for audits.
  • references/templates.md: minimal AGENTS.md, PRODUCT.md, and TECH.md templates. Read only when scaffolding or proposing exact file contents.

© majiayu000, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts, references) in skills/repo-agent-context-audit of majiayu000/spellbook.

  • SKILL.md
  • references/standards.md
  • references/templates.md
  • scripts/scan_repo_context.py

Open the folder on GitHubat commit ed52af7

Compare with similar skills

Repo Agent Context Audit next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Repo Agent Context Audit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Repo Agent Context Audit this skillmajiayu000/spellbook287—~1.9kAutomated safety check: PassMIT
Context Engineeringabashev/vfs-s31069 repos~2.6kAutomated safety check: NotesApache-2.0
Dotagents Standardgetknit/knit133—~4.1kAutomated safety check: PassMIT
Reconcile ContextApocrathia/home-assistant-config179—~931Automated safety check: PassNone
Verify Agent ContextLuligu/matterbridge985—~525Automated safety check: PassApache-2.0
Setup Calibercaliber-ai-org/ai-setup1.3k—~1.9kAutomated safety check: PassMIT

Similar skills

  • Context Engineering

    abashev/vfs-s3

    Optimizes agent context setup. An agent skill from abashev/vfs-s3.

    106 GitHub starsUsed in 9 repos~2.6k tokens
    Agent WorkflowsAuto-check: notes
  • Dotagents Standard

    getknit/knit

    Set up, author, and navigate the dotagents standard — a slim AGENTS.md "router" at the repository root plus a hidden .agents/ directory (rules, context, memory, personas, skills, specs, logs, tasks)…

    133 GitHub stars~4.1k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Reconcile Context

    Apocrathia/home-assistant-config

    Fix drift in Home Assistant Homelab agent context (AGENTS.md, CLAUDE.md, .agents/context/, rules, skills, agents) against the repo.

    179 GitHub stars~931 tokensUpdated 19 days ago
    Agent WorkflowsAuto-check passed
  • Verify Agent Context

    Luligu/matterbridge

    Verify which coding agent is running and that it loaded the shared Matterbridge instructions, rules and skills from AGENTS.md and .agents/.

    985 GitHub stars~525 tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Setup Caliber

    caliber-ai-org/ai-setup

    Sets up Caliber for automatic AI agent context sync. An agent skill from caliber-ai-org/ai-setup.

    1.3k GitHub stars~1.9k tokensUpdated 17 days ago
    Agent WorkflowsAuto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from majiayu000/spellbook

All 97 skills in this repo
  • Skill Ecosystem Doctor

    majiayu000/spellbook

    Audits and repairs how coding-agent Skills are owned, copied and exposed across runtimes, from canonical sources to quarantine and retirement.

    287 GitHub stars~3k tokensUpdated 2 days ago
    Auto-check passed
  • AGENTS.md Scaffold

    majiayu000/spellbook

    Scans a repository for real evidence and proposes, or on request writes, a small stack of root and scoped AGENTS.md files with validation commands and generated-file boundaries.

    287 GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Product Demo Builder

    majiayu000/spellbook

    Plans, produces or diagnoses evidence-backed product demo videos: script, capture plan, pacing checks and verified final media built on real product behavior.

    287 GitHub stars~3.3k tokensUpdated 2 days ago
    Auto-check passed
  • Flowguard Task Guard

    majiayu000/spellbook

    Single entry point that routes long or ambiguous agent tasks, checks live state, bounds autonomous loops and leaves a resumable handoff.

    287 GitHub stars~2.1k tokensUpdated 2 days ago
    Auto-check passed
  • npm Supply Chain Check

    majiayu000/spellbook

    Scans a repository, its lockfiles and node_modules for known malicious npm package versions and install-time indicators, using a read-only Python scanner.

    287 GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Product Manager Toolkit

    majiayu000/spellbook

    Product management helpers: a RICE scoring script, an interview transcript analyzer and PRD templates for prioritizing features, synthesizing research and writing requirements.

    287 GitHub stars~2.2k tokensUpdated 2 days ago
    Auto-check passed

Categories

Questions about Repo Agent Context Audit

What does Repo Agent Context Audit do?

Audits a repository's agent-readable context, from AGENTS.md and CLAUDE.md to skills and PRODUCT or TECH specs, and recommends the smallest useful improvements. This skill audits whether a repository gives coding agents a small, usable context stack: a short top-level instruction file, task-specific skills, and behavior and implementation specs for larger work.agents/skills` and `specs/` with PRODUCT and TECH files.

When should I use Repo Agent Context Audit?

Repo Agent Context Audit fits situations like: reviewing how well a repository's AGENTS.md and related files guide coding agents; scoring agent onboarding documentation across repositories with one rubric; deciding whether a repo needs task skills or PRODUCT and TECH specs; standardizing agent-context conventions across repositories.

How do I install Repo Agent Context Audit in Claude Code?

Run `npx skills add majiayu000/spellbook --skill repo-agent-context-audit -a claude-code`. Or copy the skill folder (skills/repo-agent-context-audit in majiayu000/spellbook) into .claude/skills/repo-agent-context-audit in your project. Claude Code loads it when a task matches its description.

How do I install Repo Agent Context Audit in Codex?

Run `npx skills add majiayu000/spellbook --skill repo-agent-context-audit -a codex`. Or copy the skill folder (skills/repo-agent-context-audit in majiayu000/spellbook) into .agents/skills/repo-agent-context-audit in your project. Codex loads it when a task matches its description.

Can I use Repo Agent Context Audit in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add majiayu000/spellbook --skill repo-agent-context-audit -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/repo-agent-context-audit, .gemini/skills/repo-agent-context-audit, .github/skills/repo-agent-context-audit and .opencode/skills/repo-agent-context-audit in your project.

What does Repo Agent Context Audit need to run?

Going by SKILL.md and its folder, Repo Agent Context Audit needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python, for the optional scanner script.

Does Repo Agent Context Audit access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Repo Agent Context Audit safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Repo Agent Context Audit use?

Repo Agent Context Audit is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Repo Agent Context Audit use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.8k tokens, read only when the agent opens those files.

What are the alternatives to Repo Agent Context Audit?

Skills that share tags, products or a category with Repo Agent Context Audit: Context Engineering (abashev/vfs-s3, 106 stars), Dotagents Standard (getknit/knit, 133 stars), Reconcile Context (Apocrathia/home-assistant-config, 179 stars) and Verify Agent Context (Luligu/matterbridge, 985 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Repo Agent Context Audit?

majiayu000 (a GitHub user) maintains it in majiayu000/spellbook, which has 287 GitHub stars. The repository holds 97 skills in this directory. The repository was last updated on October 8, 2026.

Source: majiayu000/spellbook on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.