scaffold-init
Skill7 starsChanged 5 months agoMITView on GitHub
Initialize an AI-native development workspace with spec-driven workflow infrastructure. Use when starting a new project, setting up Claude Code on a codebase for the first time, or when the user says scaffold, initialize, set up AI workflow, onboard this repo, or similar. Do not use for adding an individual skill or config to an already- scaffolded project — that is handled by the relevant tier skill directly.
- Deletes or force-pushes
- Commits and pushes
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adr-workflowSkill
- analyzeSkill
- arch-reviewSkill
- bug-fixSkill
- clarifySkill
- code-healthSkill
- contractsSkill
- explainSkill
- independent-reviewSkill
- memory-syncSkill
- migrateSkill
- orientSkill
- pr-reviewSkill
- reframeSkill
- security-reviewSkill
- slice-landSkill
- spec-workflowSkill
- tdd-loopSkill
- vision-elicitationSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
If you're unsure, ask the user once before scaffolding.
- Very specific: line 29
Check if the target already has a scaffold.json or docs/specs/ — if so, the project is already scaffolded.
- Distinctive: line 44
Read the wizard's stdout summary and report back to the user.
- Distinctive: line 64
Ask each question in order.
- Very specific: line 82
NOT be installed — CI, cloud agents, or teammates without jig?
- Distinctive: line 98
After running, the target directory contains (plugin mode — the default):
- Very specific: line 128
Every scaffolded doc carries Status: Draft (wizard-generated).
- Distinctive: line 133
After scaffolding succeeds, tell the user:
- Very specific: line 144
Do not invoke this skill in a directory that is already scaffolded (has scaffold.json).
- Distinctive: line 145
Do not overwrite an existing CLAUDE.md without explicit user confirmation.
≈ “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 001 is fully implemented: greenfield-scaffold, doc-content, signal-detection, deferred-decisions, and Q&A wizard. See docs/specs/001-scaffold-init/spec.md.
What this skill does
Generates an AI-native development workspace by copying templates from
${CLAUDE_PLUGIN_ROOT}/templates/ into a target directory. Detects project
signals from the filesystem (LLM/agent files, CI, tests, team), runs an optional
Q&A flow to let the user override those signals, and selects tiers accordingly.
Tier 0 always installs; Tier 1 installs when test signals are present; Tier 2
is offered (not auto-installed) when LLM/agent signals are present.
How to use
- Determine the target directory. Default: the current working directory. If you're unsure, ask the user once before scaffolding.
- Check if the target already has a
scaffold.jsonordocs/specs/— if so, the project is already scaffolded. Stop and tell the user rather than overwriting. - Run the Q&A flow (see next section). Collect answers as flag values.
- Invoke the wizard with the collected flags:
With no machinery flag the wizard scaffolds plugin mode — the lean default (docs + primer only; jig runs from the installed plugin). Passpython3 "${CLAUDE_PLUGIN_ROOT}/skills/scaffold-init/scaffold.py" \ [--runtime <name>] [--team|--solo] [--has-ci|--no-ci] \ [--has-tests|--no-tests] [--plans-ai|--no-ai] \ [--in-repo] \ <target-dir>--in-repoonly when the sixth question is answered "yes". - Read the wizard's stdout summary and report back to the user. List the files that were created and the immediate next steps.
Codex custom-agent install
Codex scaffold mode (--host codex) writes project-local custom agents as
TOML under .codex/agents/. For Codex plugin users who want jig's role agents
globally available, run the explicit post-install helper:
python3 "${CLAUDE_PLUGIN_ROOT}/skills/scaffold-init/scaffold.py" --install-codex-agentsThe default destination is ~/.codex/agents. Use
--codex-agents-dir <dir> to target a different Codex agents directory.
The helper refuses to overwrite user-owned jig-*.toml files unless
--force is passed.
Q&A flow (slice 001-05)
Ask each question in order. Each question is independently skippable — if the user says "skip", "I don't know", "unsure", or similar, do not pass the flag (the wizard's filesystem inference handles it).
- Runtime/language — "What runtime or language is this project?
(e.g. Python, TypeScript, Go, Rust, mixed, unsure)"
→
--runtime <name>if answered; omit if skipped or unsure. - Team context — "Solo project or team setting?"
→
--teamfor team,--solofor solo; omit if skipped (uses git-author detection). - Existing CI — "Does the project already have CI configured?"
→
--has-cifor yes,--no-cifor no; omit if skipped. - Existing tests — "Does the project already have a test suite?"
→
--has-testsfor yes,--no-testsfor no; omit if skipped. This affects whether tier-1 (tdd-loopand friends) is auto-installed. - LLM/agent work planned — "Will this project involve LLM or agent development?"
→
--plans-aifor yes,--no-aifor no; omit if skipped. This affects whether tier-2 is offered. - Machinery vs. plugin — "Will this project ever run jig where the plugin may
NOT be installed — CI, cloud agents, or teammates without jig? (yes → copy
jig's machinery into the repo; no → use the installed plugin)"
→
--in-repofor yes; omit for no (plugin mode is the default). Skipping selects plugin mode. This is the one architectural question in the flow (it decides repo topology — what gets committed), so it won't appear in the project's own docs. Default to plugin mode (lean repo, jig updates flow from the plugin); choose--in-repoonly for the self-contained cases above. See ADR-0041.
Skipping every question is the legitimate "pure inference" mode (slice 001-03 behavior) — the wizard infers from filesystem signals alone, and defaults to plugin mode. Do not invent answers when the user is unsure.
Output
After running, the target directory contains (plugin mode — the default):
CLAUDE.md(with Hot Cache section, project name substituted)docs/(architecture, workflow, conventions, refinement-todo, inbox, memory/, specs/, decisions/).claude/hooks/(empty — project-specific gates can go here)- a project-scoped permissions file, on hosts that provide one — seeded with
the ADR-0013 destructive-command deny floor (
git push --force,git reset --hard,rm -rf). Hosts with no project-scoped permission surface get no such file and no deny floor. .gitignore(secret-ignore floor)scaffold.json(install-state manifest;scaffold_mode: "plugin-only")
For what your project actually received:
scaffold.jsonrecords the mode and host, and your host's own settings file (if it has one) carries the deny floor. (This section is deliberately host-neutral — it is machine-translated per host.)
In plugin mode jig's skills, agents, and hooks stay under the installed plugin
and run from the plugin root — no machinery is copied into the repo. The one
exception is the permissions file above: permissions.deny lives in the
project's own settings and no plugin mechanism can inject it, so the scaffold
writes it in both modes wherever the host supports it (ADR-0041 OQ1). It
carries no hook registrations.
The wizard's stdout summary states the mode and why.
With --in-repo, the target additionally gets a self-contained copy of jig's
skills, agents, hook scripts, and templates under the host's runtime directory,
plus the host's own hook-registration file (scaffold_mode: "in-repo"). Choose
it only for CI, cloud agents, or teammates without jig installed.
Every scaffolded doc carries Status: Draft (wizard-generated).
docs/memory/people.md is NOT created (solo-project default — team detection is slice 001-03).
Immediate next steps to surface to the user
After scaffolding succeeds, tell the user:
- Open
CLAUDE.mdand fill in the Hot Cache section with project-specific terms. - Open
docs/refinement-todo.mdto see what was deferred. - Your first spec will be
001— reserve it with/jig:spec-workflow new <slug>(or writedocs/specs/001-<feature>/spec.mdby hand). The scaffold seeds only the genesis worked example000-adopt-jig; there is no placeholder spec to replace. - Note:
docs/conventions.mdis now gated. Edits requireJIG_CONVENTIONS_APPROVED=1in the shell session.
Constraints
- Do not invoke this skill in a directory that is already scaffolded (has
scaffold.json). - Do not overwrite an existing
CLAUDE.mdwithout explicit user confirmation. - The wizard is deterministic — do not edit the generated files yourself before
reporting back. The user should see exactly what
scaffold.pyproduced.
Gotchas
- The spec-gate hook for
docs/conventions.mdactivates AFTER scaffold-init completes. It cannot gate its own creation (bootstrap paradox — documented and intentional). templates/CLAUDE.md.templateis the source template; do NOT use the jig repo's ownCLAUDE.mdas a template — the two diverge over time.${CLAUDE_PLUGIN_ROOT}is the right env var inside the plugin. Don't confuse it with$CLAUDE_PROJECT_DIR(which is the target project's root after install).- Signal detection (existing CI, LLM/agent files, team size) is deferred to slice 001-03. Until then, the wizard installs default tiers regardless of project context.
- scaffold-init refuses if the target looks spec-driven but lacks
scaffold.json. Slice 008-05 introduced a second pre-flight check: if ≥3 of the four migrate triggers (docs/specs//docs/slices/,docs/decisions//docs/adrs/,docs/workflow.md,docs/architecture.md) are present without ascaffold.json, the helper raisesLooksAlreadySpecDrivenError(exit 2) and points at/jig:migrate. Pass--forceto scaffold over the existing tree anyway (NOT recommended — overwrites docs).
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.

