feedback-loop
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFeedback Loop
反馈循环
Goal
目标
- User has confirmed the commits, after as many feedback rounds as needed.
- Any fixup commits created along the way are squashed into their originating commits.
- 在完成所需的多轮反馈后,用户已确认提交内容。
- 过程中创建的所有fixup提交都已合并到其对应的原始提交中。
Input
输入
- : branch to compute the merge-base against, both for deriving the commit set to confirm and for autosquash.
target_branch
- : 用于计算合并基准的分支,既用于确定需要确认的提交集,也用于自动压缩操作。
target_branch
Prerequisites
前提条件
- skill available.
fix-feedback
- 已具备技能。
fix-feedback
Steps
步骤
Step 1: Present for confirmation
步骤1:提交确认
Re-derive the current commit set from git before presenting - don't rely on a carried-over list, since the user may add, drop, or amend commits manually between rounds without saying so:
bash
git log --oneline $(git merge-base HEAD "<target_branch>")..HEADSummarize the result for the user (messages, changed files, diff as needed). Ask for proceed confirmation (yes) or feedback (free text). This confirmation is mandatory - if no interactive access to the user exists, stop here and wait rather than auto-proceeding.
在呈现给用户之前,重新从git中获取当前提交集——不要依赖之前的提交列表,因为用户可能在多轮反馈之间手动添加、删除或修改提交而未告知:
bash
git log --oneline $(git merge-base HEAD "<target_branch>")..HEAD为用户总结结果(提交信息、变更文件、按需展示差异)。询问用户是否确认继续(输入yes)或提供反馈(自由文本)。此确认步骤为必填项——如果无法与用户进行交互,在此处暂停等待,而非自动继续。
Step 2: Route feedback
步骤2:处理反馈
If the user confirms, go to Step 3.
Otherwise, wrap the feedback as a single item and invoke:
Skill(skill: "fix-feedback", args: "fixup mode. {id: 'feedback-loop-<n>', body: '<feedback text>'}")nRead the output entry for :
feedback-loop-<n>- : no bookkeeping needed - Step 1's re-derivation picks the new fixup commit up on the next round.
implemented - /
declined/deferred: no new commit - carry itsexplainedinto the next Step 1 as context for the user.description
Return to Step 1.
如果用户确认,进入步骤3。
否则,将反馈内容封装为单个条目并调用:
Skill(skill: "fix-feedback", args: "fixup mode. {id: 'feedback-loop-<n>', body: '<feedback text>'}")n读取的输出结果:
feedback-loop-<n>- : 无需额外记录——下一轮执行步骤1时,重新获取提交集会自动包含新的fixup提交。
implemented - /
declined/deferred: 无新提交生成——将其explained带入下一次步骤1,作为用户的上下文信息。description
返回步骤1。
Step 3: Autosquash
步骤3:自动压缩
bash
GIT_SEQUENCE_EDITOR=true git rebase --autosquash -i $(git merge-base HEAD "<target_branch>")bash
GIT_SEQUENCE_EDITOR=true git rebase --autosquash -i $(git merge-base HEAD "<target_branch>")Output
输出
Markdown format:
- Commits: final set, from 's merge-base to
target_branchafter squash.HEAD- Hash
- Message
Markdown格式:
- 提交:压缩完成后,从的合并基准到
target_branch的最终提交集。HEAD- 哈希值
- 提交信息