Both branches of the flag reduced to the same expression, so the option was inert: a caller who asked for the no-import form got the import-form check anyway and a passing result that meant nothing. Two further defects in the same validator: --max-lines failed silently when given a value it could not use, and the Fix text told the agent to edit AGENTS.md when the offending content is the provider adapter's. The boundary clauses now name the operation being routed rather than the file type, which was ambiguous where both skills touch the same file. Addresses #115.
2.7 KiB
name, description, allowed-tools, metadata
| name | description | allowed-tools | metadata | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| provider-adapter-author | Use when a provider file (CLAUDE.md, .cursor rules, copilot-instructions) duplicating the repo's AGENTS.md should be cut to a thin adapter — "make CLAUDE.md just import AGENTS.md". Not writing the AGENTS file -> `agentsmd-author`. Not auditing the AGENTS file -> `agentsmd-audit`. | Bash Read Edit Write |
|
Gotchas
- Assume a provider has no cross-file import mechanism until you have confirmed it has one. Claude Code is the exception, not the rule: a
CLAUDE.mdmay consist of nothing but@pathlines, while the same@AGENTS.mdline in a Cursor rule or a Copilot instructions file is inert text no tool resolves. Pass--no-import-syntaxtoscripts/validate-adapter.shfor those providers.
Step 1 — Detect
Find the provider instruction file to convert. Before searching, read references/provider-matrix.md — skip it only when the target is already a known root CLAUDE.md, which is the common case.
Then confirm AGENTS.md exists at the repo root. If it does not, stop and tell the user to run agentsmd-author first — there is nothing to adapt to.
Step 2 — Diff and rewrite
Read the provider file and AGENTS.md side by side. Separate the provider file's content into two buckets: lines that restate what AGENTS.md already owns (universal rules, conventions, project overview) versus lines that are genuinely provider-specific (tool syntax, IDE behavior, model-specific instructions). Rewrite the provider file:
- Providers with import syntax (Claude Code): replace the redundant bucket with an
@AGENTS.md(or correct relative path) import line, keep the provider-specific bucket below it. - Providers without import syntax (Cursor, Copilot, etc.): replace the redundant bucket with a short pointer sentence mentioning
AGENTS.md, keep the provider-specific bucket.
The provider file is the only file this skill ever writes. Never create or edit AGENTS.md — not in this step, not in any step, whatever the payoff looks like.
Strip only what is genuinely redundant. Provider-specific material stays even when it is short — the goal is thin, not empty.
Step 3 — Self-validate
Run the bundled check before finishing — this is the skill's own closeout gate; there is no separate paired audit skill for this concern:
bash scripts/validate-adapter.sh [--no-import-syntax] [--max-lines N] <adapter-file> <agents-md-file>
Fix any FAIL by editing the provider file, and re-run until it exits 0.
Step 4 — Report
State which file was converted, what was removed versus kept, and the validator's final result.