spec-driven-sync-specs
Original:🇺🇸 English
Translated
1 scriptsChecked / no sensitive code detected
Scan code and specs for drift, directly synchronize spec files, and report the gaps in chat.
7installs
Added on
NPX Install
npx skill4agent add kw12121212/auto-spec-driven spec-driven-sync-specsTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →You are helping the user synchronize with behavior that
already exists in the repository.
.spec-driven/specs/Prerequisites
The directory must exist at the project root. Before
proceeding, verify:
.spec-driven/ls .spec-driven/If this fails, the project is not initialized. Run first.
/spec-driven-initSteps
-
Choose the scan scope — determine whether the user wants:
- a repository-wide scan
- a scoped scan for a specific directory, module, or feature area
If the user already gave a scope, use it. If not, ask whether to scan the whole repository or a narrower target. -
Read spec context first — before deciding that any drift exists, read:
.spec-driven/config.yaml.spec-driven/specs/INDEX.md- every main spec file that appears relevant to the chosen scan scope
-
Read repository evidence in the chosen scope — inspect the code, tests, and nearby documentation that define current observable behavior in that scope.
- Prefer files that expose behavior directly: CLI commands, handlers, user-facing flows, tests, and docs
- Do not treat internal implementation details as requirements
-
Classify drift findings — compare the repository evidence to the current specs and sort findings into:
- confirmed behavior that exists in code but is missing from specs
- existing requirements that appear outdated or incomplete
- ambiguous findings that need human confirmation before they become specs
- areas with no meaningful drift in the scanned scope
-
Report drift summary in chat — present a concise summary covering:
- the scan scope that was analyzed
- confirmed gaps or outdated spec areas, with specific file references
- ambiguous findings that need human input
- areas in scope where no meaningful drift was found
-
Get user confirmation — before editing any spec file, ask the user to confirm the proposed changes. List each spec file that will be added, modified, or removed. Do not proceed until the user explicitly approves.
-
Edit spec files directly — for each confirmed gap:
- edit the corresponding file under
.spec-driven/specs/ - add, modify, or remove blocks as appropriate
### Requirement: - preserve or update and
mapping.implementationfrontmatter to match the repository evidence used for the syncmapping.tests - describe observable behavior only
- if no existing category or file fits, create the new file under
with the correct relative path
.spec-driven/specs/
- edit the corresponding file under
-
Refresh INDEX.md — after all spec edits are complete, run:
node {{SKILL_DIR}}/scripts/spec-driven.js initThis regeneratesto reflect the current file state..spec-driven/specs/INDEX.mdIf mapping frontmatter changed, also run:node {{SKILL_DIR}}/scripts/spec-driven.js verify-spec-mappings -
Report final changes — summarize what was done:
- which spec files were added, modified, or removed
- a brief description of the drift that was fixed in each file
- any ambiguous findings that were left unresolved and why
Rules
- This is a documentation skill only — do not change product code
- Read spec context before judging drift
- Respect the user-selected scope; do not imply full-repository coverage after a scoped scan
- Use code, tests, and nearby docs as evidence, but write only observable behavior into the specs
- Do not create a change — edit files directly
.spec-driven/specs/ - Do not write a standalone report file; the summary belongs in chat
- Get explicit user confirmation before editing any spec file
- Keep implementation and test mappings in frontmatter, not in requirement prose