name: merging-and-deploying description: "Use when a PR has passed review and is ready to merge, deploy, and run post-deploy regression AT."
Merging and Deploying
Step 6 of the atdd-kit v1.0 flow — the flow terminus. Take an Issue whose deliverables passed Step 5 review, then run the ordered ship sequence: merge → deploy → post-deploy regression. The post-deploy regression re-runs the Acceptance Tests under tests/acceptance/ against the deployed build, so production is verified against the same green tests that drove the implementation.
Scope starts at a PASS verdict. Producing or fixing deliverables is owned by the earlier steps; this skill assumes review already passed and does not re-open implementation.
Trigger
- Explicit:
/atdd-kit:merging-and-deploying <issue-number> - Keyword-detected (confirm before invoking): When user messages mention merge / deploy / ship intent (e.g. "マージ", "deploy", "リリース"), confirm before starting via AskUserQuestion (header
Merge?; first option(Recommended) マージfor one-tap go, then保留(レビュー継続);multiSelect: false):
This replaces the previousRecommended: マージ — reply 'ok' to accept, or 保留 to hold for more reviewY/ntext confirm — it changes only how the existing confirm is offered, not the Flow (precondition check → squash-merge is unchanged); no new in-skill gate is added. TheOtheroption is harness-auto — never list it manually; anOtherfree-text comment flows into the existing natural-language route unchanged. On non-selection-UI channels (headless / cron), theRecommended: ... — reply 'ok'line is the fallback. Auto-invocation without confirmation is forbidden by the v1.0 Step B progression rule (#179).
Input
- Issue number (command-line argument or recognized in a user message)
- A PR for the Issue with a PASS verdict from
reviewing-deliverables(Step 5) and green CI. - The executable Acceptance Tests under
tests/acceptance/(the regression set).
If the review verdict is not PASS, instruct the user to return to reviewing-deliverables (or running-atdd-cycle to fix findings) and stop.
Output
| Artifact | Form |
|---|---|
| Merged PR | squash-merged to main, Issue closed via Closes #<NNN> |
| Deployed build | the platform deploy for the merged change |
| Post-deploy regression result | the tests/acceptance/ suite re-run against the deployed build |
Output language: Japanese (fixed). The merge / deploy / regression report is written in Japanese; commit and PR metadata follow the repository's commit conventions.
Flow
- Precondition check. Confirm the PR carries a PASS verdict from
reviewing-deliverablesand CI is green. Do not merge otherwise. - Merge. Squash-merge the PR to
main, closing the Issue (Closes #<NNN>). - Deploy. Deploy the merged change via the project's configured deploy path (platform-specific; see
.claude/config.yml). - Post-deploy regression. Re-run the Acceptance Tests in
tests/acceptance/against the deployed build as a regression check. These are the[regression]-marked ATs stabilized at Step 4. If any fails, report it immediately and treat the deploy as suspect. - Report + Retrospective. Summarize merge SHA, deploy result, and the post-deploy regression outcome in one message. Output the same content to both the terminal and as an Issue/PR comment (all-channel sync: terminal + Issue/PR comment). Then run
scripts/retrospective.sh --issue <NNN> --pr <PR>— this is the sole entry point for retrospective execution. The express skill does not callmerging-and-deploying, so express Issues skip retrospective structurally — noif non-expressbranch is needed (express skip is structural, not a flag).
Responsibility Boundary
| Concern | Owner |
|---|---|
| Merge + deploy + post-deploy AT regression | merging-and-deploying (this skill) |
| PRD / US / Plan / Code / AT review verdict | reviewing-deliverables (Step 5, #192) |
| Plan + AT spec → green AT + production code | running-atdd-cycle (Step 4, #191) |
Parallel-session conflict, in-progress label management |
skill-gate (#197) |
This skill does not add or remove the in-progress label — that is skill-gate's responsibility. This skill does not write or fix code — a failing post-deploy regression is reported back to Step 4, not patched here.
Test Execution Policy (#324 / #323)
Pre-merge gate: full BATS suite + impact-selected skill-e2e — run all BATS tests (incl. tests/acceptance/, #356) plus the e2e for the skills this branch touched, before merging:
scripts/run-tests.sh --all # pre-merge gate: full BATS suite incl. acceptance/ (mandatory, fail-safe)
scripts/run-skill-e2e.sh --changed-files "$(git diff --name-only origin/main...HEAD | paste -sd, -)" # impact-selected skill-e2e
The full BATS suite (--all) is mandatory and must exit 0. The skill-e2e step runs tests/e2e/*.bats (real claude -p) only for skills affected by this branch's diff, via run-skill-e2e.sh's built-in path-based impact mapping — never the full e2e set. When claude auth is absent locally (e2e cannot run), skip the skill-e2e step with an explicit logged note and proceed on the BATS suite alone; the mandatory --all run is never skipped.
Post-deploy regression: impact scope — after deploy, re-run the Acceptance Tests using impact scope against the deployed commit:
scripts/run-tests.sh --impact --base <merge-sha> # post-deploy regression (impact scope)
The asymmetry is by design: the merge gate runs the full BATS suite (--all, incl. tests/acceptance/ — the fail-safe guarantee, #356) plus impact-selected skill-e2e (run-skill-e2e.sh --changed-files, not the full e2e set); post-deploy regression uses --impact --base <ref> (targeted verification of what was deployed). e2e never runs blindly at full scale — both at merge gate and post-deploy it follows the impact criterion.
For the full policy doctrine, see docs/methodology/test-execution-policy.md.
Integration
- Upstream:
reviewing-deliverables(merges only on its PASS verdict) - Downstream: — (flow terminus; the next Issue restarts at
session-start→defining-requirements)