gitlink-cli/skills/gitlink-pm/examples/pm-workflow.md

3.9 KiB
Raw Permalink Blame History

示例:项目管理流程(真实数据)

本示例基于 chroe/gitlink-cli 项目于 2026-06-13 在 Claude Code 中实际执行。 展示轻量项目管理流程:里程碑 → 标签 → Issue 关联。 注chroe/gitlink-cli 未开启 PM 模块(open_devops: false),因此使用 milestone + label 替代。


场景:项目维护者查看项目管理状态

Step 1检查项目是否开启 PM 模块

gitlink-cli repo +info --owner chroe --repo gitlink-cli --format json

关键字段:

{
  "open_devops": false,
  "project_id": 1547045
}

结论: PM 模块未开启,使用 milestone + label 进行轻量管理。

Step 2查看里程碑

gitlink-cli milestone +list --owner chroe --repo gitlink-cli --format json

真实输出:

{
  "ok": true,
  "data": {
    "total_count": 1,
    "opening_milestone_count": 1,
    "closed_milestone_count": 0,
    "milestones": [
      {
        "id": 2761,
        "name": "v2.0",
        "description": "新里程碑",
        "effective_date": "2026-07-01",
        "status": "open",
        "issues_count": 0,
        "percent": 0
      }
    ]
  }
}

分析: 仅剩 1 个活跃里程碑 v2.0(截止日期 2026-07-01无 Issue 关联。测试用里程碑已清理。

Step 3查看标签分类

gitlink-cli label +list --owner chroe --repo gitlink-cli --format json

真实输出摘要:

{
  "ok": true,
  "data": {
    "total_count": 13,
    "issue_tags": [
      { "id": 323829, "name": "缺陷", "color": "#d92d4c", "description": "表示存在意外问题或错误" },
      { "id": 323830, "name": "功能", "color": "#ee955a", "description": "表示新功能申请" },
      { "id": 323831, "name": "疑问", "color": "#2d6ddc", "description": "表示存在疑惑" },
      { "id": 323832, "name": "支持", "color": "#019549", "description": "表示特定功能或特定需求" },
      { "id": 323833, "name": "任务", "color": "#c1a30d", "description": "表示需要分配的任务" },
      { "id": 323837, "name": "测试", "color": "#2897b9", "description": "表示需要测试的需求" },
      { "id": 323838, "name": "重复", "color": "#bb5332", "description": "表示已存在类似的疑修" }
    ]
  }
}

分析: 项目有 13 个标签,覆盖缺陷/功能/疑问/支持/任务/文档/测试/重复等分类,但当前无 Issue 使用标签。

Step 4验证 PM API确认不可用

gitlink-cli api GET /pm/dashboards --query 'project_id=1547045'

结果: 返回 HTML 页面(而非 JSON确认 PM 模块未激活。

Step 5轻量管理实践

# 创建新里程碑用于 Sprint
gitlink-cli milestone +create --owner chroe --repo gitlink-cli \
  --name "Sprint-3" --due-date "2026-06-30"

# 创建标签
gitlink-cli label +create --owner chroe --repo gitlink-cli \
  --name "good-first-issue" --color "#7057ff"

# 创建 Issue 并关联里程碑
gitlink-cli issue +create --owner chroe --repo gitlink-cli \
  --title "新人任务:修复 README 拼写错误" \
  --body "适合首次贡献者,修改 README.md 中的拼写错误"

# 查看进度
gitlink-cli milestone +list --owner chroe --repo gitlink-cli --format json

轻量管理 vs PM 模块对比

功能 轻量管理(所有项目) PM 模块(需开启)
Sprint milestone 命名 /pm/sprint_issues
看板 issue +list + label /pm/dashboards
标签分类 label +create /pm/issue_tags
周报 issue +list + 时间筛选 /pm/weekly_issues
进度 milestone percent 看板视图

改进建议

  1. 将现有 Issue 关联到对应里程碑(目前 4 个里程碑均无 Issue
  2. 为开放 Issue 打标签(#4 #5 #6 均未使用标签)
  3. 定期关闭已完成的里程碑