Agent skill

Writing Spec

by bartstc in bartstc/vite-ts-react-template

Collaboratively write a feature spec with the developer. An agent skill from bartstc/vite-ts-react-template.

MITAuto-check passedFrontend & Design

Install Writing Spec

skills CLI
$ npx skills add bartstc/vite-ts-react-template --skill writing-spec -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install bartstc/vite-ts-react-template writing-spec --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/bartstc/vite-ts-react-template.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/writing-spec .claude/skills/writing-spec && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
writing-spec
GitHub stars
122
Token cost
~3.4k tokens
SKILL.md length
1,686 words
Files
5
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Collaboratively write a feature spec with the developer. An agent skill from bartstc/vite-ts-react-template.

  • Works in 4 steps: Goal & Scope (Intent) → Design (Approach) → Spec (Sequencing) → …
  • A task involves 5+ unconstrained decisions
  • SKILL.md covers Purpose, Prerequisites, Workflow: Four Phases with Gates and Rules & Constraints, plus 4 more sections
  • Calls git

What it does

Writing Spec is an agent skill from bartstc/vite-ts-react-template. Collaboratively write a feature spec with the developer. Trigger when a task involves 5+ unconstrained decisions, spans 10+ files, or the developer explicitly asks for a spec. Do NOT trigger for config edits, CSS fixes, helper functions, exploratory prototyping, presentation-only changes, or when the developer explicitly opts out.

Its SKILL.md is about 3.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files (for example `templates/contract-template.md`, `templates/design-template.md` and `templates/requirements-template.md`).

It sits in Frontend & Design, covering PRD writing and Prototyping. It works with React. The repository describes itself as: This project provides a basic dev setup intended for Single Page Application (SPA) development. It contains key tools, settings for seamless DX, and an demo app presenting good… The licence is MIT.

When your agent uses it

  • A task involves 5+ unconstrained decisions
  • Spans 10+ files
  • The developer explicitly asks for a spec
  • Helper functions

Example prompts

  • “/writing-spec”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Goal & Scope (Intent)
  2. Design (Approach)
  3. Spec (Sequencing)
  4. Review & Finalize

What it can do on your machine

Read from SKILL.md and the folder at commit 6aa5c9c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Writing Spec loads about 3.4k tokens when it runs. Until then it costs about 86 tokens; SKILL.md has 1,686 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~86
When it runs · the whole SKILL.md, loaded when a task matches
~3.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from bartstc/vite-ts-react-template at commit 6aa5c9c, republished under its MIT licence (© bartstc). 1,686 words, ~3,388 tokens.

Download SKILL.mdSave it as .claude/skills/writing-spec/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
writing-spec
description
Collaboratively write a feature spec with the developer. Trigger when a task involves 5+ unconstrained decisions, spans 10+ files, or the developer explicitly asks for a spec. Do NOT trigger for config edits, CSS fixes, helper functions, exploratory prototyping, presentation-only changes, or when the developer explicitly opts out.

Purpose

Guide the developer through writing a feature spec before any code is written. The spec constrains intent and approach so implementation decisions are explicit, reviewed, and traceable. This skill produces three files in specs/NNN-feature-name/ — requirements.md, design.md, tasks.md — using the templates in ./templates/.

Prerequisites

  • Read ./templates/requirements-template.md, ./templates/design-template.md, ./templates/tasks-template.md, and ./templates/contract-template.md before starting — they define the section structure
  • Read @docs/architecture.md to understand current building block types and project structure
  • Determine the next available sequence number by checking both specs/ directory listings AND git log for prior spec-related commits — use the higher of the two

Workflow: Four Phases with Gates

Each phase ends with a human review gate. Do NOT advance to the next phase without explicit developer approval ("continue", "ok", "next", "looks good", or similar). If something goes wrong, STOP and re-plan — do not push forward.

Phase 1 — Goal & Scope (Intent)

Collaborate with the developer to fill requirements.md.

  1. Ask the developer to describe the feature in 2-5 sentences (or accept what they've already provided)
  2. Before drafting, ask 3-5 clarifying questions about scope boundaries, error scenarios, and unstated assumptions — only where the answer would change the spec. Skip obvious ones.
    • If the feature introduces new API calls (queries or mutations): explicitly ask which server-side error responses each call must handle, and how the UI should react to each.
  3. Draft the Goal & Context section — focus on the problem, not the solution
  4. Draft Requirements using EARS notation: WHEN [condition] THE SYSTEM SHALL [behavior]. Assign stable IDs (R1, R2, …)
  5. Draft Non-Goals — ask: "What should this feature explicitly NOT do?"
  6. Present requirements.md for review

What to ask if unclear: "What's the observable user behavior when this works correctly?" Never invent requirements — if the developer hasn't specified a behavior, ask about it.

Phase 2 — Design (Approach)

Collaborate on design.md.

  1. Propose a Building Blocks Diff — list every block that is ADDED, MODIFIED, or DELETED. Use the project's building block taxonomy from .agents/skills/building-blocks/SKILL.md. Reference by name and type only — do not define internals. Implementation details belong in coding standards and per-type skills, not specs. For changes that don't map to a typed building block, use the target file path + a short description instead.

  2. Cross-slice concerns — ask whether any new block needs to interact with another feature or sub-feature slice. If yes, decide the wiring point (parent feature or page) and injection mechanism (callback, render prop, slot) in the design — don't defer to implementation.

  3. Identify contract candidates. For each block in the diff, check the signal checklist below. For every block hitting ≥1 signal, present an inline proposal — one line each: `blockName` (type) — <signal(s) hit>; design problem: <one phrase>. The developer approves/rejects each. For approved blocks, create specs/NNN-feature-name/contracts/{block-slug}.md (slug = block name kebab-cased per code-style.md; on a slug collision, suffix the type, e.g. review-form-store.md) from ./templates/contract-template.md, and add a contract link to that block's design.md Building Blocks Diff entry. Contracts are signal-driven, not type-driven — most blocks hit zero signals and get nothing. If no block hits a signal, skip this step entirely: no contracts/ directory, no proposals. When a block hits a signal but the developer rejects the proposal (or you judge it trivial), record the skip reason inline in that block's design.md entry — e.g. `fooStore` (store) — contract skipped: shape is flat.

    Signals — a block warrants a contract proposal if ≥1 holds. Signals describe properties of the design problem, not block types:

    1. Multiple states & transitions — the block moves through several discrete states with conditional or guarded transitions.
    2. Structured internal state — more than a couple of flat fields: derived values, interdependent fields, or normalized collections.
    3. Branching domain logic — conditional rules, invariants, or multi-step computation where the rules themselves are the design.
    4. Cross-slice coordination — behavior depends on wiring into another feature or sub-feature slice; the seam (callback, slot, render-prop) needs design.
    5. No canonical pattern — the block matches no established pattern the agent can look up, so its shape must be designed from scratch.
  4. For non-trivial features, propose two plausible designs with tradeoffs. Let the developer choose. Capture the winner and rationale in Design Decisions

  5. Draft the Boundaries section using the three-tier system:

    • ✅ Always — proceed without asking (e.g., create files in the feature directory)
    • ⚠️ Ask first — needs approval (e.g., modify API contracts, change schema, create shared utilities)
    • 🚫 Never — hard stops (e.g., modify core auth, remove tests, commit secrets)
  6. Present design.md for review

Critical rule for building blocks: Reference names and types. Do NOT define contracts, interfaces, or implementation — those live in separate coding-standards skills and existing code. The spec describes a CHANGE to the status quo. The agent reads relevant code to see the current status quo.

Phase 3 — Spec (Sequencing)

Fill tasks.md.

  1. Break work into a Task Breakdown — ordered, independently testable tasks. Each task:
    • References building blocks from design.md if any are involved
    • Traces to requirement IDs (R1, R2, …)
    • Includes target file paths
    • Is marked [P] (parallelizable) or [S] (sequential)
  2. Draft Error & Edge Cases using GIVEN/WHEN/THEN — cover failure modes (including fetch errors for data-fetching components), boundary conditions, concurrency
  3. Add Open Questions for anything unresolved that blocks a specific task
  4. Present tasks.md for review
Phase 4 — Review & Finalize
  1. Run a structured self-audit and present findings to the developer (don't silently verify — show the results):
    • Coverage matrix: for each requirement ID, list which task(s) implement it. Flag any requirement with zero tasks
    • Orphan tasks: flag any task that doesn't trace back to a requirement ID
    • EARS compliance: flag any requirement missing WHEN/THE SYSTEM SHALL or using vague language ("handle properly", "work correctly")
    • Boundary specificity: flag any boundary item (✅/⚠️/🚫) that references a vague category instead of a file path or module name
    • Building block references: flag any block in design.md that doesn't exist in the building-blocks catalog — acceptable without a catalog match if the block has a contract (signal 5, no canonical pattern); flag it only if it lacks both
    • Contract coverage: every contract file links back from a design.md block entry; every design.md block that hits a signal either has a contract or an inline skip reason in its entry
    • Line count: report each file's count and the combined total. Caps: requirements.md ≤50, design.md ≤80, tasks.md ≤70, combined ≤200. Contracts are excluded from the combined cap — report each contract's count separately, ≤80 each. If any cap is exceeded, identify which section to compress or extract
    • Contract count: no hard cap — report the count. A high count (e.g. >3) signals the feature should be split into separate specs; surface it, don't enforce it
  2. Fix any issues found in step 1 before proceeding
  3. Set status to review in each Meta table
  4. Present the audit results and the final spec for developer sign-off
Show full SKILL.md (576 more words)Show less

Rules & Constraints

What the agent MUST do
  • ALWAYS read the three template files in ./templates/ before drafting
  • ALWAYS use EARS notation for requirements and GIVEN/WHEN/THEN for edge cases
  • ALWAYS assign stable IDs to requirements (R1, R2, …) — tasks reference these for traceability
  • ALWAYS include the three-tier boundary system (✅ / ⚠️ / 🚫) with specific paths
What the agent MUST NOT do
  • NEVER invent requirements the developer hasn't stated or confirmed — ask instead
  • NEVER define building block internals (interfaces, schemas, implementation) in design.md — reference name + type only. Internals/pseudocode for complex blocks belong in contracts/; contracts are the one sanctioned place for block-shape detail in a spec
  • NEVER duplicate a decision across design.md and a contract — cross-block decisions go in design.md Design Decisions; intra-block shape rationale goes in the contract
  • NEVER skip a review gate — each phase needs explicit developer approval
  • NEVER conflate spec layers: requirements constrain intent, design constrains approach, tasks constrain sequencing. Keep them separate
  • NEVER add boilerplate boundaries — every item in ✅/⚠️/🚫 must be reachable during implementation of this specific feature
Prefer
  • Prefer concise specs (combined ~200 lines: requirements ≤50, design ≤80, tasks ≤70) over exhaustive ones — the curse of instructions means longer specs get followed less reliably. Contracts are excluded from the ~200 combined cap and capped individually at ≤80 lines
  • Prefer mechanical enforcement (lint, tests, schemas) over prose rules — if a constraint can be a linter rule, it doesn't belong in the spec
  • Prefer two design options with tradeoffs over a single "obvious" choice — this surfaces assumptions
  • Prefer specific file paths in boundaries over vague module names

Anti-Patterns

  • Spec that's actually a task list — "first create the model, then add the service" constrains sequencing but not intent. The agent follows every step and still builds the wrong thing. Fix: write requirements first, derive tasks from them
  • Over-specification that becomes code — if the spec includes TypeScript interfaces, database DDL, or code snippets, it has crossed from "what" into "how." Move those to design docs or coding standards
  • Under-specification that forces guessing — if a requirement says "handle errors gracefully" without specifying which errors and what "gracefully" means, the agent will guess. Fix: use GIVEN/WHEN/THEN for every error scenario
  • Auto-generated specs — LLM-generated context files have been shown to reduce task success rates. The developer drives content; the agent structures and challenges it
  • Markdown review trap — if any file exceeds its cap (requirements 50 / design 80 / tasks 70) or the combined spec exceeds ~200 lines, the review cost may exceed the value. Split the feature or compress the spec

Examples

✅ Correct: Building block reference
markdown
### Added

- `loginMutation` (mutation) — handles POST /auth/login
- `LoginForm` (component) — email/password form with validation
❌ Wrong: Building block with implementation details
markdown
### Added

- `loginMutation` (mutation):
  ```typescript
  export const loginMutation = {
    mutationFn: (data: LoginData) => api.post("/auth/login", data),
    onSuccess: (response) => {
      authStore.setToken(response.token);
    },
  };
  ```
Why wrong: the spec now contains code. The mutation's internals are governed by coding standards, not the feature spec.

### ✅ Correct: EARS requirement
```markdown
- **R3**: WHEN the login form is submitted with an empty email field, THE SYSTEM SHALL display an inline validation error without making an API call.
❌ Wrong: Vague requirement
markdown
- **R3**: The form should validate inputs properly.

Why wrong: "properly" is undefined — the agent will guess what validations to apply and what "proper" error display looks like.

Exit Criteria

The spec is ready for implementation when:

  • Every section marked REQUIRED in each template is filled
  • Every requirement has a stable ID and uses EARS notation
  • Every task traces to ≥1 requirement ID
  • Building blocks reference name + type only, no implementation details
  • Boundaries use specific file paths, not vague categories
  • Open questions are either resolved or explicitly block named tasks
  • Developer has approved the final spec (status set to approved)
  • Every proposed-and-approved contract is filled and linked from design.md
  • File sizes within caps: requirements.md ≤50, design.md ≤80, tasks.md ≤70, combined ≤200 lines; each contract ≤80 lines (excluded from the combined cap)

References

  • .agents/skills/building-blocks/SKILL.md — building block type dictionary (names, descriptions, when to use each)
  • ./templates/requirements-template.md, ./templates/design-template.md, ./templates/tasks-template.md, ./templates/contract-template.md — section structure and inline guidance
  • @docs/architecture.md — project structure, architectural decisions, conventions

© bartstc, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files in .agents/skills/writing-spec of bartstc/vite-ts-react-template.

  • SKILL.md
  • templates/contract-template.md
  • templates/design-template.md
  • templates/requirements-template.md
  • templates/tasks-template.md

Open the folder on GitHubat commit 6aa5c9c

Compare with similar skills

Writing Spec next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Writing Spec compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Writing Spec this skillbartstc/vite-ts-react-template122—~3.4kAutomated safety check: PassMIT
LobeHub Interactive Prototypelobehub/lobehub83k—~1.6kAutomated safety check: PassCustom licence
S2 Docsadobe/spectrum-design-data155—~868Automated safety check: PassApache-2.0
Code to PRDalirezarezvani/claude-skills28k1 repos~4.9kAutomated safety check: PassMIT
Product Design Workflow BundleXiaomiMiMo/MiMo-Code14k—~721Automated safety check: PassMIT
React Composition Patternsvercel-labs/openreview1.7k58 repos~721Automated safety check: PassMIT

Similar skills

  • Builds single-file interactive HTML prototypes rendered with the real LobeHub UI components and written as production-style React, so they can later be split into files.

    83k GitHub stars~1.6k tokensUpdated today
    Frontend & DesignAuto-check passed
  • S2 Docs

    adobe/spectrum-design-data

    Look up Spectrum 2 (S2) component documentation, design guidelines, and usage patterns when building with React Spectrum or Spectrum Web Components.

    155 GitHub stars~868 tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Code to PRD

    alirezarezvani/claude-skills

    Reverse-engineers a frontend, backend or fullstack codebase into a product requirements document with per-page docs, an enum dictionary and an API inventory.

    28k GitHub starsUsed in 1 repo~4.9k tokens
    Product & Project ManagementAuto-check passed
  • Product Design Workflow Bundle

    XiaomiMiMo/MiMo-Code

    Entry point to a bundle of product design workflows covering context, research, audits, ideation, URL or image to code, design QA and sharing a prototype.

    14k GitHub stars~721 tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • React Composition Patterns

    vercel-labs/openreview

    Official

    Rules for structuring React components with composition instead of boolean props, covering compound components, lifted state, variants and React 19 changes.

    1.7k GitHub starsUsed in 58 repos~721 tokens
    Frontend & DesignAuto-check passed
  • Official

    React and Next.js performance optimization guidelines from Vercel Engineering.

    6.4k GitHub starsUsed in 130 repos~1.6k tokens
    Frontend & DesignAuto-check passed

More from bartstc/vite-ts-react-template

  • GitHub Actions Templates

    bartstc/vite-ts-react-template

    Create production-ready GitHub Actions workflows for automated testing, building, and deploying applications.

    122 GitHub starsUsed in 13 repos~1.9k tokens
    Auto-check passed
  • Commit Work

    bartstc/vite-ts-react-template

    Create high-quality git commits: review/stage intended changes, split into logical commits, and write clear commit messages (including Conventional Commits).

    122 GitHub starsUsed in 3 repos~623 tokens
    Auto-check passed
  • Playwright Page Objects

    bartstc/vite-ts-react-template

    A skill your agent uses when creating page objects or refactoring Playwright E2E tests for better maintainability with Page Object Model patterns.

    122 GitHub stars~1k tokensUpdated yesterday
    Auto-check: notes
  • Explaining Code

    bartstc/vite-ts-react-template

    Explains code with visual diagrams and analogies. An agent skill from bartstc/vite-ts-react-template.

    122 GitHub starsUsed in 2 repos~154 tokens
    Auto-check passed
  • Building Blocks

    bartstc/vite-ts-react-template

    Frontend building block catalog — typed patterns for components, hooks, queries, mutations, stores, and models.

    122 GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed
  • Test Building Blocks

    bartstc/vite-ts-react-template

    Test building block catalog — typed patterns for Storybook play-function tests, Vitest hook tests, Vitest unit tests, MSW handlers, and test data fixtures.

    122 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Writing Spec

What does Writing Spec do?

Collaboratively write a feature spec with the developer. An agent skill from bartstc/vite-ts-react-template. Writing Spec is an agent skill from bartstc/vite-ts-react-template. Collaboratively write a feature spec with the developer.

When should I use Writing Spec?

Writing Spec fits situations like: A task involves 5+ unconstrained decisions; spans 10+ files; the developer explicitly asks for a spec; helper functions.

How do I install Writing Spec in Claude Code?

Run `npx skills add bartstc/vite-ts-react-template --skill writing-spec -a claude-code`. Or copy the skill folder (.agents/skills/writing-spec in bartstc/vite-ts-react-template) into .claude/skills/writing-spec in your project. Claude Code loads it when a task matches its description.

How do I install Writing Spec in Codex?

Run `npx skills add bartstc/vite-ts-react-template --skill writing-spec -a codex`. Or copy the skill folder (.agents/skills/writing-spec in bartstc/vite-ts-react-template) into .agents/skills/writing-spec in your project. Codex loads it when a task matches its description.

Can I use Writing Spec in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bartstc/vite-ts-react-template --skill writing-spec -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/writing-spec, .gemini/skills/writing-spec, .github/skills/writing-spec and .opencode/skills/writing-spec in your project.

What does Writing Spec need to run?

Going by SKILL.md and its folder, Writing Spec needs the command-line tools its instructions call (git).

Does Writing Spec access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Writing Spec safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Writing Spec use?

Writing Spec is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Writing Spec use?

About 3.4k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Writing Spec?

Skills that share tags, products or a category with Writing Spec: LobeHub Interactive Prototype (lobehub/lobehub, 83k stars), S2 Docs (adobe/spectrum-design-data, 155 stars), Code to PRD (alirezarezvani/claude-skills, 28k stars) and Product Design Workflow Bundle (XiaomiMiMo/MiMo-Code, 14k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Writing Spec?

bartstc (a GitHub user) maintains it in bartstc/vite-ts-react-template, which has 122 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 6, 2026.

Source: bartstc/vite-ts-react-template on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.