Smith specify

From ATTCKDigital/smith · View interactive version

Smith specify is an AI agent skill from the GitHub repository ATTCKDigital/smith. Create or update the feature specification from a natural language feature description.

How to use this skill

Skill file

Workflow requirement (Smith 20+): This skill must be invoked from inside an active top-level workflow (/smith-new, /smith-bugfix, /smith-debug, /smith-build). The workflow-gate hook will block standalone invocation. To use this skill standalone, start a top-level workflow first.

Vault Logging

Throughout this action, log significant events to the vault session log. Read the session log path from .smith/vault/.current-session. If the file is missing or the vault is not initialized, skip all logging silently.

Timestamps are UTC. HH:MM:SS comes from date -u +%H:%M:%S — never a local clock, never a time from memory. The append already runs through a shell, so read the clock in that same command (TS=$(date -u +%H:%M:%S)) and spend no extra tool call. Substitute the resulting value: an unexpanded $(...) reaching the log is a known regression and will not parse. Every hook-written stamp in this log is date -u, so a local-clock entry lands hours away from its neighbours and skews the workflow window hooks/workflow_summary_lib.py derives from them.

Append entries using this format:

### [HH:MM:SS] /smith-specify <event>

**User Request:**
> <verbatim user message that triggered this action>

**Synthesized Input:** <brief summary>
**Outcome:** <what happened>
**Artifacts:** <files created/modified>
**Systems affected:** <system IDs>

Log at these points:

  1. On invocation — the feature description provided
  2. After system detection — primary system identified, also_affects list
  3. After spec creation — path to spec.md, summary of key requirements and acceptance criteria count

User Input

$ARGUMENTS

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

Outline

The text the user typed after /smith-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. Check for existing branches before creating new one:

a. First, fetch all remote branches to ensure we have the latest information:

```bash

git fetch --all --prune

```

b. Find the highest feature number across all sources for the short-name:

c. Determine the next available number:

d. Run the script .specify/scripts/bash/create-new-feature.sh --json "$ARGUMENTS" with the calculated number and short-name:

IMPORTANT:

  1. Auto-detect primary system:
  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 (system detection from step 3 informs scope decisions):

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 the system-routed feature folder (from step 3). Include YAML frontmatter at the top of spec.md:

```yaml


feature: <NNN-short-name>

primary_system: <system-folder-name>

also_affects:

branch: <branch-name>

created: <YYYY-MM-DD>

status: in-progress


```

Fill 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 (/smith-clarify or /smith-plan).

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

General Guidelines

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.