From 62eb394e906414205005c56bd3140a0896ab0842 Mon Sep 17 00:00:00 2001 From: BIG Date: Fri, 17 Apr 2026 15:14:29 +0700 Subject: [PATCH] feat(df-merge-pr): add --yes flag to skip confirmation gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously /df-merge-pr always stopped at the Confirmation Gate via AskUserQuestion. When the caller already knows they want to merge (e.g. scripted invocation or repeated ship workflow) this extra round-trip is friction with no safety benefit beyond what --admin + the hard aborts already provide. Add a --yes / -y flag that, when present: - prints the summary block and proceeds without AskUserQuestion - downgrades CI-failing and concurrent-hotfix prompts to warning lines - does NOT bypass hard aborts: dirty tree, draft PR, rebase conflict, tag exists, PR already merged — those still stop the run Updated files: - SKILL.md: argument-hint, {auto_confirm} semantics, safety-check notes, edge-case table - workflow-feature.md: step [4/6] gate follows the new bypass - workflow-deploy.md: step [7/14] gate follows the new bypass, with an explicit safety note that release tags are still irreversible Version: 1.9.0 -> 1.10.0 (minor: new user-facing flag, no breakage) --- .claude-plugin/plugin.json | 42 +++++++++---------- CHANGELOG.md | 8 ++++ skills/df-merge-pr/SKILL.md | 28 +++++++++---- .../df-merge-pr/references/workflow-deploy.md | 9 +++- .../references/workflow-feature.md | 5 ++- 5 files changed, 60 insertions(+), 32 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index f290757..b204500 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,22 +1,22 @@ { - "name": "devflow", - "description": "A Claude Code plugin powering structured development workflows \u2014 skills for building, reviewing, responding, and debugging. Includes core workflow skills (build, review, respond, debug), utility skills, custom agents, workflow automation hooks, and output styles.", - "version": "1.9.0", - "license": "MIT", - "keywords": [ - "skills", - "devflow", - "multi-agent", - "agent-teams", - "pr-review", - "debug", - "productivity", - "workflow" - ], - "author": { - "name": "kobig", - "url": "https://github.com/wasikarn" - }, - "homepage": "https://github.com/wasikarn/devflow#readme", - "repository": "https://github.com/wasikarn/devflow" -} \ No newline at end of file + "name": "devflow", + "description": "A Claude Code plugin powering structured development workflows \u2014 skills for building, reviewing, responding, and debugging. Includes core workflow skills (build, review, respond, debug), utility skills, custom agents, workflow automation hooks, and output styles.", + "version": "1.10.0", + "license": "MIT", + "keywords": [ + "skills", + "devflow", + "multi-agent", + "agent-teams", + "pr-review", + "debug", + "productivity", + "workflow" + ], + "author": { + "name": "kobig", + "url": "https://github.com/wasikarn" + }, + "homepage": "https://github.com/wasikarn/devflow#readme", + "repository": "https://github.com/wasikarn/devflow" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 280229a..732165c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. +## [1.10.0] — 2026-04-17 + +### df-merge-pr auto-confirm + docs + +- feat: `--yes` / `-y` flag on `/df-merge-pr` — skips the Confirmation Gate, CI-failing prompt, and concurrent-hotfix prompt; hard aborts (dirty tree, draft PR, rebase conflict, tag exists) still fire +- docs: SKILL.md documents `{auto_confirm}` behavior explicitly; workflow-feature.md and workflow-deploy.md gates follow the same bypass +- docs: deploy workflow notes that `--yes` does not bypass tag-exists / rebase-conflict aborts — only the confirmation prompt + ## [1.9.0] — 2026-04-14 ### Advisor Strategy mode for df-review diff --git a/skills/df-merge-pr/SKILL.md b/skills/df-merge-pr/SKILL.md index 3548acb..5adf96f 100644 --- a/skills/df-merge-pr/SKILL.md +++ b/skills/df-merge-pr/SKILL.md @@ -1,7 +1,7 @@ --- name: df-merge description: "Automated git-flow merge and deploy — feature, hotfix, and release modes with pre-merge safety checks. Use to merge a branch to main/develop." -argument-hint: "[pr-number?] [--hotfix?] [--release?] [jira-key?]" +argument-hint: "[pr-number?] [--hotfix?] [--release?] [--yes?] [jira-key?]" effort: medium compatibility: "Requires gh CLI (authenticated) and a git repository with a GitHub remote." allowed-tools: Bash(git *), Bash(gh *), Read, Edit, Grep, AskUserQuestion, mcp__mcp-atlassian__jira_add_comment @@ -44,6 +44,18 @@ Parse args for position-independent flags: PR number: extract non-flag token from $ARGUMENTS, else auto-detect with `gh pr view --json number --jq '.number'`. +### Auto-confirm (`--yes` / `-y`) + +Set `{auto_confirm}=true` when `--yes` or `-y` is present in `$ARGUMENTS`. When true: + +- Confirmation Gate → print the summary block but **do not** call `AskUserQuestion`; proceed directly +- CI-failing warning → print a warning line and proceed (relies on `--admin` bypass) +- Concurrent-hotfix warning → print a warning line and proceed + +When `{auto_confirm}` is false (default), every AskUserQuestion in this skill still fires as before. + +`--yes` does **not** bypass hard aborts (dirty tree, draft PR, rebase conflict, tag exists, etc.) — those still stop the run. + --- ## Pre-execution Safety Checks @@ -56,9 +68,9 @@ Run all checks before any merge operation. Abort immediately on failure unless n | 1 | Clean working tree | `git status --porcelain` | output non-empty — uncommitted changes break rebase | | 2 | Fetch remote | `git fetch origin` | fails — stale state causes wrong rebase decisions | | 3 | PR status | `gh pr view --json isDraft,state,mergeable --jq '{isDraft,state,mergeable}'` | isDraft=true, state=MERGED, or mergeable=CONFLICTING | -| 4 | CI checks | `gh pr checks` | any failing → **warn** via `AskUserQuestion` ("CI failing — --admin will bypass. Continue?") | +| 4 | CI checks | `gh pr checks` | any failing → **warn** via `AskUserQuestion` ("CI failing — --admin will bypass. Continue?"). If `{auto_confirm}` → print warning line and proceed. | | 5 | No PR found | (if auto-detect returns empty) | prompt user for PR number | -| 6 | Mode 2/3: concurrent hotfix | see command below table | any result → **warn** via `AskUserQuestion` ("Found open hotfix PR. Proceed anyway?") | +| 6 | Mode 2/3: concurrent hotfix | see command below table | any result → **warn** via `AskUserQuestion` ("Found open hotfix PR. Proceed anyway?"). If `{auto_confirm}` → print warning line and proceed. | Check 6 command (concurrent hotfix detection): @@ -96,7 +108,7 @@ concurrent hotfixes). Review the report before proceeding to the Confirmation Ga ## Confirmation Gate -Before any merge, tag, or delete operation, show this summary then use `AskUserQuestion` with Yes/No options: +Before any merge, tag, or delete operation, show this summary: ```text === merge-pr: Ready to execute === @@ -108,7 +120,9 @@ Backport: {backport_target} (Mode 2/3 only) PR: #{pr_number} ``` -Call `AskUserQuestion` with: +**If `{auto_confirm}` is true** (user passed `--yes`/`-y`): append `Auto-confirm: on — proceeding without prompt.` and proceed. Do **not** call `AskUserQuestion`. + +**Otherwise** call `AskUserQuestion` with: - question: "Proceed with merge?" - header: "Confirm" @@ -160,11 +174,11 @@ Done | Dirty working tree | Abort: "Uncommitted changes. Commit or stash first." | | Draft PR | Abort: "PR is still draft. Mark ready for review first." | | PR already merged | Abort: "PR already merged. Nothing to do." | -| CI checks failing | Warn via `AskUserQuestion`: "CI failing — --admin will bypass. Continue?" (Yes/No) | +| CI checks failing | Warn via `AskUserQuestion`: "CI failing — --admin will bypass. Continue?" (Yes/No). With `--yes` → print warning and proceed. | | No PR found for branch | Prompt user for PR number or offer `gh pr list` | | Rebase conflict | Abort: "Rebase conflict. Resolve manually then re-run /merge-pr" | | Tag already exists | Abort: "Tag v{version} already exists. Bump version manually first." | -| Concurrent open hotfix PR | Warn via `AskUserQuestion`: "Found open hotfix PR #{n}. Proceed anyway?" (Yes/No) | +| Concurrent open hotfix PR | Warn via `AskUserQuestion`: "Found open hotfix PR #{n}. Proceed anyway?" (Yes/No). With `--yes` → print warning and proceed. | | Active release branch during hotfix | Auto-detect and backport to release branch instead of develop | | Backport cherry-pick conflict | Create PR but don't auto-merge: "Backport has conflicts — manual resolution needed." | | No GitHub remote | Abort: "No GitHub remote found. Cannot use gh CLI." | diff --git a/skills/df-merge-pr/references/workflow-deploy.md b/skills/df-merge-pr/references/workflow-deploy.md index 13770bb..5221a08 100644 --- a/skills/df-merge-pr/references/workflow-deploy.md +++ b/skills/df-merge-pr/references/workflow-deploy.md @@ -116,8 +116,13 @@ Backport: {backport_target} PR: #{pr_number} ``` -Call `AskUserQuestion` (question: "Proceed with merge?", header: "Confirm", -options: Yes/No as defined in SKILL.md § Confirmation Gate). Abort if "No, abort". +Follow SKILL.md § Confirmation Gate. If `{auto_confirm}` (`--yes`/`-y` in `$ARGUMENTS`), append +`Auto-confirm: on — proceeding without prompt.` and skip `AskUserQuestion`. Otherwise call +`AskUserQuestion` (question: "Proceed with merge?", header: "Confirm", Yes/No). Abort if "No, abort". + +**Safety note:** `--yes` skips only the confirmation prompt — it does **not** bypass tag-exists, +rebase-conflict, or dirty-tree aborts. Mode 2/3 tag a release that cannot be easily undone, so +only use `--yes` when the version bump and CHANGELOG have already been reviewed. --- diff --git a/skills/df-merge-pr/references/workflow-feature.md b/skills/df-merge-pr/references/workflow-feature.md index b6934a2..cbe8618 100644 --- a/skills/df-merge-pr/references/workflow-feature.md +++ b/skills/df-merge-pr/references/workflow-feature.md @@ -49,8 +49,9 @@ Branch: {branch} → develop PR: #{pr_number} ``` -Call `AskUserQuestion` (question: "Proceed with merge?", header: "Confirm", -options: Yes/No as defined in SKILL.md § Confirmation Gate). Abort if "No, abort". +Follow SKILL.md § Confirmation Gate. If `{auto_confirm}` (`--yes`/`-y` in `$ARGUMENTS`), append +`Auto-confirm: on — proceeding without prompt.` and skip `AskUserQuestion`. Otherwise call +`AskUserQuestion` (question: "Proceed with merge?", header: "Confirm", Yes/No). Abort if "No, abort". **[5/6] Merge PR**