/ai-config:ai-configfrom ai-config
Review the codebase against AI meta configuration files (CLAUDE.md, AGENTS.md) and report what should be added, updated, or restructured. Read-only — does not edit files.
Ships in ai-config. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Follow these instructions strictly.
This is a review-only command. Do NOT edit, branch, commit, push, or run check commands — only produce findings. The expected next step is /apply-fix, which will consume these findings and edit (or create) the files; after that, /pr will commit and open a pull request.
~/.claude/, ~/.codex/, or any path outside the repository.In-scope meta files:
CLAUDE.md (root and any nested CLAUDE.md under subdirectories)AGENTS.md (root and any nested AGENTS.md). Note: AGENTS.md is a shared file that other AI tools (Codex, Cursor, Cline, etc.) may also consume — only review parts that state repository-level facts. Do NOT touch sections that clearly belong to another specific tool (heuristic: the section heading or its leading sentence names another tool, e.g. "## Cursor", "### For Codex", "Notes for Cline").AGENTS.md via @<path> (e.g. docs/ai-rules.md) — normative rules that intentionally override generic best practices and model knowledge (placement rules: see Target structure). Review them ONLY for staleness: a rule referencing code, files, paths, or versions that no longer exist in the repository. Do NOT judge a rule's merit, recommend weakening it for contradicting best practices, or recommend consolidating it into AGENTS.md.When searching for nested CLAUDE.md / AGENTS.md, exclude common non-source directories: node_modules/, vendor/, .git/, build outputs (dist/, build/, .next/, .nuxt/, target/), and any path listed in .gitignore.
Out of scope (do NOT report on these in this command):
.claude/rules/*.md — intentionally not part of the canonical structure (see "Why no .claude/rules/" under Target structure). Exception: when a .claude/rules/ directory is present as leftover from earlier attempts, flag it under Structural drift so its content is consolidated into AGENTS.md and the directory is deleted..claude/agents/*.md, .claude/commands/*.md.claude/settings.json / settings.local.json~/.claude/...).cursorrules, .cursor/rules/*, .windsurfrules, .github/copilot-instructions.md) — future extension, not now.When in-scope meta files are missing or being newly populated, the project should converge on this canonical layout:
AGENTS.md (project root, optionally nested for monorepo workspaces) — full inline content. The single source of truth for project facts. Consumed by Codex, Cursor, Cline, and any other agent that follows the agents.md spec. Target ≤200 lines (see "Size guideline" below).
CLAUDE.md (project root) — primarily a one-line @AGENTS.md import. May optionally carry a small trailing section of Claude-Code-specific instructions below the import. The tail section MUST: (a) appear AFTER the @AGENTS.md line, (b) stay within ~20 lines, (c) contain only instructions that genuinely do not apply to other AI tools (e.g. plan-mode hints for a specific subdirectory, Claude Code skill or hook references). A tail section that meets these conditions is NOT Structural drift; anything beyond is.
Rulebook file(s) (optional, e.g. docs/ai-rules.md) — non-negotiable rules for AI agents (conventions that must override model priors), imported from AGENTS.md via a @<path> line. A sanctioned exception to the "full inline content" rule: normative rules live in the rulebook, factual project description in AGENTS.md. It must NOT live under .claude/ (protected directory — see "Why no .claude/rules/"). An import line in CLAUDE.md instead of AGENTS.md is Structural drift (recommend moving it into AGENTS.md); the AGENTS.md import line and the rulebook itself are NOT drift. Do not recommend creating a rulebook when none exists.
This is the canonical structure — recommend it by default. The one-line @AGENTS.md pattern is the official Claude Code recommendation for AGENTS.md interop (code.claude.com/docs/en/memory, AGENTS.md section: "create a CLAUDE.md that imports it so both tools read the same instructions without duplicating them").
.claude/rules/Earlier iterations of this spec recommended splitting content into .claude/rules/<topic>.md files. That approach has been removed because it is unmaintainable in CI:
.claude/** paths. In headless / -p mode (which is what anthropics/claude-code-action uses), the check returns an immediate error and is not overridable by --permission-mode (acceptEdits, bypassPermissions, dontAsk all fail), settings.json permissions.allow, --allowedTools, or PermissionRequest hooks. Refs: anthropics/claude-code#37253 (open), #36282, #35646./apply-fix-style automated maintenance of .claude/rules/*.md impossible from CI..claude/ — see Target structure) covers the same need without hitting the protected-dir guard.If/when Claude Code provides a CI override for the protected-dir check, this section can be revisited and the rules/-based structure considered again.
Per Claude Code memory docs, CLAUDE.md adherence degrades above ~200 lines. Because CLAUDE.md = @AGENTS.md loads AGENTS.md transitively at session start, AGENTS.md should target ≤200 lines as well.
When AGENTS.md grows past that target, prune content that is derivable from code (exhaustive dependency version listings, full package script descriptions that mirror package.json, directory trees that mirror an obvious filesystem layout) before considering structural changes. Splitting content into @-imports does NOT reduce context — imported files load in full at launch (memory docs, "Import additional files").
When the project has nested workspaces (pnpm workspace, Cargo workspace, Go modules in subdirectories) whose conventions differ meaningfully from the repo root, apply the Target structure independently per workspace root. Each workspace root may have its own AGENTS.md + CLAUDE.md (= @AGENTS.md) pair. Do not hoist child-workspace facts into the repo-root files; the repo root only carries facts that apply to the whole repo. Flag a single-root meta config in a divergent monorepo as Structural drift.
package.json, pyproject.toml, go.mod, Cargo.toml, Gemfile, Makefile, justfile, pnpm-workspace.yaml — note declared scripts, dependencies, toolchain, and whether the repo is a monorepo / workspace.src/, tests/, docs/, cmd/, internal/, etc.).next.config.*, nuxt.config.*, vite.config.*, tsconfig.json, astro.config.*, Dockerfile, pytest.ini, tox.ini, noxfile.py, Cargo workspace [workspace] blocks, etc. Adapt the inspection to the actual language ecosystem of the repo — do not insist on Node-specific files when the project is Python / Go / Rust / etc..github/workflows/..claude/rules/ directory — see Structural drift).CLAUDE.md contains @AGENTS.md (or any other @<path> import), follow the import and read the target so you have the complete picture.Missing file → Structural drift → Stale → Missing content. Stop at the first category that fits.
CLAUDE.md NOR AGENTS.md exists, AND the project warrants meta config (substantial conventions, non-trivial build/test setup). Recommend creating the Target structure in full: an inline AGENTS.md plus an import-only CLAUDE.md (= @AGENTS.md). If at least one of the two files exists, this category does not apply; use Structural drift instead.CLAUDE.md carries inline rule content beyond @AGENTS.md (and the optional tail section per Target structure). Recommend moving the inline content into AGENTS.md and replacing CLAUDE.md's body with @AGENTS.md. If AGENTS.md does not yet exist, this fix decomposes into two findings: a create-new for AGENTS.md (containing the extracted content) plus an update-existing for CLAUDE.md (replace body with @AGENTS.md).AGENTS.md exists with content but CLAUDE.md does not import it (CLAUDE.md is empty, missing, or carries unrelated content). Recommend replacing CLAUDE.md with @AGENTS.md (or creating CLAUDE.md with that single line if missing)..claude/rules/ directory exists in the repo as a leftover from earlier attempts. Recommend consolidating its content into AGENTS.md and deleting the directory. (Note: the consolidation step is the only place this command considers .claude/rules/ — once removed, it is out of scope per the Scope rules.)AGENTS.md does not mention how to run type checks even though package.json declares a check:types script).high (factually wrong content actively misleading agents, or the structure is so off that maintenance is broken) / medium (omits or under-specifies meaningful facts, or notable structural drift) / low (factually accurate but lacks a small piece of useful context — e.g. a minor script or convention).update-existing (edit a file that already exists) / create-new (create a file the findings explicitly call for).package.json declares a check:types script, but AGENTS.md does not mention how to run type checks")./apply-fix will produce the actual edit, or create the file from your description.) For Structural-drift fixes that touch both files, decompose into the concrete create / update operations needed (e.g. "move the stack section from CLAUDE.md lines 5-25 into AGENTS.md" + "replace CLAUDE.md body with @AGENTS.md").AGENTS.md and the optional CLAUDE.md tail section in the same language. Pick the dominant language used today; if both files are empty, follow the project's other docs (root README, etc.); default to English when nothing is populated.AGENTS.md. Do NOT recommend adding such content to a meta file.AGENTS.md is approaching or exceeding 200 lines, recommend pruning facts that are derivable from code (exhaustive dependency version listings, full mirroring of package.json scripts, directory trees that mirror an obvious filesystem layout). Do NOT recommend splitting into @-imports as a size remedy — imported files load in full at launch and the total context cost is unchanged..claude/rules/ directory under Structural drift is the explicit exception.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub kurosame/claude-code-plugins --plugin ai-config