الصفحات · Claude Github PMS
gh-advance
Advance an issue to the next workflow status with evidence. Validates the gate per `workflows/default.yaml` — required `## Sections`, file paths, cooldown, kind-specific skips. Mirrors Orchestra MCP's `advance_feature`. Auto-invoke when the user says "tests pass for #N", "ready for review on #N", "advance #N", "move #N to {status}".
Move an issue forward through its lifecycle, enforcing the gate.
What it does
- Read target issue:
mcp__github__issue_read({issue_number}) - Determine current status from labels (the unique
status:*label) - Determine target status:
- If user specifies one ("move to in-testing"), use it
- Otherwise advance to the natural next status per workflow:
- in-progress → ready-for-testing (Gate 1)
- in-testing → ready-for-docs (Gate 2)
- in-docs → documented (Gate 3, auto-skipped for bug/hotfix/testcase — go straight to documented with placeholder comment)
- documented → in-review (Gate 4, requires PR)
- in-review → done (Gate 5, requires user approval)
- Look up the gate for
from → toinworkflows/default.yaml - If free transition: update via the unified setter (updates Project Status field + status:* label):
Done.bash
- Branch-policy pre-check (Gate 1 only): per
workflows/default.yaml#branching.gate1_refuses_protected_base, before validating Gate 1 evidence, check the current git branch. If it is inbranching.protected_base(default: main / master) AND the issue's kind is inbranching.pr_required_kinds, REJECT:Skip this check only if the issue body or a comment contains the literal stringtext[gh-pms: branch-exception](a one-off escape hatch — should be rare). - If gated:
a. Check cooldown: read
~/.cache/gh-pms/state.json[issue_key].last_transition_at. If < 30s ago, REJECT:Gate cooldown: last transition was {N}s ago. Wait {30-N}s and verify your evidence is real, not boilerplate.b. Build the evidence comment from the user's input. The user provides evidence either inline or as a structured payload. Format MUST be:c. Runmarkdownlib/validate-evidence.sh(via Bash tool) — passes evidence + gate spec, returns{ valid: bool, errors: [...] }d. If invalid, STOP and report each error:e. If valid:text- Post the evidence as a comment via
mcp__github__add_issue_comment - Update via unified setter (label + Project Status field):
bash
- Update
~/.cache/gh-pms/state.json[issue_key].last_transition_at = now() - Update
current_status = to - Report:
text
- Post the evidence as a comment via
- For Gate 4 (documented → in-review): must verify a PR is open with
Closes #{N}in body. Usemcp__github__list_pull_requeststo find any PR mentioning the issue number. If no PR exists, route the user to/gh-pms:gh-push #{N}which handles push + PR creation + review-request in one shot. Then run the CI check:bash- Exit 0 → Gate 4 proceeds.
- Exit 1 → REFUSE the transition. The script prints which checks are failing/pending and the override hint.
- Override: if the user passes
--ignore-checks "<reason>", skip the refusal but append a## Check overridessection to the gate evidence comment with the reason. This is for cases like "flaky linter, will fix in follow-up #123" — the audit trail is the point. Don't let it become a habit; the cooldown won't help here.
- For Gate 5 (in-review → done): this skill REJECTS direct calls. User must approve via
/gh-pms:gh-review'ssubmit_reviewstep. Return:Cannot advance to status:done directly. Use /gh-pms:gh-review to request user approval, then submit the decision.
Auto-skip logic for kinds
Per workflows/default.yaml gates[*].skip_for_kinds:
bug,hotfix,testcase→ skip Gate 3 (docs)- When skipping: insert a system comment
Gate 3 auto-skipped (kind: bug)and proceedready-for-docs → documentedin one move.
Programmatic guardrails (re-state)
- Cooldown: 30s between transitions
- WIP limit: enforced by
gh-currentnot here (advance assumes you're already current) - Evidence file-path check:
## Changesand## Checklistmust contain at least one path that exists in the repo (-prefix list, validate via Bashtest -f) - Branch-policy check (Gate 1): refuses to advance feature work that is still on the protected base branch — see step 6 above
- macOS bash 3.2 compatibility:
lib/validate-evidence.shuses bash 4+ associative arrays. On systems with only bash 3 (default on macOS), the validator errors withdeclare: -A: invalid option. Until the script is rewritten, fall back to a manual section-length + file-existence check before posting evidence; this is a known plugin issue tracked separately.
Cross-skill contract
After Gate 4 passes, the agent calls AskUserQuestion to ask: "Approve PR #X / Closes #N?" with options Approve / Needs Edits. Then runs /gh-pms:gh-review with the decision.