You are helping the user create or modify main spec files under
directly, without going through the change workflow.
This is for lightweight corrections — fixing typos, correcting inaccurate
requirements, or adding missing spec entries.
The
directory must exist at the
project root. Before
proceeding, verify:
If this fails, the project is not initialized. Run
first.
-
Read spec context first — before making any changes, read:
.spec-driven/specs/INDEX.md
- any existing main spec files relevant to the user's request
-
Understand the request — identify whether the user wants to:
- add a new spec file or category
- add new requirements to an existing spec file
- modify an existing requirement
- remove one or more existing requirements
-
Choose the target — use
to determine where the content
belongs:
- If one or more existing spec files cover the behavior, use those
- Only create a new spec file if no existing file fits
- Only create a new category if no existing category fits
-
Prepare the changes — draft the exact modifications:
- For additions: write the new heading and body
- For modifications: show the before and after content
- For removals: identify the exact heading(s) to remove
- Describe observable behavior only, not implementation details
-
Present and confirm — show the user:
- which file or files will be changed
- the exact content that will be added, modified, or removed
- whether needs updating
Wait for explicit user confirmation before writing anything.
-
Apply the changes — after confirmation:
- Edit the target spec file(s) under
- Preserve existing and
frontmatter
- If the edit changes which implementation or test files evidence the spec,
update only the mapping frontmatter with repo-relative file paths
- If a new file or category was created, update
.spec-driven/specs/INDEX.md
- For removals, delete the exact heading(s) cleanly — do
not leave orphaned headings or vague remnants
-
Validate the result — after editing, verify:
- Each edited file still follows the standard heading
format
- Edited files still have valid mapping frontmatter
- correctly reflects all spec files under
- If format issues are found, fix them immediately
Run
node {{SKILL_DIR}}/scripts/spec-driven.js verify-spec-mappings
when
mapping frontmatter changed.
-
Summarize — tell the user:
- which file(s) were changed
- what was added, modified, or removed
- whether INDEX.md was updated