Speckit specify

From jiazhenz026/SciStudio · View interactive version

Speckit specify is an AI agent skill from the GitHub repository jiazhenz026/SciStudio. Create or update the feature specification from a natural language feature description.

How to use this skill

Skill file

User Input

$ARGUMENTS

You MUST consider the user input before proceeding (if not empty).

Pre-Execution Checks

Check for extension hooks (before specification):

```

## Extension Hooks

Optional Pre-Hook: {extension}

Command: /{command}

Description: {description}

Prompt: {prompt}

To execute: /{command}

```

```

## Extension Hooks

Automatic Pre-Hook: {extension}

Executing: /{command}

EXECUTE_COMMAND: {command}

Wait for the result of the hook command before proceeding to the Outline.

```

Outline

The text the user typed after /speckit.specify in the triggering message is the feature description. Assume you always have it available in this conversation even if $ARGUMENTS appears literally below. Do not ask the user to repeat it unless they provided an empty command.

Given that feature description, do this:

  1. Generate a concise short name (2-4 words) for the branch:
  1. Create the feature branch by running the script with --short-name (and --json). In sequential mode, do NOT pass --number — the script auto-detects the next available number. In timestamp mode, the script generates a YYYYMMDD-HHMMSS prefix automatically:

Branch numbering mode: Before running the script, check if .specify/init-options.json exists and read the branch_numbering value.

IMPORTANT:

  1. Load .specify/templates/spec-template.md to understand required sections.
  1. Follow this execution flow:

1. Parse user description from Input

If empty: ERROR "No feature description provided"

2. Extract key concepts from description

Identify: actors, actions, data, constraints

3. For unclear aspects:

4. Fill User Scenarios & Testing section

If no clear user flow: ERROR "Cannot determine user scenarios"

5. Generate Functional Requirements

Each requirement must be testable

Use reasonable defaults for unspecified details (document assumptions in Assumptions section)

6. Define Success Criteria

Create measurable, technology-agnostic outcomes

Include both quantitative metrics (time, performance, volume) and qualitative measures (user satisfaction, task completion)

Each criterion must be verifiable without implementation details

7. Identify Key Entities (if data involved)

8. Return: SUCCESS (spec ready for planning)

  1. Write the specification to SPEC_FILE using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings.
  1. Specification Quality Validation: After writing the initial spec, validate it against quality criteria:

a. Create Spec Quality Checklist: Generate a checklist file at FEATURE_DIR/checklists/requirements.md using the checklist template structure with these validation items:

```markdown

# Specification Quality Checklist: [FEATURE NAME]

Purpose: Validate specification completeness and quality before proceeding to planning

Created: [DATE]

Feature: [Link to spec.md]

## Content Quality

## Requirement Completeness

## Feature Readiness

## Notes

```

b. Run Validation Check: Review the spec against each checklist item:

c. Handle Validation Results:

1. List the failing items and specific issues

2. Update the spec to address each issue

3. Re-run validation until all items pass (max 3 iterations)

4. If still failing after 3 iterations, document remaining issues in checklist notes and warn user

1. Extract all [NEEDS CLARIFICATION: ...] markers from the spec

2. LIMIT CHECK: If more than 3 markers exist, keep only the 3 most critical (by scope/security/UX impact) and make informed guesses for the rest

3. For each clarification needed (max 3), present options to user in this format:

```markdown

## Question [N]: [Topic]

Context: [Quote relevant spec section]

What we need to know: [Specific question from NEEDS CLARIFICATION marker]

Suggested Answers:

| Option | Answer | Implications |

|--------|--------|--------------|

| A | [First suggested answer] | [What this means for the feature] |

| B | [Second suggested answer] | [What this means for the feature] |

| C | [Third suggested answer] | [What this means for the feature] |

| Custom | Provide your own answer | [Explain how to provide custom input] |

Your choice: _[Wait for user response]_

```

4. CRITICAL - Table Formatting: Ensure markdown tables are properly formatted:

5. Number questions sequentially (Q1, Q2, Q3 - max 3 total)

6. Present all questions together before waiting for responses

7. Wait for user to respond with their choices for all questions (e.g., "Q1: A, Q2: Custom - [details], Q3: B")

8. Update the spec by replacing each [NEEDS CLARIFICATION] marker with the user's selected or provided answer

9. Re-run validation after all clarifications are resolved

d. Update Checklist: After each validation iteration, update the checklist file with current pass/fail status

  1. Report completion with branch name, spec file path, checklist results, and readiness for the next phase (/speckit.clarify or /speckit.plan).
  1. Check for extension hooks: After reporting completion, check if .specify/extensions.yml exists in the project root.

```

## Extension Hooks

Optional Hook: {extension}

Command: /{command}

Description: {description}

Prompt: {prompt}

To execute: /{command}

```

```

## Extension Hooks

Automatic Hook: {extension}

Executing: /{command}

EXECUTE_COMMAND: {command}

```

NOTE: The script creates and checks out the new branch and initializes the spec file before writing.

Quick Guidelines

Section Requirements

For AI Generation

When creating this spec from a user prompt:

  1. Make informed guesses: Use context, industry standards, and common patterns to fill gaps
  2. Document assumptions: Record reasonable defaults in the Assumptions section
  3. Limit clarifications: Maximum 3 [NEEDS CLARIFICATION] markers - use only for critical decisions that:
  1. Prioritize clarifications: scope > security/privacy > user experience > technical details
  2. Think like a tester: Every vague requirement should fail the "testable and unambiguous" checklist item
  3. Common areas needing clarification (only if no reasonable default exists):

Examples of reasonable defaults (don't ask about these):

Success Criteria Guidelines

Success criteria must be:

  1. Measurable: Include specific metrics (time, percentage, count, rate)
  2. Technology-agnostic: No mention of frameworks, languages, databases, or tools
  3. User-focused: Describe outcomes from user/business perspective, not system internals
  4. Verifiable: Can be tested/validated without knowing implementation details

Good examples:

Bad examples (implementation-focused):

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.