Spec

From stefvw93/weft · View interactive version

Spec is an AI agent skill from the GitHub repository stefvw93/weft. Step 1 of the Weft TDD workflow. Use when starting any new feature (or retroactively spec'ing an existing one being modified): drives an interactive Q&A requirements discussion, then writes the co-located specs.md. Entry point of the cycle spec → mock → type-tests → unit-test → implement → e2e → rev

How to use this skill

Skill file

/spec: Specification (TDD step 1)

Draft a co-located specs.md for a feature through interactive Q&A, before any code exists.

When to run

Procedure

  1. Locate the feature. Determine the owning package (packages/base, packages/core, packages/dom, or an examples/* package) and the source file the feature will live in. The spec is co-located: dom/feature.ts gets dom/feature.specs.md. If a specs.md already exists for this feature, this run revises it. Read it first.
  1. Q&A discussion: one question at a time. Use the AskUserQuestion tool. Ask a single question, await the answer, then ask the next (per the project Meta Rules). Cover, as applicable:

Keep asking until you have no material open questions. Do not batch questions.

  1. Write specs.md from this template:

```markdown

# <Feature Name>

## Overview & Purpose

<What this is and why it exists.>

## Acceptance Criteria

## Technical Requirements <!-- optional -->

## Dependencies & Integrations <!-- optional -->

## Expected Behavior & Edge Cases <!-- optional -->

```

Required sections: Overview & Purpose, Acceptance Criteria. Optional sections only when they carry real content. Acceptance criteria must be concrete enough that /unit-test can name test cases after them.

  1. Iterate until approved. Present the draft, incorporate feedback, repeat. Only when the user approves is this step done.
  1. Hand off. Tell the user the spec is approved and the next step is /mock.

Rules

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.