关于 feature-manifest
这项 Skill 用于维护功能清单,记录软件功能与实现文件、测试、依赖项及变更历史的关联。它提供创建、更新和验证清单的命令与流程。
主要功能
- 01创建和查看功能清单
- 02追踪实现文件与测试
- 03记录依赖项和环境变量
- 04验证清单准确性
- 05检查功能状态与未归档文件
适用场景
- 01登记新实现的功能
- 02代码变更后更新清单
- 03查询文件所属功能
- 04查找过期清单或未追踪文件
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ curiositech/ some_claude_skills --skill feature-manifest安装后在 Claude Code 中输入/feature-manifest确认已加载。
附带文件.claude-plugin/plugin.json
详细介绍
功能清单管理
此技能可帮助你使用功能清单系统,跟踪功能与其实现之间的关系。
何时使用此技能
- 创建新功能
- 修改现有功能代码
- 检查某个文件归属哪个功能
- 验证清单是否准确
- 更新变更日志
- 运行功能健康检查
快捷命令
# List all features
npm run feature:info -- --list
# Get details about a feature
npm run feature:info -- <feature-id>
# Find which feature owns a file
npm run feature:info -- --files <filepath>
# Validate all manifests
npm run feature:validate
# Check feature health (staleness, orphans, coverage)
npm run feature:health
# Create a new feature manifest
npm run feature:create
工作流:创建新功能
-
先创建清单:
npm run feature:create -- --id=my-feature --name="My Feature" -
实现功能,并在过程中添加文件
-
更新清单,包括:
- 在
implementation.files中列出所有实现文件 - 在
tests.unit/integration/e2e中列出测试 - 在
dependencies.internal/external中列出依赖项 - 在
dependencies.env_vars中列出环境变量
- 在
-
提交前进行验证:
npm run feature:validate
工作流:修改现有功能
-
先阅读清单:
npm run feature:info -- <feature-id> -
修改实现文件
-
更新清单:
- 将新文件添加到
implementation.files - 将
history.last_modified更新为今天的日期 - 添加一条变更日志
- 将新文件添加到
-
进行验证:
npm run feature:validate
清单结构
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"
健康报告说明
运行 npm run feature:health 时:
- 健康的功能:清单与代码一致,且存在测试
- 过期的功能:清单已有 90 天或更久未更新,或代码在清单之后发生了更改
- 没有测试的功能:已完成但未列出任何测试的功能
- 孤立文件:
src/中未被任何清单跟踪的文件 - 建议创建清单:应该有清单的新目录
最佳实践
- 每个清单对应一个功能——保持范围明确
- 每次更改都更新——不要让清单过期
- 变更日志只追加——绝不修改旧条目
- 包含所有文件——不要留下孤立文件
- 关联依赖项——注明哪些功能依赖其他功能
评论
支持 Markdown