diff --git a/src/commands/reviewTasks.ts b/src/commands/reviewTasks.ts index 48f4864..1dd244d 100644 --- a/src/commands/reviewTasks.ts +++ b/src/commands/reviewTasks.ts @@ -232,6 +232,49 @@ async function selectWorkflowForInstruction(projectDir: string): Promise 0 ? lines.join('\n') + '\n\n' : ''; +} + /** * Instruct worktree: give additional instructions to modify the worktree. * Executes a task on the worktree and auto-commits if successful. @@ -260,10 +303,16 @@ export async function instructWorktree( log.info('Instructing worktree', { branch, worktreePath, workflow: selectedWorkflow }); info(`Running instruction on ${branch}...`); - // 3. Execute task on worktree - const taskSuccess = await executeTask(instruction, worktreePath, selectedWorkflow, projectDir); + // 3. Build instruction with worktree context + const worktreeContext = getWorktreeContext(projectDir, branch); + const fullInstruction = worktreeContext + ? `${worktreeContext}## 追加指示\n${instruction}` + : instruction; - // 4. Auto-commit if successful + // 4. Execute task on worktree + const taskSuccess = await executeTask(fullInstruction, worktreePath, selectedWorkflow, projectDir); + + // 5. Auto-commit if successful if (taskSuccess) { const commitResult = autoCommitWorktree(worktreePath, item.taskSlug); if (commitResult.success && commitResult.commitHash) {