18 lines
993 B
Markdown
18 lines
993 B
Markdown
---
|
||
name: k12-comment-header-standard
|
||
description: 当任务涉及注释模板、global.code-snippets 或 .fileheader 配置时使用,确保 author 与当前仓库 git user.name 对齐
|
||
---
|
||
# K12 注释头规范技能
|
||
## 何时使用
|
||
- 用户要求统一文件头/函数注释规范
|
||
- 用户要求 `@author` 与 git 用户名一致
|
||
- 任务涉及 `global.code-snippets` 或 `.fileheader/fileheader.config.yaml`
|
||
## 执行步骤
|
||
1. 读取仓库 `git config user.name`,以此作为 `author` 基线。
|
||
2. 更新 `global.code-snippets` 中 `FileHeader` 与 `Method` 的 author 默认值。
|
||
3. 若项目使用 `turbo-file-header`,检查 `.fileheader/fileheader.config.yaml` 的 `@author` 字段,确保与团队约定一致。
|
||
4. 修改后验证 JSON/YAML 可解析,避免因注释模板格式错误导致编辑器失效。
|
||
## 约束
|
||
- 不修改业务逻辑代码,只处理注释与模板规范。
|
||
- 需要保留已有注释字段顺序(description/filename/author/copyright/since)。
|