AI Dev Setup
Turn a repository into a tuned AI-assisted development environment — safely, modularly, and in a way the maintainer still owns.
Most repos either have nothing (greenfield, unopinionated) or a patchwork of agent files, MCP snippets, and half-configured tools. Both cases benefit from the same discipline: look first, decide with the user, install small, validate, leave a record. This skill is that discipline, plus a curated map of what to consider.
When to use
- User asks to configure, bootstrap, or harden AI tooling in a repo.
- User names a specific component (Serena, RTK, Spec Kit, an MCP server, a skill) but the install should be done safely in the context of the whole setup.
- User wants an audit/recommendation pass without changes.
- User wants to discover reusable skills for this repo.
When NOT to use
- Writing product code, fixing bugs, running tests — those are the work this skill is meant to make easier, not replace.
- Pure documentation authoring unrelated to agent context files.
- Single-file tweaks the user has already decided on (just do the edit).
Modes
The skill operates in one of four modes. Ask the user which one if it's not obvious from the request.
| Mode |
When |
Behavior |
| audit |
"review", "what's missing", "recommend" |
Detect + research + report. No writes. |
| bootstrap |
Greenfield or near-empty repo |
Propose a full baseline; install only approved pieces. |
| optimize |
Repo already has AI setup |
Inventory, find gaps/overlap, propose targeted changes. |
| selective |
User names a single category |
Scope the flow to that category only (e.g. "add MCP"). |
Default to audit when in doubt. It's the least destructive and naturally leads into the others.
Core workflow
Execute these phases in order. Each phase has a clear exit condition — don't skip ahead.
Phase 1 — Detect
Before recommending anything, understand what's already here. Read — don't write.
Run scripts/detect.sh from the skill directory. It emits a JSON profile describing:
- project type, languages, package managers, test/build tools
- existing agent context files (
CLAUDE.md, AGENTS.md, .github/copilot-instructions.md, .cursorrules, etc.)
- existing skills directories (
.claude/skills/, .agents/skills/), skill-lock files
- existing MCP configs (
.mcp.json, .vscode/mcp.json, ~/.codex/config.toml if readable)
- token-optimization tooling signals (Serena config at
.serena/, RTK in PATH, Caveman, etc.)
- SDD signals (
.specify/, spec/plan/task files)
- hooks, settings, permissions (
.claude/settings.json, .claude/settings.local.json)
- git state (branch, remote, clean/dirty)
If the script is unavailable or fails, fall back to an inline checklist — see references/detection.md. That reference also explains how to interpret the signals (e.g. "a skill-lock.json + symlinked skills dir means a skill registry tool is managing them — do not hand-install skills there").
Exit condition: you can state, in 3–5 bullets, what this repo already has and where the gaps are.
Phase 2 — Decide the scope
Given the detection report, propose a mode and a shortlist of categories to consider. Present it to the user concisely:
Detected: <1-line summary>
Already configured: <list>
Gaps/opportunities: <list>
Proposed mode: <audit | bootstrap | optimize | selective>
Categories I'd consider: [AI artifacts, SDD, MCP, token optimization, agent/IDE integration]
Out of scope for now: <anything you're deferring and why>
OK to proceed, or adjust?
Wait for confirmation before doing any research or writes. Scope drift is the #1 failure mode of setup skills.
Phase 3 — Research & curate
For each in-scope category, consult the category-specific reference under references/categories/. Each reference lists well-known candidates, fit criteria, compatibility notes, and install sketches:
- references/categories/ai-artifacts.md — agent instructions, prompts, skills, memory
- references/categories/sdd.md — Spec Kit and alternatives
- references/categories/mcp.md — MCP servers
- references/categories/token-optimization.md — Serena, RTK, Caveman, Serena Slim
- references/categories/agent-ide.md — Claude Code, Copilot, Codex, Cursor, etc.
When skill installation is on the table, follow references/skill-discovery.md. That reference requires consulting skills.sh and/or installing/using find-skills before shortlisting.
Apply the decision framework in references/decision-framework.md to avoid tool overload. High-leverage over maximal — every tool is maintenance.
Cross-check candidates against references/compatibility.md before proposing. Some combinations conflict (e.g. two hook frameworks racing, two MCP servers offering the same capability) and must be flagged.
Exit condition: for each in-scope category you have 1–3 recommended candidates + clear reasons. No blind "install everything popular."
Phase 4 — Present decisions and get approval
Decisions must be presented, not assumed. Use the pattern in references/interaction.md. Skeleton:
Decision <N>: <one-line decision title>
Why it matters: <one sentence>
Option A — Recommended: <tool/approach>
Best fit because: <reason tied to this repo>
Tradeoffs: <honest cost>
Option B: <alternative>
Best fit if: <different priority>
Tradeoffs: ...
Option C: <do nothing / defer>
Best fit if: <e.g. too early>
Your call?
Batch related decisions but cap at ~5 at a time — cognitive load matters. For audit mode, stop here and produce a written recommendation document instead of asking for decisions.
Phase 5 — Install, configure, validate
Only after explicit approval. Follow references/install-playbook.md. Hard rules:
- Back up first.
scripts/backup.sh snapshots touched files into a tarball under .ai-dev-setup/backups/<timestamp>/. Run it before any write.
- Idempotent writes. Prefer merging into existing files (e.g. appending an MCP server to
.mcp.json) over full rewrites. If you must rewrite, diff-preview first.
- No silent overwrites. If a target file exists and your change isn't purely additive, show the diff and ask.
- Log the change. Append an entry to
.ai-dev-setup/changelog.md with what, why, which backup.
- Validate. Run
scripts/validate.sh (or the category-specific validator). For MCP: attempt the listed tools work. For skills: the skill shows up in the expected location. For Serena: the hook fires.
- Surface rollback. Tell the user the exact command to undo (
tar -xf <backup> -C /).
Exit condition: validation passes, or you've surfaced a real failure with a clear next step. Never report success without running the validator.
Phase 6 — Report
One concise report at the end:
- What was installed/changed (file-by-file, with backup locations).
- What was deliberately not installed, and why (so the user can revisit later).
- Suggested next steps (e.g. "run
rtk gh auth login once before using the GitHub MCP").
- How to roll back.
Skill discovery
Any time the in-scope work includes installing reusable skills, you MUST perform active skill discovery before recommending anything. Read and follow references/skill-discovery.md. Summary:
- Check if
find-skills is installed locally. If yes, use it.
- Otherwise, consult skills.sh (https://skills.sh/) as a web source.
- Offer to install
find-skills as a durable helper if the user will likely do this again.
- Curate — do not dump — shortlisted candidates. Flag overlap with installed skills (read the detection inventory).
- Get explicit approval per-skill before install.
Do not invent skill names. If you can't confirm a skill exists on skills.sh or in a known index, say so rather than guessing.
Safety constraints
- Never modify
~/.claude/settings.json or other user-global config without explicit, specific approval. Prefer project-local scopes (.claude/settings.json, .mcp.json).
- Never commit secrets. GitHub tokens, API keys, etc. go in
.env (git-ignored) and are referenced by env var in configs.
- If the git tree is dirty, warn the user and offer to stash or create a dedicated branch before writing.
- If the skill detects an active skill-registry tool (e.g. a
skills-lock.json), do not hand-install into the managed skills directory — use the registry tool's own install path, or tell the user.
- On destructive prompts (overwrites, deletes), require explicit confirmation with the file path echoed back.
Reference index
| Topic |
File |
| Detection signals & fallback checklist |
references/detection.md |
| Decision framework (when to install vs. defer) |
references/decision-framework.md |
| How to present options to the user |
references/interaction.md |
| Skill discovery (skills.sh, find-skills) |
references/skill-discovery.md |
| Tool compatibility & conflicts |
references/compatibility.md |
| Install / configure / validate / rollback |
references/install-playbook.md |
| Category: AI artifacts |
references/categories/ai-artifacts.md |
| Category: SDD |
references/categories/sdd.md |
| Category: MCP |
references/categories/mcp.md |
| Category: Token optimization |
references/categories/token-optimization.md |
| Category: Agent/IDE integration |
references/categories/agent-ide.md |
| Known-tool registry (machine-readable) |
assets/manifests/registry.json |
| Templates |
assets/templates/ |
Scripts
| Script |
Purpose |
scripts/detect.sh |
Emit repo profile JSON to stdout |
scripts/backup.sh <file>... |
Snapshot files before modification |
scripts/validate.sh [category] |
Post-install validation |
All scripts assume POSIX shell, jq, and rg. They degrade gracefully if a tool is missing (print a clear message; don't crash the skill flow).
Anti-patterns to avoid
- Installing everything popular. Maintenance is a real cost; each added tool adds surface. Prefer 3 tools the user will actually use over 10 they won't.
- Assuming the agent. This repo may be used by Claude Code, Copilot, Codex, or all three. Detect, don't assume.
- Rewriting existing guidance wholesale. If
CLAUDE.md already exists and reflects deliberate choices, merge — never clobber.
- Silent destructive operations. Always announce file path + intent before writing.
- Skipping validation. A setup that "installed without errors" but doesn't work is worse than no setup.
- Overwhelming prompts. If you're asking more than ~5 questions in a batch, you haven't done enough curation.
1---2name: ai-dev-setup-23description: Bootstrap and optimize a repository for AI-assisted development. Analyzes the repo, detects existing AI tooling, researches and curates candidate artifacts (skills, prompts, agent instructions, SDD scaffolding, MCP servers, token/context optimizers like Serena/RTK, and agent/IDE integrations for Claude Code / Copilot / Codex), asks the user for approval on each meaningful decision, then installs, configures, and validates the chosen setup. Trigger this whenever the user wants to set up, bootstrap, harden, audit, upgrade, or "make this repo better for Claude / agents / Copilot / Codex" — including phrasings like "configure this project for AI", "install an MCP server here", "add Spec Kit", "add Serena", "add token optimization", "review our agentic setup", or "what AI tooling should this repo have". Also trigger when the user asks to discover or install reusable skills (skills.sh, find-skills) as part of a larger setup effort. Prefer this skill over ad-hoc installation even when the user names a single compone4---56# AI Dev Setup78Turn a repository into a tuned AI-assisted development environment — safely, modularly, and in a way the maintainer still owns.910Most repos either have nothing (greenfield, unopinionated) or a patchwork of agent files, MCP snippets, and half-configured tools. Both cases benefit from the same discipline: **look first, decide with the user, install small, validate, leave a record**. This skill is that discipline, plus a curated map of what to consider.1112## When to use1314- User asks to configure, bootstrap, or harden AI tooling in a repo.15- User names a specific component (Serena, RTK, Spec Kit, an MCP server, a skill) but the install should be done safely in the context of the whole setup.16- User wants an audit/recommendation pass without changes.17- User wants to discover reusable skills for this repo.1819## When NOT to use2021- Writing product code, fixing bugs, running tests — those are the work this skill is meant to make *easier*, not replace.22- Pure documentation authoring unrelated to agent context files.23- Single-file tweaks the user has already decided on (just do the edit).2425## Modes2627The skill operates in one of four modes. Ask the user which one if it's not obvious from the request.2829| Mode | When | Behavior |30|------|------|----------|31| **audit** | "review", "what's missing", "recommend" | Detect + research + report. **No writes.** |32| **bootstrap** | Greenfield or near-empty repo | Propose a full baseline; install only approved pieces. |33| **optimize** | Repo already has AI setup | Inventory, find gaps/overlap, propose targeted changes. |34| **selective** | User names a single category | Scope the flow to that category only (e.g. "add MCP"). |3536Default to **audit** when in doubt. It's the least destructive and naturally leads into the others.3738## Core workflow3940Execute these phases in order. Each phase has a clear exit condition — don't skip ahead.4142### Phase 1 — Detect4344Before recommending anything, understand what's already here. Read — don't write.4546Run `scripts/detect.sh` from the skill directory. It emits a JSON profile describing:47- project type, languages, package managers, test/build tools48- existing agent context files (`CLAUDE.md`, `AGENTS.md`, `.github/copilot-instructions.md`, `.cursorrules`, etc.)49- existing skills directories (`.claude/skills/`, `.agents/skills/`), skill-lock files50- existing MCP configs (`.mcp.json`, `.vscode/mcp.json`, `~/.codex/config.toml` if readable)51- token-optimization tooling signals (Serena config at `.serena/`, RTK in PATH, Caveman, etc.)52- SDD signals (`.specify/`, spec/plan/task files)53- hooks, settings, permissions (`.claude/settings.json`, `.claude/settings.local.json`)54- git state (branch, remote, clean/dirty)5556If the script is unavailable or fails, fall back to an inline checklist — see [references/detection.md](references/detection.md). That reference also explains how to interpret the signals (e.g. "a skill-lock.json + symlinked skills dir means a skill registry tool is managing them — do not hand-install skills there").5758**Exit condition:** you can state, in 3–5 bullets, what this repo already has and where the gaps are.5960### Phase 2 — Decide the scope6162Given the detection report, propose a mode and a shortlist of categories to consider. Present it to the user concisely:6364```65Detected: <1-line summary>66Already configured: <list>67Gaps/opportunities: <list>6869Proposed mode: <audit | bootstrap | optimize | selective>70Categories I'd consider: [AI artifacts, SDD, MCP, token optimization, agent/IDE integration]71Out of scope for now: <anything you're deferring and why>7273OK to proceed, or adjust?74```7576Wait for confirmation before doing any research or writes. Scope drift is the #1 failure mode of setup skills.7778### Phase 3 — Research & curate7980For each in-scope category, consult the category-specific reference under [references/categories/](references/categories/). Each reference lists well-known candidates, fit criteria, compatibility notes, and install sketches:8182- [references/categories/ai-artifacts.md](references/categories/ai-artifacts.md) — agent instructions, prompts, skills, memory83- [references/categories/sdd.md](references/categories/sdd.md) — Spec Kit and alternatives84- [references/categories/mcp.md](references/categories/mcp.md) — MCP servers85- [references/categories/token-optimization.md](references/categories/token-optimization.md) — Serena, RTK, Caveman, Serena Slim86- [references/categories/agent-ide.md](references/categories/agent-ide.md) — Claude Code, Copilot, Codex, Cursor, etc.8788When skill installation is on the table, follow [references/skill-discovery.md](references/skill-discovery.md). That reference requires consulting **skills.sh** and/or installing/using **find-skills** before shortlisting.8990Apply the decision framework in [references/decision-framework.md](references/decision-framework.md) to avoid tool overload. High-leverage over maximal — every tool is maintenance.9192Cross-check candidates against [references/compatibility.md](references/compatibility.md) before proposing. Some combinations conflict (e.g. two hook frameworks racing, two MCP servers offering the same capability) and must be flagged.9394**Exit condition:** for each in-scope category you have 1–3 recommended candidates + clear reasons. No blind "install everything popular."9596### Phase 4 — Present decisions and get approval9798Decisions must be *presented*, not assumed. Use the pattern in [references/interaction.md](references/interaction.md). Skeleton:99100```101Decision <N>: <one-line decision title>102Why it matters: <one sentence>103104 Option A — Recommended: <tool/approach>105 Best fit because: <reason tied to this repo>106 Tradeoffs: <honest cost>107108 Option B: <alternative>109 Best fit if: <different priority>110 Tradeoffs: ...111112 Option C: <do nothing / defer>113 Best fit if: <e.g. too early>114115Your call?116```117118Batch related decisions but cap at ~5 at a time — cognitive load matters. For `audit` mode, stop here and produce a written recommendation document instead of asking for decisions.119120### Phase 5 — Install, configure, validate121122Only after explicit approval. Follow [references/install-playbook.md](references/install-playbook.md). Hard rules:1231241. **Back up first.** `scripts/backup.sh` snapshots touched files into a tarball under `.ai-dev-setup/backups/<timestamp>/`. Run it before any write.1252. **Idempotent writes.** Prefer merging into existing files (e.g. appending an MCP server to `.mcp.json`) over full rewrites. If you must rewrite, diff-preview first.1263. **No silent overwrites.** If a target file exists and your change isn't purely additive, show the diff and ask.1274. **Log the change.** Append an entry to `.ai-dev-setup/changelog.md` with what, why, which backup.1285. **Validate.** Run `scripts/validate.sh` (or the category-specific validator). For MCP: attempt the listed tools work. For skills: the skill shows up in the expected location. For Serena: the hook fires.1296. **Surface rollback.** Tell the user the exact command to undo (`tar -xf <backup> -C /`).130131**Exit condition:** validation passes, or you've surfaced a real failure with a clear next step. Never report success without running the validator.132133### Phase 6 — Report134135One concise report at the end:136137- What was installed/changed (file-by-file, with backup locations).138- What was deliberately *not* installed, and why (so the user can revisit later).139- Suggested next steps (e.g. "run `rtk gh auth login` once before using the GitHub MCP").140- How to roll back.141142## Skill discovery143144Any time the in-scope work includes *installing reusable skills*, you MUST perform active skill discovery before recommending anything. Read and follow [references/skill-discovery.md](references/skill-discovery.md). Summary:1451461. Check if `find-skills` is installed locally. If yes, use it.1472. Otherwise, consult **skills.sh** (https://skills.sh/) as a web source.1483. Offer to install `find-skills` as a durable helper if the user will likely do this again.1494. Curate — do not dump — shortlisted candidates. Flag overlap with installed skills (read the detection inventory).1505. Get explicit approval per-skill before install.151152Do not invent skill names. If you can't confirm a skill exists on skills.sh or in a known index, say so rather than guessing.153154## Safety constraints155156- Never modify `~/.claude/settings.json` or other *user-global* config without explicit, specific approval. Prefer project-local scopes (`.claude/settings.json`, `.mcp.json`).157- Never commit secrets. GitHub tokens, API keys, etc. go in `.env` (git-ignored) and are referenced by env var in configs.158- If the git tree is dirty, warn the user and offer to stash or create a dedicated branch before writing.159- If the skill detects an active skill-registry tool (e.g. a `skills-lock.json`), do not hand-install into the managed skills directory — use the registry tool's own install path, or tell the user.160- On destructive prompts (overwrites, deletes), require explicit confirmation with the file path echoed back.161162## Reference index163164| Topic | File |165|------|------|166| Detection signals & fallback checklist | [references/detection.md](references/detection.md) |167| Decision framework (when to install vs. defer) | [references/decision-framework.md](references/decision-framework.md) |168| How to present options to the user | [references/interaction.md](references/interaction.md) |169| Skill discovery (skills.sh, find-skills) | [references/skill-discovery.md](references/skill-discovery.md) |170| Tool compatibility & conflicts | [references/compatibility.md](references/compatibility.md) |171| Install / configure / validate / rollback | [references/install-playbook.md](references/install-playbook.md) |172| Category: AI artifacts | [references/categories/ai-artifacts.md](references/categories/ai-artifacts.md) |173| Category: SDD | [references/categories/sdd.md](references/categories/sdd.md) |174| Category: MCP | [references/categories/mcp.md](references/categories/mcp.md) |175| Category: Token optimization | [references/categories/token-optimization.md](references/categories/token-optimization.md) |176| Category: Agent/IDE integration | [references/categories/agent-ide.md](references/categories/agent-ide.md) |177| Known-tool registry (machine-readable) | [assets/manifests/registry.json](assets/manifests/registry.json) |178| Templates | [assets/templates/](assets/templates/) |179180## Scripts181182| Script | Purpose |183|--------|---------|184| `scripts/detect.sh` | Emit repo profile JSON to stdout |185| `scripts/backup.sh <file>...` | Snapshot files before modification |186| `scripts/validate.sh [category]` | Post-install validation |187188All scripts assume POSIX shell, `jq`, and `rg`. They degrade gracefully if a tool is missing (print a clear message; don't crash the skill flow).189190## Anti-patterns to avoid191192- **Installing everything popular.** Maintenance is a real cost; each added tool adds surface. Prefer 3 tools the user will actually use over 10 they won't.193- **Assuming the agent.** This repo may be used by Claude Code, Copilot, Codex, or all three. Detect, don't assume.194- **Rewriting existing guidance wholesale.** If `CLAUDE.md` already exists and reflects deliberate choices, merge — never clobber.195- **Silent destructive operations.** Always announce file path + intent before writing.196- **Skipping validation.** A setup that "installed without errors" but doesn't work is worse than no setup.197- **Overwhelming prompts.** If you're asking more than ~5 questions in a batch, you haven't done enough curation.