agentleFS
BostonOrangeBostonOrange/claude-code-framework/skills/setup/SKILL.md

setup

Skill2 starsChanged 6 months agoMITView on GitHub

First-time onboarding — orchestrates project-setup-detector and project-setup-applier across a confirm checkpoint. Distinct from /improve (ongoing evolution); /setup owns the first-run shape decisions

193 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use add-slack, add-parallel and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    add-slack

    Add Slack channel integration via Chat SDK.

    Also in 6 projects that use this

  • MicrosoftSkill

    add-parallel

    Also in 5 projects that use this

  • sskarzSkill

    add-telegram-swarm

    Add Agent Swarm (Teams) support to Telegram. Each subagent gets its own bot identity in the group. Requires Telegram channel to be set up first (use /add-telegram). Triggers on "agent swarm", "agent teams telegram", "telegram swarm", "bot pool".

    Also in 5 projects that use this

  • +9 more from microsoft

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 4 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 171 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read .claude/state/setup-proposal.md and surface a condensed view to the user.

    line 42
  2. Distinctive:

    Wait for user reply. Common shapes:

    line 81
  3. Very specific:

    Working-tree dirty?: If the detector's ## Pre-apply checks block reported uncommitted changes to CLAUDE.md or any .claude/ file in the …

    line 86
  4. Very specific:

    If the user replies apply on dirty, set Apply on dirty: yes in the proposal's ## Pre-apply checks block before continuing to Phase 4.

    line 90
  5. Very specific:

    If --dry-run, stop here and remove .claude/state/setup.lock so the next /setup is unblocked.

    line 94
  6. Distinctive:

    After the applier returns:

    line 113
  7. Distinctive:

    Run the smoke check yourself (don't trust the agent's report alone):

    line 115
  8. Very specific:

    All under .claude/state/ (the applier ensures .gitignore covers it).

    line 140
  9. Distinctive:

    If you're onboarding a sensitive repo, verify in your transcript that no network commands were run.

    line 146

“Common” is measured: kept by at least 6 in 10 of the 171 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Setup — First-Time Onboarding

setup.sh puts the framework files on disk. /setup makes them fit your project.

The bash installer can only ask the eight questions it was built around. /setup walks 17 layers — language, framework, build, test, type-check, format/lint, persistence, API style, frontend, design system, monorepo, observability, infra, CI/CD, tracker, notification, branch — and uses what's actually in the repo to pre-fill answers. For each layer it can't auto-answer, it shows the options, the tradeoffs, and a recommended default. You pick "default" or pick differently — no research required.

Lifecycle vs /improve: /setup decides shape (first run, or re-baseline). /improve keeps shape in tune as the project grows. They don't overlap — framework-improver-detector reads the ## Layers owned by /setup block in setup-applied.md to build a skip-list at proposal time, and framework-improver-applier re-validates that skip-list at apply time, halting if anything escaped detection.

Usage

/setup                    full onboarding pass; detect → propose → confirm → apply
/setup --refresh          re-run all 17 layers using existing values as the baseline
/setup --layer=<name>     re-run a single layer (e.g., /setup --layer=ci-cd)
/setup --dry-run          detect + propose only; do not apply even after confirmation

Layer names: language, framework, build, test, type-check, format-lint, persistence, api-style, frontend, design-system, monorepo, observability, infra, ci-cd, tracker, notification, branch.

Process

Phase 1: Detect (read-only)

Spawn project-setup-detector:

Run your full process. Inventory the repo, classify greenfield vs brownfield,
walk the 17 layers, and write the proposal to .claude/state/setup-proposal.md
following the schema in your Phase 4. Do not apply changes — you don't have
Edit/Write tools. End with the surface summary.

The detector is read-only by tool restriction (no Edit/Write). It writes only .claude/state/setup-proposal.md (creating .claude/state/ via mkdir -p if missing).

Phase 2: Present Proposal

Read .claude/state/setup-proposal.md and surface a condensed view to the user. Always include both a confirmation prompt for detected values (per finding #9 — even brownfield silently auto-accepts is wrong) and explicit asks for needs-decision layers.

## Setup Proposal

**Mode:** brownfield (Next.js 15 + Postgres detected)
**Backup target:** `.claude/state/setup-backup-<timestamp>/` (created on apply)

### Detected (confirm these are right)
- Language: TypeScript
- Framework: Next.js 15 App Router
- Build: pnpm
- Test: vitest
- Type check: tsc --noEmit
- Format/Lint: eslint + prettier
- Persistence: Drizzle ORM
- API style: REST (Next.js route handlers)
- Frontend: React 18
- Design system: Tailwind + shadcn/ui
- Monorepo: single-repo
- Observability: Sentry
- Infra: Vercel (vercel.json — overrides framework default? no, matches)
- CI/CD: GitHub Actions
- Branch: main

### Conflicts (must resolve)
1. Layer 7 (Persistence) — detection says Drizzle, existing CLAUDE.md mentions Prisma. Pick one.

### Open questions (no detection)
1. Tracker — Azure DevOps / Jira / Linear / GitHub Issues / None?
2. Notification — Slack / Teams / Discord / None?

Reply: "use detected values + Linear + Slack + drop Prisma" — or layer-by-layer.

Greenfield mode looks similar but each layer presents 2–4 options with one-sentence tradeoffs, and the proposal ends with bootstrap commands the user runs themselves.

Phase 3: Collect Decisions

Wait for user reply. Common shapes:

  • "use detected" — every detected/needs-confirmation layer takes its detected value; open questions still need answers.
  • "use detected + <answer1> + <answer2>" — detected plus answers to open questions.
  • Layer-by-layer — explicit choice per layer.

Working-tree dirty? If the detector's ## Pre-apply checks block reported uncommitted changes to CLAUDE.md or any .claude/ file in the affected set, surface that to the user explicitly:

"Working tree has uncommitted changes to <files>. The applier will halt unless you opt in. Reply apply on dirty to set the override (your unstaged work in those files will be backed up but the apply will run on top of it). Otherwise commit/stash first and re-run /setup."

If the user replies apply on dirty, set Apply on dirty: yes in the proposal's ## Pre-apply checks block before continuing to Phase 4.

Update .claude/state/setup-proposal.md in place with the resolved values under the existing ## Confirmed by user section. The schema for that section — required columns, valid Source of decision values, and which Status values must appear — is in docs/setup-state-schema.md. Every layer with Status: detected, needs-confirmation, or needs-decision must appear in ## Confirmed by user. Anything else fails the applier's gate 2.

If --dry-run, stop here and remove .claude/state/setup.lock so the next /setup is unblocked. Print the path to setup-proposal.md for inspection.

On user abort during this phase (user explicitly cancels, or the skill is interrupted): remove .claude/state/setup.lock. The proposal stays on disk; the next /setup will resume from it.

Phase 4: Apply

Spawn project-setup-applier:

--apply mode. Read .claude/state/setup-proposal.md (with the populated `## Confirmed by user` section).
Run all 6 pre-apply gates per project-setup-applier.md. On success, snapshot to
.claude/state/setup-backup-<ts>/, ensure .gitignore, apply substitutions, smoke-check,
write .claude/state/setup-applied.md, release the lock.

Gates and behavior are specified in project-setup-applier.md. The applier owns the spec; do not duplicate gate logic here.

Phase 5: Verify

After the applier returns:

  1. Run the smoke check yourself (don't trust the agent's report alone):
    grep -r '{{' CLAUDE.md .claude/ 2>/dev/null | grep -vE '\.claude/(state|backup)/' | head -20
  2. Confirm .claude/state/setup-applied.md exists and lists files changed.
  3. Confirm the backup directory exists (ls .claude/state/setup-backup-*/).
  4. Show the user:
    • Which files changed
    • Backup location (rollback path if anything is wrong)
    • Which placeholders were intentionally left unfilled (e.g., backend-only keeps {{DESIGN_*}})
    • The next recommended action

Phase 6: Hand-off

  • Brownfield: "Run /develop TICKET-123 to try the dev cycle, or /team review to validate the framework picked up your conventions."
  • Greenfield: "Run the bootstrap command listed in .claude/state/setup-proposal.md (under ## Bootstrap commands). After your first commit, /improve will keep things in sync as conventions emerge."

State Files

FileOwnerLifecycle
.claude/state/setup-proposal.mdproject-setup-detector (Phase 1); skill updates ## Confirmed by user (Phase 3)Append-only audit
.claude/state/setup-applied.mdproject-setup-applier (Phase 4)Append-only; framework-improver-detector and framework-improver-applier both read ## Layers owned by /setup
.claude/state/setup-backup-<ts>/project-setup-applier (Phase 4 step 1)Created every apply; rollback path

All under .claude/state/ (the applier ensures .gitignore covers it).

Network Boundary (honest version)

Both the detector and applier are instructed not to make network calls — no npm view, no gh api, no curl/wget/registry queries. The framework's guardrails.sh does not enforce this at the harness level (it blocks destructive ops, not network egress). The agents' tool-list does not include MCP servers that reach the network.

If you're onboarding a sensitive repo, verify in your transcript that no network commands were run. The "local-only" property is a contract maintained by the agents' instructions and docs/project-detection.md's "what NOT to run" list — treat it as that, not a sandbox guarantee.

When to Use /setup vs /improve

SituationUse
Just ran setup.sh for the first time/setup
Re-onboarding after a major stack change (e.g., switched ORMs, migrated framework)/setup --refresh
One layer is wrong (e.g., switched npm → pnpm)/setup --layer=build
Convention drift after weeks of development/improve
Filling specific {{...}} placeholders that ended up unset/improve claude-md
Adding new rule patterns based on actual file structure/improve rules

Edge Cases

ScenarioBehavior
.claude/state/setup-applied.md already existsTell user setup was already run; offer --refresh
## Confirmed by user not populated when applier runsApplier halts at gate 2 — return to Phase 3
Conflict unresolved when applier runsApplier halts at gate 3 — surface the conflict, ask user to pick
Working tree has uncommitted CLAUDE.md changesApplier halts at gate 4 — tell user to commit/stash
Apply pass leaves unexpected {{...}}Applier halts before writing apply log; backup is intact; user can re-run after fix
User aborts during Phase 3Proposal stays on disk; next /setup continues from it
Detector ran but no proposal was writtenSkill detects empty .claude/state/setup-proposal.md and re-spawns detector
Apply succeeds but user wants to revertcp -r .claude/state/setup-backup-<ts>/CLAUDE.md ./ and similar for .claude/ files

Related

  • project-setup-detector agent — runs Phase 1, produces the proposal (read-only by tool removal)
  • project-setup-applier agent — runs Phase 4, applies with backup + allowlist + audit log
  • docs/project-detection.md — shared detection bash (used by project-setup-detector + framework-improver-detector)
  • /improve — ongoing evolution; reads setup-applied.md to respect /setup's decisions
  • framework-improver-detector + framework-improver-applier agents — what /improve spawns (detect → apply pipeline)
  • setup.sh / setup.ps1 — bash/PowerShell installers; /setup refines what they generated

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.