# Claude Md To Agents Md

> Scans the current repo for CLAUDE.md files, finds directories that lack a matching AGENTS.md, translates each CLAUDE.md to an AGENTS.md draft (applying the Claude -> Codex substitution table), runs a $where-agents-md sanity check per candidate, and - with per-item approval - either writes the translated draft or invokes $init inline for a richer code-derived doc. Never overwrites an existing AGEN…

- **Type:** Skill
- **Install:** `agentstack add skill-ada-ggf25-ai-tools-claude-md-to-agents-md`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ada-ggf25](https://agentstack.voostack.com/s/ada-ggf25)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ada-ggf25](https://github.com/ada-ggf25)
- **Source:** https://github.com/ada-ggf25/AI-Tools/tree/main/global/codex/skills/claude-md-to-agents-md

## Install

```sh
agentstack add skill-ada-ggf25-ai-tools-claude-md-to-agents-md
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# claude-md-to-agents-md

Global, project-agnostic skill. It finds every `CLAUDE.md` in the current repo,
identifies directories that have no matching `AGENTS.md`, translates each source file
using the Claude -> Codex substitution table, and - with per-item approval - writes the
draft or invokes `$init` inline for a richer code-derived alternative.

Use when: you've opened a Claude-first repo in Codex and there are zero or few
`AGENTS.md` files; the existing `CLAUDE.md` files already describe the directory's
purpose and conventions, so translation is a near-free win over starting from scratch.

## Procedure

### 1. Scan

```bash
find . -name CLAUDE.md \
  -not -path '*/node_modules/*' \
  -not -path '*/.git/*' \
  -not -path '*/vendor/*' \
  -not -path '*/.venv/*'
```

Also detect `AGENTS.override.md` files with a parallel find. Keep them as target-side
context - they are never translated or overwritten, but they may affect the approval
prompt for a directory that is missing shared `AGENTS.md` guidance.

### 2. Compute the gap

For each `/CLAUDE.md` found, check whether `/AGENTS.md` already exists.
Separate results into three buckets:

- **Gaps** - directory has `CLAUDE.md` but no `AGENTS.md` (action candidates)
- **Override-present gaps** - directory has `CLAUDE.md` and `AGENTS.override.md`, but
  no `AGENTS.md` (action candidates with an extra warning)
- **Already in sync** - both files exist (skip silently)

If there are no gaps or override-present gaps, report "All directories with CLAUDE.md
already have an AGENTS.md - nothing to do." and stop.

Present the gap list before doing anything else:

```text
Directories with CLAUDE.md but no AGENTS.md
  - src/backend/     (CLAUDE.md: 34 lines)
  - scripts/         (CLAUDE.md: 12 lines)

Already in sync (skipped)
  - .               (both files exist)

Needs extra confirmation - Codex override already present
  - .github/         (AGENTS.override.md exists - AGENTS.md would add shared guidance)
```

Ask the user which items to act on. **Do not proceed without explicit per-item approval.**

### 3. $where-agents-md sanity check (per approved candidate)

Before presenting the translated draft for a given directory, apply the
`$where-agents-md` scoring heuristic as a quick sanity check.

**Positive signals** (the directory likely warrants its own AGENTS.md):
- Has its own module manifest: `package.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`,
  `setup.py`, `*.csproj`, `pom.xml`, etc.
- Uses a different language, framework, or build tool than the repo root.
- Has its own lint/format/test config or codegen fixtures.
- Contains >= 15 source files or is a clearly self-contained component.
- Sits at an architectural seam: `services/`, `packages/`, `apps/`, `cmd/`.

**Negative signals** (the directory may not need one):
- Tiny leaf dir with few files and no module boundary.
- Already fully described by an ancestor `AGENTS.md`.
- Contains only assets, generated files, or vendored/dependency code.

If the directory scores negatively, warn before showing the draft:
> "Warning: this directory may not warrant its own AGENTS.md - it has no module boundary
> and a parent instruction file may already cover it. Proceed anyway?"

If it scores positively, note the signal in the approval prompt (e.g., "This directory
has its own `package.json` - an AGENTS.md here is well-motivated.").

### 4. Translate and get approval

Read the `CLAUDE.md` and apply the substitution table in order:

| Find | Replace with |
|---|---|
| `CLAUDE.md` | `AGENTS.md` |
| `/` invocation syntax | `$` |
| `where-claude` cross-references | `where-agents-md` |
| `audit-claude-md` cross-references | `audit-agent-docs` |
| Claude config paths (`~/.claude/`, `.claude/`) | Codex config paths (`~/.codex/`, `.codex/`) |
| "Claude Code" when referring to the product | "Codex" |

Show the full translated draft to the user. For each item, offer two choices:

**Option 1 - Write this translated draft** as `/AGENTS.md`
Fast path; content mirrors the CLAUDE.md. Best when the source is high-quality and
detailed.

**Option 2 - Invoke `$init` inline** for this directory
Codex invokes `$init` targeted at `` in this same session - no navigation needed.
Produces a fresh, code-derived doc that may be richer than the translation. Best when
the CLAUDE.md is sparse or generic and the directory has substantial source code worth
deriving context from.

Require an explicit choice (1, 2, or skip) before moving to the next item.

### 5. Write

On **choice 1**: write `/AGENTS.md` with the translated content. Create
intermediate directories if needed.

On **choice 2**: invoke `$init` with `` as the target directory. `$init` will
analyze that directory's code and write its own `AGENTS.md`; record the outcome in the
wrap-up.

On **skip**: record the directory in the wrap-up; do not write anything.

### 6. Wrap-up

Report a summary in three sections:

```text
Created (translated draft)
  /AGENTS.md

Created (via $init)
  /AGENTS.md

Skipped
    - already existed
    - user declined
    - negative $where-agents-md signal, user chose not to proceed
```

Note: AGENTS.md files are picked up automatically in the next Codex session opened in
that directory - no `./install.sh` step or restart required.

## Guardrails

- Never overwrite an existing `AGENTS.md`. Skip with a per-item warning if the target
  already exists.
- Never modify the source `CLAUDE.md`.
- Never write to global paths (`~/.claude/`, `~/.codex/`).
- Do not treat `AGENTS.override.md` as a replacement target; report it as existing local
  Codex override guidance and require explicit user approval before adding shared
  `AGENTS.md` guidance beside it.
- Require explicit per-item approval before every write.
- Apply the `$where-agents-md` sanity check and surface the result in the approval prompt;
  never silently create a file in a directory that clearly does not warrant one.
- When the CLAUDE.md is sparse or vague, surface this in the approval prompt and recommend option 2 (`$init`) over option 1.
- Create intermediate directories as needed, but only for approved writes.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ada-ggf25](https://github.com/ada-ggf25)
- **Source:** [ada-ggf25/AI-Tools](https://github.com/ada-ggf25/AI-Tools)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ada-ggf25-ai-tools-claude-md-to-agents-md
- Seller: https://agentstack.voostack.com/s/ada-ggf25
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
