mde-worktree-pr-flow

Enforces disciplined git worktree creation, focused PR shipping, and forensic cleanup workflows.

1|Updated Sep 15, 2026
One-click install
npx skills add https://github.com/amoai-tech/mdeai --skill mde-worktree-pr-flow-amoai-tech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mde-worktree-pr-flow
Source: https://github.com/amoai-tech/mdeai/tree/main/.claude/skills/mde-worktree-pr-flow
Command: npx skills add https://github.com/amoai-tech/mdeai --skill mde-worktree-pr-flow-amoai-tech

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Messy git worktrees, oversized mixed-scope PRs, and unverified merges slow down shipping and risk leaking gigabytes of untracked files into version control. This Skill enforces a strict one-worktree, one-goal, one-PR discipline with hard guards and merge gates. ## Core Features & Use Cases - Worktree safety guards: Shell scripts hard-fail if .worktrees/ is not gitignored, block nested worktree creation, and verify clean preflight state before any git worktree add. - Merge gate enforcement: Requires lint, build, test, floor checks, Vercel preview, and production HTTP verification before a PR counts as done, with PR size limits per change type. - Forensic cleanup mode: Read-only audit scripts, mandatory backup bundles, domain classification, and a removal gate for safely recovering from hundreds of dirty or untracked paths. - Use Case: Before starting a new feature branch, run the preflight scripts to confirm the tree is clean and gitignored, create a worktree from origin/main, ship one focused PR through the merge gate, then verify production before starting the next task. ## Quick Start Ask the agent to start a new worktree for a task and it will run the guard scripts, create the worktree from origin/main, and guide the change through the focused PR merge gate.

Frequently Asked Questions about mde-worktree-pr-flow

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

FAQPage Schema
How do I safely create a git worktree for a new feature branch?

Run the guard scripts first: guard-gitignore-worktrees.sh confirms worktree directories are gitignored, and guard-worktree-context.sh blocks nested worktree creation. Then create the worktree from origin/main with a naming convention like wt-san-NNN-slug.

How do I split a large pull request into smaller focused PRs?

Identify cohesive sub-changes, create a fresh branch from origin/main for each, cherry-pick only the relevant commits, and open one PR per intent. Never split after review approval, and merge in dependency order.

Why does git worktree add fail or create problems inside another worktree?

Creating a worktree inside a linked worktree produces nested state that breaks merges. The guard-worktree-context.sh script compares GIT_DIR and GIT_COMMON to detect this and blocks the operation unless --allow-linked is passed.

What should I do before removing a dirty git worktree?

Run backup-worktree.sh to create a bundle, patches, and an untracked-file copy, then review the diff against origin/main and list local-only commits. Only remove after explicit user confirmation, and never run git clean or reset --hard without a backup.

Can I symlink node_modules into a git worktree for Next.js builds?

No. Next.js 16 with Turbopack rejects symlinked node_modules pointing outside the worktree during build. Use cp -al to create a hardlink copy instead, which is instant, shares inodes, and passes the build gate.