Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Setup?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/alexander-tyagunov-setup)
---
name: setup
description: One-time workspace setup; .workspace/, .gitignore, CLAUDE.md, optional AGENTS.md and REVIEW.md. Run once per project.
allowed-tools: Read, AskUserQuestion, Bash(mkdir -p .workspace/shared/decisions .workspace/shared/specs .workspace/shared/plans .workspace/shared/research .workspace/shared/postmortems), Bash(mkdir -p .workspace/local), Edit(./.workspace/**), Edit(./.gitignore), Edit(./CLAUDE.md), Edit(./AGENTS.md), Edit(./REVIEW.md), Edit(./.claude/skills/verify/SKILL.md), Edit(./.claude/skills/simplify/SKILL.md), Edit(~/.claude/plugins/data/magician-*/workspace-strategy.json), Bash(git add .workspace/shared/ CLAUDE.md .gitignore), Bash(git add AGENTS.md), Bash(git add REVIEW.md), Bash(git add .claude/skills/verify/SKILL.md), Bash(git add .claude/skills/simplify/SKILL.md), Bash(git commit -m *)
disable-model-invocation: true
---
# /setup — Workspace Initialization
## When to use
Once per project, on request: create `.workspace/`, update `.gitignore`, write a lean `CLAUDE.md`, and optionally `AGENTS.md`, `REVIEW.md` and project verify/simplify skills, with MCP and permission suggestions only (it writes no settings). Not for a project that already has a `.workspace/`.
## What Gets Created
`.workspace/shared/` (committed in Shared mode): `context.md`, `roadmap.md`, and `decisions/`, `specs/`, `plans/`, `research/`, `postmortems/`. `.workspace/local/` (always gitignored): `prefs.md` and per-machine session state.
`/setup` never edits Claude Code settings files (`.claude/settings*.json` or `~/.claude/settings.json`) and never changes the permission mode. Permission rules and MCP servers are only printed in chat (steps 7 and 8).
## Autonomy
Gates: the setup choices, in one batched call. Everything else runs without asking.
## Process
### 1. Setup choices: one call
First look, without asking: the stack, and which of `CLAUDE.md`, `AGENTS.md`, `REVIEW.md`, `.claude/skills/verify/` and `.claude/skills/simplify/` exist. If `${CLAUDE_PLUGIN_DATA}/workspace-strategy.json` exists (step 10 of an earlier run), Read it.
Say in one line what you found ("Node + React; `CLAUDE.md` exists; no `REVIEW.md`"). Then make ONE `AskUserQuestion` call with the questions in [`references/setup-questions.md`](references/setup-questions.md): workspace mode, instructions file, review setup, optional extras. Leave out a question the repository already answers, as that reference says. The first option of each question is the recommended one.
**Wait for the reply before creating any directory or file.** Then run steps 2 to 11 without another question.
### 2. Create Directory Structure
```bash
mkdir -p .workspace/shared/decisions .workspace/shared/specs .workspace/shared/plans .workspace/shared/research .workspace/shared/postmortems
mkdir -p .workspace/local
```
### 3. Configure .gitignore
Append to .gitignore (or create it):
```
# Magician workspace (local machine only)
.workspace/local/
```
If private mode: `.workspace/` instead.
### 4. Create Initial Files
Write `.workspace/shared/context.md`, `.workspace/shared/roadmap.md` and `.workspace/local/prefs.md` from [`references/file-templates.md`](references/file-templates.md#step-4-initial-workspace-files). Fill the stack and archetype from the detected stack.
### 5. Minimal CLAUDE.md (and optional AGENTS.md)
If no `CLAUDE.md` exists, create a lean one:
```markdown
# Project Rules
(Add earned rules here — only what Claude consistently gets wrong.)
```
Do not write generic best practices. `CLAUDE.md` should only contain rules specific to this project.
Codex and other agents read `AGENTS.md`. Claude Code reads it through the `@AGENTS.md` import, so the commands are in one file. If the reply chose the `AGENTS.md` option, or `AGENTS.md` already exists:
- If `AGENTS.md` does not exist, write it from [`references/agents-md-template.md`](references/agents-md-template.md) (everything below its marker line, 40 lines or fewer). Fill the commands from the detected stack. If `AGENTS.md` exists, never overwrite it.
- Make `@AGENTS.md` the first line of `CLAUDE.md`, above `# Project Rules`. If `CLAUDE.md` exists and has no `@AGENTS.md` line, add only that line at the top and change nothing else.
### 6. Review setup (REVIEW.md and pre-commit skills)
Skip every write below that the reply did not select.
**`REVIEW.md`**: write it as [`references/file-templates.md`](references/file-templates.md#step-6-reviewmd) says, if the file does not exist. `/critique` reads it before every review.
**`.claude/skills/verify/SKILL.md`** and **`.claude/skills/simplify/SKILL.md`**: since Claude Code 2.1.286, a non-bundled skill named `verify` or `simplify` that Claude may invoke runs before each commit. Write each selected delegator exactly as [`references/file-templates.md`](references/file-templates.md#step-6-pre-commit-skills) gives it, if the file does not exist. It must stay model-invocable (no `disable-model-invocation`), or the pre-commit run does not happen. Then tell the user the two notes in that reference.
### 7. Permission Suggestions (printed, never written)
Print the list in [`references/setup-questions.md`](references/setup-questions.md#permission-suggestions-step-7): narrow allow rules for this stack's own test, lint and build commands, and `permissions.deny` Read rules for credential paths. The destructive guard screens shell readers only; a deny rule also covers the Read tool. The user adds what they want with `/permissions`. Do not ask whether to show it.
### 8. MCP Suggestions
Print, in the same message, the MCP servers that fit the detected archetype:
- web: browser automation MCP for UI testing
- data: notebook MCP for Jupyter integration
- devops: cloud provider CLI MCPs
State the tool budget: tool choice degrades above about 30–50 tool definitions ([`lore/skill-authoring.md`](../../lore/skill-authoring.md#tool-budget)). Suggest deferred loading (ToolSearch) for a rarely used server. `/setup` installs no server: point to its install instructions (a `/plugin` entry or the `claude mcp add …` command) for the user to run.
### 9. Optional extras
For each extra the reply selected, follow [`references/optional-setup.md`](references/optional-setup.md): a one-paragraph `.workspace/shared/north-star.md`, a production-gate hook template at `.workspace/shared/hooks/production-gate.sh` (never installed), or cost-attribution hints in chat.
### 10. Save Strategy
Record the workspace mode in `${CLAUDE_PLUGIN_DATA}/workspace-strategy.json`, the magician plugin data folder. Step 1 of a later run reads it. No hook reads it. Read the file first if it exists, then write it with exactly one of:
- Shared mode (only `.workspace/local/` is gitignored): `{"mode": "shared", "ignored": "false"}`
- Private mode (the whole `.workspace/` is gitignored): `{"mode": "private", "ignored": "true"}`
### 11. Commit (if shared mode)
```bash
git add .workspace/shared/ CLAUDE.md .gitignore
git add AGENTS.md
git add REVIEW.md
git add .claude/skills/verify/SKILL.md
git add .claude/skills/simplify/SKILL.md
git commit -m "chore: initialize magician workspace"
```
The first line also stages the step 9 files. Run the other lines only for files steps 5 and 6 wrote. Each is a separate exact command, so a skipped file never breaks the staging.
## Obstacles
This is a terminal, user-facing skill. It reports to the human directly, not upward to an orchestrator, so it emits no upward Obstacles block. Surface any blocker in prose to the user and stop.
See [`lore/obstacles.md`](../../lore/obstacles.md).
## Completion Signal
"Setup complete. Workspace initialized in <mode> mode. Wrote: <files>. Skipped (already there): <files>. Committed: <sha | no, private mode>."