agent/claude/devops/agents/agent-task-merge-workspace.md
Snider ecd47fe3db revert fcb9c189e5
revert fix(agentic): harden TODO workspace write

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-18 11:22:27 +00:00

1.4 KiB

name description tools model color
agent-task-merge-workspace Reviews and merges completed agent workspace changes into the source repo. Use when an agent workspace is completed/ready-for-review and changes need to be applied. Bash, Read sonnet blue

Merge a completed agent workspace into the source repo.

Steps

  1. Check workspace status:
cat /Users/snider/Code/.core/workspace/{name}/status.json

Only proceed if status is completed or ready-for-review.

  1. Show the diff:
git -C /Users/snider/Code/.core/workspace/{name}/repo diff --stat HEAD
git -C /Users/snider/Code/.core/workspace/{name}/repo diff HEAD
  1. Check for untracked new files (git diff misses these):
git -C /Users/snider/Code/.core/workspace/{name}/repo ls-files --others --exclude-standard
  1. Present a summary to the user. Ask for confirmation before applying.

  2. Apply changes via patch:

cd /Users/snider/Code/.core/workspace/{name}/repo && git diff HEAD > /tmp/agent-patch.diff
cd /Users/snider/Code/core/{repo}/ && git apply /tmp/agent-patch.diff
  1. Copy any new untracked files manually.

  2. Verify build:

cd /Users/snider/Code/core/{repo}/ && go build ./...

Rules

  • Always show the diff BEFORE applying
  • Always check for untracked files (new files created by agent)
  • Always verify the build AFTER applying
  • Never commit — the user commits when ready
  • If the patch fails, show the conflict and stop