| name | agent-copy |
| description | Use when the user asks to copy, install, refresh, or update repo-local AGENTS.md files from ~/.codex/AGENTS.md, root AGENTS.md compatibility, source agent instructions, or wants .codex/AGENTS.md and .claude/AGENTS.md to include global operating rules plus repo-specific guide, project overview, stack, run commands, boundaries, and implementation notes. Also use when the user says "agent copy". |
| metadata | {"short-description":"Copy global AGENTS into repo and append repo guide"} |
Agent Copy
This skill installs or refreshes repo-local .claude/AGENTS.md and .codex/AGENTS.md instruction files by copying /Users/sc/.codex/AGENTS.md, then appending a repo-specific guide.
Only AGENTS.md files should be created, copied, or updated.
Output Files
Default targets:
./.codex/AGENTS.md
./.claude/AGENTS.md
Source preamble:
/Users/sc/.codex/AGENTS.md
Do not create root ./AGENTS.md or root ./CLAUDE.md unless the user asks for root compatibility.
Core Rule
Each target file must:
- Start with an exact copy of
/Users/sc/.codex/AGENTS.md.
- Append a repo-specific tail section titled
## Repo-Specific Guide.
- Include only repo facts from filesystem inspection or the user's answers.
- Mark unknowns as
TBD - ask the user before implementing this area.
Do not paraphrase, summarize, or partially copy the global AGENTS file.
Workflow
1. Ground in the repo
Run before editing:
pwd
git status --short --branch
git branch --show-current
git remote -v
find . -maxdepth 2 -type f \( -name 'package.json' -o -name 'pnpm-lock.yaml' -o -name 'package-lock.json' -o -name 'yarn.lock' -o -name 'pyproject.toml' -o -name 'requirements.txt' -o -name 'go.mod' -o -name 'Cargo.toml' -o -name '.env.example' -o -name 'README.md' -o -name 'DESIGN.md' \) -print
find . -maxdepth 3 \( -path './.codex/AGENTS.md' -o -path './.claude/AGENTS.md' -o -name AGENTS.md -o -name CLAUDE.md \) -print
Scan and read existing repo docs/manifests before writing repo-specific details.
2. Preserve existing useful repo-specific content
If ./.codex/AGENTS.md or ./.claude/AGENTS.md already exists:
- Read it first.
- Preserve useful repo-specific guidance unless the user asked to replace it.
- Refresh the global preamble from
/Users/sc/.codex/AGENTS.md.
- Keep the repo-specific tail after the global preamble.
If existing instructions conflict with /Users/sc/.codex/AGENTS.md, keep the global rules unless the user explicitly says the repo is an exception.
3. Write the repo-specific tail
Append this section after the global preamble. If any of this information is unclear, ask and confirm with the user first.
Populate known fields from:
- user-provided project description
README.md, DESIGN.md, package manifests, lockfiles, env examples
- app directory structure and framework files
- existing scripts and tests
Never invent production credentials, live deployment state, database schema, auth policy, or external integrations.
## Repo-Specific Guide
### Project Overview
### Product Goal
### Audience / Users
### Key Directories/Docs/Scripts
### Stack / Architecture
### Local Dev configs / Hosting configs
### Boundaries / Do Not Touch
### Implementation Notes
Verification
After writing:
head -n "$(wc -l < /Users/sc/.codex/AGENTS.md)" ./.codex/AGENTS.md | cmp /Users/sc/.codex/AGENTS.md -
head -n "$(wc -l < /Users/sc/.codex/AGENTS.md)" ./.claude/AGENTS.md | cmp /Users/sc/.codex/AGENTS.md -
rg -n "Repo-Specific Guide|Project Overview|Product Goal|Stack / Architecture|Boundaries / Do Not Touch|Implementation Notes" ./.codex/AGENTS.md ./.claude/AGENTS.md
git status --short --branch
Report whether the global preamble verification passed.
Handoff
Final response should include:
- files created or updated
- whether the global preamble matches
/Users/sc/.codex/AGENTS.md
- which repo-specific sections were populated
- which sections remain blank or need user confirmation
- current git status
Commit only when the user explicitly asked for commit/push or the current task includes publishing.