Merge ready

From rysweet/amplihack · View interactive version

Merge ready is an AI agent skill from the GitHub repository rysweet/amplihack. Checks whether a pull request satisfies the project's merge criteria and records the required evidence in the PR description. Use with `/merge-ready` before review or merge when QA-team scenarios, docs links, quality-audit convergence, CI status, and diff scope must be verified.

How to use this skill

Skill file

Merge Ready

Use this skill as the final gate before calling a PR ready for review or merge.

This skill coordinates existing project workflows. It does not replace:

Use pr-description-template.md to update the PR description with the required evidence.

Required outcome

A PR is merge-ready only when all of the following are true:

  1. qa-team scenarios were written or updated, validated with gadugi-test validate, and actually run with gadugi-test run.
  2. User-facing docs were updated when the change affects APIs, configuration, deployment, CLI behavior, or other external surfaces.
  3. quality-audit completed at least 3 SEEK → VALIDATE → FIX cycles, continued past 3 if critical or high findings remained, and ended on a clean final cycle.
  4. All GitHub Actions checks are green with 0 failures.
  5. The PR description contains concrete evidence for criteria 1–4 and 6.
  6. The diff contains no unrelated changes.

If any criterion is missing, the PR is not merge-ready.

Non-negotiable guardrails

Workflow

1. Establish PR context

Identify the target PR from $ARGUMENTS if provided; otherwise use the current branch's PR.

Gather:

Useful commands:

gh pr view "$PR" --json number,url,title,body
gh pr diff "$PR" --name-only
gh pr checks "$PR"
git diff --name-only origin/main...HEAD

If no PR exists yet, you may still prepare evidence, but the final verdict must remain blocked until the PR exists and CI status is available.

2. Satisfy the QA criterion with `qa-team`

Invoke qa-team and ensure it covers the changed behavior from an external user perspective.

Required deliverables:

Minimum commands:

gadugi-test validate path/to/scenario.yaml
gadugi-test run path/to/scenario.yaml

If the environment needed to run the scenario does not exist, stop and report a blocker. Do not downgrade this to "definition only".

3. Satisfy the docs criterion

Inspect the changed files and decide whether the PR changes any user-facing surface:

If yes, update the corresponding docs and add links to those docs in the PR description.

If no, list the changed surfaces you checked and explain why each is internal-only. For example: "Changed surfaces reviewed: rust_runner.py, smart-orchestrator.yaml — both are internal orchestration plumbing with no CLI/API/config impact."

4. Satisfy the quality-audit criterion

Invoke quality-audit and require the full iterative loop:

Every fix uncovered during this audit must follow default-workflow. If the audit finds issues that require code or docs changes, switch to default-workflow for those fixes, complete the work, then return to this skill and resume verification.

Capture in the PR description:

5. Satisfy the CI criterion

Check all GitHub Actions status for the PR.

Rules:

Useful commands:

gh pr checks "$PR"
gh run list --branch "$(git branch --show-current)"

If CI is pending, red, cancelled, or unavailable, the PR is not merge-ready.

6. Enforce scope

Review the diff and confirm the PR is focused on the intended change. If unrelated changes are present, report them as blockers and do not mark the PR ready.

7. Update the PR description

This step must not be performed until steps 2–6 have all completed and evidence has been collected. Do not update the PR description with placeholder or anticipated evidence.

Use pr-description-template.md and replace every placeholder with actual evidence. Keep the wording concise, but make the evidence concrete enough that a reviewer can verify the work without guessing.

If the PR description already has useful sections, merge the evidence into the existing structure instead of duplicating headings.

8. Return a binary verdict

End with one of these outcomes:

Use this format:

Verdict: MERGE_READY | NOT_MERGE_READY

Criteria:

- QA-team: pass | fail
- Docs: pass | fail | not-applicable
- Quality-audit: pass | fail
- CI: pass | fail
- Scope: pass | fail
- PR description evidence: pass | fail

Blockers:

- <concrete missing item or `none`>

When to stop and hand back a blocker

Stop and report NOT_MERGE_READY when any of these are true:

Do not substitute promises or TODOs for evidence.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.