pmai-build-cancel

Cancels an active worktree-mode build candidate and clears its in-progress state after PM confirmation.

4|Updated May 26, 2026
One-click install
npx skills add https://github.com/YYG501/PM-AI-Harness --skill pmai-build-cancel-yyg501
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pmai-build-cancel
Source: https://github.com/YYG501/PM-AI-Harness/tree/main/skills/build-cancel
Command: npx skills add https://github.com/YYG501/PM-AI-Harness --skill pmai-build-cancel-yyg501

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When a product manager decides an in-progress build should be abandoned, leftover active state in .work-meta.json and orphaned worktrees cause status views to keep showing stale work. This Skill cleanly abandons a worktree-mode build candidate without touching anything already merged into the main branch. ## Core Features & Use Cases - Mode Guard: Reads .work-meta.json and only proceeds when build.mode=worktree; main-mode builds are rejected and redirected to proposal or design replanning. - Confirmed Cancellation: Asks the PM for explicit confirmation before running cancel-work.sh, which commits only the .work-meta.json deletion and queues the worktree for safe background cleanup. - Use Case: A PM realizes mid-build that the feature direction changed. Instead of manually deleting branches, they run this Skill, confirm the abandonment, and the candidate is discarded while mainline docs and history stay intact. ## Quick Start Tell the assistant to cancel the current build because this round of work should be abandoned, then confirm when prompted.

Frequently Asked Questions about pmai-build-cancel

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

FAQPage Schema
How do I cancel an in-progress build in a git worktree?

Run the build-cancel skill, which asks for confirmation and then executes cancel-work.sh. The script commits only the removal of the module's .work-meta.json active state and queues the worktree and branch for automatic cleanup at a safe time.

What happens to my worktree and branch after cancelling a build?

The worktree and branch are not deleted immediately. They are recorded in .runs/pending-cleanup.json, and a background process removes them once no session is still active in that environment, so you never run cleanup commands manually.

Can I cancel a build that runs in main mode instead of a worktree?

No. Main-mode builds are rejected before any checkout, commit, or cleanup. Changes already on main must be handled forward through proposal or design replanning, which freezes the old scope rather than rolling it back.

Does cancelling a build delete product documents or decisions already on main?

No. Cancellation only affects the unmerged candidate. Product documents, specs, and historical decisions already committed to the main branch are preserved, and the cancel commit contains only the .work-meta.json deletion.

When should I use build-cancel versus build-close or record?

Use build-cancel only when abandoning unfinished worktree work. If the PM has accepted the result, return to the build flow for automatic finalize; use build-close only for compatibility or recovery, and record for lightweight confirmed facts.