From a7c16d64fef963cc7b723b84fc2f88154b07c7aa Mon Sep 17 00:00:00 2001 From: Surponess Date: Fri, 12 Jun 2026 10:08:28 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=F0=9F=86=95=20=E6=96=B0=E4=BA=BA=E5=BC=95?= =?UTF-8?q?=E5=AF=BC=20Skill=20(gitlink-onboarding)=20=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E4=BA=86=20SKILL.md=EF=BC=8C=E5=8C=85=E5=90=AB=204=20=E4=B8=AA?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E5=B7=A5=E4=BD=9C=E6=B5=81=EF=BC=9A=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=96=B0=E4=BA=BA=E5=85=A5=E9=97=A8=EF=BC=88?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=A6=82=E8=A7=88=20+=20=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E6=90=AD=E5=BB=BA=EF=BC=89=20=E5=AF=BB=E6=89=BE=E9=80=82?= =?UTF-8?q?=E5=90=88=E6=96=B0=E4=BA=BA=E7=9A=84=20Issue=EF=BC=88good-first?= =?UTF-8?q?-issue=20=E6=90=9C=E7=B4=A2=20+=205=20=E7=BB=B4=E5=BA=A6?= =?UTF-8?q?=E5=8F=8B=E5=A5=BD=E5=BA=A6=E8=AF=84=E4=BC=B0=EF=BC=89=20Issue?= =?UTF-8?q?=20=E5=BC=95=E5=AF=BC=E8=AF=84=E8=AE=BA=E7=94=9F=E6=88=90?= =?UTF-8?q?=EF=BC=88=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E4=B8=AA=E6=80=A7?= =?UTF-8?q?=E5=8C=96=E5=BC=95=E5=AF=BC=E5=B9=B6=E5=8F=91=E5=B8=83=EF=BC=89?= =?UTF-8?q?=20=E6=96=B0=E4=BA=BA=E8=B4=A1=E7=8C=AE=E5=85=A8=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E5=BC=95=E5=AF=BC=EF=BC=88Fork=20=E2=86=92=20Branch?= =?UTF-8?q?=20=E2=86=92=20Code=20=E2=86=92=20PR=EF=BC=89=20=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E4=BA=86=20examples/onboarding-workflow.md=202.=20?= =?UTF-8?q?=F0=9F=93=A6=20=E8=A1=A5=E5=85=A8=20examples=20=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=E6=96=87=E4=BB=B6=20=E4=BB=8E=203/28=20=E6=8F=90?= =?UTF-8?q?=E5=8D=87=E5=88=B0=2028/28=20=E5=85=A8=E8=A6=86=E7=9B=96=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=2024=20=E4=B8=AA=20examples=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E6=AF=8F=E4=B8=AA=E5=8C=85=E5=90=AB=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E6=8F=8F=E8=BF=B0=E3=80=81=E5=88=86=E6=AD=A5=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E3=80=81=E8=BE=93=E5=87=BA=E7=A4=BA=E4=BE=8B=E3=80=81?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E9=80=9F=E8=A7=88=203.=20=F0=9F=93=8B=20Agen?= =?UTF-8?q?t=20=E5=B9=B3=E5=8F=B0=E9=AA=8C=E8=AF=81=E8=AE=B0=E5=BD=95=20?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BA=86=20docs/agent-platform-verification.?= =?UTF-8?q?md=20=E8=AE=B0=E5=BD=95=2027=20=E4=B8=AA=20Skills=20=E7=9A=84?= =?UTF-8?q?=E9=80=90=E9=A1=B9=E9=AA=8C=E8=AF=81=E7=BB=93=E6=9E=9C=20+=205?= =?UTF-8?q?=20=E4=B8=AA=E5=85=B8=E5=9E=8B=E9=AA=8C=E8=AF=81=E6=A1=88?= =?UTF-8?q?=E4=BE=8B=204.=20=F0=9F=93=9D=20=E4=BB=BB=E5=8A=A1=E6=80=BB?= =?UTF-8?q?=E7=BB=93=E6=96=87=E6=A1=A3=20=E5=88=9B=E5=BB=BA=E4=BA=86=20doc?= =?UTF-8?q?s/skills-completion-report.md=20=E5=8C=85=E5=90=AB=EF=BC=9A?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=80=9D=E8=B7=AF=EF=BC=88=E4=B8=89=E5=B1=82?= =?UTF-8?q?=E6=9E=B6=E6=9E=84=20+=20=E4=B8=89=E7=A7=8D=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=20+=20=E8=AE=BE=E8=AE=A1=E5=8E=9F=E5=88=99=EF=BC=89=E3=80=8127?= =?UTF-8?q?=20=E4=B8=AA=20Skills=20=E5=85=A8=E6=99=AF=E8=A1=A8=E3=80=81?= =?UTF-8?q?=E4=B8=8E=E8=AF=BE=E7=A8=8B=E8=A6=81=E6=B1=82=E5=AF=B9=E7=85=A7?= =?UTF-8?q?=E3=80=81=E5=85=B3=E9=94=AE=E8=AE=BE=E8=AE=A1=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E3=80=81=E5=90=8E=E7=BB=AD=E5=BB=BA=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skills/gitlink-auth/examples/auth-workflow.md | 48 +++ skills/gitlink-ci/examples/ci-workflow.md | 63 +++ .../examples/commit-quality-workflow.md | 47 +++ .../examples/compare-workflow.md | 38 ++ .../examples/compliance-workflow.md | 52 +++ skills/gitlink-file/examples/file-workflow.md | 66 ++++ .../examples/health-workflow.md | 77 ++++ .../gitlink-issue/examples/issue-workflow.md | 84 ++++ .../gitlink-label/examples/label-workflow.md | 57 +++ .../examples/license-compliance-workflow.md | 55 +++ .../examples/member-workflow.md | 54 +++ .../examples/milestone-workflow.md | 69 ++++ skills/gitlink-onboarding/SKILL.md | 364 ++++++++++++++++++ .../examples/onboarding-workflow.md | 197 ++++++++++ skills/gitlink-org/examples/org-workflow.md | 35 ++ .../examples/pipeline-workflow.md | 68 ++++ skills/gitlink-pm/examples/pm-workflow.md | 72 ++++ skills/gitlink-pr/examples/pr-workflow.md | 96 +++++ .../examples/release-auto-workflow.md | 129 +++++++ .../examples/release-workflow.md | 95 +++++ skills/gitlink-repo/examples/repo-workflow.md | 64 +++ .../examples/search-workflow.md | 59 +++ skills/gitlink-user/examples/user-workflow.md | 39 ++ .../examples/webhook-workflow.md | 46 +++ skills/gitlink-wiki/examples/wiki-workflow.md | 60 +++ .../examples/workflow-examples.md | 74 ++++ 26 files changed, 2108 insertions(+) create mode 100644 skills/gitlink-auth/examples/auth-workflow.md create mode 100644 skills/gitlink-ci/examples/ci-workflow.md create mode 100644 skills/gitlink-commit-quality/examples/commit-quality-workflow.md create mode 100644 skills/gitlink-compare/examples/compare-workflow.md create mode 100644 skills/gitlink-compliance/examples/compliance-workflow.md create mode 100644 skills/gitlink-file/examples/file-workflow.md create mode 100644 skills/gitlink-health/examples/health-workflow.md create mode 100644 skills/gitlink-issue/examples/issue-workflow.md create mode 100644 skills/gitlink-label/examples/label-workflow.md create mode 100644 skills/gitlink-license-compliance/examples/license-compliance-workflow.md create mode 100644 skills/gitlink-member/examples/member-workflow.md create mode 100644 skills/gitlink-milestone/examples/milestone-workflow.md create mode 100644 skills/gitlink-onboarding/SKILL.md create mode 100644 skills/gitlink-onboarding/examples/onboarding-workflow.md create mode 100644 skills/gitlink-org/examples/org-workflow.md create mode 100644 skills/gitlink-pipeline/examples/pipeline-workflow.md create mode 100644 skills/gitlink-pm/examples/pm-workflow.md create mode 100644 skills/gitlink-pr/examples/pr-workflow.md create mode 100644 skills/gitlink-release-auto/examples/release-auto-workflow.md create mode 100644 skills/gitlink-release/examples/release-workflow.md create mode 100644 skills/gitlink-repo/examples/repo-workflow.md create mode 100644 skills/gitlink-search/examples/search-workflow.md create mode 100644 skills/gitlink-user/examples/user-workflow.md create mode 100644 skills/gitlink-webhook/examples/webhook-workflow.md create mode 100644 skills/gitlink-wiki/examples/wiki-workflow.md create mode 100644 skills/gitlink-workflow/examples/workflow-examples.md diff --git a/skills/gitlink-auth/examples/auth-workflow.md b/skills/gitlink-auth/examples/auth-workflow.md new file mode 100644 index 0000000..c9c9ed0 --- /dev/null +++ b/skills/gitlink-auth/examples/auth-workflow.md @@ -0,0 +1,48 @@ +# 认证工作流示例 + +**场景**:首次使用 gitlink-cli 的用户需要完成登录认证。 + +## 工作流步骤 + +### Step 1:交互式登录 + +```bash +# 方式 1:用户名密码登录 +gitlink-cli auth login +# 按提示输入用户名和密码 + +# 方式 2:使用已有 Token +gitlink-cli auth login --token +# 粘贴 GitLink 个人访问令牌 +``` + +### Step 2:验证登录状态 + +```bash +gitlink-cli auth status +``` + +**输出示例:** +``` +已登录为: zhangsan +Token 有效期至: 2026-06-19 +存储位置: OS Keychain +``` + +### Step 3:Token 过期后重新登录 + +```bash +# 遇到 401 错误时,重新登录 +gitlink-cli auth login + +# 退出登录 +gitlink-cli auth logout +``` + +--- + +## 注意事项 + +- GitLink Token 有效期 7 天,过期需重新登录 +- Token 存储在系统密钥管理器中,安全可靠 +- 非交互环境可设置环境变量 `GITLINK_TOKEN` diff --git a/skills/gitlink-ci/examples/ci-workflow.md b/skills/gitlink-ci/examples/ci-workflow.md new file mode 100644 index 0000000..14e0335 --- /dev/null +++ b/skills/gitlink-ci/examples/ci-workflow.md @@ -0,0 +1,63 @@ +# CI 构建管理完整工作流示例 + +**场景**:开发者需要查看 CI 构建状态、重启失败的构建。 + +## 工作流步骤 + +### Step 1:查看构建列表 + +```bash +# 列出最近的构建 +gitlink-ci build list --owner myorg --repo myproject --format json +``` + +**输出示例:** +```json +{ + "ok": true, + "data": [ + { + "build_number": 156, + "status": "success", + "branch": "master", + "trigger": "push", + "duration": "3m 42s", + "created_at": "2026-05-28T15:30:00+08:00" + }, + { + "build_number": 155, + "status": "failure", + "branch": "feature/new-api", + "trigger": "push", + "duration": "5m 10s" + } + ] +} +``` + +### Step 2:查看构建详情 + +```bash +# 查看特定构建的详细信息 +gitlink-cli ci +builds --owner myorg --repo myproject --format json + +# 查看构建日志(失败构建) +gitlink-cli ci +log --build 155 +``` + +### Step 3:重启构建 + +```bash +# 重启失败的构建 +gitlink-cli ci +restart --build 155 +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli ci +builds --owner --repo --format json +gitlink-cli ci +log --build +gitlink-cli ci +restart --build +``` diff --git a/skills/gitlink-commit-quality/examples/commit-quality-workflow.md b/skills/gitlink-commit-quality/examples/commit-quality-workflow.md new file mode 100644 index 0000000..0afd796 --- /dev/null +++ b/skills/gitlink-commit-quality/examples/commit-quality-workflow.md @@ -0,0 +1,47 @@ +# 提交质量检查完整工作流示例 + +**场景**:项目维护者需要检查提交信息的质量和规范性。 + +## 工作流步骤 + +### Step 1:获取提交历史 + +```bash +# 获取最近的提交记录 +gitlink-cli repo +commits --owner myorg --repo myproject --limit 20 --format json +``` + +### Step 2:分析提交信息 + +AI 检查提交信息是否符合 Conventional Commits 规范: + +```markdown +## 📝 提交质量报告 + +### 检查项 + +| 检查项 | 标准 | 结果 | +|--------|------|------| +| 格式规范 | Conventional Commits | 15/20 通过 | +| 描述清晰 | 有具体说明 | 18/20 通过 | +| 关联 Issue | 引用 Issue 编号 | 12/20 通过 | + +### 不合规示例 + +1. `fix bug` → 应改为 `fix: resolve login timeout issue (#165)` +2. `update` → 应改为 `docs: update API reference` +3. `wip` → WIP 提交不应出现在主分支 + +### 建议 +- 遵循 `type(scope): description` 格式 +- type 可选:feat / fix / docs / style / refactor / perf / test / ci / chore +- 添加 Breaking Change 标注(如有) +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli repo +commits --owner --repo --limit --format json +``` diff --git a/skills/gitlink-compare/examples/compare-workflow.md b/skills/gitlink-compare/examples/compare-workflow.md new file mode 100644 index 0000000..5f68b64 --- /dev/null +++ b/skills/gitlink-compare/examples/compare-workflow.md @@ -0,0 +1,38 @@ +# 代码比较完整工作流示例 + +**场景**:开发者需要比较两个分支或提交之间的差异。 + +## 工作流步骤 + +### Step 1:比较两个分支 + +```bash +# 比较两个分支的差异 +gitlink-cli api GET /:owner/:repo/compare/master...develop --format json +``` + +### Step 2:查看提交差异 + +```bash +# 获取两个提交之间的差异 +gitlink-cli api GET /:owner/:repo/compare/abc123...def456 --format json +``` + +### Step 3:查看特定文件变更 + +```bash +# 获取文件的变更历史 +gitlink-cli repo +commits --owner myorg --repo myproject --format json + +# 获取某个提交的详细内容 +gitlink-cli api GET /:owner/:repo/commits/ --format json +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli api GET /:owner/:repo/compare/... --format json +gitlink-cli repo +commits --owner --repo --format json +``` diff --git a/skills/gitlink-compliance/examples/compliance-workflow.md b/skills/gitlink-compliance/examples/compliance-workflow.md new file mode 100644 index 0000000..f6fa9a7 --- /dev/null +++ b/skills/gitlink-compliance/examples/compliance-workflow.md @@ -0,0 +1,52 @@ +# 合规检查完整工作流示例 + +**场景**:项目维护者需要检查项目的合规性(许可证、代码规范等)。 + +## 工作流步骤 + +### Step 1:检查项目许可证 + +```bash +# 查看 LICENSE 文件 +gitlink-cli repo +raw --owner myorg --repo myproject --path LICENSE + +# 查看仓库信息中的许可证 +gitlink-cli repo +info --owner myorg --repo myproject --format json +``` + +### Step 2:检查项目结构 + +```bash +# 查看根目录文件(寻找 .gitignore, CONTRIBUTING.md 等) +gitlink-cli api GET /:owner/:repo/sub_entries --query 'filepath=.&ref=master' + +# 检查 CI 配置 +gitlink-cli repo +raw --owner myorg --repo myproject --path .gitea/workflows/ci.yml +``` + +### Step 3:生成合规报告 + +AI 根据采集到的信息生成合规报告: + +```markdown +## 📋 项目合规检查报告 + +| 检查项 | 状态 | 说明 | +|--------|:----:|------| +| LICENSE 文件 | ✅ | Apache-2.0 | +| README.md | ✅ | 完整 | +| CONTRIBUTING.md | ⚠️ | 缺失,建议补充 | +| .gitignore | ✅ | 已配置 | +| CI 配置 | ✅ | Gitea Actions | +| 代码规范配置 | ⚠️ | 缺少 linter 配置 | +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli repo +raw --owner --repo --path LICENSE +gitlink-cli repo +info --owner --repo --format json +gitlink-cli api GET /:owner/:repo/sub_entries --query 'filepath=.&ref=master' +``` diff --git a/skills/gitlink-file/examples/file-workflow.md b/skills/gitlink-file/examples/file-workflow.md new file mode 100644 index 0000000..21c0ad6 --- /dev/null +++ b/skills/gitlink-file/examples/file-workflow.md @@ -0,0 +1,66 @@ +# 文件操作完整工作流示例 + +**场景**:开发者需要通过 API 在仓库中创建、更新或删除文件。 + +## 前置条件 + +- `gitlink-cli` 已安装并登录 +- 熟悉 GitLink 文件操作 API(base64 编码、SHA 校验) + +## 工作流步骤 + +### Step 1:创建文件 + +```bash +# content 必须 base64 编码 +# 方式 1:Linux/macOS +CONTENT=$(echo -n "# 项目文档\n\n这是一个示例文档" | base64) + +# 方式 2:直接传递 +gitlink-cli api POST /:owner/:repo/create_file --body '{ + "filepath": "docs/guide.md", + "content": "IyDpobnnm67mlrnlvI8KCuacrOeahOWLvumZpGRvYw==", + "branch": "master", + "message": "docs: add project guide" +}' +``` + +### Step 2:获取文件 SHA(用于更新/删除) + +```bash +# 获取文件信息(含 SHA) +gitlink-cli api GET /:owner/:repo/sub_entries --query 'filepath=docs/guide.md&ref=master' +# 从返回结果中取 entries.sha +``` + +### Step 3:更新文件 + +```bash +gitlink-cli api PUT /:owner/:repo/update_file --body '{ + "filepath": "docs/guide.md", + "content": "", + "sha": "<从sub_entries获取的sha>", + "branch": "master", + "message": "docs: update project guide" +}' +``` + +### Step 4:删除文件 + +```bash +gitlink-cli api DELETE /:owner/:repo/delete_file --body '{ + "filepath": "docs/old-guide.md", + "sha": "<文件sha>", + "branch": "master", + "message": "docs: remove outdated guide" +}' +``` + +--- + +## 注意事项 + +- 创建文件时 content 必须使用 base64 编码 +- 更新和删除文件需要提供文件的 SHA 值 +- SHA 可通过 `sub_entries` 接口获取 +- 文件操作会直接在指定分支上生成一个提交 diff --git a/skills/gitlink-health/examples/health-workflow.md b/skills/gitlink-health/examples/health-workflow.md new file mode 100644 index 0000000..d821a11 --- /dev/null +++ b/skills/gitlink-health/examples/health-workflow.md @@ -0,0 +1,77 @@ +# 项目健康度分析完整工作流示例 + +**场景**:项目维护者需要全面了解项目健康状况,生成健康度报告。 + +## 前置条件 + +- `gitlink-cli` 已安装并登录 +- 仓库有一定数量的 Issue 和 PR 历史 + +## 工作流步骤 + +### Step 1:采集仓库数据 + +```bash +# 采集 PR 和 Issue 数据到 SQLite +gitlink-cli health +fetch --owner myorg --repo myproject +``` + +**输出示例:** +``` +正在采集仓库数据... +✓ 获取仓库信息: myorg/myproject +✓ 采集 Issue 数据: 156 条 +✓ 采集 PR 数据: 89 条 +✓ 数据已保存到 ~/.agents/skills/gitlink-health/data/gitlink_health.db +``` + +### Step 2:查询关键指标 + +参考 `references/queries.md` 执行 SQL 查询: + +```bash +# 查询 Issue 平均解决时长 +sqlite3 ~/.agents/skills/gitlink-health/data/gitlink_health.db \ + "SELECT AVG(julianday(closed_at) - julianday(created_at)) as avg_days FROM issues WHERE closed_at IS NOT NULL" + +# 查询 PR 合并率 +sqlite3 ~/.agents/skills/gitlink-health/data/gitlink_health.db \ + "SELECT COUNT(CASE WHEN status='merged' THEN 1 END)*100.0/COUNT(*) as merge_rate FROM pulls" + +# 查询贡献者活跃度 +sqlite3 ~/.agents/skills/gitlink-health/data/gitlink_health.db \ + "SELECT author, COUNT(*) as pr_count FROM pulls GROUP BY author ORDER BY pr_count DESC LIMIT 10" +``` + +### Step 3:生成健康度报告 + +按照 `asset/health_report_template.md` 模板组装报告: + +```markdown +## 🏥 项目健康度报告 — myorg/myproject + +### 总体评分:⭐⭐⭐⭐ (4/5) + +| 维度 | 状态 | 评分 | 建议 | +|------|:----:|:----:|------| +| 📖 文档 | ✅ | ☆☆☆☆☆ | README 完整,有 API 文档 | +| 📜 许可证 | ✅ | ☆☆☆☆☆ | Apache-2.0 | +| 🔧 CI/CD | ✅ | ☆☆☆☆☆ | Gitea Actions 配置完善 | +| 🐛 Issue 管理 | ⚠️ | ☆☆☆☆☆ | 平均解决时长 8.5 天,偏长 | +| 🔀 PR 活跃度 | ✅ | ☆☆☆☆☆ | 合并率 78%,活跃度良好 | +| 👥 贡献者 | ⚠️ | ☆☆☆☆☆ | 核心贡献者 3 人,较集中 | + +### 关键发现 +1. Issue 解决时长偏长,建议引入自动分拣 +2. 贡献者集中度高,需吸引更多外部贡献者 +3. CI 配置完善,构建成功率高 +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli health +fetch --owner --repo +gitlink-cli health +fetch --owner --repo --max-pages 5 +``` diff --git a/skills/gitlink-issue/examples/issue-workflow.md b/skills/gitlink-issue/examples/issue-workflow.md new file mode 100644 index 0000000..d877651 --- /dev/null +++ b/skills/gitlink-issue/examples/issue-workflow.md @@ -0,0 +1,84 @@ +# Issue 管理完整工作流示例 + +**场景**:项目维护者需要批量管理 Issue:创建、分类、关闭、评论。 + +## 前置条件 + +- `gitlink-cli` 已安装并登录 + +## 工作流步骤 + +### Step 1:列出项目 Issue + +```bash +# 查看所有开放的 Issue +gitlink-cli issue +list --owner myorg --repo myproject --state open --format json +``` + +**输出示例:** +```json +{ + "ok": true, + "data": [ + { + "number": 42, + "subject": "登录页面报错 500", + "status_id": 1, + "priority_id": 2, + "author": "user_a", + "created_at": "2026-05-20T10:00:00+08:00" + } + ] +} +``` + +### Step 2:创建 Issue + +```bash +gitlink-cli issue +create \ + --owner myorg --repo myproject \ + --title "Bug: 搜索结果排序异常" \ + --body "## 复现步骤\n1. 打开搜索页面\n2. 输入关键词\n3. 点击搜索\n\n## 预期结果\n结果按相关度排序\n\n## 实际结果\n结果顺序随机" +``` + +### Step 3:批量分类 Issue + +```bash +# 查看可用标签 +gitlink-cli issue +tags --owner myorg --repo myproject + +# 批量更新 Issue 标签(加 --dry-run 预览) +gitlink-cli issue +batch-update --ids 10,20,30 --tag-ids 1,3 --dry-run + +# 确认后执行 +gitlink-cli issue +batch-update --ids 10,20,30 --tag-ids 1,3 +``` + +### Step 4:添加评论和关闭 Issue + +```bash +# 为 Issue 添加评论 +gitlink-cli issue +comment --number 42 --body "已修复,请更新到 v1.2.0 验证" + +# 关闭单个 Issue +gitlink-cli issue +close --number 42 + +# 批量关闭已解决的 Issue +gitlink-cli issue +batch-close --owner myorg --repo myproject --numbers 42,43,44 --dry-run +gitlink-cli issue +batch-close --owner myorg --repo myproject --numbers 42,43,44 +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli issue +list --state open --format json +gitlink-cli issue +create --title "..." --body "..." +gitlink-cli issue +view --number --format json +gitlink-cli issue +update --number --title "..." --tag-ids +gitlink-cli issue +comment --number --body "..." +gitlink-cli issue +close --number +gitlink-cli issue +batch-close --numbers 1,2,3 +gitlink-cli issue +batch-update --ids 1,2,3 --status closed --dry-run +``` diff --git a/skills/gitlink-label/examples/label-workflow.md b/skills/gitlink-label/examples/label-workflow.md new file mode 100644 index 0000000..1d0fa9e --- /dev/null +++ b/skills/gitlink-label/examples/label-workflow.md @@ -0,0 +1,57 @@ +# 标签管理完整工作流示例 + +**场景**:项目维护者需要创建和管理 Issue 标签体系。 + +## 工作流步骤 + +### Step 1:查看现有标签 + +```bash +gitlink-cli label +list --owner myorg --repo myproject --format json +``` + +**输出示例:** +```json +{ + "ok": true, + "data": [ + { "id": 1, "name": "bug", "color": "#FF0000" }, + { "id": 2, "name": "enhancement", "color": "#00FF00" }, + { "id": 3, "name": "documentation", "color": "#0075CA" } + ] +} +``` + +### Step 2:创建标签 + +```bash +# 创建 bug 标签 +gitlink-cli label +create --name "bug" --color "#FF0000" + +# 创建新人友好标签 +gitlink-cli label +create --name "good first issue" --color "#7057FF" + +# 创建优先级标签 +gitlink-cli label +create --name "priority: high" --color "#FF6600" +``` + +### Step 3:更新和删除标签 + +```bash +# 更新标签颜色 +gitlink-cli label +update --id 1 --color "#E74C3C" + +# 删除标签(⚠️ 需确认) +gitlink-cli label +delete --id 5 +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli label +list --owner --repo --format json +gitlink-cli label +create --name --color +gitlink-cli label +update --id --name --color +gitlink-cli label +delete --id +``` diff --git a/skills/gitlink-license-compliance/examples/license-compliance-workflow.md b/skills/gitlink-license-compliance/examples/license-compliance-workflow.md new file mode 100644 index 0000000..034661e --- /dev/null +++ b/skills/gitlink-license-compliance/examples/license-compliance-workflow.md @@ -0,0 +1,55 @@ +# 许可证合规检查完整工作流示例 + +**场景**:项目维护者需要检查项目的依赖许可证是否合规。 + +## 工作流步骤 + +### Step 1:获取项目依赖文件 + +```bash +# Go 项目 +gitlink-cli repo +raw --owner myorg --repo myproject --path go.mod + +# Node.js 项目 +gitlink-cli repo +raw --owner myorg --repo myproject --path package.json + +# Python 项目 +gitlink-cli repo +raw --owner myorg --repo myproject --path requirements.txt +``` + +### Step 2:检查项目许可证 + +```bash +# 查看项目自身许可证 +gitlink-cli repo +raw --owner myorg --repo myproject --path LICENSE +``` + +### Step 3:生成合规报告 + +AI 分析依赖许可证后生成报告: + +```markdown +## 📜 许可证合规检查报告 + +### 项目许可证:Apache-2.0 + +### 依赖分析 + +| 依赖 | 许可证 | 兼容性 | 风险 | +|------|--------|:------:|:----:| +| library-a | MIT | ✅ 兼容 | 低 | +| library-b | Apache-2.0 | ✅ 兼容 | 低 | +| library-c | GPL-3.0 | ⚠️ 注意 | 高 | +| library-d | BSD-3-Clause | ✅ 兼容 | 低 | + +### 建议 +- ⚠️ library-c 使用 GPL-3.0 许可证,可能要求项目也使用 GPL 许可 +- ✅ 其他依赖许可证与 Apache-2.0 兼容 +``` + +--- + +## 注意事项 + +- GPL/AGPL 许可证具有传染性,需特别关注 +- 建议定期检查依赖许可证变更 diff --git a/skills/gitlink-member/examples/member-workflow.md b/skills/gitlink-member/examples/member-workflow.md new file mode 100644 index 0000000..a2c338e --- /dev/null +++ b/skills/gitlink-member/examples/member-workflow.md @@ -0,0 +1,54 @@ +# 成员管理完整工作流示例 + +**场景**:项目维护者需要管理仓库的协作者和团队成员。 + +## 工作流步骤 + +### Step 1:查看仓库成员 + +```bash +gitlink-cli member +list --owner myorg --repo myproject --format json +``` + +**输出示例:** +```json +{ + "ok": true, + "data": [ + { "id": 100, "name": "张三", "login": "zhangsan", "role": "Manager" }, + { "id": 101, "name": "李四", "login": "lisi", "role": "Developer" } + ] +} +``` + +### Step 2:添加成员 + +```bash +# 添加仓库协作者 +gitlink-cli member +add --owner myorg --repo myproject --user-id 102 --role Developer +``` + +### Step 3:修改成员角色 + +```bash +# 将成员提升为 Manager +gitlink-cli member +update --owner myorg --repo myproject --user-id 101 --role Manager +``` + +### Step 4:移除成员 + +```bash +# 移除仓库协作者(⚠️ 需确认) +gitlink-cli member +remove --owner myorg --repo myproject --user-id 101 +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli member +list --owner --repo --format json +gitlink-cli member +add --user-id --role +gitlink-cli member +update --user-id --role +gitlink-cli member +remove --user-id +``` diff --git a/skills/gitlink-milestone/examples/milestone-workflow.md b/skills/gitlink-milestone/examples/milestone-workflow.md new file mode 100644 index 0000000..ce6250f --- /dev/null +++ b/skills/gitlink-milestone/examples/milestone-workflow.md @@ -0,0 +1,69 @@ +# 里程碑管理完整工作流示例 + +**场景**:项目维护者需要创建里程碑来规划版本迭代。 + +## 工作流步骤 + +### Step 1:查看里程碑列表 + +```bash +gitlink-cli milestone +list --owner myorg --repo myproject --format json +``` + +**输出示例:** +```json +{ + "ok": true, + "data": [ + { + "id": 5, + "name": "v1.3.0", + "description": "用户体验升级", + "due_date": "2026-07-01", + "open_issues": 3, + "closed_issues": 12 + } + ] +} +``` + +### Step 2:创建里程碑 + +```bash +gitlink-cli milestone +create \ + --owner myorg --repo myproject \ + --name "v1.4.0" \ + --description "性能优化与稳定性提升" \ + --due-date "2026-08-01" +``` + +### Step 3:关联 Issue 到里程碑 + +```bash +# 将 Issue 分配到里程碑 +gitlink-cli issue +update --number 156 --milestone 6 + +# 批量分配 +gitlink-cli issue +batch-update --ids 156,157,158 --milestone 6 +``` + +### Step 4:更新和关闭里程碑 + +```bash +# 更新里程碑描述 +gitlink-cli milestone +update --id 6 --description "更新后的描述" + +# 版本发布后关闭里程碑 +gitlink-cli milestone +close --id 5 +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli milestone +list --owner --repo --format json +gitlink-cli milestone +create --name --description "..." --due-date +gitlink-cli milestone +update --id --description "..." +gitlink-cli milestone +close --id +``` diff --git a/skills/gitlink-onboarding/SKILL.md b/skills/gitlink-onboarding/SKILL.md new file mode 100644 index 0000000..0a090ac --- /dev/null +++ b/skills/gitlink-onboarding/SKILL.md @@ -0,0 +1,364 @@ +--- +name: gitlink-onboarding +version: 1.0.0 +description: "新人引导:为开源项目新贡献者提供从环境搭建到首次提交的完整引导。当用户提到「新人引导」「新手入门」「good first issue」「贡献指南」「如何参与」「onboarding」等场景时触发。" +metadata: + requires: + bins: ["gitlink-cli"] + cliHelp: "gitlink-cli --help" +--- + +# gitlink-onboarding(新人引导) + +**CRITICAL — 开始前必须先阅读 [`../gitlink-shared/SKILL.md`](../gitlink-shared/SKILL.md),其中包含认证、权限处理和 API 注意事项。** +**CRITICAL — GitLink 操作只能用 `gitlink-cli`。禁止用 `gh`(GitHub CLI)操作 GitLink 资源。`gh` 仅适用于 GitHub 平台。** + +> **前置条件:** 先阅读 [`../gitlink-shared/SKILL.md`](../gitlink-shared/SKILL.md) 了解认证和全局参数。 + +## 工作流概览 + +本 Skill 为开源项目新贡献者提供从零到一的完整引导体验,涵盖环境搭建、项目理解、Issue 选择、代码修改到提交 PR 的全过程。 + +| 阶段 | 操作 | AI Agent 角色 | +|------|------|--------------| +| ① 项目概览 | 拉取仓库信息、README、目录结构 | 执行 CLI 命令采集项目信息 | +| ② 环境搭建 | 引导安装依赖、配置开发环境 | 根据项目类型生成环境搭建指南 | +| ③ 寻找任务 | 搜索 good-first-issue 标签的 Issue | 推荐、筛选适合新人的 Issue | +| ④ 代码引导 | 分析 Issue 对应的代码位置 | 生成代码定位和修改指引 | +| ⑤ 提交贡献 | Fork → Branch → Commit → PR | 引导完成 Fork 工作流 | +| ⑥ 发布引导评论 | 在 Issue 中添加新人引导评论 | 自动生成个性化引导内容 | + +--- + +## 详细工作流 + +### 工作流 1:项目新人入门(Project Onboarding) + +**场景**:新人想要参与一个 GitLink 项目,需要了解项目信息和上手指南。 + +#### Step 1:获取项目概览 + +```bash +# 获取仓库基本信息 +gitlink-cli repo +info --owner --repo --format json + +# 获取 README 内容 +gitlink-cli repo +readme --owner --repo + +# 获取语言统计 +gitlink-cli repo +languages --owner --repo --format json + +# 获取贡献者列表 +gitlink-cli repo +contributors --owner --repo --format json + +# 获取目录结构(查看 src 目录) +gitlink-cli api GET /:owner/:repo/sub_entries --query 'filepath=src&ref=master' +``` + +#### Step 2:生成环境搭建指南 + +根据项目的语言和技术栈,AI 生成对应的环境搭建指南: + +**Go 项目模板:** +```markdown +## 🚀 环境搭建指南 + +### 前置要求 +- Go 1.21+ +- Git +- gitlink-cli(已安装) + +### 步骤 +1. Fork 项目:`gitlink-cli repo +fork --owner --repo ` +2. Clone 你的 Fork:`git clone https://www.gitlink.org.cn//.git` +3. 添加 upstream:`git remote add upstream https://www.gitlink.org.cn//.git` +4. 安装依赖:`go mod download` +5. 验证构建:`go build ./...` +6. 运行测试:`go test ./...` +``` + +**Python 项目模板:** +```markdown +## 🚀 环境搭建指南 + +### 前置要求 +- Python 3.10+ +- Git +- gitlink-cli(已安装) + +### 步骤 +1. Fork 项目:`gitlink-cli repo +fork --owner --repo ` +2. Clone 你的 Fork:`git clone https://www.gitlink.org.cn//.git` +3. 创建虚拟环境:`python -m venv venv && source venv/bin/activate` +4. 安装依赖:`pip install -e ".[dev]"` +5. 运行测试:`pytest tests/` +``` + +#### Step 3:输出项目结构分析 + +AI 根据仓库信息和目录结构,输出项目概览报告: + +```markdown +## 📋 项目概览 — / + +| 信息 | 详情 | +|------|------| +| 项目名称 | | +| 描述 | | +| 主要语言 | | +| 开源协议 | | +| 贡献者数 | | +| 开放 Issue | | +| 开放 PR | | + +### 📁 核心目录 +- `src/` — 源代码 +- `tests/` — 测试 +- `doc/` — 文档 +- `cmd/` — CLI 入口 + +### 🤝 贡献流程 +1. Fork → Branch → Code → Test → PR +2. 遵循 Conventional Commits 规范 +3. PR 需要通过 CI 检查和 Code Review +``` + +--- + +### 工作流 2:寻找适合新人的 Issue + +**场景**:新人不知道从哪里入手,需要推荐适合新手的任务。 + +#### Step 1:搜索 good-first-issue + +```bash +# 搜索带 good-first-issue 标签的 Issue +gitlink-cli search +issues --owner --repo --keyword "good first issue" --category opened + +# 查看所有打开的 Issue +gitlink-cli issue +list --state open --format json + +# 获取标签列表(寻找新人友好标签) +gitlink-cli issue +tags --owner --repo +``` + +#### Step 2:分析 Issue 新人友好度 + +AI 对每个开放的 Issue 进行新人友好度评估: + +| 评估维度 | 高友好 ✅ | 中友好 🟡 | 低友好 🔴 | +|---------|----------|----------|----------| +| 标题清晰度 | 明确描述问题和期望 | 模糊但可理解 | 标题不清 | +| 描述完整度 | 有复现步骤、预期结果 | 有简要描述 | 只有标题 | +| 代码定位 | 标注了文件/函数 | 可推断位置 | 无任何定位信息 | +| 改动范围 | 单文件、<50 行 | 多文件或 >50 行 | 涉及架构改动 | +| 难度标签 | good-first-issue / easy | medium | hard / critical | + +#### Step 3:推荐 Issue 列表 + +```markdown +## 🎯 推荐新手任务 + +### ⭐ 强烈推荐(新人友好度:⭐⭐⭐) + +1. **Issue #** — + - 📁 涉及文件:`<file_path>` + - 📝 改动范围:约 <n> 行 + - 💡 提示:<具体修改建议> + - 🔗 链接:https://www.gitlink.org.cn/<owner>/<repo>/issues/<n> + +### ✅ 值得尝试(新人友好度:⭐⭐) + +2. **Issue #<n>** — <title> + - 📝 需要了解:<相关知识> + - 💡 提示:<学习建议> +``` + +--- + +### 工作流 3:Issue 引导评论生成 + +**场景**:项目维护者希望为 good-first-issue 自动生成引导评论,帮助新人快速上手。 + +#### Step 1:获取 Issue 详情 + +```bash +# 查看 Issue 详情 +gitlink-cli issue +view --number <issue_number> --format json + +# 获取相关文件内容(用于代码定位) +gitlink-cli repo +raw --owner <owner> --repo <repo> --path <file_path> --ref master +``` + +#### Step 2:生成引导评论 + +AI 根据 Issue 内容生成结构化的引导评论: + +```markdown +## 🌟 欢迎贡献! + +感谢你对本项目的关注!这是一个 **good first issue**,非常适合首次贡献者。 + +### 📋 任务描述 +<用自己的话重述 Issue 内容> + +### 🗺️ 代码定位 +- 需要修改的文件:`<file_path>` +- 相关函数/类:`<function_name>`(第 <n> 行附近) +- 依赖的上下文:`<related_file>` + +### ✏️ 修改步骤 +1. **Fork 项目** + ```bash + gitlink-cli repo +fork --owner <owner> --repo <repo> + ``` +2. **创建分支** + ```bash + git checkout -b fix/<branch-name> + ``` +3. **定位代码** + - 打开 `<file_path>` + - 找到 `<function_name>` 函数 + - 理解当前逻辑:<简要说明> +4. **实施修改** + - <具体修改步骤> + - 预期改动约 <n> 行 +5. **测试验证** + ```bash + go test ./<package>/... # 或 pytest tests/ + ``` +6. **提交 PR** + ```bash + git add . + git commit -m "fix: <commit-message>" + git push origin fix/<branch-name> + gitlink-cli pr +create --owner <owner> --repo <repo> \ + --head <you>:fix/<branch-name> --base master \ + --title "fix: <title>" + ``` + +### 💡 提示 +- 不确定的地方可以先在 Issue 中提问 +- PR 描述中引用本 Issue:`Fixes #<number>` +- 遵循项目的代码风格和提交规范 + +### ❓ 需要帮助? +如果遇到任何问题,请随时在下方评论,维护者会尽快回复! +``` + +#### Step 3:发布引导评论 + +```bash +# 将引导评论发布到 Issue +gitlink-cli issue +comment \ + --number <issue_number> \ + --body "$(cat <<'EOF' +## 🌟 欢迎贡献! +...引导内容... +EOF +)" +``` + +--- + +### 工作流 4:新人贡献全流程引导 + +**场景**:新人已选定 Issue,需要从 Fork 到提交 PR 的全流程指导。 + +```bash +# Step 1:Fork 仓库 +gitlink-cli repo +fork --owner <owner> --repo <repo> + +# Step 2:Clone Fork +git clone https://www.gitlink.org.cn/<you>/<repo>.git +cd <repo> + +# Step 3:添加 upstream +git remote add upstream https://www.gitlink.org.cn/<owner>/<repo>.git + +# Step 4:创建分支 +git checkout -b fix/<issue-descriptor> + +# Step 5:(用户进行代码修改) + +# Step 6:提交 +git add -A +git commit -m "fix: <description> (#<issue_number>)" + +# Step 7:推送到 Fork +git push origin fix/<issue-descriptor> + +# Step 8:创建 PR +gitlink-cli pr +create \ + --owner <owner> --repo <repo> \ + --head <you>:fix/<issue-descriptor> --base master \ + --title "fix: <title>" \ + --body "## 变更说明\n\nFixes #<issue_number>\n\n### 修改内容\n- ...\n\n### 测试\n- [ ] 单元测试通过\n- [ ] 手动验证" +``` + +--- + +## 新人友好度评估标准 + +用于评估项目是否对新人友好: + +| 维度 | 评估方法 | 数据来源 | +|------|---------|---------| +| README 完整性 | README 是否包含项目介绍、安装步骤、贡献指南 | `repo +readme` | +| Issue 标签 | 是否有 good-first-issue / easy 标签 | `issue +tags` | +| 文档覆盖 | 是否有 Wiki、API 文档 | `wiki +list` | +| CI 配置 | 是否有自动化构建和测试 | `.gitea/workflows/` 或 `.github/workflows/` | +| 维护者响应 | Issue 平均响应时间 | `issue +list` + 创建时间分析 | +| 贡献指南 | 是否有 CONTRIBUTING.md | `repo +raw --path CONTRIBUTING.md` | + +--- + +## 输出模板 + +### 项目新手上手指南 + +```markdown +# 🚀 <项目名> 新人上手指南 + +## 1. 了解项目 +<项目简介 + 技术栈> + +## 2. 环境搭建 +<Step-by-step 安装指南> + +## 3. 项目结构 +<目录说明 + 核心模块> + +## 4. 选择任务 +<推荐 Issue 列表> + +## 5. 开始贡献 +<Fork → Branch → Code → PR 流程> + +## 6. 获取帮助 +<社区链接 / 维护者联系 / 文档> +``` + +--- + +## 决策规则 + +| 条件 | 操作 | +|------|------| +| 项目无 README | 提示维护者补充 README,但仍提供基础引导 | +| 无 good-first-issue 标签 | 从开放的 Issue 中推荐最简单的(标题包含"文档""修复""小") | +| Issue 无描述 | 提示用户先在 Issue 中提问获取更多信息 | +| 用户未登录 | 引导执行 `gitlink-cli auth login` | +| 用户无 Fork | 引导执行 Fork 流程 | +| Fork 已存在但未配置 upstream | 引导添加 upstream remote | + +--- + +## 注意事项 + +- 引导评论发布前确认用户意图(维护者模式) +- 推荐的 Issue 应标注预估改动范围和难度 +- Fork 工作流严格遵循 [`../gitlink-shared/SKILL.md`](../gitlink-shared/SKILL.md) 中的 PR 协作流程 +- 不确定的信息(如代码定位)应明确标注"建议确认" +- 遵循项目的贡献规范(如果存在 CONTRIBUTING.md) +- 所有 CLI 命令使用 `--format json` 以便解析 diff --git a/skills/gitlink-onboarding/examples/onboarding-workflow.md b/skills/gitlink-onboarding/examples/onboarding-workflow.md new file mode 100644 index 0000000..001f44b --- /dev/null +++ b/skills/gitlink-onboarding/examples/onboarding-workflow.md @@ -0,0 +1,197 @@ +# 新人引导完整工作流示例 + +**场景**:一个新贡献者想参与 GitLink 上的开源项目,AI Agent 引导其完成从了解项目到提交首次贡献的全过程。 + +## 前置条件 + +- `gitlink-cli` 已安装并登录 +- 目标仓库为公开项目 + +## 工作流步骤 + +### Step 1:获取项目概览 + +```bash +# 获取仓库基本信息 +gitlink-cli repo +info --owner Gitlink --repo forgeplus --format json +``` + +**输出示例:** +```json +{ + "ok": true, + "data": { + "identifier": "forgeplus", + "name": "ForgePlus", + "description": "开源研发创新平台", + "language": "Ruby", + "default_branch": "master", + "license_name": "Apache-2.0" + } +} +``` + +```bash +# 获取 README +gitlink-cli repo +readme --owner Gitlink --repo forgeplus + +# 获取语言统计 +gitlink-cli repo +languages --owner Gitlink --repo forgeplus --format json + +# 查看贡献者 +gitlink-cli repo +contributors --owner Gitlink --repo forgeplus --format json +``` + +### Step 2:搜索适合新人的 Issue + +```bash +# 搜索 good-first-issue +gitlink-cli search +issues --owner Gitlink --repo forgeplus --keyword "good first issue" --category opened + +# 如果没有 good-first-issue 标签,查看所有开放的 Issue +gitlink-cli issue +list --state open --format json +``` + +**AI 分析 Issue 列表,推荐最适合新人的任务:** + +```markdown +## 🎯 推荐新手任务 + +### ⭐ 强烈推荐 + +1. **Issue #156** — 修复 README 中的过期链接 + - 📁 涉及文件:`README.md` + - 📝 改动范围:约 3 行 + - 💡 提示:找到文档中的链接,替换为新地址即可 + +2. **Issue #203** — 添加缺失的 API 参数文档 + - 📁 涉及文件:`doc/api_reference.md` + - 📝 改动范围:约 15 行 + - 💡 提示:参考代码中的参数定义补充文档 +``` + +### Step 3:为推荐 Issue 生成引导评论 + +```bash +# 查看 Issue 详情 +gitlink-cli issue +view --number 156 --format json +``` + +**AI 生成引导评论:** + +```markdown +## 🌟 欢迎贡献! + +这是一个很适合首次贡献的任务。 + +### 🗺️ 代码定位 +- 需要修改的文件:`README.md`(项目根目录) +- 相关位置:第 45 行附近的"相关链接"章节 + +### ✏️ 修改步骤 +1. Fork 项目 +2. 创建分支 `git checkout -b fix/readme-links` +3. 打开 `README.md`,找到第 45 行的链接 +4. 将 `https://old-domain.com/docs` 替换为 `https://new-domain.com/docs` +5. 本地预览确认链接正确 +6. 提交 PR + +### 💡 提示 +- 只需修改一处,改动量极小 +- 不需要运行测试 +- PR 标题建议:`docs: update broken link in README` +``` + +### Step 4:发布引导评论 + +```bash +gitlink-cli issue +comment \ + --number 156 \ + --body "## 🌟 欢迎贡献!\n\n这是一个很适合首次贡献的任务。\n\n### 🗺️ 代码定位\n- 需要修改的文件:README.md\n\n### ✏️ 修改步骤\n1. Fork 项目\n2. 修改 README.md 中的链接\n3. 提交 PR\n\n### 💡 提示\n只需修改一处链接即可" +``` + +### Step 5:引导新人完成 Fork-PR 流程 + +```bash +# 1. Fork 仓库 +gitlink-cli repo +fork --owner Gitlink --repo forgeplus + +# 2. Clone +git clone https://www.gitlink.org.cn/MyUser/forgeplus.git +cd forgeplus + +# 3. 配置 upstream +git remote add upstream https://www.gitlink.org.cn/Gitlink/forgeplus.git + +# 4. 创建分支 +git checkout -b fix/readme-links + +# 5. 修改代码(用户手动操作) +# ... + +# 6. 提交 +git add README.md +git commit -m "docs: update broken link in README" + +# 7. 推送到 Fork +git push origin fix/readme-links + +# 8. 创建 PR +gitlink-cli pr +create \ + --owner Gitlink --repo forgeplus \ + --head MyUser:fix/readme-links --base master \ + --title "docs: update broken link in README" \ + --body "## 变更说明\n\nFixes #156\n\n更新了 README 中的过期链接。" +``` + +### Step 6:生成新人上手指南 + +**AI 输出完整的新人上手指南:** + +```markdown +# 🚀 ForgePlus 新人上手指南 + +## 项目简介 +ForgePlus 是一个开源研发创新平台,主要使用 Ruby 开发。 + +## 环境搭建 +1. Fork 项目:`gitlink-cli repo +fork --owner Gitlink --repo forgeplus` +2. Clone:`git clone https://www.gitlink.org.cn/<you>/forgeplus.git` +3. 安装依赖:`bundle install` +4. 配置数据库:`cp config/database.yml.example config/database.yml` +5. 运行测试:`bundle exec rspec` + +## 推荐的第一个任务 +- Issue #156:修复 README 过期链接(难度:⭐) +- Issue #203:补充 API 文档(难度:⭐⭐) + +## 贡献流程 +Fork → Branch → Code → Test → PR + +## 获取帮助 +在 Issue 中 @maintainer 或在 Wiki 中查阅贡献指南 +``` + +--- + +## 完整命令速览 + +```bash +# 项目信息 +gitlink-cli repo +info --owner <owner> --repo <repo> --format json +gitlink-cli repo +readme --owner <owner> --repo <repo> +gitlink-cli repo +languages --owner <owner> --repo <repo> --format json +gitlink-cli repo +contributors --owner <owner> --repo <repo> --format json + +# 搜索 Issue +gitlink-cli search +issues --owner <owner> --repo <repo> --keyword "good first issue" --category opened +gitlink-cli issue +list --state open --format json +gitlink-cli issue +view --number <n> --format json + +# 发布引导评论 +gitlink-cli issue +comment --number <n> --body "<引导内容>" + +# Fork 和 PR +gitlink-cli repo +fork --owner <owner> --repo <repo> +gitlink-cli pr +create --owner <owner> --repo <repo> --head <you>:<branch> --base master --title "..." --body "..." +``` diff --git a/skills/gitlink-org/examples/org-workflow.md b/skills/gitlink-org/examples/org-workflow.md new file mode 100644 index 0000000..4797784 --- /dev/null +++ b/skills/gitlink-org/examples/org-workflow.md @@ -0,0 +1,35 @@ +# 组织管理完整工作流示例 + +**场景**:组织管理员需要查看组织信息和成员列表。 + +## 工作流步骤 + +### Step 1:查看组织信息 + +```bash +# 列出用户所在的组织 +gitlink-cli org +list --format json +``` + +### Step 2:查看组织成员 + +```bash +# 列出组织成员 +gitlink-cli org +members --owner myorg --format json +``` + +### Step 3:查看组织仓库 + +```bash +# 列出组织下的仓库 +gitlink-cli repo +list --user myorg --format json +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli org +list --format json +gitlink-cli org +members --owner <org> --format json +``` diff --git a/skills/gitlink-pipeline/examples/pipeline-workflow.md b/skills/gitlink-pipeline/examples/pipeline-workflow.md new file mode 100644 index 0000000..78f9edb --- /dev/null +++ b/skills/gitlink-pipeline/examples/pipeline-workflow.md @@ -0,0 +1,68 @@ +# Pipeline 管理完整工作流示例 + +**场景**:开发者需要查看和管理 CI/CD Pipeline 工作流。 + +## 工作流步骤 + +### Step 1:查看 Pipeline 列表 + +```bash +# 列出平台 Pipeline +gitlink-cli pipeline +list --owner-id 123 --page 1 --limit 20 +``` + +### Step 2:查看仓库 Pipeline 运行记录 + +```bash +# 列出仓库的 Pipeline 运行记录 +gitlink-cli pipeline +runs --owner Gitlink --repo forgeplus --ref master --workflow build.yml +``` + +### Step 3:查看 Pipeline 详情和日志 + +```bash +# 查看 Pipeline 详情 +gitlink-cli pipeline +view --owner Gitlink --repo forgeplus --id 7 + +# 查看 Pipeline 运行日志 +gitlink-cli pipeline +logs --owner Gitlink --repo forgeplus --run-id 99 --id 7 --index 43 + +# 查看运行报告结果 +gitlink-cli pipeline +results --owner Gitlink --repo forgeplus --run-id 99 +``` + +### Step 4:管理 Pipeline + +```bash +# 启用 Pipeline 工作流(⚠️ 需确认) +gitlink-cli pipeline +enable --owner Gitlink --repo forgeplus --id 7 --workflow build.yml --dry-run + +# 禁用 Pipeline 工作流 +gitlink-cli pipeline +disable --owner Gitlink --repo forgeplus --id 7 --workflow build.yml --dry-run + +# 删除 Pipeline(⚠️ 危险操作) +gitlink-cli pipeline +delete --owner Gitlink --repo forgeplus --id 7 --dry-run +``` + +### Step 5:保存 Pipeline 可视化 YAML + +```bash +# 保存 Pipeline 图形为 YAML +gitlink-cli pipeline +save-yaml --owner Gitlink --repo forgeplus \ + --id 7 --pipeline-json '{"nodes":[]}' --dry-run +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli pipeline +list --owner-id <id> --page <n> --limit <n> +gitlink-cli pipeline +runs --owner <owner> --repo <repo> --ref <branch> --workflow <name> +gitlink-cli pipeline +view --owner <owner> --repo <repo> --id <id> +gitlink-cli pipeline +logs --owner <owner> --repo <repo> --run-id <id> --id <id> --index <n> +gitlink-cli pipeline +run --owner <owner> --repo <repo> --ref <branch> --workflow <name> +gitlink-cli pipeline +enable --owner <owner> --repo <repo> --id <id> --workflow <name> +gitlink-cli pipeline +disable --owner <owner> --repo <repo> --id <id> --workflow <name> +gitlink-cli pipeline +delete --owner <owner> --repo <repo> --id <id> --dry-run +``` diff --git a/skills/gitlink-pm/examples/pm-workflow.md b/skills/gitlink-pm/examples/pm-workflow.md new file mode 100644 index 0000000..7e38d1f --- /dev/null +++ b/skills/gitlink-pm/examples/pm-workflow.md @@ -0,0 +1,72 @@ +# 项目管理(PM)完整工作流示例 + +**场景**:项目经理需要查看看板、Sprint、周报等项目管理信息。 + +## 工作流步骤 + +### Step 1:查看看板 + +```bash +# 查看项目看板(自动从 git remote 解析) +gitlink-cli pm +boards +``` + +### Step 2:查看 Sprint Issue 列表 + +```bash +# 查看 Sprint 中的 Issue +gitlink-cli pm +sprints +``` + +### Step 3:查看周报 + +```bash +# 生成本周周报 +gitlink-cli pm +weekly +``` + +### Step 4:查看 PM Issue 标签和流水线 + +```bash +# 查看 PM Issue 标签 +gitlink-cli pm +tags + +# 查看 PM 流水线 +gitlink-cli pm +pipelines +``` + +### Step 5:查看 Action 运行记录 + +```bash +# 查看最近的 Action 运行记录 +gitlink-cli pm +actions --page 1 --limit 10 + +# 翻页查看更多 +gitlink-cli pm +actions --page 2 --limit 10 +``` + +### Step 6:通过 Raw API 灵活查询 + +```bash +# 按项目 ID 查看看板 +gitlink-cli api GET /pm/dashboards --query 'project_id=123' + +# 查询 Sprint Issue +gitlink-cli api GET /pm/sprint_issues --query 'project_id=123' + +# 查询周报 +gitlink-cli api GET /pm/weekly_issues --query 'project_id=123' +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli pm +boards +gitlink-cli pm +sprints +gitlink-cli pm +weekly +gitlink-cli pm +tags +gitlink-cli pm +pipelines +gitlink-cli pm +actions --page <n> --limit <n> +``` diff --git a/skills/gitlink-pr/examples/pr-workflow.md b/skills/gitlink-pr/examples/pr-workflow.md new file mode 100644 index 0000000..89ed7b7 --- /dev/null +++ b/skills/gitlink-pr/examples/pr-workflow.md @@ -0,0 +1,96 @@ +# PR 管理完整工作流示例 + +**场景**:贡献者从 Fork 仓库到创建 PR、审查、合并的完整流程。 + +## 前置条件 + +- `gitlink-cli` 已安装并登录 +- 已 Fork 目标仓库 + +## 工作流步骤 + +### Step 1:Fork 仓库并创建分支 + +```bash +# Fork 目标仓库 +gitlink-cli repo +fork --owner TargetOrg --repo target-repo + +# Clone 自己的 Fork +git clone https://www.gitlink.org.cn/MyUser/target-repo.git +cd target-repo +git remote add upstream https://www.gitlink.org.cn/TargetOrg/target-repo.git + +# 创建功能分支 +git checkout -b feat/new-search +# ... 编写代码 ... +git add -A && git commit -m "feat: add full-text search" +git push origin feat/new-search +``` + +### Step 2:创建 PR + +```bash +gitlink-cli pr +create \ + --owner TargetOrg --repo target-repo \ + --head MyUser:feat/new-search --base master \ + --title "feat: add full-text search functionality" \ + --body "## 变更说明\n\n- 新增全文搜索功能\n- 支持中英文分词\n- 添加搜索结果高亮\n\n## 测试\n- [x] 单元测试通过\n- [x] 手动验证搜索功能" +``` + +**输出示例:** +```json +{ + "ok": true, + "data": { + "id": 88, + "number": 88, + "title": "feat: add full-text search functionality", + "state": "open", + "source_branch": "MyUser:feat/new-search", + "target_branch": "master" + } +} +``` + +### Step 3:查看和审查 PR + +```bash +# 查看 PR 详情 +gitlink-cli pr +view --id 88 --format json + +# 获取变更文件列表 +gitlink-cli pr +files --id 88 --format json + +# 获取 Diff +gitlink-cli pr +diff --id 88 --format json + +# 添加 Review 评论 +gitlink-cli api POST /TargetOrg/target-repo/pulls/88/reviews --body '{ + "body": "代码结构清晰,测试覆盖完整。建议合并。", + "event": "APPROVE" +}' +``` + +### Step 4:合并 PR + +```bash +# 查看开放的 PR 列表 +gitlink-cli pr +list --state open --format json + +# 合并 PR(使用 squash 方式) +gitlink-cli pr +merge --id 88 --method squash +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli pr +list --state open --format json +gitlink-cli pr +view --id <id> --format json +gitlink-cli pr +files --id <id> --format json +gitlink-cli pr +diff --id <id> --format json +gitlink-cli pr +create --owner <owner> --repo <repo> --head <user>:<branch> --base master --title "..." +gitlink-cli pr +merge --id <id> --method merge +gitlink-cli api POST /:owner/:repo/pulls/:id/reviews --body '{"body":"...","event":"COMMENT"}' +``` diff --git a/skills/gitlink-release-auto/examples/release-auto-workflow.md b/skills/gitlink-release-auto/examples/release-auto-workflow.md new file mode 100644 index 0000000..3080504 --- /dev/null +++ b/skills/gitlink-release-auto/examples/release-auto-workflow.md @@ -0,0 +1,129 @@ +# 自动化 Release 管理完整工作流示例 + +**场景**:项目维护者需要从提交历史自动生成 Release Notes 并发布新版本。 + +## 前置条件 + +- `gitlink-cli` 已安装并登录 +- 项目有提交历史和已合并的 PR + +## 工作流步骤 + +### Step 1:确认当前版本和推荐新版本号 + +```bash +# 获取当前最新 Release +gitlink-cli release +list --owner myorg --repo myproject --format json +``` + +**输出示例:** +```json +{ + "ok": true, + "data": { + "releases": [ + { "id": 15, "tag_name": "v1.2.0", "name": "v1.2.0 - 性能优化版" } + ] + } +} +``` + +```bash +# 获取自 v1.2.0 以来的提交历史 +git log v1.2.0..HEAD --format="%H %s %an %ad" --date=short 2>&1 +``` + +### Step 2:AI 分析提交并推荐版本号 + +AI 根据提交类型(Conventional Commits)推荐: + +``` +当前版本:v1.2.0 +分析了 22 次提交: + - 4 个 feat:全文搜索、暗黑模式、消息通知、批量导入 + - 6 个 fix:修复了 6 个 Bug + - 2 个 docs:更新 API 文档 + - 无 Breaking Change + +推荐版本:v1.3.0(MINOR 升级,有新功能) +``` + +### Step 3:自动生成 Release Notes + +```bash +# 获取本期关闭的 Issue +gitlink-cli issue +list --state closed --format json + +# 获取本期合并的 PR +gitlink-cli pr +list --state merged --format json +``` + +AI 根据提交和 PR/Issue 数据生成 Release Notes: + +```markdown +## v1.3.0 (2026-06-12) + +### ✨ 新功能 +- feat(search): 新增全文搜索功能 (#156) +- feat(ui): 支持暗黑模式 (#178) +- feat(notify): 添加站内消息通知 (#189) +- feat(import): 支持批量导入数据 (#195) + +### 🐛 Bug 修复 +- fix(login): 修复手机号登录验证码未清除 (#165) +- fix(upload): 修复大文件上传超时 (#172) +- fix(api): 修复并发请求偶发 500 错误 (#180) + +### 🤝 贡献者 +感谢 @zhangsan、@lisi、@wangwu 的贡献! +``` + +### Step 4:创建 Release 并通知 + +```bash +# 创建 Release +gitlink-cli release +create \ + --owner myorg --repo myproject \ + --tag v1.3.0 \ + --name "v1.3.0 - 功能增强版" \ + --body "## v1.3.0 (2026-06-12) + +### ✨ 新功能 +- feat(search): 新增全文搜索功能 (#156) +- feat(ui): 支持暗黑模式 (#178) + +### 🐛 Bug 修复 +- fix(login): 修复手机号登录验证码未清除 (#165) +- fix(upload): 修复大文件上传超时 (#172) + +### 🤝 贡献者 +感谢 @zhangsan、@lisi 的贡献!" \ + --target master + +# 验证发布成功 +gitlink-cli release +list --owner myorg --repo myproject --format json + +# 通知相关 Issue 已发版 +gitlink-cli issue +comment --number 165 --body "🎉 此问题已在 v1.3.0 中修复,请更新验证。" +gitlink-cli issue +comment --number 172 --body "🎉 此问题已在 v1.3.0 中修复,请更新验证。" +``` + +--- + +## 完整命令速览 + +```bash +# 版本确认 +gitlink-cli release +list --format json +git log v<prev>..HEAD --format="%s" + +# 发布 +gitlink-cli release +create --tag v<x.y.z> --name "..." --body "..." --target master + +# 验证 +gitlink-cli release +list --format json +gitlink-cli release +view --id <version_id> + +# 通知 +gitlink-cli issue +comment --number <n> --body "🎉 已在 v<x.y.z> 修复" +``` diff --git a/skills/gitlink-release/examples/release-workflow.md b/skills/gitlink-release/examples/release-workflow.md new file mode 100644 index 0000000..a3b688b --- /dev/null +++ b/skills/gitlink-release/examples/release-workflow.md @@ -0,0 +1,95 @@ +# Release 管理完整工作流示例 + +**场景**:项目维护者需要创建新版本发布,包含自动生成的 Release Notes。 + +## 前置条件 + +- `gitlink-cli` 已安装并登录 +- 项目有已合并的 PR 和关闭的 Issue + +## 工作流步骤 + +### Step 1:查看当前版本 + +```bash +# 列出已有的 Release +gitlink-cli release +list --owner myorg --repo myproject --format json +``` + +**输出示例:** +```json +{ + "ok": true, + "data": { + "releases": [ + { + "id": 15, + "tag_name": "v1.2.0", + "name": "v1.2.0 - 性能优化版", + "body": "## ✨ 新功能\n...", + "created_at": "2026-05-01" + } + ] + } +} +``` + +### Step 2:查看提交历史和变更 + +```bash +# 查看自上次发版以来的提交 +gitlink-cli repo +commits --owner myorg --repo myproject --limit 30 --format json + +# 查看已合并的 PR +gitlink-cli pr +list --state merged --format json + +# 查看已关闭的 Issue +gitlink-cli issue +list --state closed --format json +``` + +### Step 3:创建 Release + +```bash +gitlink-cli release +create \ + --owner myorg --repo myproject \ + --tag v1.3.0 \ + --name "v1.3.0 - 用户体验升级" \ + --body "## v1.3.0 (2026-06-01) + +### ✨ 新功能 +- feat: 新增搜索历史功能 (#156) +- feat: 支持暗黑模式 (#178) + +### 🐛 Bug 修复 +- fix: 修复登录超时问题 (#165) +- fix: 修复文件上传进度显示错误 (#172) + +### 🤝 贡献者 +感谢 @zhangsan @lisi 的贡献!" \ + --target master +``` + +### Step 4:验证和通知 + +```bash +# 验证发布成功 +gitlink-cli release +list --owner myorg --repo myproject --format json + +# 获取 version_id 用于查看详情 +gitlink-cli release +view --owner myorg --repo myproject --id <version_id> + +# 通知相关 Issue +gitlink-cli issue +comment --number 165 --body "🎉 此问题已在 v1.3.0 中修复,请更新验证。" +gitlink-cli issue +comment --number 172 --body "🎉 此问题已在 v1.3.0 中修复,请更新验证。" +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli release +list --owner <owner> --repo <repo> --format json +gitlink-cli release +view --owner <owner> --repo <repo> --id <version_id> +gitlink-cli release +create --tag v1.3.0 --name "..." --body "..." --target master +gitlink-cli release +delete --id <version_id> +``` diff --git a/skills/gitlink-repo/examples/repo-workflow.md b/skills/gitlink-repo/examples/repo-workflow.md new file mode 100644 index 0000000..3e8b9bb --- /dev/null +++ b/skills/gitlink-repo/examples/repo-workflow.md @@ -0,0 +1,64 @@ +# 仓库管理完整工作流示例 + +**场景**:开发者需要创建仓库、查看信息、管理文件和贡献者。 + +## 工作流步骤 + +### Step 1:创建新仓库 + +```bash +gitlink-cli repo +create --name my-project --description "我的新项目" --private false +``` + +### Step 2:查看仓库信息 + +```bash +gitlink-cli repo +info --owner myuser --repo my-project --format json + +# 查看 README +gitlink-cli repo +readme --owner myuser --repo my-project + +# 查看贡献者 +gitlink-cli repo +contributors --owner myuser --repo my-project --format json + +# 查看语言统计 +gitlink-cli repo +languages --owner myuser --repo my-project --format json +``` + +### Step 3:管理仓库文件 + +```bash +# 获取文件内容 +gitlink-cli repo +raw --owner myuser --repo my-project --path README.md + +# 查看目录结构 +gitlink-cli api GET /:owner/:repo/sub_entries --query 'filepath=src&ref=master' + +# 查看提交历史 +gitlink-cli repo +commits --owner myuser --repo myproject --limit 10 --format json +``` + +### Step 4:Fork 和删除 + +```bash +# Fork 仓库 +gitlink-cli repo +fork --owner target-user --repo target-repo + +# 删除自己的仓库(⚠️ 危险操作,需确认) +gitlink-cli repo +delete --owner myuser --repo old-project +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli repo +list --user <user> --format json +gitlink-cli repo +info --owner <owner> --repo <repo> --format json +gitlink-cli repo +create --name <name> --description "..." +gitlink-cli repo +fork --owner <owner> --repo <repo> +gitlink-cli repo +readme --owner <owner> --repo <repo> +gitlink-cli repo +contributors --owner <owner> --repo <repo> --format json +gitlink-cli repo +commits --owner <owner> --repo <repo> --limit <n> --format json +gitlink-cli repo +raw --owner <owner> --repo <repo> --path <path> +``` diff --git a/skills/gitlink-search/examples/search-workflow.md b/skills/gitlink-search/examples/search-workflow.md new file mode 100644 index 0000000..255719f --- /dev/null +++ b/skills/gitlink-search/examples/search-workflow.md @@ -0,0 +1,59 @@ +# 搜索操作完整工作流示例 + +**场景**:开发者需要在 GitLink 上搜索仓库、用户和 Issue。 + +## 工作流步骤 + +### Step 1:搜索仓库 + +```bash +gitlink-cli search +repos --keyword "machine learning" --limit 10 +``` + +**输出示例:** +```json +{ + "ok": true, + "data": [ + { + "full_name": "AI-Lab/ml-framework", + "description": "轻量级机器学习框架", + "language": "Python", + "forks_count": 156, + "stars_count": 1024 + } + ] +} +``` + +### Step 2:搜索用户 + +```bash +gitlink-cli search +users --keyword "zhangsan" +``` + +### Step 3:搜索 Issue + +```bash +# 基本搜索 +gitlink-cli search +issues --owner myorg --repo myproject --keyword "登录失败" + +# 搜索已关闭的 Issue +gitlink-cli search +issues --keyword "bug" --category closed + +# 按标签和负责人筛选 +gitlink-cli search +issues --keyword "性能" --assignee 42 --tag 1,2 + +# 按时间排序 +gitlink-cli search +issues --keyword "需求" --sort-by created_on --sort-dir asc +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli search +repos --keyword "<keyword>" --limit <n> +gitlink-cli search +users --keyword "<username>" +gitlink-cli search +issues --owner <owner> --repo <repo> --keyword "<keyword>" --category opened +``` diff --git a/skills/gitlink-user/examples/user-workflow.md b/skills/gitlink-user/examples/user-workflow.md new file mode 100644 index 0000000..add0eed --- /dev/null +++ b/skills/gitlink-user/examples/user-workflow.md @@ -0,0 +1,39 @@ +# 用户信息完整工作流示例 + +**场景**:开发者需要查看 GitLink 用户信息。 + +## 工作流步骤 + +### Step 1:查看当前用户信息 + +```bash +# 查看当前登录用户 +gitlink-cli auth status +``` + +### Step 2:查看其他用户信息 + +```bash +# 通过 Raw API 获取用户信息 +gitlink-cli api GET /users/me --format json + +# 获取指定用户信息 +gitlink-cli api GET /users/<username> --format json +``` + +### Step 3:搜索用户 + +```bash +# 通过搜索命令查找用户 +gitlink-cli search +users --keyword "zhangsan" +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli auth status +gitlink-cli api GET /users/me --format json +gitlink-cli search +users --keyword "<keyword>" +``` diff --git a/skills/gitlink-webhook/examples/webhook-workflow.md b/skills/gitlink-webhook/examples/webhook-workflow.md new file mode 100644 index 0000000..de1d862 --- /dev/null +++ b/skills/gitlink-webhook/examples/webhook-workflow.md @@ -0,0 +1,46 @@ +# Webhook 管理完整工作流示例 + +**场景**:项目维护者需要配置 Webhook 来实现自动化通知。 + +## 工作流步骤 + +### Step 1:查看 Webhook 列表 + +```bash +gitlink-cli webhook +list --owner myorg --repo myproject --format json +``` + +### Step 2:创建 Webhook + +```bash +gitlink-cli webhook +create \ + --owner myorg --repo myproject \ + --url "https://example.com/webhook" \ + --events "push,pull_request,issues" \ + --secret "my-webhook-secret" +``` + +### Step 3:测试和更新 Webhook + +```bash +# 查看 Webhook 详情 +gitlink-cli webhook +view --id 10 --format json + +# 更新 Webhook URL +gitlink-cli webhook +update --id 10 --url "https://new.example.com/webhook" + +# 删除 Webhook(⚠️ 需确认) +gitlink-cli webhook +delete --id 10 +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli webhook +list --owner <owner> --repo <repo> --format json +gitlink-cli webhook +create --url <url> --events <events> --secret <secret> +gitlink-cli webhook +view --id <id> --format json +gitlink-cli webhook +update --id <id> --url <url> +gitlink-cli webhook +delete --id <id> +``` diff --git a/skills/gitlink-wiki/examples/wiki-workflow.md b/skills/gitlink-wiki/examples/wiki-workflow.md new file mode 100644 index 0000000..551c557 --- /dev/null +++ b/skills/gitlink-wiki/examples/wiki-workflow.md @@ -0,0 +1,60 @@ +# Wiki 管理完整工作流示例 + +**场景**:项目维护者需要管理项目 Wiki 文档。 + +## 工作流步骤 + +### Step 1:列出 Wiki 页面 + +```bash +gitlink-cli wiki +list --owner myorg --repo myproject +``` + +**输出示例:** +```json +{ + "ok": true, + "data": [ + { "name": "Home", "title": "首页", "updated_at": "2026-05-20" }, + { "name": "Getting-Started", "title": "快速开始", "updated_at": "2026-05-18" }, + { "name": "API-Reference", "title": "API 参考", "updated_at": "2026-05-15" } + ] +} +``` + +### Step 2:查看和创建 Wiki 页面 + +```bash +# 查看 Wiki 页面内容 +gitlink-cli wiki +view --name Getting-Started + +# 创建新 Wiki 页面 +gitlink-cli wiki +create \ + --name "Deployment-Guide" \ + --content "# 部署指南\n\n## Docker 部署\n\n```bash\ndocker build -t myapp .\ndocker run -p 8080:8080 myapp\n```\n\n## 手动部署\n\n..." +``` + +### Step 3:更新和删除 Wiki 页面 + +```bash +# 更新 Wiki 页面 +gitlink-cli wiki +update \ + --name "Getting-Started" \ + --content "# 快速开始(已更新)\n\n新增了环境变量配置说明..." \ + --message "更新环境变量配置" + +# 删除 Wiki 页面(⚠️ 需确认) +gitlink-cli wiki +delete --name Old-Page +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli wiki +list --owner <owner> --repo <repo> +gitlink-cli wiki +view --name <page-name> +gitlink-cli wiki +create --name <name> --content "..." +gitlink-cli wiki +update --name <name> --content "..." --message "..." +gitlink-cli wiki +delete --name <name> +``` diff --git a/skills/gitlink-workflow/examples/workflow-examples.md b/skills/gitlink-workflow/examples/workflow-examples.md new file mode 100644 index 0000000..0a858e9 --- /dev/null +++ b/skills/gitlink-workflow/examples/workflow-examples.md @@ -0,0 +1,74 @@ +# AI 工作流完整工作流示例 + +**场景**:利用 AI 自动化工作流完成 Issue 分类、PR Review 和报告生成。 + +## 工作流步骤 + +### 工作流 A:Issue 自动分类 + +```bash +# 1. 获取开放的 Issue +gitlink-cli issue +list --state open --format json + +# 2. 分析每个 Issue 并分类 +# AI 根据关键词判断:bug → bug标签,feature → enhancement标签 +gitlink-cli issue +view --number 200 --format json + +# 3. 应用标签 +gitlink-cli api POST /:owner/:repo/issues/:id --body '{"issue_tag_ids":[1]}' +``` + +### 工作流 B:生成 PR 摘要报告 + +```bash +# 生成 PR 审查摘要(只读模式) +gitlink-cli workflow +pr-summary --owner Gitlink --repo gitlink-cli --number 1 --format markdown +``` + +### 工作流 C:生成仓库报告 + +```bash +# 生成综合仓库报告 +gitlink-cli workflow +repo-report --owner Gitlink --repo gitlink-cli --format markdown +``` + +**输出示例(Markdown):** +```markdown +# 仓库报告 — Gitlink/gitlink-cli + +## 基本信息 +- 语言:Go +- 开放 Issue:12 +- 开放 PR:3 +- 最近贡献者:@dev1, @dev2, @dev3 + +## Issue 分布 +- Bug:5 +- Enhancement:4 +- Question:3 + +## 建议 +- 3 个 Issue 超过 30 天未响应,建议处理 +``` + +### 工作流 D:Sprint 报告 + +```bash +# 获取 Issue 和 PR 统计 +gitlink-cli issue +list --state open --format json +gitlink-cli issue +list --state closed --format json +gitlink-cli pr +list --state merged --format json + +# 获取项目动态 +gitlink-cli api GET /:owner/:repo/activity --format json +``` + +--- + +## 完整命令速览 + +```bash +gitlink-cli workflow +pr-summary --owner <owner> --repo <repo> --number <n> --format markdown +gitlink-cli workflow +repo-report --owner <owner> --repo <repo> --format markdown +gitlink-cli workflow +repo-report --owner <owner> --repo <repo> --format json +```