Loading...
Loading...
Compare original and translation side by side
[Main Task] "Create PR: [branch-name]"
└── [CI Task] "CI Run #1" (status: failed, reason: lint)
└── [Fix Task] "Fix: lint"
└── [CI Task] "CI Run #2" (status: failed, reason: test failures)
└── [Fix Task] "Fix: test failures"
└── [CI Task] "CI Run #3" (status: passed)[Main Task] "Create PR: [branch-name]"
└── [CI Task] "CI Run #1" (status: failed, reason: lint)
└── [Fix Task] "Fix: lint"
└── [CI Task] "CI Run #2" (status: failed, reason: test failures)
└── [Fix Task] "Fix: test failures"
└── [CI Task] "CI Run #3" (status: passed)TaskCreate:
- subject: "Create PR: [branch-name or 'pending']"
- description: "Create pull request from current changes."
- activeForm: "Checking git status"
TaskUpdate:
- taskId: [pr task ID]
- status: "in_progress"git status
git diff --statTaskCreate:
- subject: "Create PR: [branch-name or 'pending']"
- description: "Create pull request from current changes."
- activeForm: "Checking git status"
TaskUpdate:
- taskId: [pr task ID]
- status: "in_progress"git status
git diff --stat
**Determine the starting point:**
| State | Next Step |
|-------|-----------|
| On base branch with uncommitted changes | Step 2 (create branch) |
| On feature branch with uncommitted changes | Step 3 (commit) |
| On feature branch with commits, nothing uncommitted | Step 4 (sync) |
| PR already exists for this branch | Inform user, ask whether to update or monitor CI |
| No changes anywhere | Inform user "No changes detected. Nothing to do." and stop |
**Update task with branch info:**undefined
**确定起始操作:**
| 状态 | 下一步操作 |
|-------|-----------|
| 当前在基准分支,存在未提交变更 | 步骤2(创建分支) |
| 当前在功能分支,存在未提交变更 | 步骤3(提交变更) |
| 当前在功能分支,已提交所有变更 | 步骤4(与基准分支同步) |
| 该分支已存在对应PR | 告知用户,询问是否更新PR或监控CI |
| 无任何变更 | 告知用户“未检测到变更,无需执行操作”并终止流程 |
**更新任务的分支信息:**undefinedgit checkout -b <descriptive-branch-name>feat/short-descriptionfix/short-descriptionrefactor/short-descriptiondocs/short-descriptiongit checkout -b <descriptive-branch-name>feat/short-descriptionfix/short-descriptionrefactor/short-descriptiondocs/short-descriptiongit add -Agit status
git add <file1> <file2> ...
git diff --cached --stat
git commit -m "$(cat <<'EOF'
<type>: <short summary>
<optional longer description>
EOF
)"feat:fix:refactor:docs:test:chore:git add -Agit status
git add <file1> <file2> ...
git diff --cached --stat
git commit -m "$(cat <<'EOF'
<type>: <short summary>
<optional longer description>
EOF
)"feat:fix:refactor:docs:test:chore:git fetch origin
git log --oneline HEAD..origin/<base-branch> | head -20AskUserQuestiongit fetch origin
git log --oneline HEAD..origin/<base-branch> | head -20AskUserQuestiongit log --oneline <base-branch>..HEAD
git diff <base-branch>...HEAD --statCloses #45[issue references: Fixes #...]git log --oneline <base-branch>..HEAD
git diff <base-branch>...HEAD --statCloses #45[issue references: Fixes #...]AskUserQuestionAskUserQuestionHere's what I'll do next:
- Run local checks (if available for this project)
- Push the branch to origin
- Create the PR with the approved title and body
- Monitor CI and fix any failures
I'll auto-fix small issues (formatting, lint, type errors, test failures). If anything bigger comes up, I'll check with you first.Ready to proceed?
AskUserQuestionAskUserQuestion接下来我将执行以下操作:
- 运行本地检查(如果项目支持)
- 推送分支至远程仓库
- 创建PR,使用已批准的标题和正文
- 监控CI并修复所有失败项
我将自动修复小型问题(格式、代码检查、类型错误、测试失败)。如果遇到较大问题,我会先与您确认。是否准备继续?
package.jsonMakefilepyproject.tomlDESCRIPTIONJustfileTaskfile.yml.github/workflows/npm run lintruff checkair formatbiome checknpm run buildpip install -e .devtools::check()npm run check-typesmypypyrightnpm testpytestdevtools::test()cargo testgit add -AAskUserQuestionpackage.jsonMakefilepyproject.tomlDESCRIPTIONJustfileTaskfile.yml.github/workflows/npm run lintruff checkair formatbiome checknpm run buildpip install -e .devtools::check()npm run check-typesmypypyrightnpm testpytestdevtools::test()cargo testgit add -AAskUserQuestiongit push -u origin <branch-name>git push -u origin <branch-name>gh pr create --title "<approved-title>" --body "$(cat <<'EOF'
<approved-body>
EOF
)"TaskUpdate:
- taskId: [pr task ID]
- metadata: {"prUrl": "<url>", "prNumber": <N>, "prTitle": "<title>", "commits": <count>}gh pr create --title "<approved-title>" --body "$(cat <<'EOF'
<approved-body>
EOF
)"TaskUpdate:
- taskId: [pr task ID]
- metadata: {"prUrl": "<url>", "prNumber": <N>, "prTitle": "<title>", "commits": <count>}TaskCreate:
- subject: "CI Run #[N]: monitoring"
- description: "Monitoring CI run for PR #[number]"
- activeForm: "Monitoring CI Run #[N]"
TaskUpdate:
- taskId: [ci task ID]
- addBlockedBy: [pr task ID]
- status: "in_progress"undefinedTaskCreate:
- subject: "CI Run #[N]: monitoring"
- description: "Monitoring CI run for PR #[number]"
- activeForm: "Monitoring CI Run #[N]"
TaskUpdate:
- taskId: [ci task ID]
- addBlockedBy: [pr task ID]
- status: "in_progress"undefined
**IMPORTANT:** Do NOT run `gh run watch` without redirecting output. It generates thousands of lines of repeated status updates. Always redirect to `/dev/null` and rely on the exit code.
**Store run ID in task:**undefined
**重要提示:** 运行`gh run watch`时务必重定向输出,否则会生成数千行重复的状态更新。请始终将输出重定向至`/dev/null`,并依赖退出码判断结果。
**将运行ID存储到任务中:**undefinedTaskUpdate:
- taskId: [ci task ID]
- subject: "CI Run #[N]: passed"
- status: "completed"
- metadata: {"status": "passed"}TaskUpdate:
- taskId: [ci task ID]
- subject: "CI Run #[N]: passed"
- status: "completed"
- metadata: {"status": "passed"}TaskUpdate:
- taskId: [ci task ID]
- subject: "CI Run #[N]: failed"
- status: "completed"
- metadata: {"status": "failed", "failureReason": "[brief reason]"}--log-failed# Summary of which jobs/steps failed
gh run view <run-id>
# Failed logs, limited to the last 40 lines (where the error usually is)
gh run view <run-id> --log-failed 2>&1 | tail -40
# Search for specific errors if needed
gh run view <run-id> --log-failed 2>&1 | grep -A 5 -B 5 "error\|Error\|FAIL\|failed"TaskCreate:
- subject: "Fix: [failure reason]"
- description: "Fixing CI failure from Run #[N]: [detailed error]"
- activeForm: "Fixing [failure reason]"
TaskUpdate:
- taskId: [fix task ID]
- addBlockedBy: [ci task ID]
- status: "in_progress"git add <specific-files>
git commit -m "$(cat <<'EOF'
fix: <what was fixed>
EOF
)"
git pushTaskUpdate:
- taskId: [fix task ID]
- status: "completed"TaskUpdate:
- taskId: [ci task ID]
- subject: "CI Run #[N]: failed"
- status: "completed"
- metadata: {"status": "failed", "failureReason": "[brief reason]"}--log-failed# 汇总失败的作业/步骤
gh run view <run-id>
# 失败日志,仅显示最后40行(通常错误信息位于末尾)
gh run view <run-id> --log-failed 2>&1 | tail -40
# 如有需要,搜索特定错误
gh run view <run-id> --log-failed 2>&1 | grep -A 5 -B 5 "error\|Error\|FAIL\|failed"TaskCreate:
- subject: "Fix: [failure reason]"
- description: "Fixing CI failure from Run #[N]: [detailed error]"
- activeForm: "Fixing [failure reason]"
TaskUpdate:
- taskId: [fix task ID]
- addBlockedBy: [ci task ID]
- status: "in_progress"git add <specific-files>
git commit -m "$(cat <<'EOF'
fix: <what was fixed>
EOF
)"
git pushTaskUpdate:
- taskId: [fix task ID]
- status: "completed"TaskListundefinedTaskListundefined<branch-name><base-branch><branch-name><base-branch>undefinedundefinedTaskList shows:
├── PR task in_progress, no CI tasks
│ └── PR was created, start monitoring CI (Step 9)
├── PR task in_progress, CI task in_progress
│ └── Resume monitoring CI run from task metadata runId
├── PR task in_progress, CI task failed, no fix task
│ └── Analyze failure and create fix task (Step 10)
├── PR task in_progress, fix task in_progress
│ └── Continue fixing, then push and monitor new CI run
├── PR task completed
│ └── PR is done, show final report
└── No tasks exist
└── Fresh start (Step 1)gh run view <runId>TaskList显示以下情况:
├── PR任务状态为in_progress,无CI任务
│ └── PR已创建,开始监控CI(步骤9)
├── PR任务状态为in_progress,CI任务状态为in_progress
│ └── 从任务元数据的runId恢复监控CI运行记录
├── PR任务状态为in_progress,CI任务已失败,无修复任务
│ └── 分析失败原因并创建修复任务(步骤10)
├── PR任务状态为in_progress,修复任务状态为in_progress
│ └── 继续修复,然后推送并监控新的CI运行记录
├── PR任务已完成
│ └── PR已完成,显示最终报告
└── 无任何任务
└── 从头开始(步骤1)gh run view <runId>git add -Agit add .git add -Agit add .ghgh auth loginghgh auth login