speckit-baseline

Generates functional specification documents by analyzing existing source code.

Last repository push
GitHub Stars
176
Forks
28
Issues / PRs
2

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "speckit-baseline" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-7d88deba737e872cfb00f8ce15fdfc9bf9e6fa543cd306ee6870ba67b855e41d. Verify the upstream source and version against https://github.com/dceoy/speckit-agent-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Generates functional specification documents by analyzing existing source code.

0 Downloads

Introduction source: third_party · dceoy · 0.0.1 Reference

SkillPi interpretation

Tasks
Generate feature specifications by analyzing existing source code.
Audience
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 and outputs
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.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: speckit-baseline
description: Generate feature specifications by analyzing existing source code.

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.

Version history

  1. v0.1.2 GitHub ↗
    Original release notes

    ## What's Changed * Improve speckit skill docs by @dceoy in https://github.com/dceoy/speckit-agent-skills/pull/5 * Simplify repository guidelines and runtime links by @dceoy in https://github.com/dceoy/speckit-agent-skills/pull/7 **Full Changelog**: https://github.com/dceoy/speckit-agent-skills/compare/v0.1.1...v0.1.2

  2. v0.1.1 GitHub ↗
    Original release notes

    ## What's Changed * Recreate Spec Kit skills from slash commands by @dceoy in https://github.com/dceoy/speckit-agent-skills/pull/4 **Full Changelog**: https://github.com/dceoy/speckit-agent-skills/compare/v0.1.0...v0.1.1

  3. v0.1.0 GitHub ↗
    Original release notes

    ## What's Changed * Add speckit-fromcode skill to generate specs from existing code by @dceoy in https://github.com/dceoy/speckit-agent-skills/pull/1 * Update docs to use agent skills by @dceoy in https://github.com/dceoy/speckit-agent-skills/pull/2 * Add OpenCode to the AI assistants by @dceoy in https://github.com/dceoy/speckit-agent-skills/pull/3 ## New Contributors * @dceoy made their first contribution in https://github.com/dceoy/speckit-agent-skills/pull/1 **Full Changelog**: https://github.com/dceoy/speckit-agent-skills/commits/v0.1.0

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 解决开发者常见痛点:为遗留或无文档代码生成规格说明
  • 适用场景明确,包括重构前文档化、接手代码库等
Trigger Precision85/100

Areas to improve

  • description写错位置 Reported severity: Minor

    description 内容位于 skill_body 内部的 frontmatter,而非顶层元数据

    Recommendation: 建议将 description 字段移至顶层,与 name 并列

Highlights

  • 触发场景描述清晰,覆盖典型使用案例
  • 输入输出定义明确,边界清晰
Structure and Standards82/100

Areas to improve

  • 缺少出口条件描述 Reported severity: Minor

    Workflow 步骤完整但未明确说明成功/失败的出口条件

    Recommendation: 建议在 Workflow 末尾补充成功判定标准和错误处理出口

Highlights

  • 10步工作流逻辑清晰,Phase 划分合理
  • 提供 Code Pattern → Spec Requirement 的实用示例
Execution Reliability65/100

Areas to improve

  • 依赖外部文件未验证存在性 Reported severity: Major

    核心流程依赖 .specify/scripts/bash/create-new-feature.sh 和 .specify/templates/spec-template.md,但未检查这些文件是否存在

    Recommendation: 建议在步骤5和6添加前置文件存在性检查,若缺失则提示用户或提供 fallback 方案

Highlights

  • 参数转义说明详细(如单引号处理)
  • 关键规则明确(如抽象实现细节、标记需澄清项)
Evidence Verifiability (mean of the first four)78/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Accounts, secrets or authorization

    Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.

    Mentioned in main document · lines 104
  • Administrator or elevated privileges

    Elevate only when necessary. Keep protection and certificate validation enabled and avoid broad system access.

    Mentioned in main document · lines 97

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.