---
description: Scaffold a new SDD spec in a ticket-keyed folder under the current scope
argument-hint: "<title>"
---

The user wants to create a new spec titled: **$ARGUMENTS**

Follow the @cleepi/sdd workflow (load `/skill:sdd` if you haven't).

1. **Resolve scope.**
   - Inside `packages/<n>/` or the spec is clearly about one package
     → scope = package. Target = `packages/<n>/docs/`.
   - Otherwise → scope = repo. Target = `docs/`.
   - Ambiguous → ask.

2. **Resolve the ticket ID.** Ask: *"Ticket ID for this spec (e.g.
   `AC-101`)? Leave empty if there's no tracker ticket yet."*
   - User provides one → use it as the folder prefix and the
     frontmatter `id` and `ticket` fields.
   - User leaves empty → use `DRAFT-NNN` where `NNN` is the next
     monotonic number among existing `DRAFT-*` folders in the
     target. No `ticket:` field in frontmatter.

3. **Slugify the title.** Lowercase, kebab-case, drop articles.
   Folder name = `<ticket-id>-<slug>/`.

4. **Create the folder** if it doesn't exist. **Refuse** if it
   exists AND already contains a `spec.md`. (Don't overwrite.)

5. **Load the spec template** from the installed @cleepi/sdd
   package's `templates/spec.md`. In this repo:
   `packages/sdd/templates/spec.md`.

6. **Fill frontmatter:**
   - `id`: ticket ID, or `DRAFT-NNN`.
   - `title`: user's title (preserve human-readable casing).
   - `status`: `draft`.
   - `created`: today's date in `YYYY-MM-DD`.
   - `owner`: ask if you don't know.
   - `ticket`: ticket ID (omit field entirely if no tracker).
   - `ticket-url`: ask if relevant; omit otherwise.
   - `related`: leave empty.

7. **Body.** Keep the three required sections (`## What`,
   `## Why`, `## Decision`) from the template. Replace placeholder
   text with a short first-draft sketch only if you already know
   enough — never fabricate. Leave the "optional sections" comment
   block at the bottom untouched; the author opts in as needed.

8. **Write `<folder>/spec.md`.** Report the path.

9. **Next step.** Tell the user: *"Spec drafted at `<path>`. Status
   is `draft`. Iterate on What / Why / Decision, then flip to
   `accepted` before we touch code (strict SDD). Use `/journal
   <text>` to log friction as you work."*

Be concise throughout (see skill "Voice and length"). No throat-
clearing; no restating what the user just typed.
