Close / Resolve Procedure
Full Step 9 workflow. Trigger: $0 is close or resolve.
Extract the operation from $0 and the argument from $1+:
$0=close:$1+ = title or#N→ verify implementation and mark COMPLETED$0=resolve:$1+ = title or#N→ mark no longer applicable (no verification required)
9a: Find Item
If $1 starts with # (e.g., close #42), treat it as an issue number:
gh issue view {issue_number} -R Jamie-BitFlight/claude_skills \
--json number,title,state,body,labels
- If the issue is not found, report and stop.
- Extract
titlefrom the issue response and use it as the working title.
Otherwise, scan .claude/backlog/ per-item files and search item titles for case-insensitive match against {title}.
- Zero matches: report "No backlog item found matching: {title}" and stop.
- Multiple matches: list all matches and ask user to pick one.
- Item already in
## Completedsection: report "Item already closed on {Completed date}" and stop.
9b: Resolve path (skip verification)
If operation is resolve:
- Use
AskUserQuestionto ask: "Why is this item no longer applicable?" (free text) - Invoke the backlog script:
uv run .claude/skills/backlog/scripts/backlog.py resolve "{title or #N}" --reason "{reason}" -R Jamie-BitFlight/claude_skills
- Report the script output to the user.
Then stop.
9c: Close path — checklist verification
If operation is close:
- Extract
**Plan**:field from the matched item. If absent:
Then stop.
Read the plan file. Count:
total_tasks— lines matching- \[ \]or- \[x\]checked_tasks— lines matching- \[x\]
If
checked_tasks < total_tasks:
Remaining: {list of unchecked task lines}
Complete all tasks before closing this item.
Then stop.
9d: Close path — typed acceptance-criteria verification
Extract
**Acceptance Criteria**:from the per-item file (.claude/backlog/{priority}-{slug}.md) or from the backlog item body. The field format is a bullet list following the header:**Acceptance Criteria**: - {criterion 1} - {criterion 2} - {criterion 3}Parse each
-line as a separate criterion.Spawn a verification agent with subagent_type="general-purpose". Prompt must include: item title, plan file path, checklist status (100%), and each criterion listed individually as "Criterion N: {text}". Instruct the agent to: read the plan file, search
git log --oneline -20, check relevant files for each criterion, and return per-criterion PASS/FAIL with file:line evidence. Required return format:If no acceptance criteria exist: warn "No Acceptance Criteria: field found — falling back to description-based verification" and spawn agent with the description as the goal instead.
Parse the agent verdict:
[PASS] running X produces Y — verified at src/main.py:42 [FAIL] file Z exists with field W — file exists but field W not found [PASS] test suite passes — confirmed via git log (commit abc123f)
Overall: FAIL (2/3 criteria met)
Collect agent verdict:
- Overall PASS (all criteria met): proceed to 9e
- Overall FAIL (any criterion failed): report gaps, do not close:
Per-criterion results: {agent findings}
Address the failing criteria before closing.
Then stop.
9e: Invoke backlog close
- Invoke the backlog script (script updates per-item file and closes GitHub issue):
uv run .claude/skills/backlog/scripts/backlog.py close "{title}" --plan "{plan file path}" --checklist-pass -R Jamie-BitFlight/claude_skills
If invoked as close #N, use #N as the selector:
uv run .claude/skills/backlog/scripts/backlog.py close "#{N}" --plan "{plan file path}" --checklist-pass -R Jamie-BitFlight/claude_skills
- Report the script output to the user.