spec-docs-mvp-generator
Generate the v1 spec document set for one named spec from local templates, preserving existing authored content.
Files5
View on GitHubSKILL.mdskills/spec-docs-mvp-generator/SKILL.md
GitHubPurpose
Create or backfill the minimum v1 spec document set for exactly one explicit
spec-name using this skill package's local references and templates only.
This skill is bounded to exactly two downstream repo-visible outputs:
docs/01-specs/<spec-name>.mddocs/02-spec-relations/data-ownership-map.md
Trigger / When to use
Use this skill when:
- the caller needs a stable starting point for one spec and its shared data ownership map
- an existing
docs/01-specs/<spec-name>.mdis missing one or more required fixed sections - an existing
docs/02-spec-relations/data-ownership-map.mdis missing one or more required fixed sections or the fixed ownership-table header
Do not use this skill when:
- the request asks for multi-spec generation or any output outside the exact two-file v1 contract
- the request asks for
docs/00-overview/architecture-principles.md, interfaces, flows, state machines, ADRs, implementation notes, or any near-equivalent substitute section - the request tries to reopen projection, path migration, workflow binding, or runtime orchestration scope
Inputs
Required input:
spec-nameThe value must be a filename-safe slug for one spec file, not a path. Block before any write if it contains/,\,.., a leading., an absolute path marker, or any other path-like segment. Only continue after resolving the candidate output path and confirming its normalized location remains insidedocs/01-specs/.
Optional input:
- summary of the problem or opportunity
- initial goals and non-goals
- known actors
- known requirements or constraints
- known data ownership facts
- open questions that should remain visible in the starter docs
If optional context is sparse, still create a non-empty starter document by using this skill package's local template prompts instead of leaving blank sections.
Process
- Validate that one explicit
spec-nameis present before any write. - Validate that
spec-nameis a filename-safe slug, not a path-like value. Reject traversal, absolute-path, separator-containing, or dot-segment inputs before any write. - Resolve the candidate spec output path from
spec-name, normalize it, and confirm the resolved path stays contained withindocs/01-specs/before writing. - Use
templates/spec-template.mdandtemplates/data-ownership-map-template.mdas the canonical starter skeletons. - Target only these two files:
docs/01-specs/<spec-name>.mddocs/02-spec-relations/data-ownership-map.md
- When
docs/01-specs/<spec-name>.mddoes not exist, create it from the spec template with the fixed section order:SummaryProblemGoalsNon-goalsActorsRequirementsData Ownership NotesAcceptance SignalsOpen Questions
- When
docs/02-spec-relations/data-ownership-map.mddoes not exist, create it from the ownership-map template with the fixed section order:PurposeOwnership TableShared or Derived DataBoundary NotesOpen Questions
- If a target file already exists, preserve existing authored content and backfill only missing fixed sections or the missing ownership-table header.
- Keep reruns idempotent by avoiding duplicate same-name fixed sections and by never clearing or rewriting the whole file just to normalize layout.
- Refuse or reroute any request that would widen the write set, add excluded artifact families, or require destructive rewrite.
- Stay local-only. Do not depend on network access, external services, runtime orchestration, or projection sync.
Platform Path Policy
- Authoring, templates, and adapter examples may use the placeholder
.<platform>/skills/<skill-name>/when describing projection layouts. - That placeholder is documentation-only and is not a runtime discovery path.
- Any adapter or installer must resolve the placeholder to a concrete platform path before execution begins.
- For Codex projection mapping,
.<platform>/skills/<skill-name>/resolves to.codex/skills/<skill-name>/. - Do not treat
skills/,.agents/skills/,.github/skills/, or.claude/skills/as fixed runtime paths in skill instructions unless the instruction is explicitly describing a mapping rule.
Examples
Positive example:
- Input:
spec-name: customer-profile-syncwith sparse background context. Outcome: create or backfill onlydocs/01-specs/customer-profile-sync.mdanddocs/02-spec-relations/data-ownership-map.md, using non-empty starter content and preserving authored text already present.
Negative example:
- Input:
spec-name: customer-profile-sync, plus a request to also generate architecture principles, interfaces, and an ADR. Outcome: refuse or reroute the extra request and keep the v1 scope limited to the two allowed files.
Outputs
This skill may create or update only:
docs/01-specs/<spec-name>.mddocs/02-spec-relations/data-ownership-map.md
docs/01-specs/<spec-name>.md must contain the nine fixed non-empty sections
listed in templates/spec-template.md.
docs/02-spec-relations/data-ownership-map.md must contain the five fixed
non-empty sections listed in
templates/data-ownership-map-template.md, including the fixed header:
| Data Item | System of Record | Upstream Writers | Downstream Readers | Notes |
Validation
Required Checks
- confirm one explicit
spec-nameis present before writing anything - confirm
spec-nameis a filename-safe slug and reject any path-like, traversal, or absolute-path value before writing anything - confirm the normalized resolved output path for
docs/01-specs/<spec-name>.mdremains contained withindocs/01-specs/ - confirm the run targets only the two allowed output paths
- confirm
docs/01-specs/<spec-name>.mdcontains the fixed nine required non-empty sections - confirm
docs/02-spec-relations/data-ownership-map.mdcontains the fixed five required non-empty sections and the fixed ownership-table header - confirm existing authored content survives rerun and that no duplicate same-name fixed headings were introduced
Quality Checks
- starter content remains non-empty even when optional context is sparse
- rerun behavior backfills only missing structure and does not approximate excluded scope by adding substitute sections
- execution remains local-only and does not depend on network, external services, or projection surfaces
Soft-fail / Blocked Behavior
- Soft fail: if optional context is incomplete, proceed with template starter prompts, keep sections non-empty, and make the remaining gaps visible in the generated documents.
- Blocked: if
spec-nameis missing, stop and ask for it before writing any file. - Blocked: if
spec-nameis path-like, contains traversal, or resolves outsidedocs/01-specs/, stop before writing any file and report the exact invalid input. - Blocked: if the request would widen the two-file contract or requires a destructive whole-file rewrite, stop and report the exact blocker instead of improvising.
Failure Handling
Missing Context
- If
spec-nameis missing, ask for one explicitspec-nameand do not guess the filename. - If
spec-nameis path-like, traversal-shaped, absolute, or fails normalized containment insidedocs/01-specs/, block instead of sanitizing or rewriting it. - If optional context is missing, continue with starter prompts rather than leaving blank sections.
Ambiguous Requirement
- If it is unclear whether the request exceeds the v1 boundary, clarify before writing outside the exact two-file contract.
- If the ambiguity is only about content details inside the allowed files, use conservative starter text and keep unresolved items visible as open questions.
Execution Limitation
- If the required local templates are unavailable, unreadable, or inconsistent with the fixed contract, stop and report the limitation instead of inventing a new skeleton.
- If an existing file can only be changed by destructive rewrite to comply, stop and report that limitation rather than overwriting authored content.
Boundaries
- Do not touch any file outside:
docs/01-specs/<spec-name>.mddocs/02-spec-relations/data-ownership-map.md
- Do not generate multi-spec output or any extra document family.
- Do not approximate excluded scope by adding near-equivalent sections to the two allowed files.
- Do not require network access, external services, runtime orchestration, or projection / compatibility-surface updates.
Local references
reference.md: deterministic local-only write, merge, rerun, and refusal rulesexamples.md: scenario coverage for creation, backfill, rerun safety, and refusal behaviortemplates/spec-template.md: fixed nine-section spec skeletontemplates/data-ownership-map-template.md: fixed five-section ownership-map skeleton and table header