feat(claude/commands): add claude-to-agents conversion command

Provide a reusable command to convert a project's CLAUDE.md into an
AGENTS.md file while replacing the original with a thin @-reference.
Includes precondition checks, self-reference updating, and summary
reporting steps.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-31 18:56:46 +00:00
parent 5892d9692a
commit c1844bead4

View File

@@ -0,0 +1,36 @@
# Task: Convert CLAUDE.md to AGENTS.md
Convert this project's `CLAUDE.md` into an `AGENTS.md` file, and
replace `CLAUDE.md` with a thin reference to it.
## Steps
1. **Verify preconditions**:
- Confirm `CLAUDE.md` exists in the project root. If not, abort
with an error message.
- Confirm `AGENTS.md` does NOT already exist in the project root.
If it does, abort — suggest using it directly or removing it
first.
2. **Read `CLAUDE.md`** content in full.
3. **Review content for references that need updating**:
- Headings like `# CLAUDE.md``# AGENTS.md`
- Self-references like "this CLAUDE.md file" →
"this AGENTS.md file"
- Any other mentions of the filename that refer to the file
itself and should change to reflect the new name
- Do NOT change references to CLAUDE.md that refer to other
projects' files, Claude Code documentation, or external
concepts
4. **Write `AGENTS.md`** with the updated content.
5. **Replace `CLAUDE.md`** contents with just:
```
@AGENTS.md
```
This makes Claude Code load `AGENTS.md` via the `@`-reference.
6. **Summary**: Report what was done, including any references that
were updated in step 3.