---
name: creating-specifications
description: Create structured design documentation before implementing features. Use for new features, significant refactoring, or work spanning multiple sessions. Triggers on "new feature", "implement", "build", "design", "spec", "plan the implementation".
license: MIT
title: creating-specifications
canonical_url: https://skilld.dev/gh/ayushjj/skills/creating-specifications
last_updated: 2026-10-26T13:15:43.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/implementation-protocol.md](https://skilld.dev/api/skills-raw/ayushjj/skills/creating-specifications/references/implementation-protocol.md), [references/templates.md](https://skilld.dev/api/skills-raw/ayushjj/skills/creating-specifications/references/templates.md).
>
> If the user asked to install this Skill, run `npx skilld install ayushjj/skills/creating-specifications`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/creating-specifications`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/ayushjj/skills/creating-specifications) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/creating-specifications`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/creating-specifications --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/creating-specifications --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Creating Specifications

Use this skill BEFORE implementing any non-trivial feature, especially when trade-offs need to be explicit. Creates structured documentation that persists across sessions.

## Before You Start

Use this skill only when all of these hold:

- The feature or change is non-trivial.
- It is not a simple bug fix. For bugs, first find one concrete failing example and its root cause; write a spec only if the fix turns out to be non-trivial.
- The scope is understood at least at a high level.
- The premise is validated: if "should we build this at all?" is unclear, run `/premise-check` first.

## Usage

```
/creating-specifications {feature-name}
```

<critical_sequence enforce_order="strict">

<step number="1" required="true" blocking="true">
## Step 1: Create Folder Structure

Create the spec directory:

```
specs/{feature-name}/
├── design.md        # Problem + proposed solution
├── decisions.md     # Trade-offs documented
└── implementation.md # Execution notes
```

<validation_gate name="folder-created" blocking="true">
**BLOCK if not created:**
- [ ] Directory `specs/{feature-name}/` exists
- [ ] All three files initialized

Do NOT proceed to design until structure exists.
</validation_gate>
</step>

<step number="2" required="true" depends_on="1" blocking="true">
## Step 2: Write Problem Statement

**Prerequisite check:** Before writing the problem statement, assess: is the problem crystal clear?
- If a PREMISE CHECK output already exists in the conversation → proceed
- If the problem is vague or the user said "maybe we should build..." → offer: "The problem isn't crystal clear yet. Want me to run `/premise-check` first? It takes 2-3 minutes and prevents building the wrong thing."
- If the user declines or the problem is already specific → proceed normally

Fill the **Problem Statement + Current Behavior** section of `design.md` (full template: `references/templates.md`).

<validation_gate name="problem-defined" blocking="true">
**BLOCK if problem unclear:**
- [ ] Problem statement is one clear sentence
- [ ] Current behavior documented
- [ ] "Why it matters" explained

Do NOT propose solutions until problem is crystal clear.
</validation_gate>
</step>

<step number="3" required="true" depends_on="2">
## Step 3: Document Alternatives

Research and document at least 2 alternative approaches. Fill the **Alternatives Considered** section of `design.md` (`references/templates.md`).

This forces thinking beyond the first idea.
</step>

<step number="4" required="true" depends_on="3" blocking="true">
## Step 4: Propose Solution

Document the chosen approach. Fill the **Proposed Solution** section of `design.md` — including *What Already Exists*, *Key Changes*, *Success Metrics (Test Expectations)* written as when/then statements, and *Risks* (`references/templates.md`).

<validation_gate name="solution-proposed" blocking="true">
**BLOCK if incomplete:**
- [ ] Solution clearly described
- [ ] Key changes listed
- [ ] Success metrics defined (measurable!)
- [ ] Risks identified with mitigations
</validation_gate>
</step>

<step number="5" required="true" depends_on="4">
## Step 5: Document Key Decisions

For each non-obvious choice, document in `decisions.md` using the **Decision** block (`references/templates.md`).

WHY: Future-you needs to understand WHY decisions were made, not just WHAT was decided.
</step>

<step number="6" required="true" depends_on="5">
## Step 6: Initialize Implementation Tracker

Create `implementation.md` from the template (`references/templates.md`) — initialize **Status**, seed the **Test Queue** (Kent Beck-style: a list of tests worked one at a time) from design.md's Success Metrics, and set up the **Execution Log**, **Files to Change**, and **Verification** sections.
</step>

</critical_sequence>

<success_criteria>
## Spec Complete When ALL Are True

- [ ] All three files created (design.md, decisions.md, implementation.md)
- [ ] Problem statement is clear and specific
- [ ] At least 2 alternatives documented
- [ ] Solution has measurable success metrics
- [ ] Key decisions documented with rationale
- [ ] Implementation plan initialized
</success_criteria>

<decision_gate wait_for_user="true">
## Spec Created

Files created:
- `specs/{feature}/design.md`
- `specs/{feature}/decisions.md`
- `specs/{feature}/implementation.md`

What's next?
1. Begin implementation (recommended)
2. Review spec with user
3. Add more alternatives to consider
4. Run /executing-batch-operations if this involves bulk data changes
5. Other

Choose (1-5): _
</decision_gate>

<implementation_protocol trigger="user-chooses-1">
## Implementation Pre-Flight (MANDATORY before any code changes)

If the user chooses **(1) Begin implementation** → this is MANDATORY: read and execute the gates in `references/implementation-protocol.md` **IN ORDER** before touching any code (Gate 1 Read Plan → Gate 2 Read Targets → Gate 3 Baseline → Gate 4 Scope Gut-Check, then the Beck test-queue loop + post-task checklist).
</implementation_protocol>

## Templates

- File templates (design.md, decisions.md, implementation.md) → `references/templates.md`
- Implementation pre-flight gates → `references/implementation-protocol.md`

<integration_protocol>
## Integration Points

**Invoked by:**
- A bug investigation, once the root cause is found and the fix is non-trivial
- Manual invocation for new features
- Auto-suggested when user describes feature requirements

**Invokes:**
- `/executing-batch-operations` skill (if implementation involves bulk data changes; its Step 6 query-correctness validation verifies the implementation)
- Implementation pre-flight gates (when user chooses "Begin implementation")

**Handoff expectations:**
Creates `specs/{feature}/` directory with full documentation.
Implementation phase uses `implementation.md` to track progress.
</integration_protocol>
