Code Agent Init
Workflow
Identify the target repository root.
- Use the current working directory when the user does not specify a path.
- Prefer the nearest directory containing
.gitwhen working from a subdirectory.
Generate the files from this skill's bundled templates:
skills/code-agent-init/scripts/generate_agent_docs.sh [target-directory]
Add language-specific AGENTS.md constraints when available.
- Inspect the target repository to identify the primary implementation language.
- If
lang/<language>.mdexists for that language, append its contents to the generatedAGENTS.md. - Only add language constraints that match the target repository; do not add every file from
lang/.
Append to existing files by default.
- If
AGENTS.mdorCLAUDE.mdalready exists, the script appends the matching template content to the existing file. - When the user explicitly asks to regenerate, replace, or overwrite the files, run:
- If
skills/code-agent-init/scripts/generate_agent_docs.sh --force [target-directory]
- Report the generated file paths.
- Do not edit the generated content unless the user asks for a custom template.
- Treat
assets/AGENTS.mdandassets/CLAUDE.mdas the source of truth for the fixed templates.
Templates
assets/AGENTS.md: fixed Codex-style agent instructions.assets/CLAUDE.md: fixed Claude Code-style agent instructions.lang/*.md: optional language-specific constraints appended toAGENTS.mdwhen the target repository uses that language.
Notes
- Keep the templates deterministic and concise.
- If the templates need to change, update the files in
assets/first, then regenerate target files with--force.
Source: linuxperf/infra-programmer-skills — distributed by TomeVault.