agiledev-cli 0.1.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +300 -173
  2. package/SKILL.md +114 -98
  3. package/adev.js +1319 -1285
  4. package/autofix/agents/antigravity.js +379 -0
  5. package/autofix/agents/claude.js +147 -0
  6. package/autofix/agents/codex.js +179 -0
  7. package/autofix/agents/exec.js +230 -0
  8. package/autofix/agents/index.js +400 -0
  9. package/autofix/agents/opencode.js +233 -0
  10. package/autofix/agents/pi.js +247 -0
  11. package/autofix/agiledev.js +98 -0
  12. package/autofix/bridge.js +371 -0
  13. package/autofix/cli.js +712 -0
  14. package/autofix/context.js +152 -0
  15. package/autofix/conversation.js +302 -0
  16. package/autofix/coordinator.js +2892 -0
  17. package/autofix/git.js +459 -0
  18. package/autofix/policy.js +230 -0
  19. package/autofix/profile.js +578 -0
  20. package/autofix/public/app.js +3668 -0
  21. package/autofix/public/i18n-id.js +282 -0
  22. package/autofix/public/index.html +32 -0
  23. package/autofix/public/style.css +2463 -0
  24. package/autofix/queue.js +146 -0
  25. package/autofix/scheduler.js +994 -0
  26. package/autofix/scope.js +32 -0
  27. package/autofix/service.js +1940 -0
  28. package/autofix/store.js +375 -0
  29. package/autofix/workspace.js +298 -0
  30. package/autofix/worktree.js +379 -0
  31. package/docs/autofix-design.md +801 -0
  32. package/docs/autofix-profiles.example.json +65 -0
  33. package/imgs/Bug/350/247/243/345/206/263/345/244/207/346/263/250.png +0 -0
  34. package/imgs/logo.png +0 -0
  35. package/imgs//344/277/256/346/224/271Bug/347/212/266/346/200/201.png +0 -0
  36. package/imgs//345/270/256/346/210/221/344/277/256/345/244/215Bug-20260922-010.png +0 -0
  37. package/imgs//346/237/245/347/234/213/345/271/266/345/210/206/346/236/220/351/234/200/346/261/202/346/226/207/346/241/243.png +0 -0
  38. package/imgs//347/234/213/344/270/200/344/270/213/346/210/221/347/216/260/345/234/250/346/234/211/345/223/252/344/272/233/345/274/200/345/217/221/344/273/273/345/212/241.png +0 -0
  39. package/imgs//347/234/213/344/270/200/344/270/213/346/210/221/350/277/230/346/234/211/345/223/252/344/272/233Bug/346/234/252/350/247/243/345/206/263.png +0 -0
  40. package/package.json +39 -36
package/SKILL.md CHANGED
@@ -1,98 +1,114 @@
1
- ---
2
- name: adev
3
- description: 操作 AgileDev 敏捷研发管理系统(用户常称"敏捷系统/敏捷开发系统",scrum.chitem.com):查看/登记/修复 bug,查看/创建需求和任务,版本迭代管理,线上故障,知识库,周报,工作台,测试计划等。当用户提到"看bug/拉bug/修bug/登记bug"、"需求/任务/迭代/提测"、"线上故障"、"知识库/周报/工作台/看板"、"测试计划",把"敏捷系统/敏捷开发系统/AgileDev"与其他操作组合(如"敏捷系统里有哪些项目"、"我的敏捷系统待办"),或**直接发送一个编号**(如 BUG-20260922-011、REQ-20260922-003、INC-20260910-001 或纯数字 id)时使用。若用户的话是"登录"与敏捷系统组合(如"帮我登录敏捷系统"),优先使用 adev-login skill。
4
- ---
5
-
6
- # adev — AgileDev 敏捷系统操作
7
-
8
- 通过 `adev` 命令行工具(已全局安装)读写公司 AgileDev 系统。无需登录网页复制粘贴。
9
-
10
- ## 收到编号时的行为规则(重要)
11
-
12
- 用户直接发送一个编号(如 `BUG-20260922-011`、`REQ-20260922-003`、`INC-20260910-001` 或纯数字 id)而**没有附带任何动作词**时:
13
-
14
- 1. 按编号前缀查询并展示摘要(BUG → `adev bugs show`,REQ → `adev reqs show`,INC → `adev incidents show`;show 会自动下载截图,用 Read 查看)
15
- 2. 展示后**主动询问**用户下一步想做什么,例如:"这个 bug 当前状态是『待处理』,处理人是你。需要我修复它吗?还是你只想看详情/截图?"
16
- 3. **严禁在用户未明确要求时执行任何写操作**(resolve/claim/reject/reopen/comment/transition 等)。只发编号 ≠ 要修复,查询是只读操作可以放心做。
17
- 4. 只有当用户消息里带明确的动作词("修复 BUG-xxx"、"帮我修复"、"处理一下这个"、"认领"、"拒绝")时,才执行对应写操作。修复标准流程:`show` 拿详情 + Read 截图 → 定位代码修复 → `adev bugs resolve <编号> --notes "修复说明"`,提交信息带编号。
18
-
19
- ## 首次配置(登录)
20
-
21
- 用户说"登录敏捷系统/帮我登录"等话时,优先走 `adev-login` skill 的引导流程。新用户可先执行 `adev setup` 一键安装本 skill(装到用户级共享目录 ~/.agents/skills)。两种登录方式任选:
22
- - **账号密码**:`adev login`(提示输入账号密码,密码不回显;记住用户名,过期只需重输)
23
- - **API Key**:平台「个人设置 → API」创建后 `adev config set-token agv1_xxx`
24
-
25
- **不要代替用户输入账号密码**。token 过期(401)时同样提示重新 `adev login`。`adev whoami` 可确认当前身份。
26
-
27
- ## 命令速查
28
-
29
- ```bash
30
- adev me # 当前用户
31
- adev projects # 项目列表(拿项目 id)
32
- adev dashboard # 我的工作台(待办/即将到期/今日完成)
33
- adev kanban [--project 28] # 效能看板
34
- adev members list # 成员列表(查人用)
35
-
36
- # ---- 缺陷 ----
37
- adev bugs list [--status Pending] [--assignee 张三|me] [--severity P1] [--project 28|海外] [--keyword x] [--mine]
38
- adev bugs show 856 # 详情(自动下载截图到本地,务必 Read 查看截图)
39
- adev bugs stats [--project 28]
40
- adev bugs comment <id> --content "已修复" # 评论
41
- adev bugs comments <id> # 看评论
42
- # 状态流转(写操作,见下方权限说明):
43
- adev bugs claim <id> # 认领(自动设自己为处理人)
44
- adev bugs resolve <id> --notes "修复说明" # 修复(默认 resolution=fixed,转待验证)
45
- adev bugs reject <id> --reason "无法复现" # 拒绝
46
- adev bugs reopen <id> --notes "原因" # 重开
47
- adev bugs create --title "xx" --project 28 --severity P2 --data '{"actual_behavior":"..."}' # 登记缺陷
48
-
49
- # ---- 需求 ----
50
- adev reqs list [--mine] [--status 已准入] [--keyword x]
51
- adev reqs show <id|REQ-编号>
52
- adev reqs create --title "xx" --project 28 --data '{"type":"新功能","description":"..."}'
53
- adev reqs set-test-date <id> --date 2026-10-01 # 设置提测时间
54
- adev reqs data-sources <id> # 查看数据源对接清单(--data 保存)
55
- adev reqs assign-iteration <id> --iteration 101 # 分配到迭代
56
- adev reqs shelve|unshelve|reactivate|revoke <id>
57
-
58
- # ---- 开发任务 ----
59
- adev tasks list [--mine] [--project 28] [--version 101]
60
- adev tasks create --title "xx" --project 28 --assignee me --version 101 --backlog 401
61
- adev tasks update <id> --status 开发中
62
- adev tasks delete <id>
63
- adev tasks batch --data '[{"title":"任务1",...},...]' # 批量创建(AI 拆解需求后用)
64
-
65
- # ---- 版本迭代 ----
66
- adev versions list [--project 28]
67
- adev versions start|start-testing|complete|accept|release <id> [--notes "发布说明"]
68
-
69
- # ---- 线上故障 ----
70
- adev incidents list [--mine] [--status Pending]
71
- adev incidents show <id|INC-编号>
72
- adev incidents claim|resolve|reject|reopen <id>
73
- adev incidents create --title "xx" --project 28 --severity P1 --data '{...}'
74
-
75
- # ---- 测试/知识库/周报 ----
76
- adev tests list [--project 28] # 测试计划
77
- adev tests cases <版本迭代id> # 某迭代的测试用例
78
- adev kb categories # 知识库分类树
79
- adev kb list [--keyword x] | kb show <id> | kb annotations <docId>
80
- adev weekly list [--mine] | weekly show <id> | weekly draft --week 2026-09-22
81
- ```
82
-
83
- 状态枚举:Bug/故障 `Pending/InProgress/ToVerify/Reopened/Rejected/Closed`(故障另有 `Released`);需求(中文)`待处理/已准入/开发中/已发布/已拒绝/暂缓`;任务(中文)`待开始/开发中/已暂停/已完成/不处理`。
84
-
85
- ## 典型工作流
86
-
87
- **修 bug:** `adev bugs list --status Pending` → `adev bugs show <id>`(**必须 Read 下载好的截图**,红框即问题现场)→ 改代码 → `adev bugs resolve <id> --notes "修复说明"`,提交信息带编号如 `fix: xxx (BUG-20260922-009)`。
88
-
89
- **AI 拆解需求:** `adev reqs show <id>` 读需求 → 拆解为任务清单 → `adev tasks batch --data '[...]'` 批量建任务。
90
-
91
- **写操作的权限:** 当前 API Key 可能仅只读。写操作报 `40300 无权限` 时,提示用户到平台为该 Key 分配对应模块的写权限即可,命令本身无需改动。
92
-
93
- ## 注意事项
94
-
95
- - 表格长字段会截断,要完整内容用 `--json` 或 `show`
96
- - `--assignee 名字` 是拉取后本地过滤,数据不全时加大 `--size 200`
97
- - 写操作通用支持 `--data '<json>'` 透传任意字段(字段名与平台表单一致)
98
- - token 在 `~/.agiledev-cli.json`;401 时提示用户重新 `adev config set-token`
1
+ ---
2
+ name: adev
3
+ description: 操作 AgileDev 敏捷研发管理系统(用户常称"敏捷系统/敏捷开发系统",scrum.chitem.com):查看/登记/修复 bug,自动修复(autofix 挂机修 bug),查看/创建需求和任务,版本迭代管理,线上故障,知识库,周报,工作台,测试计划等。当用户提到"看bug/拉bug/修bug/登记bug"、"自动修复/挂机修bug/autofix"、"需求/任务/迭代/提测"、"线上故障"、"知识库/周报/工作台/看板"、"测试计划",把"敏捷系统/敏捷开发系统/AgileDev"与其他操作组合(如"敏捷系统里有哪些项目"、"我的敏捷系统待办"),或**直接发送一个编号**(如 BUG-20260922-011、REQ-20260922-003、INC-20260910-001 或纯数字 id)时使用。若用户的话是"登录"与敏捷系统组合(如"帮我登录敏捷系统"),优先使用 adev-login skill。
4
+ ---
5
+
6
+ # adev — AgileDev 敏捷系统操作
7
+
8
+ 通过 `adev` 命令行工具(已全局安装)读写公司 AgileDev 系统。无需登录网页复制粘贴。
9
+
10
+ ## 收到编号时的行为规则(重要)
11
+
12
+ 用户直接发送一个编号(如 `BUG-20260922-011`、`REQ-20260922-003`、`INC-20260910-001` 或纯数字 id)而**没有附带任何动作词**时:
13
+
14
+ 1. 按编号前缀查询并展示摘要(BUG → `adev bugs show`,REQ → `adev reqs show`,INC → `adev incidents show`;show 会自动下载截图,用 Read 查看)
15
+ 2. 展示后**主动询问**用户下一步想做什么,例如:"这个 bug 当前状态是『待处理』,处理人是你。需要我修复它吗?还是你只想看详情/截图?"
16
+ 3. **严禁在用户未明确要求时执行任何写操作**(resolve/claim/reject/reopen/comment/transition 等)。只发编号 ≠ 要修复,查询是只读操作可以放心做。
17
+ 4. 只有当用户消息里带明确的动作词("修复 BUG-xxx"、"帮我修复"、"处理一下这个"、"认领"、"拒绝")时,才执行对应写操作。修复标准流程:`show` 拿详情 + Read 截图 → 定位代码修复 → `adev bugs resolve <编号> --notes "修复说明"`,提交信息带编号。
18
+
19
+ ## 首次配置(登录)
20
+
21
+ 用户说"登录敏捷系统/帮我登录"等话时,优先走 `adev-login` skill 的引导流程。新用户可先执行 `adev setup` 一键安装本 skill(装到用户级共享目录 ~/.agents/skills)。两种登录方式任选:
22
+ - **账号密码**:`adev login`(提示输入账号密码,密码不回显;记住用户名,过期只需重输)
23
+ - **API Key**:平台「个人设置 → API」创建后 `adev config set-token agv1_xxx`
24
+
25
+ **不要代替用户输入账号密码**。token 过期(401)时同样提示重新 `adev login`。`adev whoami` 可确认当前身份。
26
+
27
+ ## 命令速查
28
+
29
+ ```bash
30
+ adev me # 当前用户
31
+ adev projects # 项目列表(拿项目 id)
32
+ adev dashboard # 我的工作台(待办/即将到期/今日完成)
33
+ adev kanban [--project 28] # 效能看板
34
+ adev members list # 成员列表(查人用)
35
+
36
+ # ---- 缺陷 ----
37
+ adev bugs list [--status Pending] [--assignee 张三|me] [--severity P1] [--project 28|海外] [--keyword x] [--mine]
38
+ adev bugs show 856 # 详情(自动下载截图到本地,务必 Read 查看截图)
39
+ adev bugs stats [--project 28]
40
+ adev bugs comment <id> --content "已修复" # 评论
41
+ adev bugs comments <id> # 看评论
42
+ # 状态流转(写操作,见下方权限说明):
43
+ adev bugs claim <id> # 认领(自动设自己为处理人)
44
+ adev bugs resolve <id> --notes "修复说明" # 修复(默认 resolution=fixed,转待验证)
45
+ adev bugs reject <id> --reason "无法复现" # 拒绝
46
+ adev bugs reopen <id> --notes "原因" # 重开
47
+ adev bugs create --title "xx" --project 28 --severity P2 --data '{"actual_behavior":"..."}' # 登记缺陷
48
+
49
+ # ---- 需求 ----
50
+ adev reqs list [--mine] [--status 已准入] [--keyword x]
51
+ adev reqs show <id|REQ-编号>
52
+ adev reqs create --title "xx" --project 28 --data '{"type":"新功能","description":"..."}'
53
+ adev reqs set-test-date <id> --date 2026-10-01 # 设置提测时间
54
+ adev reqs data-sources <id> # 查看数据源对接清单(--data 保存)
55
+ adev reqs assign-iteration <id> --iteration 101 # 分配到迭代
56
+ adev reqs shelve|unshelve|reactivate|revoke <id>
57
+
58
+ # ---- 开发任务 ----
59
+ adev tasks list [--mine] [--project 28] [--version 101]
60
+ adev tasks create --title "xx" --project 28 --assignee me --version 101 --backlog 401
61
+ adev tasks update <id> --status 开发中
62
+ adev tasks delete <id>
63
+ adev tasks batch --data '[{"title":"任务1",...},...]' # 批量创建(AI 拆解需求后用)
64
+
65
+ # ---- 版本迭代 ----
66
+ adev versions list [--project 28]
67
+ adev versions start|start-testing|complete|accept|release <id> [--notes "发布说明"]
68
+
69
+ # ---- 线上故障 ----
70
+ adev incidents list [--mine] [--status Pending]
71
+ adev incidents show <id|INC-编号>
72
+ adev incidents claim|resolve|reject|reopen <id>
73
+ adev incidents create --title "xx" --project 28 --severity P1 --data '{...}'
74
+
75
+ # ---- 测试/知识库/周报 ----
76
+ adev tests list [--project 28] # 测试计划
77
+ adev tests cases <版本迭代id> # 某迭代的测试用例
78
+ adev kb categories # 知识库分类树
79
+ adev kb list [--keyword x] | kb show <id> | kb annotations <docId>
80
+ adev weekly list [--mine] | weekly show <id> | weekly draft --week 2026-09-22
81
+ ```
82
+
83
+ 状态枚举:Bug/故障 `Pending/InProgress/ToVerify/Reopened/Rejected/Closed`(故障另有 `Released`);需求(中文)`待处理/已准入/开发中/已发布/已拒绝/暂缓`;任务(中文)`待开始/开发中/已暂停/已完成/不处理`。
84
+
85
+ ## 典型工作流
86
+
87
+ **修 bug:** `adev bugs list --status Pending` → `adev bugs show <id>`(**必须 Read 下载好的截图**,红框即问题现场)→ 改代码 → `adev bugs resolve <id> --notes "修复说明"`,提交信息带编号如 `fix: xxx (BUG-20260922-009)`。
88
+
89
+ **AI 拆解需求:** `adev reqs show <id>` 读需求 → 拆解为任务清单 → `adev tasks batch --data '[...]'` 批量建任务。
90
+
91
+ **写操作的权限:** 当前 API Key 可能仅只读。写操作报 `40300 无权限` 时,提示用户到平台为该 Key 分配对应模块的写权限即可,命令本身无需改动。
92
+
93
+ ## 自动修复服务(`adev autofix`)
94
+
95
+ 用户说"开启自动修复 / 自动修 bug / 挂机修 bug / autofix"时,引导他在**要修复代码的仓库目录**执行:
96
+
97
+ ```bash
98
+ adev autofix
99
+ ```
100
+
101
+ - 零参数启动:先打开本机控制台 `http://127.0.0.1:3210/`,停在配置页,不会立刻拉取缺陷
102
+ - 页面里由用户选择主 Agent / 修复 Agent(Claude Code / OpenCode / Antigravity / Codex / Pi,仅显示本机已安装的)及各自模型、从敏捷系统拉取的项目(推荐项来自仓库匹配),确认最大权限提示后点击「启动自动修复」;命令参数只作为预填值
103
+ - 启动后三栏控制台:左侧主 Agent + Bug 列表,中间实时会话,右侧缺陷详情与待决问题;之后用 `adev autofix status|pause|resume|say|stop` 管理
104
+ - 只处理分配给我、状态 `Pending`/`Reopened` 的缺陷,按 P1→P3 排序;复核通过后会自动 commit → 合并测试分支 → push → 切回开发分支,但**不会** deploy / 发布 / 关闭缺陷
105
+ - 一个敏捷项目横跨多个仓库时,用**工作区配置档**声明「项目 ↔ 仓库(前端/后端/移动端) ↔ 分支 ↔ 巡检时段 ↔ 复核阈值」(项目内 `.autofix.json` 或全局 `~/.agiledev-autofix/profiles.json`);`adev autofix profiles` 可列出已有配置档,`--profile <id>` 显式指定
106
+ - 业务取舍不明确、改动超出基线、验证不通过时会生成待决问题,用 `adev autofix answer <问题id> "回答"` 回复;控制台详情页也提供可点按钮
107
+ - 不要替用户点击启动,也不要自动加 `--yes`;不要替用户加 `--auto-verify`(自动转"待验证"),除非用户明确要求
108
+
109
+ ## 注意事项
110
+
111
+ - 表格长字段会截断,要完整内容用 `--json` 或 `show`
112
+ - `--assignee 名字` 是拉取后本地过滤,数据不全时加大 `--size 200`
113
+ - 写操作通用支持 `--data '<json>'` 透传任意字段(字段名与平台表单一致)
114
+ - token 在 `~/.agiledev-cli.json`;401 时提示用户重新 `adev config set-token`