forked from Gitlink/gitlink-cli
docs(skills): 同步更新 repo/issue/wiki skill 文档,补全新增 shortcut 命令
This commit is contained in:
parent
69a820cccb
commit
601e566bac
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
## 2026-05-31 新增 `wiki +lint` 文档质量检查命令
|
||||
|
||||
> **注意:`+lint` 命令当前仅在本地编译版本中可用**(全局安装的 `gitlink-cli` 暂未包含)。需先 `go build -o gitlink-cli.exe .` 然后使用 `./gitlink-cli.exe wiki +lint`。
|
||||
|
||||
### 使用方法
|
||||
|
||||
```bash
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
name: gitlink-faq
|
||||
version: 1.2.0
|
||||
description: "Issue 知识库:从项目 Issue 自动分类(Bug/功能请求/使用问题),按类型归纳聚类,生成结构化知识库发布到 Wiki;增量更新已有知识库;检测新 Issue 是否与已有问题重复。当用户需要整理 Issue、归纳 Issue、总结常见问题/Bug、建立知识库、更新知识库、检查重复 Issue、查重时触发。"
|
||||
version: 1.3.0
|
||||
description: "Issue 知识库:从项目 Issue 自动分类(Bug/功能请求/使用问题),按类型归纳聚类,生成结构化知识库发布到 Wiki;增量更新已有知识库;检测新 Issue 是否与已有问题重复。当用户需要整理 Issue、归纳 Issue、总结常见问题/Bug、建立知识库、更新知识库、检查重复 Issue、查重时触发。通用 Issue 操作(创建/查看/更新/关闭/评论等)请使用 gitlink-issue skill。"
|
||||
metadata:
|
||||
requires:
|
||||
bins: ["gitlink-cli"]
|
||||
|
|
@ -225,10 +225,15 @@ gitlink-cli issue +view --number N --format json
|
|||
如果是查重场景且判定高度重复,用户确认后执行:
|
||||
|
||||
```bash
|
||||
gitlink-cli issue +comment --number N --body "..."
|
||||
gitlink-cli issue +label-add --number N --labels "duplicate"
|
||||
# 添加评论(使用 Issue ID,参见 gitlink-issue skill)
|
||||
gitlink-cli issue +comment --number N --body "此 Issue 与 #M 内容重复,建议..."
|
||||
|
||||
# 打重复标签(使用项目内编号,批量操作)
|
||||
gitlink-cli issue +batch-label --label duplicate --numbers N,M
|
||||
```
|
||||
|
||||
> 通用 Issue 操作(创建、查看、更新、关闭、评论等)参见 [`../gitlink-issue/SKILL.md`](../gitlink-issue/SKILL.md)。
|
||||
|
||||
---
|
||||
|
||||
## 模式 C:Wiki 增量更新
|
||||
|
|
@ -295,16 +300,18 @@ gitlink-cli wiki +update --title "Issue-知识库" --file ./issue-knowledge-base
|
|||
|
||||
## 命令速查
|
||||
|
||||
本 skill 只涉及知识库分析相关的命令。通用 Issue 操作(创建、查看、更新、关闭、批量操作等)统一使用 [`gitlink-issue`](../gitlink-issue/SKILL.md) skill。
|
||||
|
||||
| 命令 | 用途 | 模式 |
|
||||
|------|------|------|
|
||||
| `issue +list --state open --limit 100 --format json` | 获取 open Issue 列表 | A / C |
|
||||
| `issue +list --state closed --limit 100 --format json` | 获取 closed Issue 列表 | A / C |
|
||||
| `issue +view --number N --format json` | 读取单个 Issue 详情 | A / B / C |
|
||||
| `wiki +view --title "Issue-知识库" --format json` | 查看已有知识库内容 | B / C |
|
||||
| `wiki +create --title "Issue-知识库" --file ./xxx.md` | 首次创建知识库页面 | A |
|
||||
| `wiki +update --title "Issue-知识库" --file ./xxx.md` | 增量更新知识库页面 | A / C |
|
||||
| `issue +comment --number N --body "..."` | 添加评论引导用户 | B |
|
||||
| `issue +label-add --number N --labels "duplicate"` | 标记重复 Issue | B |
|
||||
| `issue +comment --number N --body "..."` | 查重时添加评论引导用户 | B |
|
||||
| `issue +batch-label --label duplicate --numbers N,M` | 查重时批量标记重复 | B |
|
||||
| `wiki +view --title "Issue-知识库" --format json` | 查看已有知识库内容 | C |
|
||||
| `wiki +create --title "Issue-知识库" --file ./xxx.md` | 首次创建知识库 Wiki 页面 | A |
|
||||
| `wiki +update --title "Issue-知识库" --file ./xxx.md` | 增量更新知识库 Wiki 页面 | A / C |
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -312,7 +319,8 @@ gitlink-cli wiki +update --title "Issue-知识库" --file ./issue-knowledge-base
|
|||
|
||||
- `issue +list` 的 `--state` 参数**不可靠**(与 PR 列表同款问题),返回列表可能包含所有状态。因此必须同时拉 open + closed 两份列表合并去重。
|
||||
- **`issue +view` 不返回 journals 内容**:只有 `comment_journals_count`(评论数量),无法通过 API 读取实际评论。`GET /v1/.../issues/{N}/journals` 返回 HTML 而非 JSON。分析只能依靠 `subject` + `description`。
|
||||
- Wiki 内容为 base64 编码传输,CLI 自动处理编解码。Wiki 通过 Gateway API。
|
||||
- **`issue +label-add` API 返回 404**:GitLink 平台 `POST /v1/.../issues/{N}/labels` 端点不可用。打标签请改用 `issue +batch-label`(走 `updateIssueField` 而非 labels API)。
|
||||
- `wiki +view` Gateway API 可能返回 404(已知问题),但 `wiki +create` / `wiki +update` 写入正常。
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
name: gitlink-issue
|
||||
version: 2.0.0
|
||||
description: "Issue 管理:创建、查看、更新、关闭/批量关闭 Issue,添加评论。当用户需要操作 GitLink Issue 时触发。"
|
||||
version: 3.0.0
|
||||
description: "Issue 全生命周期管理:创建/查看/更新/关闭/重开 Issue、添加评论、标签操作(添加/移除/查看)、批量操作(创建/关闭/标签/状态/优先级/负责人)。当用户需要操作 GitLink Issue 时触发。"
|
||||
metadata:
|
||||
requires:
|
||||
bins: ["gitlink-cli"]
|
||||
|
|
@ -18,42 +18,75 @@ metadata:
|
|||
|
||||
## Shortcuts
|
||||
|
||||
### 查询
|
||||
|
||||
| Shortcut | 说明 | 需要认证 |
|
||||
|----------|------|----------|
|
||||
| `issue +list` | Issue 列表 | 否(公开项目) |
|
||||
| `issue +create` | 创建 Issue | 是 |
|
||||
| `issue +view` | Issue 详情 | 否(公开项目) |
|
||||
| `issue +update` | 更新 Issue | 是 |
|
||||
| `issue +list` | Issue 列表(支持 `--state open/closed`、`--limit`、`--page`) | 否(公开项目) |
|
||||
| `issue +view` | Issue 详情(含 description、状态、优先级等) | 否(公开项目) |
|
||||
| `issue +label-list` | 查看 Issue 上的标签 | 否(公开项目) |
|
||||
|
||||
### 单个操作
|
||||
|
||||
| Shortcut | 说明 | 需要认证 |
|
||||
|----------|------|----------|
|
||||
| `issue +create` | 创建 Issue(`--title` + `--body`) | 是 |
|
||||
| `issue +update` | 更新 Issue 标题/描述 | 是 |
|
||||
| `issue +close` | 关闭 Issue | 是 |
|
||||
| `issue +batch-close` | 批量关闭 Issue,支持 `--dry-run` 预览 | 是(dry-run 不写入) |
|
||||
| `issue +reopen` | 重新打开已关闭的 Issue | 是 |
|
||||
| `issue +comment` | 添加评论 | 是 |
|
||||
| `issue +label-add` | 添加标签(⚠️ API 可能 404,建议用 `+batch-label`) | 是 |
|
||||
| `issue +label-remove` | 移除标签 | 是 |
|
||||
|
||||
### 批量操作
|
||||
|
||||
| Shortcut | 说明 | 支持 dry-run |
|
||||
|----------|------|-------------|
|
||||
| `issue +batch-create` | 批量创建 Issue(`--titles` 逗号分隔 或 `--from CSV`) | ✅ |
|
||||
| `issue +batch-close` | 批量关闭 Issue | ✅ |
|
||||
| `issue +batch-label` | 批量修改标签:bug, feature, support, doc, test, duplicate, question | ✅ |
|
||||
| `issue +batch-status` | 批量修改状态:new, in-progress, resolved, closed, rejected | ✅ |
|
||||
| `issue +batch-priority` | 批量修改优先级:low, normal, high, urgent | ✅ |
|
||||
| `issue +batch-assign` | 批量修改负责人(`--assignee` 登录名或用户 ID) | ✅ |
|
||||
|
||||
> 批量操作均支持 `--numbers 1,2,3` 或 `--from file.csv` 指定目标 Issue。
|
||||
|
||||
## 使用示例
|
||||
|
||||
```bash
|
||||
# === 查询 ===
|
||||
# 列出 Issue
|
||||
gitlink-cli issue +list --owner Gitlink --repo forgeplus --state open
|
||||
|
||||
# 创建 Issue
|
||||
gitlink-cli issue +create --owner myuser --repo myrepo --title "Bug: 登录失败" --body "复现步骤:..."
|
||||
|
||||
# 查看 Issue 详情(使用网页可见的 Issue 编号)
|
||||
# 分页拉取
|
||||
gitlink-cli issue +list --owner Gitlink --repo forgeplus --state open --limit 20 --page 2
|
||||
# 查看详情(使用网页 URL 中的 Issue 编号)
|
||||
gitlink-cli issue +view --owner Gitlink --repo forgeplus --number 4
|
||||
|
||||
# === 单个操作 ===
|
||||
# 创建 Issue
|
||||
gitlink-cli issue +create --owner myuser --repo myrepo --title "Bug: 登录失败" --body "复现步骤:..."
|
||||
# 更新 Issue
|
||||
gitlink-cli issue +update --number 4 --title "新标题" --body "更新描述"
|
||||
|
||||
# 关闭 Issue
|
||||
# 关闭 / 重开
|
||||
gitlink-cli issue +close --number 4
|
||||
|
||||
# 预览批量关闭 Issue,不修改数据
|
||||
gitlink-cli issue +batch-close --owner myuser --repo myrepo --numbers 123,124 --dry-run
|
||||
|
||||
# 从 CSV 文件批量关闭 Issue
|
||||
gitlink-cli issue +batch-close --owner myuser --repo myrepo --from issues.csv
|
||||
|
||||
gitlink-cli issue +reopen --number 4
|
||||
# 添加评论
|
||||
gitlink-cli issue +comment --number 4 --body "已修复,请验证"
|
||||
|
||||
# === 批量操作 ===
|
||||
# 批量创建
|
||||
gitlink-cli issue +batch-create --titles "修复登录Bug,新增导出功能,优化首页加载"
|
||||
# 批量关闭(先 dry-run 预览)
|
||||
gitlink-cli issue +batch-close --numbers 1,2,3 --dry-run
|
||||
gitlink-cli issue +batch-close --numbers 1,2,3
|
||||
# 批量打标签
|
||||
gitlink-cli issue +batch-label --label duplicate --numbers 3,4
|
||||
# 批量改状态
|
||||
gitlink-cli issue +batch-status --state resolved --numbers 1,2,3
|
||||
# 批量改优先级
|
||||
gitlink-cli issue +batch-priority --priority high --numbers 5,6
|
||||
# 批量分配
|
||||
gitlink-cli issue +batch-assign --assignee zzx-coder --numbers 7,8
|
||||
```
|
||||
|
||||
## Raw API 补充
|
||||
|
|
@ -80,17 +113,31 @@ gitlink-cli api POST /:owner/:repo/issues/series_update --body '{"ids":[1,2,3],"
|
|||
## API 注意事项
|
||||
|
||||
- **Issue 编号(`--number`)是网页 URL 中看到的序号**(如 `issues/4` 中的 `4`),不是数据库内部 ID
|
||||
- **批量关闭使用 `--numbers`,同样传网页 URL 中的 Issue 编号**,不是数据库内部 ID
|
||||
- **批量操作使用 `--numbers`,同样传网页 URL 中的 Issue 编号**,不是数据库内部 ID
|
||||
- Issue 操作使用 v1 API(`/api/v1/`),支持按 Issue 编号查询和操作
|
||||
- **创建 Issue 时 CLI 会自动设置 `status_id: 1`(新增)和 `priority_id: 2`(正常)**
|
||||
- **更新/关闭 Issue 时必须保留当前 `subject` 和 `description`**,即使只修改状态(CLI 会先读取当前 Issue 并自动带回)
|
||||
- v1 API 写操作必须使用 `access_token`(非 `token`)认证,CLI 已自动处理
|
||||
- **`issue +label-add` / `+label-remove` / `+label-list` 的 labels API(`POST /v1/.../issues/{N}/labels`)可能返回 404**。打标签请优先使用 `issue +batch-label`,它走 `updateIssueField` 而非 labels API
|
||||
|
||||
## Issue 状态映射(status_id)
|
||||
|
||||
| status_id | 名称 | 说明 |
|
||||
|-----------|------|------|
|
||||
| 1 | 新增 | 新建 Issue 的默认状态 |
|
||||
| 2 | 正在解决 | 处理中 |
|
||||
| 3 | 已解决 | 已修复 |
|
||||
| 5 | 关闭 | 关闭(`+close` 命令使用此值) |
|
||||
| status_id | 名称 | `+batch-status --state` 对应值 |
|
||||
|-----------|------|-------------------------------|
|
||||
| 1 | 新增 | `new` |
|
||||
| 2 | 正在解决 | `in-progress` |
|
||||
| 3 | 已解决 | `resolved` |
|
||||
| 5 | 关闭 | `closed` |
|
||||
| 6 | 已拒绝 | `rejected` |
|
||||
|
||||
## Issue 标签映射(tracker_id)
|
||||
|
||||
| 标签 | `+batch-label --label` 对应值 |
|
||||
|------|------------------------------|
|
||||
| Bug | `bug` |
|
||||
| 功能 | `feature` |
|
||||
| 支持 | `support` |
|
||||
| 文档 | `doc` |
|
||||
| 测试 | `test` |
|
||||
| 重复 | `duplicate` |
|
||||
| 问题 | `question` |
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
name: gitlink-repo
|
||||
version: 1.0.0
|
||||
description: "仓库管理:创建、查看、Fork、删除仓库,查看分支、提交、贡献者等。当用户需要操作 GitLink 仓库时触发。"
|
||||
version: 2.0.0
|
||||
description: "仓库全生命周期管理:创建/查看/Fork/删除/更新仓库、成员管理(邀请/移除/查看)、批量操作(创建/更新/邀请/移除)。当用户需要操作 GitLink 仓库时触发。"
|
||||
metadata:
|
||||
requires:
|
||||
bins: ["gitlink-cli"]
|
||||
|
|
@ -18,35 +18,72 @@ metadata:
|
|||
|
||||
## Shortcuts
|
||||
|
||||
### 查询
|
||||
|
||||
| Shortcut | 说明 | 需要认证 |
|
||||
|----------|------|----------|
|
||||
| `repo +list` | 仓库列表 | 否(公开项目) |
|
||||
| `repo +list` | 仓库列表(`--user` 指定用户) | 否(公开项目) |
|
||||
| `repo +info` | 仓库详情 | 否(公开项目) |
|
||||
| `repo +create` | 创建仓库 | 是 |
|
||||
| `repo +members` | 仓库成员列表(`--page`、`--limit` 分页) | 否(公开项目) |
|
||||
|
||||
### 单个操作
|
||||
|
||||
| Shortcut | 说明 | 需要认证 |
|
||||
|----------|------|----------|
|
||||
| `repo +create` | 创建仓库(`--name`、`--description`、`--private`) | 是 |
|
||||
| `repo +fork` | Fork 仓库 | 是 |
|
||||
| `repo +delete` | 删除仓库 | 是 |
|
||||
| `repo +delete` | 删除仓库(⚠️ 不可逆) | 是 |
|
||||
| `repo +update` | 更新仓库设置(`--description`、`--private`) | 是 |
|
||||
| `repo +invite` | 邀请成员(`--user-id`) | 是 |
|
||||
| `repo +remove-member` | 移除成员(`--user-id`) | 是 |
|
||||
|
||||
### 批量操作
|
||||
|
||||
| Shortcut | 说明 | 支持 dry-run |
|
||||
|----------|------|-------------|
|
||||
| `repo +batch-create` | 批量创建仓库(`--names` 逗号分隔 或 `--from CSV`) | ✅ |
|
||||
| `repo +batch-update` | 批量更新仓库设置(`--description`、`--private`/`--public`) | ✅ |
|
||||
| `repo +batch-invite` | 批量邀请成员(`--users` 逗号分隔 或 `--from CSV`) | ✅ |
|
||||
| `repo +batch-remove` | 批量移除成员(`--users` 逗号分隔 或 `--from CSV`) | ✅ |
|
||||
|
||||
> 批量操作均支持 `--names repo-a,repo-b` 或 `--users 1,2,3` 或 `--from file.csv` 三种输入方式。
|
||||
|
||||
## 使用示例
|
||||
|
||||
```bash
|
||||
# === 查询 ===
|
||||
# 查看仓库信息
|
||||
gitlink-cli repo +info --owner Gitlink --repo forgeplus
|
||||
|
||||
# 在 git 仓库目录下自动解析
|
||||
cd ~/my-project
|
||||
gitlink-cli repo +info
|
||||
|
||||
# 列出用户的仓库
|
||||
# 列出用户仓库
|
||||
gitlink-cli repo +list --user zhangsan
|
||||
# 查看成员
|
||||
gitlink-cli repo +members --owner myuser --repo myrepo
|
||||
|
||||
# === 单个操作 ===
|
||||
# 创建仓库
|
||||
gitlink-cli repo +create --name my-project --description "项目描述"
|
||||
|
||||
# 创建私有仓库
|
||||
gitlink-cli repo +create --name my-project --private
|
||||
# Fork 仓库
|
||||
gitlink-cli repo +fork --owner Gitlink --repo forgeplus
|
||||
|
||||
# 删除仓库(⚠️ 危险操作)
|
||||
# 更新仓库设置
|
||||
gitlink-cli repo +update --owner myuser --repo myrepo --description "新描述"
|
||||
gitlink-cli repo +update --owner myuser --repo myrepo --private true
|
||||
# 邀请/移除成员
|
||||
gitlink-cli repo +invite --owner myuser --repo myrepo --user-id 12345
|
||||
gitlink-cli repo +remove-member --owner myuser --repo myrepo --user-id 12345
|
||||
# 删除仓库(⚠️ 不可逆,务必确认)
|
||||
gitlink-cli repo +delete --owner myuser --repo old-project
|
||||
|
||||
# === 批量操作 ===
|
||||
# 批量创建
|
||||
gitlink-cli repo +batch-create --names repo-a,repo-b,repo-c --private
|
||||
# 批量更新(先 dry-run 预览)
|
||||
gitlink-cli repo +batch-update --names repo-a,repo-b --description "批量更新描述" --dry-run
|
||||
gitlink-cli repo +batch-update --names repo-a,repo-b --description "批量更新描述"
|
||||
# 批量管理成员
|
||||
gitlink-cli repo +batch-invite --users 111,222,333 --dry-run
|
||||
gitlink-cli repo +batch-remove --users 111,222 --dry-run
|
||||
```
|
||||
|
||||
## Raw API 补充
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
name: gitlink-wiki
|
||||
version: 1.0.0
|
||||
description: "Wiki 管理:查看、创建、更新、删除 Wiki 页面。当用户需要操作 GitLink Wiki 时触发。"
|
||||
version: 1.1.0
|
||||
description: "Wiki 管理:查看、创建、更新、删除 Wiki 页面、质量检查(lint)。当用户需要操作 GitLink Wiki 时触发。"
|
||||
metadata:
|
||||
requires:
|
||||
bins: ["gitlink-cli"]
|
||||
|
|
@ -13,6 +13,7 @@ metadata:
|
|||
**CRITICAL — 开始前必须先阅读 [`../gitlink-shared/SKILL.md`](../gitlink-shared/SKILL.md),其中包含认证、权限处理和 API 注意事项。**
|
||||
**CRITICAL — 所有 Shortcuts 在执行写入/删除操作前,务必先确认用户意图。**
|
||||
**CRITICAL — GitLink 操作只能用 `gitlink-cli`。禁止用 `gh`(GitHub CLI)操作 GitLink 资源。`gh` 仅适用于 GitHub 平台。**
|
||||
**注意:`wiki +lint` 当前仅在本地编译版本中可用,需 `go build -o gitlink-cli.exe .` 后使用 `./gitlink-cli.exe`。**
|
||||
|
||||
> **前置条件:** 先阅读 [`../gitlink-shared/SKILL.md`](../gitlink-shared/SKILL.md)
|
||||
|
||||
|
|
@ -25,6 +26,7 @@ metadata:
|
|||
| `wiki +create` | 创建 Wiki 页面,支持 `--dry-run` 预览 | 是 |
|
||||
| `wiki +update` | 更新 Wiki 页面,支持 `--dry-run` 预览 | 是 |
|
||||
| `wiki +delete` | 删除 Wiki 页面,支持 `--dry-run` 预览 | 是 |
|
||||
| `wiki +lint` | 检查 Wiki 页面质量问题(链接、标题、图片、空白页) | 否 |
|
||||
|
||||
## 使用示例
|
||||
|
||||
|
|
@ -64,6 +66,12 @@ gitlink-cli wiki +delete --owner myuser --repo myrepo --title "废弃页面"
|
|||
|
||||
# 预览删除操作
|
||||
gitlink-cli wiki +delete --owner myuser --repo myrepo --title "废弃页面" --dry-run
|
||||
|
||||
# 检查 Wiki 页面质量问题(全部检查)
|
||||
gitlink-cli wiki +lint --owner myuser --repo myrepo
|
||||
|
||||
# 只检查链接和空白页
|
||||
gitlink-cli wiki +lint --owner myuser --repo myrepo --check links,empty
|
||||
```
|
||||
|
||||
## Wiki 页面内容格式
|
||||
|
|
|
|||
Loading…
Reference in New Issue