Initializing codebase and spec-driven configuration for new project based on existing concept file
94
94%
Does it follow best practices?
Impact
95%
7.30xAverage score across 5 eval scenarios
Passed
No known issues
Initialize a fully configured, spec-driven project repository from a concept document (and optional architecture/datamodel docs) and a chosen tech stack.
The user MUST provide:
react-node, react-rust (see references/stacks/ for details).Optional:
~/dev/<project-name>).data-model change proposals and informs the OpenSpec config.{{ARCHITECTURE_SUMMARY}} in the OpenSpec config and informs the overall roadmap structure.If the user hasn't specified these, ask for them before proceeding.
For all input validation steps: if a required condition is not met (file missing, unreadable, invalid stack, etc.), stop immediately and report the specific error to the user. Do not attempt to continue with missing or invalid inputs.
react-node, react-rust. If not, list valid options and ask the user to choose.references/stacks/<stack>/README.md. If this file is missing, report that the stack reference files are not found and stop.mkdir -p <target-directory>
cd <target-directory>
git initIf git init fails due to an existing repo, prompt the user for confirmation before proceeding.
Read references/stacks/<stack>/README.md for the exact directory tree.
Create all directories listed in the structure. Create .gitkeep files in empty directories that need to be tracked (e.g., data/pglite/.gitkeep, crates/.gitkeep).
For each template file in references/stacks/<stack>/:
{{PLACEHOLDER}} values:
{{PROJECT_NAME}} — the project name (kebab-case){{PROJECT_DESCRIPTION}} — one-line descriptionAlso copy common files from references/common/:
mcp.json → .mcp.jsonAGENTS.md → AGENTS.mdIf any template file is missing, report which file is absent and stop — do not proceed with incomplete templates.
Read the OpenSpec config template at references/stacks/<stack>/openspec-config.yaml.
Replace placeholders:
{{PROJECT_NAME}} — project name{{PROJECT_DESCRIPTION}} — one-line description{{CONCEPT_SUMMARY}} — 2-3 sentence summary derived from the concept document{{ARCHITECTURE_SUMMARY}} — if an architecture document was provided, use its content directly; otherwise derive from the concept documentWrite to openspec/config.yaml.
Read the CLAUDE.md template at references/stacks/<stack>/CLAUDE.md.
Copy it to the project root as CLAUDE.md.
Run OpenSpec initialization to set up the project with agent tooling:
cd <target-directory>
openspec init --tools claude,antigravityThis creates the OpenSpec directory structure and installs agent instructions for Claude and Antigravity.
If the user requests support for additional AI tools, use --tools all instead (covers Cursor, Gemini, Codex, Windsurf, and others).
Verify success: Confirm the openspec/ directory was created. If openspec init fails, report the error output to the user and stop — subsequent steps depend on this directory.
Copy the concept document to openspec/concept.md.
If a datamodel document was provided, copy it to DATAMODEL.md in the project root (canonical schema reference, accessible to both the agent and the developer).
If an architecture document was provided, copy it to ARCHITECTURE.md in the project root.
Analyze all provided documents (concept, datamodel, architecture) and create openspec/roadmap.md based on the template at references/common/roadmap-template.md.
Derive from the input documents:
data-model change should reference specific tables and schemas from it- [ ] \change-name` — description`Based on all provided documents (concept, datamodel, architecture) and the roadmap, create OpenSpec changes for every change listed in the roadmap — across all phases, not just Phase 1.
For each change in the roadmap:
openspec new change "<change-name>"If openspec new change fails for any change, report the error and the change name, then ask the user whether to retry, skip, or abort. Do not silently continue with a missing change directory.
Then get the artifact instructions and create the proposal artifact:
openspec status --change "<change-name>" --json
openspec instructions proposal --change "<change-name>" --jsonRead the instructions JSON and create the proposal.md artifact for each change based on:
template field from instructions (use as structure)context and rules fields (apply as constraints, do NOT copy into the file)data-model and API-related changes, reference specific tables, columns, types, and relationshipsThe proposal.md for each change should follow this structure:
## Why
<Why this change is needed — derived from concept>
## What Changes
<Bullet list of what this change introduces>
## Capabilities
### New Capabilities
<List of new capabilities with short descriptions>
### Modified Capabilities
(none — for initial changes)
## Impact
<Tables, APIs, or infrastructure affected>Standard starting changes (Phase 1):
foundation — project structure, package configs, dev tooling, health check endpointdata-model — database schema, models, migrationsPhase 2 and beyond are derived entirely from the concept/architecture documents — each major feature or vertical slice becomes its own change. Every change in the roadmap MUST have a corresponding openspec/changes/<name>/ directory with a proposal.md; the roadmap and changes must match 1:1.
Create README.md with:
openspec/concept.md for full detailsopenspec/roadmap.md for implementation planCreate TESTING.md adapted to the stack, documenting:
git add -A
git commit -m "feat: initialize <project-name> with spec-driven configuration"Print a summary of what was created:
cd <target-directory>npm install / cargo build)openspec show foundation or use /opsx:apply foundationreferences/stacks/<stack>/README.md has the complete structure and template file list.foundation change, the user should be able to start the dev server and see something.proposal.md artifact. Specs, design, and tasks are created later during implementation via the openspec workflow (/opsx:new, /opsx:ff, /opsx:apply).