Agent skill

Feature Spec Generator

by cashew-labs in cashew-labs/libretto

Researches the codebase and relevant docs, asks clarifying questions, then writes a spec sheet in specs/ for a significant feature or complex fix.

MITAuto-check passedDevelopment

Install Feature Spec Generator

skills CLI
$ npx skills add cashew-labs/libretto --skill generate-spec -a claude-code

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

GitHub CLI
$ gh skill install cashew-labs/libretto generate-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/cashew-labs/libretto.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/generate-spec .claude/skills/generate-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
generate-spec
GitHub stars
904
Token cost
~2.4k tokens
SKILL.md length
1,021 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

Researches the codebase and relevant docs, asks clarifying questions, then writes a spec sheet in specs/ for a significant feature or complex fix.

  • Planning a significant new feature before any code is written
  • SKILL.md covers Understand existing code, Understand external…, Ask critical guiding questions and Establish goals and non-goals, plus 2 more sections
  • Calls pnpm
  • Scoping a complex fix that touches many parts of the codebase

What it does

For a substantial feature or a tricky fix, this skill produces a written spec in the `specs/` directory instead of jumping straight to code. The agent first studies the relevant code, using code-search sub-agents and grep, and looks up the documentation of any external library involved, sticking closely to that library's own examples and recommended practice.

Before writing anything it pauses to ask you the questions that matter, such as adding a new table versus extending an existing one, a modal versus an inline panel, or polling versus WebSockets, with the trade-offs laid out briefly. A fully defined request skips the questions. It then settles explicit goals and non-goals, which come from you; if you did not give any, it proposes a set and waits for confirmation. Goals are end-user stories that describe what is true once the work is done.

When your agent uses it

  • Planning a significant new feature before any code is written
  • Scoping a complex fix that touches many parts of the codebase
  • Turning a vague request into agreed goals and non-goals

Example prompts

  • “Write a spec in specs/ for adding Gmail trigger support to our automation builder.”
  • “Spec out the fix for sessions expiring mid-upload, and ask me whatever you need to decide.”
  • “Draft goals and non-goals for the new CSV export feature, then write the spec.”

What it can do on your machine

Read from SKILL.md and the folder at commit 41ab782. 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:

    • pnpm

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

  • Network

    No URLs in SKILL.md. Its commands use pnpm, 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

Feature Spec Generator loads about 2.4k tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 1,021 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~37
When it runs · the whole SKILL.md, loaded when a task matches
~2.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 cashew-labs/libretto at commit 41ab782, republished under its MIT licence (© cashew-labs). 1,021 words, ~2,352 tokens.

Download SKILL.mdSave it as .claude/skills/generate-spec/SKILL.md (or your agent's skills folder).
name
generate-spec
description
Create a spec sheet for the given feature/fix request in specs/ directory. Use when planning a significant new feature or complex fix.

Create a spec sheet for the given feature/fix request in specs/ directory.

Ultrathink. Follow the following steps:

Understand existing code

Use code search sub-agents and grep as much as possible to deeply understand all of the relevant code. Be smart about your code search: start with where you think it might be, and if that inspires different places to read, follow up with sub-agents to do so. Each sub-agent should give you back information, and potentially other files to read or searches that might be relevant.

Understand external documentation/libraries

If external libraries are involved, always look up and research their relevant documentation as well. Tend to adhere strictly to the examples and best practices provided by the external libraries.

Ask critical guiding questions

After completing the research steps above, pause and ask the user any critical guiding questions before writing the spec. The feature/fix request will not always be completely defined. There may be logical errors, ambiguous requirements, or important clarifications required. Examples:

  • "To store this data, we could either add a new table or extend the existing X table. The new table keeps concerns separate but adds a join; extending X is simpler but couples the concepts. Which do you prefer?"
  • "There are two ways to surface this to the user: a modal dialog or an inline panel. The modal is more disruptive but harder to miss; the inline panel is less intrusive but easier to overlook. Which feels right?"
  • "We need to sync this state. We could poll on an interval or use a WebSocket. Polling is simpler to implement but adds latency; WebSocket is real-time but more complex. Which trade-off do you want?"

Present the options you see, explain the trade-offs briefly, and let the user decide. If the feature request is fully defined and the path forward is obvious, skip the questions and write the spec directly. Practice good judgement.

Establish goals and non-goals

After research and any clarifying questions, establish explicit goals and non-goals for the spec. These come directly from the user. If the user did not provide them in the initial prompt, suggest a set of goals and non-goals and ask for confirmation before proceeding.

Goals are high-level end-user stories that describe what should be true when the spec is complete. Example: "user sets up a Gmail trigger and it works as expected."

Non-goals clarify what is deliberately out of scope. Example: "don't worry about migration or backfills."

By default, always include "no migrations or backfills" as a non-goal unless the user explicitly requests them.

The spec must include these sections near the top, before the implementation plan.

Reason critically about the spec

Before writing the spec, think through the implementation with a "bicycle before car" mindset. Spec the simplest version that works end-to-end and delivers real value. Do not spec the scalable, polished, extensible version.

Scope

Cut any phase that is not required for the core functionality to work. If you can remove a phase and a real user can still use the feature, it does not belong in v1. Infrastructure, abstraction layers, configuration systems, and polish are almost never v1 work.

Testing

Each phase's success criteria should verify the thing most likely to go wrong, not the thing most likely to go right. A test that a Zod schema parses valid input is low-value. A test that filtering logic excludes wrong results is high-value. Ask: "What would make me revert this phase?" Test that.

If a phase does not have a clear way to verify it works, the phase is poorly scoped. Restructure it so it produces something testable: extract a pure function, expose an interface, write to an observable output. Design for testability in the spec, not after implementation.

Show full SKILL.md (402 more words)Show less
End-to-end verification

Agents have access to CLI tools for running tests and project scripts. Specs should leverage these where appropriate.

When a phase involves runtime behavior, prefer success criteria that verify end-to-end behavior with the project's existing scripts and test commands rather than only relying on unit tests.

Common failure modes
  • Adding extensibility or configurability nobody asked for
  • Creating abstractions before there are two concrete cases
  • Testing that code exists rather than testing that it behaves correctly
  • Phases that are pure refactoring or setup with no user-facing progress

Write an effective spec

Specs should always have the following form:

markdown
## Problem overview

A couple plain English sentences describing the problem: either a bug, or a feature request, or a refactor to be done with motivation

## Solution overview

A couple plain English sentences describing the proposed solution.

## Goals

High-level end-user stories that must be true when the spec is complete.

## Non-goals

What is deliberately out of scope. Always includes "no migrations or backfills" unless the user requested them.

## Important files/docs/websites for implementation

A list of all the files that are involved in the implementation. Also included should be any docs files or external links to documentation. Each doc should be annotated with a brief sentence about what it is (and if its not obvious, why it's relevant).

## Implementation

A phased plan where each phase represents a single commit-sized change (<100 lines). Each phase should be independently committable and leave the codebase in a working state.
Each phase heading must be followed by a short one- to two-sentence description that explains the intent of the phase and what changes after it lands.

Each implementation phase must include success criteria as task items alongside the implementation tasks. Success criteria are verifiable assertions: quick checks ("ensure X is in package.json"), unit tests to write and run, or manual user stories. They should be the minimum set needed to confirm the phase is correctly done.

When a phase is centered on writing or changing code paths, include a short TypeScript code sample in that phase. The sample should show caller-facing interfaces and/or key implementation pieces using high-level descriptive function names. Keep each sample under 30 lines and treat it as a sketch, not production-ready code.

Phase code samples should show where new code interleaves with existing code. Include the file path in a comment, preserve the surrounding class/function/control-flow shape, and use ... for unchanged existing code rather than replacing the surrounding context with standalone snippets.

ts
// packages/libretto/src/daemon/client.ts
class DaemonClient {
  ...

  async findSession(id: string) {
    ...
    const session = await this.readSession(id);
    return normalizeSession(session);
  }
}

If a phase is documentation-only, infra-only, or otherwise not code-centric, skip the code sample for that phase.

markdown
### Phase 1: Add gender and age fields to the provider search input schema

Define the new input contract first so later query changes are constrained by a typed shape. Keep this phase focused on schema changes and validation coverage.

```ts
type SearchProvidersInput = {
  gender?: "M" | "F";
  ageFilter?: { min_age?: number; max_age?: number };
};

function buildSearchProvidersInputSchema() {
  return z.object({
    gender: z.enum(["M", "F"]).optional(),
    ageFilter: z
      .object({ min_age: z.number().int().optional(), max_age: z.number().int().optional() })
      .optional(),
  });
}
  • Add gender parameter to searchProvidersInput schema in apps/api/src/tools/searchProviders.ts as optional z.enum(["M", "F"])
  • Add ageFilter parameter using structured object with optional min_age and max_age integer fields
  • Verify pnpm run typecheck passes with the new fields
  • Add a unit test that parses input with gender: "M" and ageFilter: { min_age: 30 } without throwing
Phase 2: Implement gender and age filtering logic

Apply the schema fields to query construction so users see behavior changes in runtime results. Validate filtering semantics with focused tests that fail on wrong inclusions.

ts
async function searchProviders(input: SearchProvidersInput) {
  const query = createProviderQuery();
  const withGender = applyGenderFilter(query, input.gender);
  const withAgeRange = applyAgeRangeFilter(withGender, input.ageFilter);
  return runProviderQuery(withAgeRange);
}
  • Add gender filtering logic to the database query using eq(providers.gender, gender) when gender is provided
  • Add age range filtering logic using gte(providers.age, min_age) and lte(providers.age, max_age) when age filters are provided
  • Add a unit test querying with gender: "F" and assert only female providers are returned
  • Add a unit test querying with ageFilter: { min_age: 30, max_age: 50 } and assert results are within range

### What to avoid in the spec

- Avoid introducing new infrastructure, abstractions, or optimization work unless explicitly required for the requested outcome.
- Avoid refactor-only phases that do not produce user-visible or test-visible progress.

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

Files

Just SKILL.md in .agents/skills/generate-spec of cashew-labs/libretto.

Open the folder on GitHubat commit 41ab782

Compare with similar skills

Feature Spec Generator 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.

Feature Spec Generator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Feature Spec Generator this skillcashew-labs/libretto904—~2.4kAutomated safety check: PassMIT
GSD Phase Discussionopen-gsd/gsd-core10k1 repos~1.5kAutomated safety check: WarnMIT
Interview-Driven Spec Writerposhan0126/dotclaude871—~804Automated safety check: PassMIT
Spec-Driven DevelopmentLichAmnesia/lich-skills234—~3.5kAutomated safety check: PassMIT
Brainstorming Before BuildingjnMetaCode/superpowers-zh8.3k—~1.8kAutomated safety check: PassMIT
Spec-Driven Developmentaddyosmani/agent-skills103k1 repos~3.2kAutomated safety check: PassMIT

Similar skills

  • GSD Phase Discussion

    open-gsd/gsd-core

    Asks adaptive questions about a project phase and records the decisions in a CONTEXT.md that later research and planning agents can act on without asking again.

    10k GitHub starsUsed in 1 repo~1.5k tokens
    Agent WorkflowsAuto-check: warnings
  • Interview-Driven Spec Writer

    poshan0126/dotclaude

    Interviews you about scope, behavior, edge cases and verification, then writes a self-contained SPEC.md that a fresh session can implement without this conversation.

    871 GitHub stars~804 tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Spec-Driven Development

    LichAmnesia/lich-skills

    Runs a gated Spec, Plan, Build, Test, Review, Ship workflow so non-trivial changes are specified, verified and reviewed before they ship, with a named artifact per phase.

    234 GitHub stars~3.5k tokensUpdated 4 mo ago
    Agent WorkflowsAuto-check passed
  • Brainstorming Before Building

    jnMetaCode/superpowers-zh

    Turns a rough idea into an approved design before any code is written, sorting the request into spike, bounded or architectural and enforcing an approval gate.

    8.3k GitHub stars~1.8k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Spec-Driven Development

    addyosmani/agent-skills

    Writes a structured specification before any code, moving through gated specify, plan, tasks and implement phases, with an optional capability map for multi-part requests.

    103k GitHub starsUsed in 1 repo~3.2k tokens
    DevelopmentAuto-check passed
  • GitHub Issue Reader

    jumppad-labs/jumppad

    Pulls a GitHub issue's description, comments, labels, assignees, milestone and linked pull requests into one markdown report so the agent can plan a fix.

    263 GitHub stars~958 tokensUpdated 8 days ago
    DevelopmentAuto-check passed

More from cashew-labs/libretto

All 21 skills in this repo
  • System Prompt Writing Guide

    cashew-labs/libretto

    Lays out a minimal, iteration-first approach to writing system prompts for LLM agents, with model-specific notes for Claude, GPT, Gemini, and Codex.

    904 GitHub stars~570 tokensUpdated 1 mo ago
    Auto-check passed
  • Address PR Review Comments

    cashew-labs/libretto

    Works through the review comments on a pull request one by one: fetches the threads, makes the fixes, runs type-check, build and lint, pushes, and resolves the threads.

    904 GitHub stars~532 tokensUpdated 1 mo ago
    Auto-check passed
  • CLI Development

    cashew-labs/libretto

    Design rules for command-line tools: subcommand-scoped help, actionable success output, debuggable failures, stable output, meaningful exit codes and a --json mode.

    904 GitHub stars~781 tokensUpdated 1 mo ago
    Auto-check passed
  • Drives desktop Electron apps already installed on your machine, such as Slack, Discord or VS Code, by relaunching them with a debugging port and using the Libretto CLI.

    904 GitHub stars~967 tokensUpdated 1 mo ago
    Auto-check passed
  • Merge Conflict Resolver

    cashew-labs/libretto

    Resolves Git merge, rebase and cherry-pick conflicts by reading the PRs behind each side, keeping both intents and asking you when they truly clash.

    904 GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Glimpse Changes Walkthrough

    cashew-labs/libretto

    Turns the current session's code changes into a Markdown walkthrough shown in a native Glimpse window, with highlighted code, rendered diffs and review feedback.

    904 GitHub stars~1.5k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Feature Spec Generator

What does Feature Spec Generator do?

Researches the codebase and relevant docs, asks clarifying questions, then writes a spec sheet in specs/ for a significant feature or complex fix. For a substantial feature or a tricky fix, this skill produces a written spec in the `specs/` directory instead of jumping straight to code. The agent first studies the relevant code, using code-search sub-agents and grep, and looks up the documentation of any external library involved, sticking closely to that library's own examples and recommended practice.

When should I use Feature Spec Generator?

Feature Spec Generator fits situations like: planning a significant new feature before any code is written; scoping a complex fix that touches many parts of the codebase; turning a vague request into agreed goals and non-goals.

How do I install Feature Spec Generator in Claude Code?

Run `npx skills add cashew-labs/libretto --skill generate-spec -a claude-code`. Or copy the skill folder (.agents/skills/generate-spec in cashew-labs/libretto) into .claude/skills/generate-spec in your project. Claude Code loads it when a task matches its description.

How do I install Feature Spec Generator in Codex?

Run `npx skills add cashew-labs/libretto --skill generate-spec -a codex`. Or copy the skill folder (.agents/skills/generate-spec in cashew-labs/libretto) into .agents/skills/generate-spec in your project. Codex loads it when a task matches its description.

Can I use Feature Spec Generator 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 cashew-labs/libretto --skill generate-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/generate-spec, .gemini/skills/generate-spec, .github/skills/generate-spec and .opencode/skills/generate-spec in your project.

What does Feature Spec Generator need to run?

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

Does Feature Spec Generator access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Feature Spec Generator 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 Feature Spec Generator use?

Feature Spec Generator 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 Feature Spec Generator use?

About 2.4k tokens (SKILL.md is roughly 9.4k 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 Feature Spec Generator?

Skills that share tags, products or a category with Feature Spec Generator: GSD Phase Discussion (open-gsd/gsd-core, 10k stars), Interview-Driven Spec Writer (poshan0126/dotclaude, 871 stars), Spec-Driven Development (LichAmnesia/lich-skills, 234 stars) and Brainstorming Before Building (jnMetaCode/superpowers-zh, 8.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Feature Spec Generator?

cashew-labs (a GitHub organization) maintains it in cashew-labs/libretto, which has 904 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on August 21, 2026.

Source: cashew-labs/libretto on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.