speckit-baseline

通过分析现有源代码生成功能规格说明。

仓库最近推送
GitHub Stars
176
Forks
28
Issues / PRs
2

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "speckit-baseline":https://skillpi.com/zh/skills/deepskill-7d88deba737e872cfb00f8ce15fdfc9bf9e6fa543cd306ee6870ba67b855e41d。安装前核对上游来源和版本:https://github.com/dceoy/speckit-agent-skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

通过分析现有源代码生成功能规格说明。

0 下载

介绍来源: third_party · dceoy · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
适合谁
翻译待完成,请参阅来源文档。
输入和输出
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
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.

版本历史

  1. v0.1.2 GitHub ↗
    原版更新说明

    ## 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 ↗
    原版更新说明

    ## 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 ↗
    原版更新说明

    ## 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

当前收录版本

0.0.1

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值78/100

亮点

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

待提升项

  • description写错位置 原报告严重程度:轻微

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

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

亮点

  • 触发场景描述清晰,覆盖典型使用案例
  • 输入输出定义明确,边界清晰
结构规范82/100

待提升项

  • 缺少出口条件描述 原报告严重程度:轻微

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

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

亮点

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

待提升项

  • 依赖外部文件未验证存在性 原报告严重程度:重大

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

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

亮点

  • 参数转义说明详细(如单引号处理)
  • 关键规则明确(如抽象实现细节、标记需澄清项)
证据可验 (前四项均值)78/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

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

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 账号、密钥或授权

    使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。

    主文档提及 · 第 104 行
  • 管理员或提升权限

    确认确有必要再提升权限;不要关闭防护、绕过证书验证或扩大整个系统的访问权限。

    主文档提及 · 第 97 行

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。