Create or update a feature specification file in ./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/.
Each spec captures a single feature or requirement as a structured feature.yaml-style document with clear, testable requirements, serving as the contract between the user intent and the implementation. This skill produces only the spec.yaml contract — the implementation plan is generated separately by mini-sdd-plan.
Hook execution
Check ./{ARTIFACT_MAIN_FOLDER}/mini-sdd.config.yml for hooks.spec.pre and hooks.spec.post entries. Run pre-hooks before the Entry point; run post-hooks after the full workflow completes. See references/hooks.md for the full execution rules.
Entry point
- Read
./{ARTIFACT_MAIN_FOLDER}/context.md if it exists — use it as background for all decisions.
- Determine the user's intent from the input (e.g.,
/mini-sdd-spec user authentication).
- If no feature name or description is provided, ask: "What feature or requirement do you want to spec?"
- Derive a spec name in dash-case from the feature description (e.g.,
user-authentication, csv-export, dark-mode-toggle).
- Check for an existing spec by looking for
./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/<spec-name>/spec.yaml (exact match) and by scanning other spec folders for content similarity.
- If a match is found → read its
feature.status to get the current status, show a brief summary, and ask:
"A spec <existing-spec-name> already exists (status: ). Do you want to update this spec or create a new one with a different name?"
- Update → proceed to Update flow
- New → ask for a different name and proceed to Creation flow
- If no match is found → output the derived name and proceed to Creation flow:
"📝 Spec name: <spec-name>"
Creation flow
1. Clarify the requirement
Ask the user the following in a single numbered message (skip questions already answered in the input or inferred from initial context):
- What should this feature do? — Describe the desired behavior in 2–3 sentences.
- Who is the user? — Who benefits from this feature?
- Functional requirements — List the observable behaviors the feature must have. These become the numbered
requirements under components, grouped by area (e.g. a LOGIN group, an EXPORT group).
- Cross-cutting constraints — Any non-functional requirements (security, performance, data privacy, accessibility)? These become the
constraints section.
- Technical notes — Any implementation hints, API details, or architectural considerations?
After collecting the requirements, inspect the existing specs under ./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/ and infer whether this spec depends on other specs being completed first. Populate requires: automatically from that analysis.
Ask the user about dependencies only if the relationship is ambiguous:
"I found that <spec-name> may need <dependency-spec> to be completed first. Should I mark it as a dependency?"
2. Generate the spec file
Read the template from assets/spec.template.yaml and fill it in using the gathered information, see the template header for the rules.
- Create the folder
./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/<spec-name>/ if it does not exist.
- Write the spec to
./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/<spec-name>/spec.yaml.
- Fill the
feature block: name = <spec-name> (lowercase, dashes/underscores); description = 2–3 sentences including who the user is; optional version and prerequisites (external dependencies).
- Group functional requirements into
components with UPPER_SNAKE keys (e.g. LOGIN, EXPORT), unique across components and constraints. Number each requirement as an integer (1, 2); use <N>-<M> for sub-requirements (max 1 level, never -0). A requirement's ACID is <spec-name>.<GROUP_KEY>.<ID>.
- Put non-functional / cross-cutting requirements under
constraints; omit the section entirely if there are none.
- Keep each requirement an observable, testable (pass/fail) behavior. Be descriptive, not prescriptive.
- In the
feature block set the mini-sdd tracking fields: requires: [<spec-name>, ...] from the inferred dependencies, created: YYYY-MM-DD, updated: YYYY-MM-DD, and status: draft.
- Treat unmet
requires as a derived blocking condition during implementation, not as a separate stored status.
3. Confirm and hand off to the plan
Confirm to the user and point them to the next step:
"✅ Created <spec-name>/spec.yaml (status: draft).
Next: run /mini-sdd-plan <spec-name> to generate the implementation plan."
Update flow
Use this when a spec already exists and the user chose to update it.
- Read the current spec from
./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/<spec-name>/spec.yaml.
- Ask: "What needs to change? New requirements, updated constraints, scope change?"
- Apply the changes to the relevant
components / constraints / feature fields of spec.yaml. When adding requirements, append new numbers (or <N>-<M> sub-requirements) so existing IDs/ACIDs stay stable.
- Re-inspect the other specs in
./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/ and re-infer requires: from the updated spec content.
- In the
feature block set: requires: [<spec-name>, ...], updated: YYYY-MM-DD, status: draft.
- Setting
status: draft signals that no plan.md exists yet, or that it is out of date and must be regenerated by mini-sdd-plan.
- If some
requires are not yet done, keep that as a derived blocking condition for implementation.
- Show a summary of what changed and which dependencies were inferred.
- Confirm and point to the next step:
"✅ Updated <spec-name>/spec.yaml (status: draft).
The spec changed — run /mini-sdd-plan <spec-name> to (re)generate the implementation plan."
Status lifecycle
This skill sets status: draft — the spec contract exists but has no implementation plan yet. mini-sdd-plan advances a spec to ready once the plan is generated. The in-progress and done statuses are managed exclusively by mini-sdd-implement. Whether a spec is currently implementable is also derived from requires: — if any dependency is not done, implementation must wait.
Output rules
{SKILL_ASSETS_NOTICE}
- One spec per file, one feature per
spec.yaml
- Keep specs concise — aim for something an AI agent can read and turn into a plan without ambiguity.
- Express requirements as observable, testable (pass/fail) behaviors with stable ACIDs (
<spec-name>.<GROUP_KEY>.<ID>).
- Focus on functional behavior and key constraints; omit obvious or purely cosmetic requirements.
- Do not generate
plan.md here — that is the responsibility of mini-sdd-plan.
- If the user is vague, ask one follow-up, then proceed with best effort and record assumptions in
open_questions.
Error handling
- Spec name conflict: If the derived dash-case name collides with an existing unrelated spec, show both and ask the user to confirm or pick a different name.
- No input provided: Ask "What feature or requirement do you want to spec?" before doing anything else.
- Spec folder not writable / path missing: Create the
./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/<spec-name>/ directory if it does not exist before writing.
- User abandons the interview mid-way: Save whatever was collected, leave unanswered fields as their template placeholders, and confirm the partial spec was written.
1---2name: mini-sdd-spec3description: Create or update a feature spec — define functional requirements and cross-cutting constraints for a single feature in a structured spec.yaml. Use when defining a new feature, capturing a requirement, writing a user story, drafting a spec, or refining an existing spec. Do not use for generating the implementation plan (use mini-sdd-plan) or implementing code.4---56Create or update a feature specification file in `./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/`.78Each spec captures a single feature or requirement as a structured `feature.yaml`-style document with clear, testable requirements, serving as the contract between the user intent and the implementation. This skill produces **only** the `spec.yaml` contract — the implementation plan is generated separately by `mini-sdd-plan`.910---1112## Hook execution1314Check `./{ARTIFACT_MAIN_FOLDER}/mini-sdd.config.yml` for `hooks.spec.pre` and `hooks.spec.post` entries. Run pre-hooks before the Entry point; run post-hooks after the full workflow completes. See [references/hooks.md](./references/hooks.md) for the full execution rules.1516---1718## Entry point19201. Read `./{ARTIFACT_MAIN_FOLDER}/context.md` if it exists — use it as background for all decisions.212. Determine the user's intent from the input (e.g., `/mini-sdd-spec user authentication`).22 - If no feature name or description is provided, ask: _"What feature or requirement do you want to spec?"_233. Derive a **spec name** in dash-case from the feature description (e.g., `user-authentication`, `csv-export`, `dark-mode-toggle`).244. Check for an existing spec by looking for `./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/<spec-name>/spec.yaml` (exact match) and by scanning other spec folders for content similarity.25 - **If a match is found** → read its `feature.status` to get the current status, show a brief summary, and ask:26 > "A spec `<existing-spec-name>` already exists (status: <current-status>). Do you want to **update this spec** or **create a new one** with a different name?"27 - **Update** → proceed to **Update flow**28 - **New** → ask for a different name and proceed to **Creation flow**29 - **If no match is found** → output the derived name and proceed to **Creation flow**:30 > "📝 Spec name: `<spec-name>`"3132---3334## Creation flow3536### 1. Clarify the requirement3738Ask the user the following in a **single numbered message** (skip questions already answered in the input or inferred from initial context):39401. **What should this feature do?** — Describe the desired behavior in 2–3 sentences.412. **Who is the user?** — Who benefits from this feature?423. **Functional requirements** — List the observable behaviors the feature must have. These become the numbered `requirements` under `components`, grouped by area (e.g. a `LOGIN` group, an `EXPORT` group).434. **Cross-cutting constraints** — Any non-functional requirements (security, performance, data privacy, accessibility)? These become the `constraints` section.445. **Technical notes** — Any implementation hints, API details, or architectural considerations?4546After collecting the requirements, inspect the existing specs under `./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/` and infer whether this spec depends on other specs being completed first. Populate `requires:` automatically from that analysis.4748Ask the user about dependencies only if the relationship is ambiguous:49> "I found that `<spec-name>` may need `<dependency-spec>` to be completed first. Should I mark it as a dependency?"5051### 2. Generate the spec file5253Read the template from `assets/spec.template.yaml` and fill it in using the gathered information, see the template header for the rules.5455- Create the folder `./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/<spec-name>/` if it does not exist.56- Write the spec to `./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/<spec-name>/spec.yaml`.57- Fill the `feature` block: `name` = `<spec-name>` (lowercase, dashes/underscores); `description` = 2–3 sentences including who the user is; optional `version` and `prerequisites` (external dependencies).58- Group functional requirements into `components` with `UPPER_SNAKE` keys (e.g. `LOGIN`, `EXPORT`), unique across components and constraints. Number each requirement as an integer (`1`, `2`); use `<N>-<M>` for sub-requirements (max 1 level, never `-0`). A requirement's ACID is `<spec-name>.<GROUP_KEY>.<ID>`.59- Put non-functional / cross-cutting requirements under `constraints`; omit the section entirely if there are none.60- Keep each requirement an observable, testable (pass/fail) behavior. Be descriptive, not prescriptive.61- In the `feature` block set the mini-sdd tracking fields: `requires: [<spec-name>, ...]` from the inferred dependencies, `created: YYYY-MM-DD`, `updated: YYYY-MM-DD`, and `status: draft`.62- Treat unmet `requires` as a derived blocking condition during implementation, not as a separate stored status.6364### 3. Confirm and hand off to the plan6566Confirm to the user and point them to the next step:67> "✅ Created `<spec-name>/spec.yaml` (status: draft).68> Next: run `/mini-sdd-plan <spec-name>` to generate the implementation plan."6970---7172## Update flow7374Use this when a spec already exists and the user chose to update it.75761. Read the current spec from `./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/<spec-name>/spec.yaml`.772. Ask: _"What needs to change? New requirements, updated constraints, scope change?"_783. Apply the changes to the relevant `components` / `constraints` / `feature` fields of `spec.yaml`. When adding requirements, append new numbers (or `<N>-<M>` sub-requirements) so existing IDs/ACIDs stay stable.794. Re-inspect the other specs in `./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/` and re-infer `requires:` from the updated spec content.805. In the `feature` block set: `requires: [<spec-name>, ...]`, `updated: YYYY-MM-DD`, `status: draft`.81 - Setting `status: draft` signals that no `plan.md` exists yet, or that it is out of date and must be regenerated by `mini-sdd-plan`.82 - If some `requires` are not yet `done`, keep that as a derived blocking condition for implementation.836. Show a summary of what changed and which dependencies were inferred.847. Confirm and point to the next step:85 > "✅ Updated `<spec-name>/spec.yaml` (status: draft).86 > The spec changed — run `/mini-sdd-plan <spec-name>` to (re)generate the implementation plan."8788---8990## Status lifecycle9192This skill sets `status: draft` — the spec contract exists but has no implementation plan yet. `mini-sdd-plan` advances a spec to `ready` once the plan is generated. The `in-progress` and `done` statuses are managed exclusively by `mini-sdd-implement`. Whether a spec is currently implementable is also derived from `requires:` — if any dependency is not `done`, implementation must wait.9394---9596## Output rules9798{SKILL_ASSETS_NOTICE}99- One spec per file, one feature per `spec.yaml`100- Keep specs concise — aim for something an AI agent can read and turn into a plan without ambiguity.101- Express requirements as observable, testable (pass/fail) behaviors with stable ACIDs (`<spec-name>.<GROUP_KEY>.<ID>`).102- Focus on functional behavior and key constraints; omit obvious or purely cosmetic requirements.103- Do **not** generate `plan.md` here — that is the responsibility of `mini-sdd-plan`.104- If the user is vague, ask one follow-up, then proceed with best effort and record assumptions in `open_questions`.105106## Error handling107108- **Spec name conflict**: If the derived dash-case name collides with an existing unrelated spec, show both and ask the user to confirm or pick a different name.109- **No input provided**: Ask _"What feature or requirement do you want to spec?"_ before doing anything else.110- **Spec folder not writable / path missing**: Create the `./{ARTIFACT_MAIN_FOLDER}/{SPECS_SUBFOLDER}/<spec-name>/` directory if it does not exist before writing.111- **User abandons the interview mid-way**: Save whatever was collected, leave unanswered fields as their template placeholders, and confirm the partial spec was written.