From dmons
Scaffold the OpenSpec Apply Workflow into the current repo — generate a tailored orchestrator CLAUDE.md plus `worker` and `reviewer` subagents by auditing the repo's openspec specs and changes. Use when the user wants to "set up the openspec agents", "add the worker/reviewer agents", "scaffold the OpenSpec workflow", "bootstrap CLAUDE.md for openspec", or onboard a new repo to the section-by-section apply workflow.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dmons:scaffoldThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate three repo-local files, each tailored to the current project by auditing its OpenSpec specs and
Generate three repo-local files, each tailored to the current project by auditing its OpenSpec specs and changes:
CLAUDE.md — the orchestrator instructions (project header + the authoritative OpenSpec Apply Workflow)..claude/agents/worker.md — the implementer subagent..claude/agents/reviewer.md — the auditor subagent.The skill does not install OpenSpec, the /opsx:* commands, or the openspec-* skills — those come
from the openspec CLI (openspec init). It only produces the orchestration layer that wraps them.
The templates live at ${CLAUDE_PLUGIN_ROOT}/skills/scaffold/templates/ — CLAUDE.md.template,
worker.md.template, reviewer.md.template. They are annotated skeletons with {{PLACEHOLDER}} slots
and <!-- guidance --> comments. Your job is to fill every slot from the audit and delete every
guidance comment before writing the final files.
Run a quick check (use context-mode or plain ls/test, keep output small):
openspec/ exists in the repo root. If not: stop and tell the user this repo isn't OpenSpec-managed
yet — they should run openspec init first.openspec/changes/ (excluding archive/). If there are none,
warn that the generated agents will be thin on binding decisions, and ask whether to proceed using
only archived changes / openspec/project.md, or stop.openspec/specs/ has committed capability specs.Gather the facts that fill the templates. Prefer openspec commands and targeted reads; keep large
output in context-mode.
Project identity & decisions
openspec/project.md (if present) — the one-paragraph "what this project is", tech stack, conventions.openspec/changes/<slug>/proposal.md and design.md ## Decisions.
These are the binding constraints the agents must enforce.openspec/changes/archive/ — skim recent ones for additional load-bearing
decisions and the domain's real hazards.docs/adrs/ADR-*.md (or similar) exist? Is there a coding-agent-brief.md or equivalent
vision doc? If so, those are also binding context; if not, the binding decisions live only in each
change's design.md.Build system & gates — detect, don't assume:
Makefile → make build / make test (read the targets to confirm).*.slnx / *.csproj / *.sln → dotnet build / dotnet test; check for a dotnet format /
analyzers / TreatWarningsAsErrors policy (a format gate).package.json → the project's build / test / lint scripts.Cargo.toml → cargo build / cargo test / cargo clippy / cargo fmt --check.pyproject.toml → the test runner + linter/formatter (pytest, ruff, etc.).Tooling signals
graphify-out/graph.json present? → include the graphify tool lines in the agents.Language & domain
{{LANG}} slot).OpenSpec tasks.md groups tasks under ## N. headings. Repos call this unit either a "section" or a
"group". Look at how the existing tasks.md / design.md refer to it and match that. Default to
"section" if there's no signal. This term fills every {{UNIT}} slot consistently across all three
files.
You will rarely have every fact. Use the AskUserQuestion tool to confirm only what you genuinely can't infer — typically:
project.md is absent or vague);Prefer making reasonable, clearly-stated decisions over interrogating the user. Don't ask about things you can read.
For each template:
${CLAUDE_PLUGIN_ROOT}/skills/scaffold/templates/<file>.template.{{PLACEHOLDER}} with the audited content. Keep the prose voice of the template —
blunt, specific, imperative.<!-- ... --> comment, including the header block. The final files must contain no
template scaffolding.Key slots and where they come from:
| Slot | Source |
|---|---|
{{PROJECT_NAME}}, {{PROJECT_DESCRIPTION}}, {{PROJECT_DESCRIPTION_SHORT}} | project.md, specs |
{{TECH_STACK}}, {{ENGINEER_STRENGTHS}}, {{LANG}}, {{LANG_IDIOMS}}, {{STYLE_BULLETS}} | detected language + conventions |
{{UNIT}} | Step 3 (section/group) |
{{BUILD_CMD}}, {{TEST_CMD}}, {{GATE_LIST}}, format lines | detected build system |
{{BINDING_DECISIONS}}, {{DECISIONS_HEADING}}, {{DECISIONS_NOUN}} | change design.md ## Decisions + ADRs |
{{ADR_CONTEXT_LINES}}, {{ADR_STOP_CLAUSE}}, {{COMPLIANCE_NOUN}} | whether ADRs exist (ADRs → "ADR"; else "design-decision") |
{{DOMAIN_HAZARDS}}, {{DOMAIN_HAZARDS_HEADING}}, {{DOMAIN_QUALITY}} | project type + specs |
{{HITL_EXAMPLES}} | the change's human-verification tasks (real-terminal behaviour, interactive prompts, etc.) |
{{WORKER_DESCRIPTION}}, {{REVIEWER_DESCRIPTION}} | compose: role + project + tech + task areas + handoff |
{{GRAPHIFY_TOOL_LINE}} | present only if graphify-out/ exists |
{{COAUTHOR_LINE}} | the repo's existing commit convention, e.g. Co-Authored-By: Claude <[email protected]> (check git log) |
When ADRs do not exist, set {{COMPLIANCE_NOUN}} → "design-decision", {{DECISIONS_NOUN}} →
"binding design decisions", {{DECISIONS_NOUN_SINGULAR}} → "binding design decision", and make
{{ADR_CONTEXT_LINES}}/{{ADR_STOP_CLAUSE}} state that decisions live in the change's design.md.
When ADRs exist, use "ADR" wording and list the ADR files as binding context.
For each of CLAUDE.md, .claude/agents/worker.md, .claude/agents/reviewer.md:
.claude/agents/ if needed).CLAUDE.md often
has project content worth preserving — prefer merging the OpenSpec Apply Workflow section in over
replacing the whole file.Summarise: which files were written/skipped, the unit term chosen, the build/test gates wired in, and the
binding decisions the agents now enforce. Then tell the user the next step: run /opsx:apply (or
/opsx:propose to create a change first), and the orchestrator will delegate to the new worker /
reviewer agents.
design.md, and leave the decisions list lean.dotnet/make without confirming the repo actually uses it.Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub daemonicai/dmon-dev --plugin dmons