feature-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Feature Generator Skill

Feature Generator Skill

Expand a
spec.md
into a detailed
features.md
, ordered by the sequence an AI agent would most successfully implement them (dependency order). Keep both files in sync when either is modified.

spec.md
扩展为详细的
features.md
,按照AI Agent最易实现的顺序(依赖顺序)排列。当任一文件被修改时,保持两者同步。

Step 1: Check for spec.md

步骤1:检查spec.md是否存在

Before doing anything, check whether
spec.md
exists in the current context or has been provided by the user.
If spec.md does not exist: Tell the user: "There's no spec.md yet — you'll need to create one first. If you have the spec-generator skill enabled, I can kick that off for you now. Would you like to do that?"
Do not proceed until spec.md is available.

在执行任何操作前,检查当前环境中是否存在spec.md,或用户是否已提供该文件。
若spec.md不存在: 告知用户:“目前还没有spec.md——您需要先创建一个。如果您已启用spec-generator技能,我现在可以启动该流程。您需要我这么做吗?”
在spec.md可用前,请勿继续操作。

Step 2: Generating features.md

步骤2:生成features.md

Read spec.md fully. Extract every discrete piece of functionality implied by the spec — from user roles, core features, and technical stack. Then produce
features.md
following the format below.
完整读取spec.md。提取规格中隐含的每一项独立功能——包括用户角色、核心功能和技术栈。然后按照以下格式生成
features.md

Ordering rules

排序规则

Order features by implementation dependency — what must exist before something else can be built. Think like an AI agent working top to bottom through the file:
  1. Foundation first — database, auth, core models
  2. Then the simplest user-facing flows that depend on nothing else
  3. Then features that build on those
  4. Admin/internal features after customer-facing equivalents
  5. Cross-cutting concerns (notifications, rate limiting, etc.) last
按照实现依赖关系对功能进行排序——即哪些功能必须先完成,其他功能才能构建。想象AI Agent从上到下处理文件的逻辑:
  1. 基础功能优先——数据库、认证、核心模型
  2. 其次是最简单的、不依赖其他功能的用户端流程
  3. 然后是基于上述功能构建的其他功能
  4. 客户面向功能完成后,再处理管理员/内部功能
  5. 最后处理跨领域关注点(通知、速率限制等)

features.md format

features.md格式

Each feature follows this exact structure:
markdown
undefined
每个功能必须遵循以下精确结构:
markdown
undefined

[Product Name] — Features

[产品名称] — Features



[N]. [Feature Name]

[序号]. [功能名称]

[One sentence describing what this feature does and who it's for.]
User flow
  1. [Step]
  2. [Step]
  3. [Step]
UI overview [2–4 sentences describing the key UI elements involved.]


Rules:
- Every feature gets a number, a user flow, and a UI overview — no exceptions
- User flows are written from the perspective of the actor (customer, team member, visitor)
- UI overview describes what the user sees and interacts with, not implementation detail
- No sub-bullets inside user flows — numbered steps only
- Horizontal rules (`---`) between every feature and after the title

---
[一句话描述该功能的作用及面向人群。]
用户流程
  1. [步骤]
  2. [步骤]
  3. [步骤]
UI概览 [2–4句话描述涉及的关键UI元素。]


规则:
- 每个功能都必须包含序号、用户流程和UI概览——无例外
- 用户流程从参与者(客户、团队成员、访客)的视角撰写
- UI概览描述用户所见及交互内容,而非实现细节
- 用户流程内请勿使用子项目符号——仅使用编号步骤
- 每个功能之间以及标题之后都需添加水平分隔线(`---`)

---

Step 3: Syncing changes

步骤3:同步变更

When the user modifies either
spec.md
or
features.md
and asks to sync:
If spec.md was modified:
  • Identify what changed (new features added, features removed, features altered)
  • Update only the relevant features in
    features.md
    to reflect those changes
  • Add new features in the correct dependency order position
  • Remove features that no longer exist in the spec
  • Do not touch features that are unaffected
If features.md was modified:
  • Identify what changed (features added, removed, or substantially altered)
  • Update only the relevant sections of
    spec.md
    to reflect those changes
  • Preserve all other spec content exactly as-is
  • Do not rewrite or reformat untouched sections
Always confirm with the user what changed before syncing, so they can verify the right things are being updated.

当用户修改了spec.md或features.md并要求同步时:
若spec.md被修改:
  • 识别变更内容(新增功能、移除功能、功能修改)
  • 仅更新features.md中相关功能以反映这些变更
  • 将新增功能插入到正确的依赖顺序位置
  • 移除spec.md中已不存在的功能
  • 请勿改动未受影响的功能
若features.md被修改:
  • 识别变更内容(新增功能、移除功能或大幅修改功能)
  • 仅更新spec.md中相关部分以反映这些变更
  • 完全保留spec.md的其他内容
  • 请勿重写或格式化未改动的部分
在同步前,请始终与用户确认变更内容,以便用户验证需要更新的内容是否正确。

Output

输出

Save
features.md
to
/mnt/user-data/outputs/features.md
and present it using
present_files
.
If syncing changes to
spec.md
, save the updated version to
/mnt/user-data/outputs/spec.md
and present both files.
features.md
保存至
/mnt/user-data/outputs/features.md
,并使用
present_files
展示。
若同步spec.md的变更,请将更新后的版本保存至
/mnt/user-data/outputs/spec.md
,并展示两个文件。