You are setting up a project to use RootSpec. Start by telling the developer what you're about to do:
"I'll set up RootSpec for this project — create the spec directory, copy the framework files, and configure prerequisites (dev server, test runner, etc.). This takes a minute or two."
Step 1: Scan the project
Understand what exists. Run these from the project root:
bash
bash "$(dirname "$0")/../rs-shared/scripts/scan-spec.sh" .
bash "$(dirname "$0")/../rs-shared/scripts/scan-project.sh" .
If these paths don't resolve, find the scripts by searching for
in the skills directory.
Based on the output, determine the situation:
- Fresh init — no , no directory. Most common case.
- Partial init — some files exist but others are missing (interrupted previous init).
- Re-init — exists. If the version is behind the bundled framework, suggest instead. Otherwise, ask the developer what they want to update. Do NOT overwrite existing spec files (01-05). You may update and to the latest bundled versions if the developer confirms.
- Already initialized — everything exists. Tell the developer and suggest instead.
Report what you found before proceeding.
Step 2: Create the spec directory and base files
Create whatever is missing:
- directory —
- — copy from the bundled version at
../rs-shared/00.AXIOMS.md
(relative to this skill's directory). Read the source file and write it to the project.
- — copy from
../rs-shared/00.FRAMEWORK.md
. Same approach.
rootspec/spec-status.json
:
json
{ "hash": null, "validatedAt": null, "valid": false, "version": "7.0.1" }
rootspec/tests-status.json
:
json
{ "lastRun": null, "stories": {} }
Step 3: Detect or create prerequisites
Run the detection script:
bash
bash "$(dirname "$0")/../rs-shared/scripts/detect-prerequisites.sh" .
The script outputs
,
,
,
lines with detected paths or
.
Read
../rs-shared/fragments/prerequisites.md
for the full reference on what each prerequisite is.
Report what was found. For missing prerequisites, tell the developer you'll create all templates and proceed unless they object:
"I'll create templates for [list missing]. These are lightweight and needed by
and
. Let me know if you'd rather skip any."
Then create them all. Do not present a menu of options or ask which ones to create — just create them. The developer can always delete what they don't want.
needs the dev server and validation script.
needs both. The pre-commit hook catches problems early. The release script is the only truly optional one, but it's cheap to create.
For each prerequisite:
- Found → confirm with developer, record the path
- Not found → create the template
- Skipped (only if developer explicitly asks) → record
Dev server template
When creating the dev server template:
- Copy the bundled template from
../rs-shared/scripts/dev.sh
to in the project. Make it executable. Read the source and write it — don't generate from scratch.
- Edit the variable at the top of the copied script to match the project's actual dev command (e.g., , , etc.).
- Add package.json scripts if exists — add , , and entries that delegate to :
json
"dev:start": "./scripts/dev.sh start",
"dev:stop": "./scripts/dev.sh stop",
"dev:restart": "./scripts/dev.sh restart"
If doesn't exist, tell the developer: "No package.json found — run first if you want convenience scripts."
- Update .gitignore — if exists, add and if not already present.
Cypress plugin setup
When creating the validation script template, also set up the RootSpec Cypress reporter:
- Copy the reporter from
../rs-shared/cypress/rootspec-reporter.ts
to cypress/support/rootspec-reporter.ts
in the project.
- Wire it into — if the config exists, add the hook with the reporter. If creating a new config, include it from the start. See
../rs-shared/fragments/prerequisites.md
for the exact wiring.
This plugin automatically updates
rootspec/tests-status.json
after every Cypress run — the agent doesn't need to parse results or call scripts.
Step 4: Write
Create (or update)
at the project root:
json
{
"version": "7.0.1",
"specDirectory": "rootspec",
"prerequisites": {
"devServer": null,
"preCommitHook": null,
"releaseScript": null,
"validationScript": null
}
}
Fill in prerequisite values with paths or commands discovered in Step 3.
Step 5: Verify and hand off
Run the verification script:
bash
bash "$(dirname "$0")/../rs-shared/scripts/verify-init.sh" .
If anything is reported missing, create it. Then report:
"Project initialized. Here's what was set up:
- [list files created]
- [list prerequisites configured or skipped]
Run
to create your specification."
Focus
If the developer passes an argument:
- → skip to whatever step is incomplete
- → only run Steps 3-4 (detect/create prerequisites, update .rootspec.json)
Scope
- CAN read: all project files
- CAN write: directory (including , ), , prerequisite templates (e.g., )
- SHOULD NOT write: application source code, existing test files