@fitlab-ai/agent-infra 0.8.2 → 0.8.4
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.
- package/README.zh-CN.md +10 -0
- package/bin/cli.ts +1 -1
- package/dist/bin/cli.js +2 -2
- package/dist/lib/cp.js +57 -16
- package/dist/lib/decide.js +2 -2
- package/dist/lib/defaults.json +2 -0
- package/dist/lib/init.js +7 -7
- package/dist/lib/merge.js +1 -1
- package/dist/lib/prompt.js +1 -1
- package/dist/lib/run/index.js +7 -7
- package/dist/lib/run/prompt.js +1 -1
- package/dist/lib/sandbox/capture.js +10 -8
- package/dist/lib/sandbox/clipboard/bridge.js +59 -21
- package/dist/lib/sandbox/clipboard/inbox.js +82 -0
- package/dist/lib/sandbox/clipboard/index.js +5 -6
- package/dist/lib/sandbox/clipboard/linux.js +91 -0
- package/dist/lib/sandbox/clipboard/paths.js +1 -1
- package/dist/lib/sandbox/clipboard/win32.js +144 -0
- package/dist/lib/sandbox/commands/create.js +106 -88
- package/dist/lib/sandbox/commands/enter.js +9 -9
- package/dist/lib/sandbox/commands/list-running.js +2 -2
- package/dist/lib/sandbox/commands/ls.js +7 -7
- package/dist/lib/sandbox/commands/prune.js +8 -8
- package/dist/lib/sandbox/commands/rebuild.js +38 -50
- package/dist/lib/sandbox/commands/refresh.js +2 -2
- package/dist/lib/sandbox/commands/rm.js +11 -11
- package/dist/lib/sandbox/commands/show.js +4 -4
- package/dist/lib/sandbox/commands/start.js +4 -4
- package/dist/lib/sandbox/commands/vm.js +4 -4
- package/dist/lib/sandbox/config.js +10 -4
- package/dist/lib/sandbox/constants.js +4 -1
- package/dist/lib/sandbox/credentials.js +1 -1
- package/dist/lib/sandbox/dotfiles.js +1 -1
- package/dist/lib/sandbox/engine.js +3 -3
- package/dist/lib/sandbox/engines/index.js +5 -5
- package/dist/lib/sandbox/engines/wsl2-paths.js +1 -1
- package/dist/lib/sandbox/image-build.js +80 -0
- package/dist/lib/sandbox/image-prune.js +2 -2
- package/dist/lib/sandbox/index.js +10 -10
- package/dist/lib/sandbox/managed-fs.js +1 -1
- package/dist/lib/sandbox/readme-scaffold.js +1 -1
- package/dist/lib/sandbox/runtimes/base.dockerfile +3 -0
- package/dist/lib/sandbox/shell.js +9 -1
- package/dist/lib/sandbox/tools.js +4 -4
- package/dist/lib/server/adapters/feishu/index.js +10 -3
- package/dist/lib/server/adapters/feishu/renderer.js +88 -0
- package/dist/lib/server/adapters/feishu/transport.js +2 -13
- package/dist/lib/server/daemon.js +64 -43
- package/dist/lib/server/display.js +83 -0
- package/dist/lib/server/index.js +2 -2
- package/dist/lib/server/process-control.js +2 -2
- package/dist/lib/server/protocol.js +2 -2
- package/dist/lib/server/streamer.js +5 -4
- package/dist/lib/task/commands/cat.js +2 -2
- package/dist/lib/task/commands/decisions.js +4 -4
- package/dist/lib/task/commands/files.js +3 -3
- package/dist/lib/task/commands/grep.js +3 -3
- package/dist/lib/task/commands/issue-body.js +4 -4
- package/dist/lib/task/commands/log.js +5 -5
- package/dist/lib/task/commands/ls.js +3 -3
- package/dist/lib/task/commands/show.js +1 -1
- package/dist/lib/task/commands/status.js +71 -25
- package/dist/lib/task/index.js +9 -9
- package/dist/lib/task/resolve-ref.js +1 -1
- package/dist/lib/task/workflow-warnings.js +94 -0
- package/dist/lib/update.js +4 -4
- package/lib/cp.ts +56 -15
- package/lib/defaults.json +2 -0
- package/lib/sandbox/capture.ts +5 -3
- package/lib/sandbox/clipboard/bridge.ts +62 -18
- package/lib/sandbox/clipboard/inbox.ts +83 -0
- package/lib/sandbox/clipboard/index.ts +5 -6
- package/lib/sandbox/clipboard/linux.ts +124 -0
- package/lib/sandbox/clipboard/win32.ts +173 -0
- package/lib/sandbox/commands/create.ts +132 -88
- package/lib/sandbox/commands/rebuild.ts +42 -54
- package/lib/sandbox/config.ts +13 -1
- package/lib/sandbox/constants.ts +4 -0
- package/lib/sandbox/image-build.ts +134 -0
- package/lib/sandbox/runtimes/base.dockerfile +3 -0
- package/lib/sandbox/shell.ts +11 -2
- package/lib/sandbox/tools.ts +5 -5
- package/lib/server/adapters/_contract.ts +3 -0
- package/lib/server/adapters/feishu/index.ts +11 -3
- package/lib/server/adapters/feishu/renderer.ts +99 -0
- package/lib/server/adapters/feishu/transport.ts +5 -18
- package/lib/server/daemon.ts +74 -38
- package/lib/server/display.ts +136 -0
- package/lib/server/streamer.ts +5 -4
- package/lib/task/commands/log.ts +3 -3
- package/lib/task/commands/status.ts +102 -21
- package/lib/task/workflow-warnings.ts +121 -0
- package/package.json +2 -2
- package/templates/.agents/README.en.md +3 -0
- package/templates/.agents/README.zh-CN.md +3 -0
- package/templates/.agents/rules/create-issue.github.en.md +4 -4
- package/templates/.agents/rules/create-issue.github.zh-CN.md +4 -4
- package/templates/.agents/rules/issue-pr-commands.github.en.md +7 -2
- package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +7 -2
- package/templates/.agents/rules/issue-sync.github.en.md +13 -0
- package/templates/.agents/rules/issue-sync.github.zh-CN.md +13 -0
- package/templates/.agents/rules/next-step-output.en.md +15 -1
- package/templates/.agents/rules/next-step-output.zh-CN.md +15 -1
- package/templates/.agents/rules/pr-sync.github.en.md +17 -2
- package/templates/.agents/rules/pr-sync.github.zh-CN.md +17 -2
- package/templates/.agents/rules/review-handshake.en.md +2 -2
- package/templates/.agents/rules/review-handshake.zh-CN.md +2 -2
- package/templates/.agents/rules/task-management.en.md +1 -1
- package/templates/.agents/rules/task-management.zh-CN.md +1 -1
- package/templates/.agents/rules/testing-discipline.en.md +3 -41
- package/templates/.agents/rules/testing-discipline.zh-CN.md +3 -41
- package/templates/.agents/scripts/platform-adapters/platform-sync.github.js +57 -0
- package/templates/.agents/scripts/validate-artifact.js +213 -0
- package/templates/.agents/scripts/workflow-warnings.js +290 -0
- package/templates/.agents/skills/analyze-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/archive-tasks/scripts/archive-tasks.sh +1 -1
- package/templates/.agents/skills/block-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/cancel-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +9 -9
- package/templates/.agents/skills/close-codescan/SKILL.en.md +1 -1
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/close-dependabot/SKILL.en.md +1 -1
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/code-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/code-task/reference/branch-management.zh-CN.md +2 -2
- package/templates/.agents/skills/code-task/reference/fix-mode.en.md +2 -2
- package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +2 -2
- package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +1 -1
- package/templates/.agents/skills/commit/SKILL.en.md +1 -1
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/commit/reference/task-status-update.en.md +6 -6
- package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +6 -6
- package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +142 -0
- package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +142 -0
- package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +49 -0
- package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +49 -0
- package/templates/.agents/skills/complete-manual-validation/reference/report-template.en.md +48 -0
- package/templates/.agents/skills/complete-manual-validation/reference/report-template.zh-CN.md +48 -0
- package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +60 -0
- package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +87 -0
- package/templates/.agents/skills/complete-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/create-pr/SKILL.en.md +6 -4
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +6 -4
- package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +1 -1
- package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +1 -1
- package/templates/.agents/skills/create-task/SKILL.en.md +6 -3
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +9 -6
- package/templates/.agents/skills/import-codescan/SKILL.en.md +2 -2
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/import-dependabot/SKILL.en.md +2 -2
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/import-issue/SKILL.en.md +2 -2
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/init-milestones/SKILL.en.md +3 -2
- package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +4 -3
- package/templates/.agents/skills/init-milestones/scripts/init-milestones.github.sh +165 -41
- package/templates/.agents/skills/plan-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/restore-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/review-analysis/SKILL.en.md +1 -1
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +5 -5
- package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +5 -5
- package/templates/.agents/skills/review-code/SKILL.en.md +8 -4
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +6 -3
- package/templates/.agents/skills/review-code/config/verify.en.json +1 -0
- package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -0
- package/templates/.agents/skills/review-code/reference/output-templates.en.md +5 -5
- package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +5 -5
- package/templates/.agents/skills/review-code/reference/report-template.en.md +2 -2
- package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +2 -2
- package/templates/.agents/skills/review-plan/SKILL.en.md +1 -1
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/review-plan/reference/output-templates.en.md +5 -5
- package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +5 -5
- package/templates/.agents/skills/test/SKILL.zh-CN.md +26 -8
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +36 -6
- package/templates/.agents/skills/watch-pr/SKILL.en.md +2 -2
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +8 -1
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +8 -1
- package/templates/.agents/templates/task.en.md +7 -0
- package/templates/.agents/templates/task.zh-CN.md +7 -0
- package/templates/.claude/commands/complete-manual-validation.en.md +9 -0
- package/templates/.claude/commands/complete-manual-validation.zh-CN.md +9 -0
- package/templates/.gemini/commands/_project_/complete-manual-validation.en.toml +8 -0
- package/templates/.gemini/commands/_project_/complete-manual-validation.zh-CN.toml +8 -0
- package/templates/.github/workflows/metadata-sync.yml +5 -0
- package/templates/.opencode/commands/complete-manual-validation.en.md +11 -0
- package/templates/.opencode/commands/complete-manual-validation.zh-CN.md +11 -0
|
@@ -21,8 +21,8 @@ Use this template when writing `review-code.md` or `review-code-r{N}.md`.
|
|
|
21
21
|
- **Reviewer**: {reviewer-name}
|
|
22
22
|
- **Review Time**: {timestamp}
|
|
23
23
|
- **Scope**: {file-count and major modules}
|
|
24
|
-
- **Review Baseline Commit**: {raw
|
|
25
|
-
- **Reviewed Diff Fingerprint**: {raw node .agents/scripts/review-diff-fingerprint.js worktree
|
|
24
|
+
- **Review Baseline Commit**: {raw R captured once for this round} (baseline for the complete-task post-review commit gate; see `.agents/rules/review-handshake.md`)
|
|
25
|
+
- **Reviewed Diff Fingerprint**: {raw node .agents/scripts/review-diff-fingerprint.js worktree "$R"}
|
|
26
26
|
- **Overall Verdict**: {Approved / Changes Requested / Rejected} (pick exactly one; combined phrases will fail the verify gate)
|
|
27
27
|
- **Findings (AI-actionable)**: 0 blockers, 0 majors, 0 minors / **Manual validation**: 0
|
|
28
28
|
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
- **审查者**:{reviewer-name}
|
|
22
22
|
- **审查时间**:{timestamp}
|
|
23
23
|
- **审查范围**:{file-count and major modules}
|
|
24
|
-
- **审查基线提交**:{
|
|
25
|
-
- **审查差异指纹**:{node .agents/scripts/review-diff-fingerprint.js worktree
|
|
24
|
+
- **审查基线提交**:{本轮一次性捕获的 R 原文}(complete-task 的 post-review commit 门禁基线;详见 `.agents/rules/review-handshake.md`)
|
|
25
|
+
- **审查差异指纹**:{node .agents/scripts/review-diff-fingerprint.js worktree "$R" 原文}
|
|
26
26
|
- **总体结论**:{通过 / 需要修改 / 拒绝}(恰取一个;禁止写组合短语,否则 verify gate 失败)
|
|
27
27
|
- **发现(AI 可处理)**:0 阻塞项,0 主要,0 次要 / **人工校验**:0
|
|
28
28
|
|
|
@@ -73,7 +73,7 @@ Create `.agents/workspace/active/{task-id}/{review-artifact}`.
|
|
|
73
73
|
Get the current time:
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
|
-
date "+%Y-%m-%d %H:%M:%S
|
|
76
|
+
date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
Set `current_step` to `technical-design-review`, refresh task metadata, and append:
|
|
@@ -27,7 +27,7 @@ Task {task-id} technical plan review completed. Verdict: approved.
|
|
|
27
27
|
|
|
28
28
|
Next step - write code:
|
|
29
29
|
- Claude Code / OpenCode: /code-task {task-ref}
|
|
30
|
-
- Gemini CLI: /
|
|
30
|
+
- Gemini CLI: /{{project}}:code-task {task-ref}
|
|
31
31
|
- Codex CLI: $code-task {task-ref}
|
|
32
32
|
|
|
33
33
|
[When manual-validation > 0, append:]
|
|
@@ -43,12 +43,12 @@ Task {task-id} technical plan review completed. Verdict: approved.
|
|
|
43
43
|
|
|
44
44
|
Next step - revise plan before coding (recommended):
|
|
45
45
|
- Claude Code / OpenCode: /plan-task {task-ref}
|
|
46
|
-
- Gemini CLI: /
|
|
46
|
+
- Gemini CLI: /{{project}}:plan-task {task-ref}
|
|
47
47
|
- Codex CLI: $plan-task {task-ref}
|
|
48
48
|
|
|
49
49
|
Or proceed directly to coding:
|
|
50
50
|
- Claude Code / OpenCode: /code-task {task-ref}
|
|
51
|
-
- Gemini CLI: /
|
|
51
|
+
- Gemini CLI: /{{project}}:code-task {task-ref}
|
|
52
52
|
- Codex CLI: $code-task {task-ref}
|
|
53
53
|
|
|
54
54
|
[When manual-validation > 0, append:]
|
|
@@ -64,7 +64,7 @@ Task {task-id} technical plan review completed. Verdict: changes requested.
|
|
|
64
64
|
|
|
65
65
|
Next step - revise technical plan:
|
|
66
66
|
- Claude Code / OpenCode: /plan-task {task-ref}
|
|
67
|
-
- Gemini CLI: /
|
|
67
|
+
- Gemini CLI: /{{project}}:plan-task {task-ref}
|
|
68
68
|
- Codex CLI: $plan-task {task-ref}
|
|
69
69
|
|
|
70
70
|
[When manual-validation > 0, append:]
|
|
@@ -80,7 +80,7 @@ Task {task-id} technical plan review completed. Verdict: rejected, redesign requ
|
|
|
80
80
|
|
|
81
81
|
Next step - redesign:
|
|
82
82
|
- Claude Code / OpenCode: /plan-task {task-ref}
|
|
83
|
-
- Gemini CLI: /
|
|
83
|
+
- Gemini CLI: /{{project}}:plan-task {task-ref}
|
|
84
84
|
- Codex CLI: $plan-task {task-ref}
|
|
85
85
|
|
|
86
86
|
[When manual-validation > 0, append:]
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
下一步 - 编写代码:
|
|
29
29
|
- Claude Code / OpenCode:/code-task {task-ref}
|
|
30
|
-
- Gemini CLI:/
|
|
30
|
+
- Gemini CLI:/{{project}}:code-task {task-ref}
|
|
31
31
|
- Codex CLI:$code-task {task-ref}
|
|
32
32
|
|
|
33
33
|
[当 manual-validation > 0 时,在最后附加一行:]
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
|
|
44
44
|
下一步 - 修订方案后编码(推荐):
|
|
45
45
|
- Claude Code / OpenCode:/plan-task {task-ref}
|
|
46
|
-
- Gemini CLI:/
|
|
46
|
+
- Gemini CLI:/{{project}}:plan-task {task-ref}
|
|
47
47
|
- Codex CLI:$plan-task {task-ref}
|
|
48
48
|
|
|
49
49
|
或直接进入编码:
|
|
50
50
|
- Claude Code / OpenCode:/code-task {task-ref}
|
|
51
|
-
- Gemini CLI:/
|
|
51
|
+
- Gemini CLI:/{{project}}:code-task {task-ref}
|
|
52
52
|
- Codex CLI:$code-task {task-ref}
|
|
53
53
|
|
|
54
54
|
[当 manual-validation > 0 时,在最后附加一行:]
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
|
|
65
65
|
下一步 - 修订技术方案:
|
|
66
66
|
- Claude Code / OpenCode:/plan-task {task-ref}
|
|
67
|
-
- Gemini CLI:/
|
|
67
|
+
- Gemini CLI:/{{project}}:plan-task {task-ref}
|
|
68
68
|
- Codex CLI:$plan-task {task-ref}
|
|
69
69
|
|
|
70
70
|
[当 manual-validation > 0 时,在最后附加一行:]
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
|
|
81
81
|
下一步 - 重新设计:
|
|
82
82
|
- Claude Code / OpenCode:/plan-task {task-ref}
|
|
83
|
-
- Gemini CLI:/
|
|
83
|
+
- Gemini CLI:/{{project}}:plan-task {task-ref}
|
|
84
84
|
- Codex CLI:$plan-task {task-ref}
|
|
85
85
|
|
|
86
86
|
[当 manual-validation > 0 时,在最后附加一行:]
|
|
@@ -11,16 +11,27 @@ description: >
|
|
|
11
11
|
|
|
12
12
|
## 1. 编译 / 类型检查
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
```bash
|
|
15
|
+
# TODO:替换为项目实际的编译命令
|
|
16
|
+
# npx tsc --noEmit (TypeScript)
|
|
17
|
+
# mvn compile (Maven)
|
|
18
|
+
# go build ./... (Go)
|
|
19
|
+
# make build (通用)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
确认没有编译错误。
|
|
15
23
|
|
|
16
24
|
## 2. 运行单元测试(按层级选择)
|
|
17
25
|
|
|
18
|
-
|
|
26
|
+
三层测试是可选的反馈速度优化;如果测试套件较小,所有层级都可以映射到同一个完整测试命令。
|
|
19
27
|
|
|
20
28
|
### smoke(目标 <5s)
|
|
21
29
|
|
|
22
30
|
```bash
|
|
23
|
-
|
|
31
|
+
# TODO:替换为项目的 smoke 子集命令
|
|
32
|
+
# npm run test:smoke (Node.js)
|
|
33
|
+
# pytest -m "not slow" (Python)
|
|
34
|
+
# go test -short ./... (Go)
|
|
24
35
|
```
|
|
25
36
|
|
|
26
37
|
适用场景:
|
|
@@ -31,7 +42,10 @@ npm run test:smoke
|
|
|
31
42
|
### core(目标 <15s)
|
|
32
43
|
|
|
33
44
|
```bash
|
|
34
|
-
|
|
45
|
+
# TODO:替换为项目的 core 子集命令
|
|
46
|
+
# npm run test:core (Node.js)
|
|
47
|
+
# pytest -m "not contract" (Python)
|
|
48
|
+
# go test ./... (Go)
|
|
35
49
|
```
|
|
36
50
|
|
|
37
51
|
适用场景:
|
|
@@ -39,18 +53,22 @@ npm run test:core
|
|
|
39
53
|
- 写 code.md / code-r{N}.md 报告前的最终验证
|
|
40
54
|
- 推送 PR 前的本地把关
|
|
41
55
|
|
|
42
|
-
### full
|
|
56
|
+
### full(完整测试套件)
|
|
43
57
|
|
|
44
58
|
```bash
|
|
45
|
-
|
|
59
|
+
# TODO:替换为项目的完整测试命令
|
|
60
|
+
# npm test (Node.js)
|
|
61
|
+
# mvn test (Maven)
|
|
62
|
+
# pytest (Python)
|
|
63
|
+
# go test ./... (Go)
|
|
46
64
|
```
|
|
47
65
|
|
|
48
66
|
适用场景:
|
|
49
67
|
- release / tag 前
|
|
50
|
-
- CI
|
|
68
|
+
- CI
|
|
51
69
|
- main 合并前的最终把关
|
|
52
70
|
|
|
53
|
-
|
|
71
|
+
如果项目尚未分层,smoke / core / full 可以全部使用完整测试命令;分层不是使用协作工作流的前置条件。
|
|
54
72
|
|
|
55
73
|
## 3. 输出结果
|
|
56
74
|
|
|
@@ -35,6 +35,7 @@ const DEFAULTS = {
|
|
|
35
35
|
"gemini-cli",
|
|
36
36
|
"opencode"
|
|
37
37
|
],
|
|
38
|
+
"refreshIntervalDays": 7,
|
|
38
39
|
"dockerfile": null,
|
|
39
40
|
"vm": {
|
|
40
41
|
"cpu": null,
|
|
@@ -72,6 +73,7 @@ const DEFAULTS = {
|
|
|
72
73
|
"**/test-integration.*",
|
|
73
74
|
"**/test.*",
|
|
74
75
|
"**/upgrade-dependency.*",
|
|
76
|
+
".agents/rules/testing-discipline.*",
|
|
75
77
|
".agents/skills/post-release/SKILL.*",
|
|
76
78
|
".agents/skills/release/SKILL.*",
|
|
77
79
|
".agents/skills/test-integration/SKILL.*",
|
|
@@ -234,7 +236,7 @@ function parseSkillFrontmatter(filePath) {
|
|
|
234
236
|
if (!pair) continue;
|
|
235
237
|
|
|
236
238
|
const [, key, rawValue] = pair;
|
|
237
|
-
if (rawValue === '>') {
|
|
239
|
+
if (rawValue === '>' || rawValue === '|') {
|
|
238
240
|
const block = [];
|
|
239
241
|
for (let offset = index + 1; offset < lines.length; offset += 1) {
|
|
240
242
|
const nextLine = lines[offset];
|
|
@@ -243,7 +245,7 @@ function parseSkillFrontmatter(filePath) {
|
|
|
243
245
|
block.push(nextLine.trim());
|
|
244
246
|
index = offset;
|
|
245
247
|
}
|
|
246
|
-
result[key] = block.join(' ').trim();
|
|
248
|
+
result[key] = block.join(rawValue === '|' ? '\n' : ' ').trim();
|
|
247
249
|
continue;
|
|
248
250
|
}
|
|
249
251
|
|
|
@@ -260,6 +262,12 @@ function listTemplateSkillNames(templateRoot) {
|
|
|
260
262
|
return new Set(
|
|
261
263
|
fs.readdirSync(templateSkillsDir, { withFileTypes: true })
|
|
262
264
|
.filter((entry) => entry.isDirectory())
|
|
265
|
+
.filter((entry) => {
|
|
266
|
+
const skillDir = path.join(templateSkillsDir, entry.name);
|
|
267
|
+
return ['SKILL.md', 'SKILL.en.md', 'SKILL.zh-CN.md'].some((file) =>
|
|
268
|
+
fs.existsSync(path.join(skillDir, file))
|
|
269
|
+
);
|
|
270
|
+
})
|
|
263
271
|
.map((entry) => entry.name)
|
|
264
272
|
);
|
|
265
273
|
}
|
|
@@ -279,7 +287,8 @@ function detectCustomSkills(projectRoot, templateSkillNames) {
|
|
|
279
287
|
dirName: entry.name,
|
|
280
288
|
name: meta.name || entry.name,
|
|
281
289
|
description: meta.description || '',
|
|
282
|
-
args: meta.args || null
|
|
290
|
+
args: meta.args || null,
|
|
291
|
+
disableModelInvocation: meta['disable-model-invocation'] === 'true'
|
|
283
292
|
};
|
|
284
293
|
})
|
|
285
294
|
.filter(Boolean)
|
|
@@ -494,14 +503,35 @@ function cleanStaleSyncedFiles(projectRoot, syncedSkills, report) {
|
|
|
494
503
|
}
|
|
495
504
|
}
|
|
496
505
|
|
|
506
|
+
function formatYamlMetadata(key, value) {
|
|
507
|
+
if (!value.includes('\n')) {
|
|
508
|
+
return [`${key}: ${JSON.stringify(value)}`];
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
return [`${key}: |-`, ...value.split('\n').map((line) => ` ${line}`)];
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
function formatTomlMetadata(key, value) {
|
|
515
|
+
if (!value.includes('\n')) {
|
|
516
|
+
return `${key} = ${JSON.stringify(value)}`;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
const lines = value.split('\n').map((line) => JSON.stringify(line).slice(1, -1));
|
|
520
|
+
return `${key} = """${lines.join('\n')}"""`;
|
|
521
|
+
}
|
|
522
|
+
|
|
497
523
|
function generateClaudeCommand(skill, lang) {
|
|
498
524
|
const isZhCN = lang === 'zh-CN';
|
|
499
|
-
const lines = ['---',
|
|
525
|
+
const lines = ['---', ...formatYamlMetadata('description', skill.description)];
|
|
500
526
|
|
|
501
527
|
if (skill.args) {
|
|
502
528
|
lines.push(`usage: ${JSON.stringify(`/${skill.dirName} ${skill.args}`)}`);
|
|
503
529
|
}
|
|
504
530
|
|
|
531
|
+
if (skill.disableModelInvocation) {
|
|
532
|
+
lines.push('disable-model-invocation: true');
|
|
533
|
+
}
|
|
534
|
+
|
|
505
535
|
lines.push('---', '');
|
|
506
536
|
lines.push(
|
|
507
537
|
isZhCN
|
|
@@ -532,7 +562,7 @@ function generateGeminiCommand(skill, lang) {
|
|
|
532
562
|
promptLines.push(isZhCN ? '严格按照技能中定义的所有步骤执行。' : 'Follow all steps defined in the skill exactly.');
|
|
533
563
|
|
|
534
564
|
return [
|
|
535
|
-
|
|
565
|
+
formatTomlMetadata('description', skill.description),
|
|
536
566
|
'prompt = """',
|
|
537
567
|
...promptLines,
|
|
538
568
|
'"""'
|
|
@@ -543,7 +573,7 @@ function generateOpenCodeCommand(skill, lang) {
|
|
|
543
573
|
const isZhCN = lang === 'zh-CN';
|
|
544
574
|
const lines = [
|
|
545
575
|
'---',
|
|
546
|
-
|
|
576
|
+
...formatYamlMetadata('description', skill.description),
|
|
547
577
|
'agent: general',
|
|
548
578
|
'subtask: false',
|
|
549
579
|
'---',
|
|
@@ -67,7 +67,7 @@ When self-heal hits the cap, the failure is non-code, the run id is unlocatable,
|
|
|
67
67
|
Get the current time:
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
|
-
date "+%Y-%m-%d %H:%M:%S
|
|
70
|
+
date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
Update `.agents/workspace/active/{task-id}/task.md`:
|
|
@@ -109,7 +109,7 @@ Output per scenario:
|
|
|
109
109
|
```
|
|
110
110
|
Next step - Complete and archive the task:
|
|
111
111
|
- Claude Code / OpenCode: /complete-task {task-ref}
|
|
112
|
-
- Gemini CLI: /
|
|
112
|
+
- Gemini CLI: /{{project}}:complete-task {task-ref}
|
|
113
113
|
- Codex CLI: $complete-task {task-ref}
|
|
114
114
|
```
|
|
115
115
|
|
|
@@ -67,7 +67,7 @@ description: >
|
|
|
67
67
|
获取当前时间:
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
|
-
date "+%Y-%m-%d %H:%M:%S
|
|
70
|
+
date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
更新 `.agents/workspace/active/{task-id}/task.md`:
|
|
@@ -109,7 +109,7 @@ node .agents/scripts/validate-artifact.js gate watch-pr .agents/workspace/active
|
|
|
109
109
|
```
|
|
110
110
|
下一步 - 完成并归档任务:
|
|
111
111
|
- Claude Code / OpenCode:/complete-task {task-ref}
|
|
112
|
-
- Gemini CLI:/
|
|
112
|
+
- Gemini CLI:/{{project}}:complete-task {task-ref}
|
|
113
113
|
- Codex CLI:$complete-task {task-ref}
|
|
114
114
|
```
|
|
115
115
|
|
|
@@ -12,6 +12,13 @@ After running the watch command from `.agents/rules/pr-checks-commands.md`, clas
|
|
|
12
12
|
|
|
13
13
|
## Self-Heal Decision Tree
|
|
14
14
|
|
|
15
|
+
```text
|
|
16
|
+
# self-heal-test-command-contract
|
|
17
|
+
primary: failing-job-command
|
|
18
|
+
fallback-source: project-test-skill
|
|
19
|
+
unknown: help
|
|
20
|
+
```
|
|
21
|
+
|
|
15
22
|
For each failing check, decide "self-heal" vs "ask for help" in this order:
|
|
16
23
|
|
|
17
24
|
1. **Can the corresponding CI run be located** (per the rule's "Resolve a failing run id")? No → ask for help.
|
|
@@ -22,7 +29,7 @@ For each failing check, decide "self-heal" vs "ask for help" in this order:
|
|
|
22
29
|
4. When "locatable + code layer + under cap" holds, perform one self-heal:
|
|
23
30
|
- Before fixing, run `git status -s` to record the working tree and ensure only changes related to this failure are included.
|
|
24
31
|
- Locate and make a minimal fix per the logs (touch only code / tests / config related to that failure).
|
|
25
|
-
- Run the relevant tests: prefer the local command for the failing job;
|
|
32
|
+
- Run the relevant tests: prefer the local command for the failing job; otherwise read the project `test` skill and select its declared core or full validation command. If neither command is known, ask for help. **Do not commit or push before tests pass.**
|
|
26
33
|
- After tests pass, publish the fix: per `.agents/rules/commit-and-pr.md` stage only the related files (`git add <paths>`, avoid `git add -A` pulling in unrelated changes) → create the fix commit (`git commit`) → `git push` to the current PR branch.
|
|
27
34
|
- Record the fix commit SHA, increment the fix count, and return to SKILL step 2 to re-watch.
|
|
28
35
|
- Never make unrelated "drive-by" optimizations; never loosen / skip the failing assertion to "make it green".
|
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
|
|
13
13
|
## 自愈决策树
|
|
14
14
|
|
|
15
|
+
```text
|
|
16
|
+
# self-heal-test-command-contract
|
|
17
|
+
primary: failing-job-command
|
|
18
|
+
fallback-source: project-test-skill
|
|
19
|
+
unknown: help
|
|
20
|
+
```
|
|
21
|
+
|
|
15
22
|
对每个失败 check,按下列顺序判定「自愈」还是「求助」:
|
|
16
23
|
|
|
17
24
|
1. **能否定位到对应的 CI run**(按规则的「解析失败 run id」)?否 → 求助。
|
|
@@ -22,7 +29,7 @@
|
|
|
22
29
|
4. 满足「可定位 + 代码层 + 未达上限」时执行一次自愈:
|
|
23
30
|
- 自愈前先 `git status -s` 记录当前工作树,确保后续只纳入与本次失败相关的改动。
|
|
24
31
|
- 在本地按日志定位并最小化修复(只动与该失败相关的代码 / 测试 / 配置)。
|
|
25
|
-
- 运行对应测试:优先失败 job
|
|
32
|
+
- 运行对应测试:优先失败 job 对应的本地命令;否则读取项目 `test` skill,选择其中声明的 core 或 full 验证命令。两者均未知时进入求助出口。**测试通过前不得提交或推送。**
|
|
26
33
|
- 测试通过后发布修复:按 `.agents/rules/commit-and-pr.md` 仅暂存本次相关文件(`git add <相关路径>`,避免 `git add -A` 卷入无关改动)→ 创建修复 commit(`git commit`)→ `git push` 到当前 PR 分支。
|
|
27
34
|
- 记录本次修复的 commit SHA,修复计数 +1,回到 SKILL 步骤 2 重新监控。
|
|
28
35
|
- 绝不执行与失败无关的「顺手优化」;不放宽 / 跳过失败的断言来「修绿」。
|
|
@@ -64,6 +64,13 @@ pr_status: pending # PR status: pending (default) | created (PR crea
|
|
|
64
64
|
|
|
65
65
|
<!-- Humans record rulings for needs-human-decision decisions here and flip matching HD- rows in the Review Disagreement Ledger to human-decided. -->
|
|
66
66
|
|
|
67
|
+
## Workflow Warnings
|
|
68
|
+
|
|
69
|
+
<!-- Workflow degradation, platform sync failures, permission gaps, and related events. Keep the header when empty. -->
|
|
70
|
+
|
|
71
|
+
| id | time | step | severity | code | status | target | message | action | resolved_at | resolution |
|
|
72
|
+
|----|------|------|----------|------|--------|--------|---------|--------|-------------|------------|
|
|
73
|
+
|
|
67
74
|
## Activity Log
|
|
68
75
|
|
|
69
76
|
<!-- Append a new entry for each workflow step. Do NOT overwrite previous entries. -->
|
|
@@ -64,6 +64,13 @@ pr_status: pending # PR 状态:pending(默认)| created(已
|
|
|
64
64
|
|
|
65
65
|
<!-- 人类在此记录对 needs-human-decision 决策的裁定,并把 ## 审查分歧账本 对应 HD- 行翻为 human-decided。 -->
|
|
66
66
|
|
|
67
|
+
## 工作流告警
|
|
68
|
+
|
|
69
|
+
<!-- 工作流降级、平台同步失败、权限不足等需要后续注意的事件写入此段。无告警时保留表头即可。 -->
|
|
70
|
+
|
|
71
|
+
| id | time | step | severity | code | status | target | message | action | resolved_at | resolution |
|
|
72
|
+
|----|------|------|----------|------|--------|--------|---------|--------|-------------|------------|
|
|
73
|
+
|
|
67
74
|
## 活动日志
|
|
68
75
|
|
|
69
76
|
<!-- 每个工作流步骤追加一条新记录,不要覆盖之前的记录。 -->
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Mark PR manual validation as completed and update the summary comment"
|
|
3
|
+
usage: "/complete-manual-validation <task-id> [pr-ref] <verification-summary>"
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Read and execute the complete-manual-validation skill from `.agents/skills/complete-manual-validation/SKILL.md`.
|
|
8
|
+
|
|
9
|
+
Follow all steps defined in the skill exactly.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "标记 PR 人工验证已完成并更新摘要评论"
|
|
3
|
+
usage: "/complete-manual-validation <task-id> [pr-ref] <verification-summary>"
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
读取并执行 `.agents/skills/complete-manual-validation/SKILL.md` 中的 complete-manual-validation 技能。
|
|
8
|
+
|
|
9
|
+
严格按照技能中定义的所有步骤执行。
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
description = "Mark PR manual validation as completed and update the summary comment"
|
|
2
|
+
prompt = """
|
|
3
|
+
Complete manual validation: {{args}}
|
|
4
|
+
|
|
5
|
+
Read and execute the complete-manual-validation skill from `.agents/skills/complete-manual-validation/SKILL.md`.
|
|
6
|
+
|
|
7
|
+
Follow all steps defined in the skill exactly.
|
|
8
|
+
"""
|
|
@@ -87,6 +87,11 @@ jobs:
|
|
|
87
87
|
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
|
88
88
|
TYPE: ${{ steps.metadata.outputs.type }}
|
|
89
89
|
run: |
|
|
90
|
+
OWNER_TYPE=$(gh api "repos/$GITHUB_REPOSITORY" --jq '.owner.type // empty' 2>/dev/null || true)
|
|
91
|
+
if [ "$OWNER_TYPE" != "Organization" ]; then
|
|
92
|
+
exit 0
|
|
93
|
+
fi
|
|
94
|
+
|
|
90
95
|
case "$TYPE" in
|
|
91
96
|
bug|bugfix) ISSUE_TYPE="Bug" ;;
|
|
92
97
|
feature|enhancement) ISSUE_TYPE="Feature" ;;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Mark PR manual validation as completed and update the summary comment"
|
|
3
|
+
agent: general
|
|
4
|
+
subtask: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Complete manual validation: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
Read and execute the complete-manual-validation skill from `.agents/skills/complete-manual-validation/SKILL.md`.
|
|
10
|
+
|
|
11
|
+
Follow all steps defined in the skill exactly.
|