From c2eb3c8f1a38c4e19b73363ca2680da33d2c0bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=84=B1?= <1877685089@qq.com> Date: Mon, 15 Jun 2026 20:57:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(newcomer-skill):=20=E4=BF=AE=E5=A4=8D=20lab?= =?UTF-8?q?el=20=E5=91=BD=E4=BB=A4=20Bug=EF=BC=8C=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E8=BF=87=E6=BB=A4=E4=B8=8E=E5=B9=82=E7=AD=89?= =?UTF-8?q?=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skills/gitlink-newcomer-guide/SKILL.md | 53 +++++++++++++++++--------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/skills/gitlink-newcomer-guide/SKILL.md b/skills/gitlink-newcomer-guide/SKILL.md index 8650b8e..830f263 100644 --- a/skills/gitlink-newcomer-guide/SKILL.md +++ b/skills/gitlink-newcomer-guide/SKILL.md @@ -12,6 +12,7 @@ metadata: **CRITICAL — 开始前必须先阅读 [`../gitlink-shared/SKILL.md`](../gitlink-shared/SKILL.md),其中包含认证、权限处理和 API 注意事项。** **CRITICAL — 所有 Shortcuts 在执行写入/删除操作前,务必先确认用户意图。** +**CRITICAL — `issue +comment` 是写操作,执行前必须确认用户意图;重复运行通过标记串幂等去重,不会刷屏。** ## 说明 @@ -19,23 +20,29 @@ metadata: ## 依赖的 Shortcuts -| Shortcut | 用途 | +| Shortcut / 命令 | 用途 | |----------|------| -| `issue +list` | 获取标记了 good-first-issue 的 Issue | +| `issue +list` | 列出 Issue(用返回的 `tags[].name` 检测 good-first-issue) | | `issue +view` | 查看 Issue 详细内容 | -| `issue +comment` | 添加引导评论 | -| `label +list` | 查看可用标签 | +| `issue +comment` | 添加引导评论(写操作,先确认) | +| `api GET .../issues/:number/journals` | 读取已有评论,做幂等去重 | | `repo +info` | 获取仓库基本信息 | +> 说明:`gitlink-cli` 没有 `label` 子命令(实测 `unknown command "label"`)。good-first-issue 直接从 `issue +list` 的 `tags[].name` 字段判断,无需单独列标签。 + ## 工作流程 ``` -1. issue +list → 获取所有打开的 Issue -2. 筛选含 good-first-issue 标签的 Issue -3. issue +view --number {id} → 查看 Issue 详情 -4. 分析 Issue 内容 → 判断适合的引导信息 -5. issue +comment --body "..." → 添加引导评论 -6. 可选:issue +update → 分配 mentor +1. repo +info → 确认 owner/repo、默认分支 +2. issue +list --state open --format json(必要时 --page 2.. 翻页) +3. 客户端按 status_id 过滤:保留 1(新增)、2(正在解决);排除 3(已解决)、5(关闭) + —— 抵消 --state open 过滤不准确的已知问题 +4. 按 tags[].name 匹配入门标签(/good.?first.?issue|新手|入门|help.?wanted|easy|beginner|低难度/i) +5. 排除已分配(assigners 非空)的 Issue,除非标签是 help wanted +6. issue +view --number → 取 description / comment_journals_count 判断 Issue 类型 +7. 【去重】api GET /v1/:owner/:repo/issues//journals --format json + → 扫描已有评论是否含标记串 `gitlink-newcomer-guide:v1`,命中则跳过 +8. issue +comment --number --body "<模板 + 标记串>" → 写操作,先确认用户意图 ``` ## 引导评论模板 @@ -62,6 +69,8 @@ metadata: - 在开发过程中遇到任何问题,也欢迎随时提问 祝你编码愉快! + + ``` ### 功能需求类 Issue @@ -85,6 +94,8 @@ metadata: 4. 提交 Pull Request,描述你的改动 如有任何问题,随时留言! + + ``` ### 文档类 Issue @@ -108,25 +119,29 @@ metadata: - 代码块请标注语言类型 期待你的贡献! + + ``` ## 使用示例 ```bash -# 1. 查找所有标记了 good-first-issue 的 Issue +# 1. 列出开放 Issue(用返回的 tags[].name 检测 good-first-issue) gitlink-cli issue +list --owner myuser --repo myrepo --state open --format json -# 2. 查看某个 Issue 的详细内容(判断类型) +# 2. 客户端过滤:status_id ∈ {1,2} 且 tags[].name 匹配 good-first-issue,且 assigners 为空 + +# 3. 查看 Issue 详情,判断类型 gitlink-cli issue +view --owner myuser --repo myrepo --number 10 --format json -# 3. 查看仓库可用标签 -gitlink-cli label +list --owner myuser --repo myrepo +# 4. 【去重】读取已有评论,检查是否含标记串 +gitlink-cli api GET /v1/myuser/myrepo/issues/10/journals --format json -# 4. 添加引导评论 -gitlink-cli issue +comment --owner myuser --repo myrepo --number 10 --body "你好!欢迎参与贡献..." +# 5. 添加引导评论(写操作,先确认;评论末尾含 ) +gitlink-cli issue +comment --owner myuser --repo myrepo --number 10 --body "你好!欢迎参与贡献 🎉 +...(正文)... -# 5. 可选:将 Issue 标记为已分配 -gitlink-cli issue +update --owner myuser --repo myrepo --number 10 +" ``` ## 注意事项 @@ -135,3 +150,5 @@ gitlink-cli issue +update --owner myuser --repo myrepo --number 10 - 如果 Issue 已经被 Assignee 认领,不需要再添加引导评论。 - 不要修改 good-first-issue 标签,由项目维护者管理。 - 引导评论建议使用温和、鼓励的语气。 +- good-first-issue 检测依赖 `issue +list` 返回的 `tags[].name`;`gitlink-cli` 无 `label` 子命令,不要尝试调用任何形如 `gitlink-cli` + `label` 的写法 +- `--state open` 过滤不准确,必须客户端按 `status_id`(保留 1、2)二次过滤