feat(templates): 新增 shortcuts/_template 与 skills/_template 开发脚手架(补齐起步资源包缺失项) #417

Merged
wbtiger merged 1 commits from Taoyouce/gitlink-cli:feat/starter-templates into master 2026-07-14 20:44:17 +08:00
Contributor

背景

起步资源包计划提供「Shortcut 开发模板(shortcuts/_template/)」与「Skill 编写模板(skills/_template/)」,但主仓库至今没有这两个脚手架,新贡献者只能自行模仿既有代码。

内容

  • shortcuts/_template/:新增命令组的标准模板——template.go 覆盖读(GET 查询参数+分页)/ 写(POST 必填 flag)/ 删(DELETE + --yes 确认保护)三种典型形态,内嵌 4 条仓库惯例注释(ResolveOwnerRepo、common 助手统一调用、信封输出、破坏性操作确认);template_test.go 提供 4 个可直接改写的 httptest 单测样例;README.md 给出复制改名 5 步流程(与 PR #415 dev-guide 互相引用)
  • skills/_template/SKILL.md:Skill 编写模板——frontmatter 规范、三条 CRITICAL 声明惯例、功能/场景/执行步骤/输出格式/注意事项分节占位,附「提交前删除」的使用说明

质量保障

  • 目录以 _ 开头,Go 工具链自动忽略,不影响主构建(go build/test ./... 全绿验证)
  • 模板代码另行复制为普通包实测:go test 4/4 通过、go vet/gofmt -s 干净——保证使用者复制即可编译运行
  • 惯例与真实命令组(label/webhook 等)逐一对照提炼,非凭空杜撰
## 背景 起步资源包计划提供「Shortcut 开发模板(shortcuts/_template/)」与「Skill 编写模板(skills/_template/)」,但主仓库至今没有这两个脚手架,新贡献者只能自行模仿既有代码。 ## 内容 - `shortcuts/_template/`:新增命令组的标准模板——`template.go` 覆盖读(GET 查询参数+分页)/ 写(POST 必填 flag)/ 删(DELETE + --yes 确认保护)三种典型形态,内嵌 4 条仓库惯例注释(ResolveOwnerRepo、common 助手统一调用、信封输出、破坏性操作确认);`template_test.go` 提供 4 个可直接改写的 httptest 单测样例;`README.md` 给出复制改名 5 步流程(与 PR #415 dev-guide 互相引用) - `skills/_template/SKILL.md`:Skill 编写模板——frontmatter 规范、三条 CRITICAL 声明惯例、功能/场景/执行步骤/输出格式/注意事项分节占位,附「提交前删除」的使用说明 ## 质量保障 - 目录以 `_` 开头,Go 工具链自动忽略,**不影响主构建**(go build/test ./... 全绿验证) - 模板代码另行复制为普通包实测:`go test` 4/4 通过、`go vet`/`gofmt -s` 干净——保证使用者复制即可编译运行 - 惯例与真实命令组(label/webhook 等)逐一对照提炼,非凭空杜撰
Taoyouce added 6 commits 2026-07-11 00:14:12 +08:00
wbtiger merged commit 80d6c87142 into master 2026-07-14 20:44:17 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#417
No description provided.