feature-manifest
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFeature 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
undefinedbash
undefinedList 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
undefinednpm run feature:create
undefinedWorkflow: Creating a New Feature
工作流:创建新功能
-
Create the manifest first:bash
npm run feature:create -- --id=my-feature --name="My Feature" -
Implement the feature, adding files as you go
-
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
- All implementation files in
-
Validate before committing:bash
npm run feature:validate
-
先创建清单:bash
npm run feature:create -- --id=my-feature --name="My Feature" -
实现功能,逐步添加文件
-
更新清单,包含以下内容:
- 中的所有实现文件
implementation.files - 中的测试用例
tests.unit/integration/e2e - 中的依赖项
dependencies.internal/external - 中的环境变量
dependencies.env_vars
-
提交前验证:bash
npm run feature:validate
Workflow: Modifying an Existing Feature
工作流:修改现有功能
-
Read the manifest first:bash
npm run feature:info -- <feature-id> -
Make your changes to the implementation files
-
Update the manifest:
- Add new files to
implementation.files - Update to today's date
history.last_modified - Add a changelog entry
- Add new files to
-
Validate:bash
npm run feature:validate
-
先查看清单:bash
npm run feature:info -- <feature-id> -
修改实现文件
-
更新清单:
- 向添加新文件
implementation.files - 将更新为当前日期
history.last_modified - 添加变更日志条目
- 向
-
验证: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 not tracked by any manifest
src/ - Suggested Manifests: New directories that should have manifests
运行命令时:
npm run feature:health- 健康功能:清单与代码匹配,存在测试用例
- 过时功能:清单已90天以上未更新,或代码在清单更新后有修改
- 无测试功能:已完成但未列出测试用例的功能
- 孤立文件:目录中未被任何清单跟踪的文件
src/ - 建议创建清单:应创建清单的新目录
Best Practices
最佳实践
- One feature per manifest - Keep them focused
- Update on every change - Don't let manifests go stale
- Changelog is append-only - Never modify old entries
- Include all files - Don't leave orphaned files
- Link dependencies - Show which features depend on others
- 一个清单对应一个功能 - 保持清单聚焦
- 每次变更都更新清单 - 避免清单过时
- 变更日志仅可追加 - 切勿修改旧条目
- 包含所有文件 - 避免出现孤立文件
- 关联依赖项 - 明确哪些功能依赖其他功能