Phase 1 of the 2-phase issue-close split. Runs INSIDE the linked worktree BEFORE the PR is merged. Sub-issue gate, pending sentinel, sentinel promote, parent body update.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Issue Close Stage?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nirecom-issue-close-stage)
---
name: issue-close-stage
description: Phase 1 of the 2-phase issue-close split. Runs INSIDE the linked worktree BEFORE the PR is merged. Sub-issue gate, pending sentinel, sentinel promote, parent body update.
user-invocable: false
---
Triage routes to the correct subset of in-skill steps; each is idempotent and resumable.
Read `rules/github-issues.md` first — on-demand-only, never auto-injected; its "Session model" defines the per-session N relation.
Read `rules/coding.md` before the first `gh issue comment` or body update — on-demand-only, never auto-injected; its Public GitHub Rules govern that outbound text.
Usage: `/issue-close-stage <N>` or `/issue-close-stage --from-session`
`--from-session` resolves `<N>` from the current session's intent.md the same
way as `/issue-close-finalize`: parse `## Issues` and iterate.
(canonical parser: `hooks/lib/parse-closes-issues.js` — do not reimplement.)
## Pre-flight
Run: `bash "$AGENTS_MAIN_ROOT/bin/detect-non-github.sh" "issue-close-stage" || exit 0`
On non-GitHub remote the script exits 1, so `|| exit 0` terminates the skill immediately (no gh work). On a GitHub remote (or unknown/fail-open) the script exits 0 and the skill continues into the checks below.
Skip message on non-GitHub remote (emitted by the script to stdout): `[GITHUB_ISSUES disabled: non-GitHub remote detected, skipping issue-close-stage]`
- `AGENTS_MAIN_ROOT` must be set.
- Must be invoked from a **linked worktree** (not the main worktree). Abort
with an error when `git rev-parse --git-dir` equals `git rev-parse --git-common-dir`.
- Resolve `<owner/repo>` via
`gh repo view --json owner,name --jq '.owner.login + "/" + .name'`.
- All `gh issue comment` invocations need `ISSUE_CLOSE_SKILL=1` to bypass the
`enforce-issue-close.js` hook.
## Delegation
Dispatch in-skill steps A, B, D, F, G to the `issue-close-stage` worker per `skills/_shared/worker-dispatch.md`.
Payload keys: `issue_number` (= N), `worktree_path` (= `git rev-parse --show-toplevel`), `owner_repo`, `script_checkout_root` (= `AGENTS_MAIN_ROOT`), `artifact_dir` (= `PLANS_DIR`), `issue_repo`.
Omit `issue_repo` for current-repo issues; otherwise take it from the `closes_issues` entry's `repo` field.
Cross-repo Phase 1 is unsupported: an `issue_repo` naming any repo other than `owner_repo` is refused with `error`. Run `/issue-close-stage` from a worktree of that repository instead.
On `phase1_done` status: continue to End.
On `blocked_sub_issue` status: surface summary to user and stop.
On `error` or `failed` status: surface summary + artifact_path to user and stop.
## End
Report: Phase 1 complete for #<N>. Reminder: run `/commit-push`, then after
the PR is merged run `/issue-close-finalize --from-session`.
## Safety notes
- **Untrusted content**: never `eval` issue body, title, or comments.
- **Sentinel body**: hardcoded literal — never interpolate variables or add
metadata. The Phase 1 marker is shared with `check-phase1-complete.sh` and
`find-pr-by-marker.sh`; changing the body silently breaks both.
## Rules
- Report observations via /supervisor-report (trigger conditions: rules/supervisor-reporting.md).