feature-manifest

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Feature Manifest Management

功能清单管理

This skill helps you work with the feature manifest system that tracks the relationship between features and their implementations.
本技能可帮助你使用功能清单系统,该系统用于跟踪功能与其实现代码之间的关联。

When to Use This Skill

何时使用本技能

  • Creating a new feature
  • Modifying existing feature code
  • Checking which feature owns a file
  • Validating manifest accuracy
  • Updating changelogs
  • Running feature health checks
  • 创建新功能
  • 修改现有功能代码
  • 查看某个文件归属哪个功能
  • 验证清单的准确性
  • 更新变更日志
  • 运行功能健康检查

Quick Commands

快速命令

bash
undefined
bash
undefined

List all features

List all features

npm run feature:info -- --list
npm run feature:info -- --list

Get details about a feature

Get details about a feature

npm run feature:info -- <feature-id>
npm run feature:info -- <feature-id>

Find which feature owns a file

Find which feature owns a file

npm run feature:info -- --files <filepath>
npm run feature:info -- --files <filepath>

Validate all manifests

Validate all manifests

npm run feature:validate
npm run feature:validate

Check feature health (staleness, orphans, coverage)

Check feature health (staleness, orphans, coverage)

npm run feature:health
npm run feature:health

Create a new feature manifest

Create a new feature manifest

npm run feature:create
undefined
npm run feature:create
undefined

Workflow: Creating a New Feature

工作流:创建新功能

  1. Create the manifest first:
    bash
    npm run feature:create -- --id=my-feature --name="My Feature"
  2. Implement the feature, adding files as you go
  3. Update the manifest with:
    • All implementation files in
      implementation.files
    • Tests in
      tests.unit/integration/e2e
    • Dependencies in
      dependencies.internal/external
    • Environment variables in
      dependencies.env_vars
  4. Validate before committing:
    bash
    npm run feature:validate
  1. 先创建清单:
    bash
    npm run feature:create -- --id=my-feature --name="My Feature"
  2. 实现功能,逐步添加文件
  3. 更新清单,包含以下内容:
    • implementation.files
      中的所有实现文件
    • tests.unit/integration/e2e
      中的测试用例
    • dependencies.internal/external
      中的依赖项
    • dependencies.env_vars
      中的环境变量
  4. 提交前验证:
    bash
    npm run feature:validate

Workflow: Modifying an Existing Feature

工作流:修改现有功能

  1. Read the manifest first:
    bash
    npm run feature:info -- &lt;feature-id>
  2. Make your changes to the implementation files
  3. Update the manifest:
    • Add new files to
      implementation.files
    • Update
      history.last_modified
      to today's date
    • Add a changelog entry
  4. Validate:
    bash
    npm run feature:validate
  1. 先查看清单:
    bash
    npm run feature:info -- <feature-id>
  2. 修改实现文件
  3. 更新清单:
    • implementation.files
      添加新文件
    • history.last_modified
      更新为当前日期
    • 添加变更日志条目
  4. 验证:
    bash
    npm run feature:validate

Manifest Structure

清单结构

yaml
id: feature-id
name: Human Readable Name
status: complete  # planned | in-progress | complete | deprecated
priority: P1

description: |
  What this feature does and why it exists.

implementation:
  files:
    - src/app/api/feature/route.ts
    - src/lib/feature.ts
  entry_point: src/lib/feature.ts
  database_tables:
    - tableName
  api_routes:
    - POST /api/feature

tests:
  unit:
    - src/lib/__tests__/feature.test.ts
  integration: []
  e2e: []

dependencies:
  internal:
    - features/authentication.yaml
  external:
    - package-name
  env_vars:
    - FEATURE_SECRET
  secrets:
    - feature-api-key

history:
  created: "2024-12-01"
  last_modified: "2024-12-23"

changelog:
  - version: "1.0.0"
    date: "2024-12-23"
    changes:
      - "Initial implementation"
yaml
id: feature-id
name: Human Readable Name
status: complete  # planned | in-progress | complete | deprecated
priority: P1

description: |
  What this feature does and why it exists.

implementation:
  files:
    - src/app/api/feature/route.ts
    - src/lib/feature.ts
  entry_point: src/lib/feature.ts
  database_tables:
    - tableName
  api_routes:
    - POST /api/feature

tests:
  unit:
    - src/lib/__tests__/feature.test.ts
  integration: []
  e2e: []

dependencies:
  internal:
    - features/authentication.yaml
  external:
    - package-name
  env_vars:
    - FEATURE_SECRET
  secrets:
    - feature-api-key

history:
  created: "2024-12-01"
  last_modified: "2024-12-23"

changelog:
  - version: "1.0.0"
    date: "2024-12-23"
    changes:
      - "Initial implementation"

Health Report Interpretation

健康报告解读

When running
npm run feature:health
:
  • Healthy Features: Manifest matches code, tests exist
  • Stale Features: Manifest not updated in 90+ days, or code changed after manifest
  • Without Tests: Complete features that have no tests listed
  • Orphaned Files: Files in
    src/
    not tracked by any manifest
  • Suggested Manifests: New directories that should have manifests
运行
npm run feature:health
命令时:
  • 健康功能:清单与代码匹配,存在测试用例
  • 过时功能:清单已90天以上未更新,或代码在清单更新后有修改
  • 无测试功能:已完成但未列出测试用例的功能
  • 孤立文件
    src/
    目录中未被任何清单跟踪的文件
  • 建议创建清单:应创建清单的新目录

Best Practices

最佳实践

  1. One feature per manifest - Keep them focused
  2. Update on every change - Don't let manifests go stale
  3. Changelog is append-only - Never modify old entries
  4. Include all files - Don't leave orphaned files
  5. Link dependencies - Show which features depend on others
  1. 一个清单对应一个功能 - 保持清单聚焦
  2. 每次变更都更新清单 - 避免清单过时
  3. 变更日志仅可追加 - 切勿修改旧条目
  4. 包含所有文件 - 避免出现孤立文件
  5. 关联依赖项 - 明确哪些功能依赖其他功能