Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/claude/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,21 @@ function buildWorkspaceSystemPrompt(workingDir?: string): string {
- 不要 git add . 或 git add -A,只添加本次变更的文件
- 不要提交 .env、credentials 等敏感文件
- 如果某步骤失败且无法自动修复,停下来向用户说明情况
- 如果用户只是提问、审查代码或做探索性修改,不需要走这个流程。不确定时问用户:"需要我提交这些改动并创建 PR 吗?"`;
- 如果用户只是提问、审查代码或做探索性修改,不需要走这个流程。不确定时问用户:"需要我提交这些改动并创建 PR 吗?"

## GitHub CLI (gh) 注意事项

工作区的 git remote 指向本地缓存路径(非 GitHub URL),\`gh\` CLI 无法自动识别仓库。
**始终使用 \`--repo owner/repo\` 参数**,不要 cd 到其他目录:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Missing guidance on how to resolve owner/repo (confidence: 78)

The examples use literal owner/repo as a placeholder, but unlike prompts.ts (which says "从 git remote URL 或项目配置中推断 owner/repo"), this prompt doesn't tell the agent how to determine the actual owner/repo value. Since the workspace remote points to a local cache path, git remote -v won't directly reveal the GitHub owner/repo.

Consider adding a hint, e.g.:

owner/repo 可以从项目 CLAUDE.md、git log 中的 GitHub 链接、或 bare cache 路径结构推断。


\`\`\`bash
# 正确 ✓
gh pr view 123 --repo owner/repo
gh search issues --repo owner/repo -- "keyword"

# 错误 ✗ — 不要 cd 到主仓库或其他目录执行 gh
cd /some/other/dir && gh pr view 123
\`\`\``;

const feishuToolsGuide = config.feishu.tools.enabled ? `

Expand Down
4 changes: 4 additions & 0 deletions src/pipeline/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ export const PUSH_SYSTEM_PROMPT = `你需要将当前工作目录中的代码变
7. \`git push -u origin <当前分支>\`
8. \`gh pr create --fill\` 或用更详细的标题/描述创建 PR

**重要:gh CLI 注意事项**
工作区的 git remote 指向本地缓存路径(非 GitHub URL),\`gh\` 无法自动识别仓库。
所有 \`gh\` 命令必须加 \`--repo owner/repo\` 参数(从 git remote URL 或项目配置中推断 owner/repo)。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Minor inconsistency (confidence: 80)

Step 8 above (line 118) still shows gh pr create --fill without --repo, which contradicts the new guidance on lines 120-122 that says all gh commands must use --repo. An agent might follow the specific step 8 example and omit --repo.

Consider updating step 8 to be consistent:

Suggested change
所有 \`gh\` 命令必须加 \`--repo owner/repo\` 参数(从 git remote URL 或项目配置中推断 owner/repo)。
所有 \`gh\` 命令必须加 \`--repo owner/repo\` 参数(从 git remote URL 或项目配置中推断 owner/repo)。例如 \`gh pr create --fill --repo owner/repo\`


完成后输出:
## 推送结果
- Commit: <commit hash 和 message>
Expand Down
Loading