Purpose
Initialize a repository so that AI coding agents (Claude Code, Codex, Cursor, etc.)
can operate safely, deterministically, and with minimal human supervision.
This skill generates:
- AGENTS.md (agent operational contract)
- docs/ directory with structured technical documentation
Inputs
- Repository to initialize.
- Optional: short human note describing the project and instructions (1–3 sentences)
Outputs
- AGENTS.md at repository root
- docs/ directory with standardized markdown files
Core Principles
- Do NOT guess. If information is missing, explicitly mark TODOs.
- Prefer correctness and safety over completeness.
- Optimize for agent execution, not human prose.
- Minimize exploration cost and failure modes.
- If the given repository follows a monorepo pattern, create a subdirectory under docs/ for each project so the documentation doesn’t get mixed together.
- Example)
docs/frontend/00_overview.md docs/frontend/adr docs/frontend/plan
Execution Steps
Step 1: Repository Inspection
- Detect:
- Primary language(s)
- Framework(s)
- Package manager
- Test framework
- Deployment indicators (Dockerfile, CI configs, Vercel, etc.)
- Identify:
- Entry points
- Core business logic directories
- Infrastructure-related files (DB, queues, storage)
If detection is ambiguous:
- Record ambiguity explicitly in docs/00_overview.md
- Do NOT assume defaults
Step 2: Confirm Ambiguities & Decisions With the Human
Request the user to provide the following information:
- Whether Git-related commands are allowed: use freely vs use only with explicit approval
- Language preferences:
- Language for comments, documents and commit messages
- Communication language: same as the user vs a specific language
- Any other items discovered in Step 1 that are ambiguous or seem to require questions
If the human does not answer:
- Do NOT guess.
- Pause and ask again as needed; if you must proceed, mark missing items as “Unknown / TODO” in docs (without embedding the unanswered questions), and keep AGENTS.md conservative (minimal privileges, no destructive ops).
Step 3: Generate AGENTS.md
First, copy AGENTS.md.example, then edit it based on the information gathered so far to create AGENTS.md.
AGENTS.md MUST include:
Repository Guidelines
Project Structure & Module Organization
Documentation
Coding Style & Naming Conventions
Commit Message & PR Guidelines
Commit Message Format
Atomic Commits
Agent Operation & Safety Rules
Language Policy
User Interaction
Hard rules:
- Keep AGENTS.md concise (target: 50–120 lines)
- Link to docs/ instead of duplicating explanations
Step 4: Generate docs/ Structure
If the docs/ directory already exists, generate all new files inside docs/agents/ instead of docs/. Otherwise, use docs/ as the target directory.
Create the following files if applicable:
- docs/00_overview.md
- docs/10_architecture.md
- docs/20_dev_env.md
- docs/30_commands.md
- docs/40_testing.md
- docs/50_deploy.md
- docs/60_observability.md
- docs/70_security.md
- docs/80_style_guide.md
- docs/90_troubleshooting.md
Rules:
- Omit files that are clearly irrelevant
- Never fabricate cloud providers, CI tools, or databases
- Prefer explicit “Unknown / TODO” over assumptions
Step 5: ADR Detection (Optional but Recommended)
If architectural decisions are inferred:
- Create docs/adr/
- Record assumptions as provisional ADRs
- Mark them as “UNVERIFIED”
Step 6: Validation Checklist
Before finalizing:
- All commands copy-paste runnable OR marked TODO
- No secrets included
- No speculative tech choices
- AGENTS.md links resolve correctly
Failure Handling
If the repository is:
- Empty
- Too small to infer structure
- Highly ambiguous
Then:
- Generate minimal AGENTS.md
- Generate docs/00_overview.md that clearly separates detected facts vs “Unknown / TODO” items (but do not include a question list; ask any needed questions during execution).
If, at any point, you encounter ambiguities or actions that appear potentially risky:
Then:
- always pause and request clarification from the user before proceeding.
Non-Goals
- Do not optimize for marketing or onboarding humans
- Do not refactor code
- Do not introduce new dependencies
- Do not modify runtime behavior
Success Criteria
A coding agent can:
- Identify where to make changes
- Execute tests confidently
- Avoid destructive or unsafe operations
- Complete scoped tasks without human correction
1---2name: agent-onboarding3description: Initialize a repository by analyzing its structure and generating `AGENTS.md` and structured `docs/`, enabling AI coding agents (Claude Code, Codex, Cursor, etc.) to operate safely, deterministically, and with minimal human supervision.4license: Apache-2.05---6## Purpose7Initialize a repository so that AI coding agents (Claude Code, Codex, Cursor, etc.)8can operate safely, deterministically, and with minimal human supervision.910This skill generates:11- AGENTS.md (agent operational contract)12- docs/ directory with structured technical documentation1314## Inputs15- Repository to initialize.16- Optional: short human note describing the project and instructions (1–3 sentences)1718## Outputs19- AGENTS.md at repository root20- docs/ directory with standardized markdown files2122## Core Principles23- Do NOT guess. If information is missing, explicitly mark TODOs.24- Prefer correctness and safety over completeness.25- Optimize for agent execution, not human prose.26- Minimize exploration cost and failure modes.27- If the given repository follows a monorepo pattern, create a subdirectory under docs/ for each project so the documentation doesn’t get mixed together.28 - Example) `docs/frontend/00_overview.md` `docs/frontend/adr` `docs/frontend/plan`2930---3132## Execution Steps3334### Step 1: Repository Inspection3536- Detect:37 - Primary language(s)38 - Framework(s)39 - Package manager40 - Test framework41 - Deployment indicators (Dockerfile, CI configs, Vercel, etc.)42- Identify:43 - Entry points44 - Core business logic directories45 - Infrastructure-related files (DB, queues, storage)4647If detection is ambiguous:48- Record ambiguity explicitly in docs/00_overview.md49- Do NOT assume defaults5051---5253### Step 2: Confirm Ambiguities & Decisions With the Human5455Request the user to provide the following information:5657- Whether Git-related commands are allowed: use freely vs use only with explicit approval58- Language preferences:59 - Language for comments, documents and commit messages60 - Communication language: same as the user vs a specific language61- Any other items discovered in Step 1 that are ambiguous or seem to require questions6263If the human does not answer:64- Do NOT guess.65- Pause and ask again as needed; if you must proceed, mark missing items as “Unknown / TODO” in docs (without embedding the unanswered questions), and keep AGENTS.md conservative (minimal privileges, no destructive ops).6667---6869### Step 3: Generate AGENTS.md70First, copy [AGENTS.md.example](`assets/AGENTS.md.example`), then edit it based on the information gathered so far to create `AGENTS.md`.7172AGENTS.md MUST include:73# Repository Guidelines74## Project Structure & Module Organization7576## Documentation7778## Coding Style & Naming Conventions7980## Commit Message & PR Guidelines81### Commit Message Format82### Atomic Commits8384## Agent Operation & Safety Rules8586## Language Policy8788## User Interaction8990Hard rules:91- Keep AGENTS.md concise (target: 50–120 lines)92- Link to docs/ instead of duplicating explanations9394---9596### Step 4: Generate docs/ Structure9798**If the `docs/` directory already exists, generate all new files inside `docs/agents/` instead of `docs/`. Otherwise, use `docs/` as the target directory.**99100Create the following files if applicable:101102- docs/00_overview.md103- docs/10_architecture.md104- docs/20_dev_env.md105- docs/30_commands.md106- docs/40_testing.md107- docs/50_deploy.md108- docs/60_observability.md109- docs/70_security.md110- docs/80_style_guide.md111- docs/90_troubleshooting.md112113Rules:114- Omit files that are clearly irrelevant115- Never fabricate cloud providers, CI tools, or databases116- Prefer explicit “Unknown / TODO” over assumptions117118---119120### Step 5: ADR Detection (Optional but Recommended)121If architectural decisions are inferred:122- Create docs/adr/123- Record assumptions as provisional ADRs124- Mark them as “UNVERIFIED”125126---127128### Step 6: Validation Checklist129Before finalizing:130- All commands copy-paste runnable OR marked TODO131- No secrets included132- No speculative tech choices133- AGENTS.md links resolve correctly134135---136137## Failure Handling138If the repository is:139- Empty140- Too small to infer structure141- Highly ambiguous142143Then:144- Generate minimal AGENTS.md145- Generate docs/00_overview.md that clearly separates detected facts vs “Unknown / TODO” items (but do not include a question list; ask any needed questions during execution).146147If, at any point, you encounter ambiguities or actions that appear potentially risky:148149Then:150- always pause and request clarification from the user before proceeding.151152---153154## Non-Goals155- Do not optimize for marketing or onboarding humans156- Do not refactor code157- Do not introduce new dependencies158- Do not modify runtime behavior159160---161162## Success Criteria163A coding agent can:164- Identify where to make changes165- Execute tests confidently166- Avoid destructive or unsafe operations167- Complete scoped tasks without human correction