merge-agent-work

Merge agent branches into a task branch with --no-ff and validation.

4|Updated Sep 25, 2025
One-click install
npx skills add https://github.com/cowwoc/styler --skill merge-agent-work
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-agent-work
Source: https://github.com/cowwoc/styler/tree/main/.claude/skills/merge-agent-work
Command: npx skills add https://github.com/cowwoc/styler --skill merge-agent-work

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Merging work from individual agent branches into the main task branch requires careful validation and state tracking to avoid conflicts or broken builds. This Skill automates the safe integration of agent contributions, ensuring smooth progress and preventing rework.

Core Features & Use Cases

  • Agent Completion Verification: Ensures the agent has successfully completed its work before attempting a merge.
  • Safe Merge Execution: Performs a --no-ff merge from the agent branch to the task branch, preserving agent history.
  • Comprehensive Merge Validation: Detects conflicts, confirms commit creation, and optionally validates the build and tests after the merge.
  • State Tracking Update: Updates task.json to reflect that the agent's work has been merged.
  • Use Case: After an architect agent has completed its design implementation on its dedicated branch, use this Skill to safely merge its changes into the main task branch. This ensures the architect's work is properly integrated and validated before proceeding to the next development phase.

Quick Start

After the architect agent completes its work: TASK_NAME="implement-formatter-api" AGENT="architect" /workspace/main/.claude/scripts/merge-agent-work.sh
--task "$TASK_NAME"
--agent "$AGENT"

Frequently Asked Questions about merge-agent-work

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely merge agent work into my main task branch?

Merge agent work using a `--no-ff` merge from the agent branch to the task branch, which preserves agent history and creates a merge commit. This Skill automates the process, verifies agent completion, detects conflicts, and updates task state tracking to ensure safe integration.

What validation happens when merging agent branches?

The merge process detects conflicts, confirms merge commit creation, and optionally validates the build and tests after merging. It also verifies the agent has completed its work before attempting the merge and updates task.json to reflect the merged state.

When should I use agent branch merging instead of manual integration?

Use this approach when coordinating multiple agent merges, when agents are marked as completed in status.json, and when you need validation for merge integrity and optional build verification. It prevents conflicts and broken builds during multi-agent workflows.

Can I merge work from multiple agents into one task branch?

Yes, this Skill is applicable when coordinating multiple agent merges. Run it for each agent sequentially to integrate their contributions safely, with state tracking and conflict detection ensuring each merge completes successfully before proceeding to the next.

What happens if a merge conflict is detected?

The Skill detects conflicts during the merge operation and reports them. You can then resolve conflicts manually before proceeding, ensuring merge integrity before updating task state and running optional build validation.

Do I need to set up anything before merging agent work?

The agent must have completed its work (status.json shows 'completed'), and both the agent branch and task branch must exist in your worktree. The Skill switches to the task worktree and performs the merge with validation and state updates.