dd-ai-git-workflow

Manages Git branch workflows, worktrees, and merge checks for parallel AI coding agents.

Updated Jun 11, 2026
One-click install
npx skills add https://github.com/marcocpt/trae_skills --skill dd-ai-git-workflow-marcocpt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dd-ai-git-workflow
Source: https://github.com/marcocpt/trae_skills/tree/main/dd-ai-git-workflow
Command: npx skills add https://github.com/marcocpt/trae_skills --skill dd-ai-git-workflow-marcocpt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, swiftlint, and includes scripts (resource) components.

What problem does it solve? When multiple AI coding agents work in parallel on the same repository, branches go stale, merge conflicts multiply on shared files, and abandoned worktrees pile up. This Skill enforces a disciplined Git workflow with scripted health checks, conflict prediction, and cleanup suggestions. ## Core Features & Use Cases - Worktree & Branch Management: Creates standardized worktrees from origin/develop with enforced naming conventions (feature/fix/docs/refactor) and one-branch-one-worktree isolation. - Merge Safety Checks: Runs pre-merge self-checks (uncommitted files, SwiftLint strict, doc sync, conflict prediction) and blocks merges when all_pass is false. - Branch Health Monitoring: Scores branches on staleness, conflict count, change scale, and mergeability, outputting structured JSON reports for CI or other skills. - Use Case: Three AI agents are editing a Swift project simultaneously. Before merging, each agent runs pre-merge-check.sh and conflict-predict.sh; public file changes are isolated into short-lived branches, and stale worktrees are flagged for confirmed cleanup. ## Quick Start Ask the AI to create a new feature worktree and run a branch health check before merging it back into develop.

Frequently Asked Questions about dd-ai-git-workflow

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

FAQPage Schema
How do I manage Git worktrees for parallel AI coding agents?

Create one worktree per branch using create-worktree.sh, which bases the branch on origin/develop and places the worktree beside the repository root. Each agent works in its own worktree, and worktrees are removed immediately after merging.

How to check if a Git branch is safe to merge?

Run pre-merge-check.sh, which verifies uncommitted files, SwiftLint strict, doc sync, conflict prediction via git merge-tree, and sync status with develop. It outputs a PreMergeChecklist JSON, and merging is blocked when all_pass is false.

Should I use merge or rebase for long-lived feature branches?

This workflow mandates merge-only and forbids rebase, because rebase rewrites history and causes force-push conflicts when multiple agents collaborate. Use --no-ff for feature merges and --ff-only only for pure upstream syncs.

Does this Git workflow require a specific Git version?

Yes, the scripts depend on Git 2.55 or later for merge-tree --write-tree --name-only conflict detection. Some scripts also require jq for JSON assembly and use macOS BSD date syntax for staleness calculations.

How are conflicts on shared public files prevented?

Public files like Package.swift or shared protocols must be modified on a dedicated refactor/public-file-* branch with a PublicFile: commit tag. These branches must merge within one day, and pre-merge checks fail if they exceed that age.

Will the cleanup script delete my branches automatically?

No. cleanup-suggest.sh only outputs a CleanupSuggestion JSON listing merged branches, stale worktrees, and orphan metadata. Actual deletion requires explicit user confirmation, and the current branch, develop, and main are never targeted.