Analyze commits and codebase to determine if GitHub issues can be closed, or report remaining work with actionable tasks
Analyzes commits and codebase to determine if GitHub issues can be closed, or report remaining work with actionable tasks
/plugin marketplace add athola/claude-night-market/plugin install minister@claude-night-marketResearches commits and codebase to determine if linked GitHub issues can be closed based on existing changes. For incomplete issues, reports gaps with specific tasks and offers to work on them immediately.
<issue-ref> - One or more issue references:
21https://github.com/owner/repo/issues/21owner/repo#21--dry-run - Analyze only, skip interactive promptsParse Issue References
For each argument, determine the format and extract (owner, repo, number):
# Get current repo context for bare numbers
gh repo view --json owner,name -q '"\(.owner.login)/\(.name)"'
Parsing Rules:
21) → Use current repoowner/repo#21) → Parse directlyGroup by Repository
Group issues by owner/repo for efficient batch analysis. Issues in the same repo share commit history analysis.
Validate Issues Exist
# For each issue
gh issue view <number> --repo <owner/repo> --json number,title,body,state,labels
If issue doesn't exist or is already closed, report and skip.
For each repository group, gather evidence in parallel where possible.
Search for commits that reference the issue:
# Search by issue number patterns
git log --all --oneline --grep="#<number>" -i
git log --all --oneline --grep="issue <number>" -i
git log --all --oneline --grep="<owner>/<repo>/issues/<number>"
git log --all --oneline --grep="closes <number>" -i
git log --all --oneline --grep="fixes <number>" -i
# For each found commit, get details
git show <sha> --stat --format="%H %s"
Record:
Use an Explore agent to search the codebase for implementations related to the issue:
Spawn an Explore agent with the following task:
Analyze issue #<number> from <owner>/<repo>:
Title: <issue_title>
Body: <issue_body>
Extract acceptance criteria from the issue body (look for checkboxes, "should", "must", numbered lists).
Search the codebase for evidence that each criterion is implemented:
- Look for related function/class names
- Search for comments referencing the issue
- Check test files for related test cases
- Examine recently modified files
Return structured findings:
{
"criteria": [
{
"description": "Track skills used together",
"status": "met|partial|missing",
"evidence": ["file:line - description", ...]
}
],
"related_files": ["path/to/file.py", ...],
"confidence": "high|medium|low"
}
For multiple repo groups, spawn Explore agents in parallel using the Task tool.
For each issue, synthesize commit and codebase evidence into a verdict:
| Verdict | Criteria |
|---|---|
| READY TO CLOSE | All acceptance criteria met with evidence |
| PARTIALLY DONE | Some criteria met, clear gaps identified |
| NOT STARTED | No commits or code evidence found |
| UNCLEAR | Issue lacks clear acceptance criteria |
Verdict Logic:
if all criteria have status "met":
verdict = "READY TO CLOSE"
elif any criteria have status "met":
verdict = "PARTIALLY DONE"
elif no evidence found:
verdict = "NOT STARTED"
else:
verdict = "UNCLEAR"
Present findings in a consolidated report with per-issue sections.
# Issue Analysis Report
## Summary
| Issue | Title | Verdict |
|-------|-------|---------|
| #21 | Enhance MCP analytics | READY TO CLOSE |
| #22 | Fix validation bug | PARTIALLY DONE |
---
## #21: Enhance MCP analytics
**Repo:** athola/skrills
**Verdict:** READY TO CLOSE
### Commits (3)
- `a1b2c3d` feat(mcp): add skill co-occurrence tracking
- `e4f5g6h` feat(mcp): implement recommend-skills tool
- `i7j8k9l` feat(mcp): add metrics endpoint
### Acceptance Criteria
| Criterion | Status | Evidence |
|-----------|--------|----------|
| Track skills used together | Met | `src/mcp/analytics.py:45-89` |
| Provide recommend-skills tool | Met | `src/mcp/tools/recommend.py` |
| Add metrics endpoint | Met | `src/mcp/api/metrics.py` |
---
## #22: Fix validation bug
**Repo:** athola/skrills
**Verdict:** PARTIALLY DONE (1/3 criteria)
### Commits (1)
- `x1y2z3a` fix: add null check for user input
### Acceptance Criteria
| Criterion | Status | Evidence |
|-----------|--------|----------|
| Validate user input | Met | `src/api/validators.py:23` |
| Add error messages | Missing | - |
| Add unit tests | Missing | - |
### Remaining Tasks
1. **Add user-friendly error messages**
- Update `src/api/validators.py` to return descriptive errors
- Follow error message patterns in `src/api/errors.py`
2. **Add unit tests for validation**
- Create tests in `tests/test_validators.py`
- Cover null, empty, and invalid format cases
After presenting the report, prompt the user based on verdicts found.
Use the AskUserQuestion tool:
Question: "Close these issues?"
Options:
- "Yes, close all ready issues (Recommended)" - Close via gh issue close
- "Review individually" - Prompt per issue
- "No, just report" - End without closing
If user chooses to close:
gh issue close <number> --repo <owner/repo> --reason completed --comment "Closed via /close-issue analysis. All acceptance criteria verified as met."
Use the AskUserQuestion tool:
Question: "Work on remaining tasks now?"
Options:
- "Yes, fix now (Recommended)" - Create TodoWrite items and begin work
- "Defer to later" - End with report only
If user chooses "fix now":
--dry-run: Skip interactive prompts, only output the reportWarning: Issue #99 not found in athola/skrills
Skipping this issue.
Info: Issue #21 is already closed (completed on 2025-12-15)
Skipping analysis.
## #21: Vague feature request
**Verdict:** UNCLEAR
The issue body doesn't contain clear acceptance criteria.
Consider updating the issue with specific requirements before analysis.
Suggested criteria based on title:
- [ ] [Inferred criterion 1]
- [ ] [Inferred criterion 2]
Error: Cannot access other-org/private-repo
validate you have read access to analyze issues from this repository.
$ /close-issue 21
# Issue Analysis Report
## #21: Add user authentication
**Verdict:** READY TO CLOSE
All 4 acceptance criteria met with commit evidence.
**Close this issue?** [y/n]
> y
Closed issue #21 with comment.
$ /close-issue 21 22 23
# Issue Analysis Report
| Issue | Verdict |
|-------|---------|
| #21 | READY TO CLOSE |
| #22 | PARTIALLY DONE |
| #23 | NOT STARTED |
[Detailed sections follow...]
**Close #21?** [y/n] > y
**Work on #22 tasks now?** [fix/defer] > fix
Creating tasks for #22...
[TodoWrite items created, work begins]
$ /close-issue 21 22 --dry-run
# Issue Analysis Report
[Full report without prompts]
| Command | Scope | Question |
|---|---|---|
/fix-pr Phase 5 | PR-centric | "What issues does this PR close?" |
/close-issue | Issue-centric | "Is this specific issue done?" |
Use /fix-pr when finishing a PR. Use /close-issue for ad-hoc issue status checks.
For multi-repo issue sets, the command spawns Explore agents in parallel:
/fix-pr - PR workflow with issue linkage (Phase 5)minister:github-initiative-pulse - Initiative status snapshotsminister:release-health-gates - Release readiness checks