spec-setup
Skill2 starsChanged 6 days agoMITView on GitHub
One-time discovery that teaches the spec-driven-dev pipeline how THIS project works, and saves the answers to .spec-driven.yml — project layout (single repo, monorepo, or multiple repos), issue tracker, base branch, PR target, branch naming, commit style, and the lint/typecheck/test/ build/dev commands. Use when the user says "set up spec-driven", "configure the pipeline", "spec-setup", "change our branch rules", or when any other spec-* skill finds no .spec-driven.yml. Detects everything it can from the repos first and only asks about what is ambiguous. Writes config only — never changes code, branches, or commits.
- Reads credentials
In this repository7 other files it gives its agents.
- generative-seoSkill
- spec-checkpointSkill
- spec-createSkill
- spec-implementSkill
- spec-investigateSkill
- spec-shipSkill
- spec-verifySkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
Read, don't guess. Collect a draft of every field in references/config-template.yml:
- Very specific: line 42
Not inside a git repo, but sibling folders are git repos → candidate multi-repo.
- Very specific: line 62
Git, per repo: Default branch (git symbolic-ref refs/remotes/origin/HEAD or gh repo view --json defaultBranchRef).
- Very specific: line 72
Models per tier: Write the models: block from the template.
- Very specific: line 75
After approval: Ask whether an approved spec should stop after each stage (stop), or run implement → verify → checkpoint in one go …
- Distinctive: line 90
If the user says "just use the defaults", accept the detected values and the template defaults for the rest.
- Very specific: line 95
Write .spec-driven.yml using references/config-template.yml as the shape.
- Distinctive: line 98
If it's inside a repo, tell the user it's meant to be committed (so teammates get the same rules) — don't commit it yourself.
- Very specific: line 100
If npx is available, run npx -y @benjaminthomas/spec-driven-dev doctor from the config's folder.
- Distinctive: line 115
Never put secrets, tokens, or credentials in the config.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
spec-setup
Learn this project's rules once, save them, and let every other spec-* skill reuse them. Team
rules live in a config file the team can review and change — never in the skills themselves.
Where the config lives
.spec-driven.yml, found by walking up from the current directory (stop at the home folder). The
first one found wins.
| Layout | Put the file in | Share it? |
single | the repo root | Commit it — the whole team gets the same rules |
monorepo | the repo root | Commit it |
multi-repo | the shared parent folder of the repos (usually not itself a git repo) | Personal by default; offer to also commit a copy into the repo the team treats as "home" |
A multi-repo config only applies inside the repos it lists. If the current repo sits under that folder but isn't listed, treat it as having no config (ask whether to add it).
Step 1 — Detect before asking
Read, don't guess. Collect a draft of every field in references/config-template.yml:
- Layout.
- Inside a git repo with workspace markers (
pnpm-workspace.yaml,workspacesinpackage.json,turbo.json,nx.json,lerna.json,go.work,[workspace]inCargo.toml, severalapps/*/packages/*/services/*with their own manifests) →monorepo; list the packages. - Not inside a git repo, but sibling folders are git repos → candidate
multi-repo. Group them by remote owner (git remote get-url origin) and show the groups — the user picks which repos belong together. Never assume every folder in the parent belongs. Always also ask whether repos in other folders belong (e.g.~/clients/billing). Check each path is a git repo, and store paths inside the workspace as relative and paths outside it as absolute. - The repos of one workspace can live in unrelated places (
/Projects/frontend,~/Work/backend,/srv/database). Put the config in their shared parent folder, or in~/.spec-driven/<name>/when that parent would be the home folder or/. Then record it in~/.spec-driven/workspaces.json({"<config path>": ["<repo path>", …]}) so every repo can find it. - The user can override the detected layout. If they choose
multi-repofrom inside one repo, the workspace folder defaults to that repo's parent, with the current repo pre-selected. If they choosemonorepo, ask for the package folders. Never write amulti-repoconfig with no repos. - Otherwise →
single.
- Inside a git repo with workspace markers (
- Existing written rules.
CLAUDE.md,AGENTS.md,CONTRIBUTING.md, PR templates,.github/workflows. Anything stated there is a strong default — quote it back to the user. - Tracker. Ticket keys in recent branch names and commit subjects (
STP-123,#45,ENG-91), Jira/Linear links in PR templates or docs, whether GitHub Issues are enabled (gh repo view --json hasIssuesEnabled). - Git, per repo. Default branch (
git symbolic-ref refs/remotes/origin/HEADorgh repo view --json defaultBranchRef); integration branches (staging,develop,pre-prod); which branch recent PRs targeted (gh pr list --state merged --limit 20 --json baseRefName); the pattern of the last ~20 remote branch names; the commit style fromgit log -30 --format=%s. - Commands, per repo/package.
package.jsonscripts plus the lockfile's package manager,Makefile,pyproject.toml/tox.ini,Cargo.toml,go.mod,composer.json, CI workflow steps (CI is often the most truthful source). Dev URL from the dev script,.env.example, or framework defaults. - Models per tier. Write the
models:block from the template. Ask which models the user has for each tool they installed, only if they want to tune it: the Claude defaults (haiku / sonnet / opus) work as-is, anddefaultis safe for the rest. - After approval. Ask whether an approved spec should stop after each stage (
stop), or run implement → verify → checkpoint in one go (run-through), stopping at any failure and never pushing. Store it aspipeline.after_approval.
Step 2 — Confirm in one round
Show the draft as a short table grouped by layout, tracker, git, commands, and specs location. Mark each value detected (with where it came from) or guess. Then ask only about guesses and conflicts — in one message, not a drip of questions. Typical ones:
- "Your repos default to
master, but recent PRs targetedstaging. Cut work fromstaging?" - "Recent branches are bare ticket IDs (
STP-282). Keep that, or usefix/STP-282-short-slug?" - "These 6 repos share the
acmeGitHub org. Do they form one workspace for the pipeline?" - "Where should specs live — this folder's
specs/, or inside one repo so they go through PRs?"
If the user says "just use the defaults", accept the detected values and the template defaults for the rest.
Step 3 — Write and report
- Write
.spec-driven.ymlusingreferences/config-template.ymlas the shape. Keep its comments; drop fields that don't apply (e.g.repos:forsingle). Per-repo values only go underrepos:where they differ from the top level. - If it's inside a repo, tell the user it's meant to be committed (so teammates get the same rules) — don't commit it yourself.
- If
npxis available, runnpx -y @benjaminthomas/spec-driven-dev doctorfrom the config's folder. It checks that every branch, folder, andnpm runscript in the file really exists. Fix anything it reports before finishing. - Report: the file path, a one-line summary per section, and "re-run spec-setup any time these change".
Updating
Re-running spec-setup with an existing config: load it, re-detect, and show only what changed or
looks stale (a branch that no longer exists, a script that was renamed). Never silently overwrite
a value the user set by hand.
Boundaries
- Writes
.spec-driven.ymland nothing else. No branches, commits, pushes, installs, or code. - Never put secrets, tokens, or credentials in the config.
- A value in the config beats a detected value. If the config looks wrong mid-run (a base branch that doesn't exist), the other skills stop and point back here rather than overriding it.
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
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.

