speckit-baseline
Generate a technology-agnostic feature specification by analyzing existing source code, extracting user stories, functional requirements, and acceptance criteria from code patterns. Use when the user needs to document an existing or legacy codebase, create a spec before refactoring, or reverse-engineer requirements from source files.
Best use case
speckit-baseline is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Generate a technology-agnostic feature specification by analyzing existing source code, extracting user stories, functional requirements, and acceptance criteria from code patterns. Use when the user needs to document an existing or legacy codebase, create a spec before refactoring, or reverse-engineer requirements from source files.
Generate a technology-agnostic feature specification by analyzing existing source code, extracting user stories, functional requirements, and acceptance criteria from code patterns. Use when the user needs to document an existing or legacy codebase, create a spec before refactoring, or reverse-engineer requirements from source files.
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "speckit-baseline" skill to help with this workflow task. Context: Generate a technology-agnostic feature specification by analyzing existing source code, extracting user stories, functional requirements, and acceptance criteria from code patterns. Use when the user needs to document an existing or legacy codebase, create a spec before refactoring, or reverse-engineer requirements from source files.
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/speckit-baseline/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How speckit-baseline Compares
| Feature / Agent | speckit-baseline | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Generate a technology-agnostic feature specification by analyzing existing source code, extracting user stories, functional requirements, and acceptance criteria from code patterns. Use when the user needs to document an existing or legacy codebase, create a spec before refactoring, or reverse-engineer requirements from source files.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Spec Kit Baseline Skill
## When to Use
- You need a spec for existing or legacy code.
- You want to document a feature before refactoring.
- You inherited a codebase without written requirements.
## Inputs
- A target path, file list, or glob pattern describing the code to analyze.
- Repo context with `.specify/` scripts and templates.
If the target is missing or ambiguous, ask a focused question before continuing.
## Goal
Generate a technology-agnostic spec for existing code, then create the feature branch/spec file using the standard Spec Kit templates.
## Workflow
1. **Parse target input**: Identify files, directories, or patterns to analyze.
- Accept file paths, glob patterns, or directory paths.
- If empty: stop and ask for a concrete target.
2. **Discover and read source files**:
- Expand globs to a file list.
- Read file contents for analysis.
- Identify primary language(s) and frameworks.
- Map key file relationships and dependencies.
3. **Analyze code structure**:
- Identify entry points and public interfaces.
- Extract function/method signatures and behaviors.
- Find data models and entities.
- Detect API endpoints and routes.
- Identify user-facing functionality.
4. **Generate a short name** (2-4 words) from the analyzed code:
- Use action-noun format (e.g., "user-auth", "payment-processing").
- Base on primary functionality discovered.
- Preserve technical terms where meaningful.
5. **Create the feature branch and spec file**:
- Find the highest existing feature number for this short name (branches/specs).
- Run `.specify/scripts/bash/create-new-feature.sh --json` with the calculated number and short name.
- Read BRANCH_NAME, FEATURE_DIR, and SPEC_FILE paths from the script JSON output.
- For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
6. **Load the spec template** from `.specify/templates/spec-template.md`.
7. **Draft the specification** using the template structure:
- **User Stories**: Infer from user-facing code paths and interactions.
- **Acceptance Scenarios**: Derive from validation logic, error handling, and tests.
- **Functional Requirements**: Extract from business rules and constraints.
- **Key Entities**: Identify from data models and schemas.
- **Success Criteria**: Infer from metrics, logging, or performance-related code.
- **Assumptions**: Document inferences made during analysis.
8. **Abstract implementation details**:
- Convert technical patterns to user-focused requirements.
- Remove framework-specific terminology.
- Focus on WHAT the code does, not HOW it does it.
9. **Create spec quality checklist** at `FEATURE_DIR/checklists/requirements.md`.
10. **Report completion** with:
- Branch name and spec file path.
- Summary of analyzed files.
- Key features discovered.
- Areas needing clarification or review.
## Outputs
- `specs/<feature>/spec.md`
- `specs/<feature>/checklists/requirements.md`
## Key rules
- Focus on extracting WHAT and WHY from HOW.
- Abstract away implementation details in the generated spec.
- Document assumptions made during code analysis.
- Flag areas where code behavior is unclear.
- Preserve discovered business rules and constraints.
- Use `[NEEDS CLARIFICATION]` for ambiguous code sections (max 3).
- Generated specs should be validated by someone who knows the feature.
## Examples
**Code Pattern → Spec Requirement**:
- `if (user.role === 'admin')` → "System MUST restrict action to administrator users"
- `password.length >= 8` → "Passwords MUST be at least 8 characters"
- `cache.set(key, value, 3600)` → "System MUST cache results for improved performance"
- `try { ... } catch (e) { notify(e) }` → "System MUST notify users when errors occur"
**Code Pattern → User Story**:
- Login endpoint with OAuth → "As a user, I can sign in using my social account"
- Shopping cart logic → "As a customer, I can add items to my cart for later purchase"
- Report generation → "As an analyst, I can generate reports on system activity"
## Next Steps
After generating spec.md:
- **Clarify** with domain experts using speckit-clarify.
- **Plan** modernization/refactoring with speckit-plan.
- **Compare** the generated spec with actual requirements to identify gaps.Related Skills
speckit-taskstoissues
Convert tasks.md entries into GitHub issues in the matching remote repository using gh issue create, preserving task IDs for traceability. Use when the user wants to create GitHub issues from an existing tasks.md, needs issue tracking for implementation tasks, or wants to sync task progress with GitHub project boards.
speckit-tasks
Generate a dependency-ordered tasks.md organized by user story, with phased execution (Setup, Foundational, User Stories, Polish), parallel markers, and strict checklist format (checkbox, TaskID, Story label, file path). Use when the implementation plan is ready and the user needs an executable task breakdown before coding.
speckit-specify
Create or update a feature specification from a natural language description by generating a branch, filling the spec template with user stories, functional requirements, success criteria, and running quality validation. Use when the user provides a feature idea and needs a structured, technology-agnostic spec ready for planning.
speckit-plan
Generate a technical implementation plan from a feature spec by filling the plan template, resolving unknowns via research, producing data-model.md, API contracts, and quickstart.md artifacts. Use when the feature spec is ready and the user needs architecture decisions, data models, API schemas, or a structured plan before task generation.
speckit-install
Install the Specify CLI on the host machine (uv tool install or uvx one-time); supports multiple OS, persistent or one-time install, and corporate or restricted-network environments. Use when the user says "install Spec Kit", "install Specify CLI", or "specify command not found".
speckit-initial
Run `specify init` in the current or target directory to bootstrap a Spec Kit project (pull .specify/ and slash commands); supports multiple AI agents and --script sh/ps. Use when the user says "initialize Spec Kit project", "specify init", or "set up Spec Kit in this repo".
speckit-implement
Execute the implementation plan by processing tasks from tasks.md phase-by-phase, following TDD order, respecting task dependencies and parallel markers, setting up ignore files, and marking completed tasks. Use when the plan and tasks are ready and the user wants to begin coding, or when resuming implementation after a pause.
speckit-constitution
Create or update the project constitution at .specify/memory/constitution.md by collecting governance principles, filling template placeholders, versioning with semver, and propagating changes to dependent templates and agent config files. Use when setting up initial project governance, amending principles, or syncing constitution changes across spec/plan/tasks templates.
speckit-clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
speckit-checklist
Generate a requirements-quality checklist ('unit tests for English') that validates completeness, clarity, consistency, and measurability of spec/plan/tasks artifacts. Use when the user needs a quality gate before implementation, wants to audit requirement coverage, or needs domain-specific checklists (UX, API, security, performance).
speckit-analyze
Perform a read-only cross-artifact consistency analysis across spec.md, plan.md, and tasks.md, detecting duplications, ambiguities, coverage gaps, and constitution violations with severity ratings. Use when the user has all three artifacts and needs a quality check before implementation, or wants to identify inconsistencies across specifications.
speckit-check
Run `specify check` to verify that Spec Kit required tools (git, claude, gemini, code, cursor-agent, windsurf, qwen, opencode, codex, shai, qoder, etc.) are installed and available; interpret results and suggest next steps. Use when the user says "check Spec Kit environment", "specify not working", or "slash commands not showing".