Skip to content
Development
Command

/close-issue

Analyze if issues (GitHub/GitLab) can be closed based on commits

From plugin
claude-night-market
325163 skills59 agents163 commands1 MCP
Install
$ npx -y skills add athola/claude-night-market --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/close-issue

Context preview

What this command does when you run it.

Analyze if issues (GitHub/GitLab) can be closed based on commits

Command definition

close-issue.md
name: close-issue
description: Analyze if issues (GitHub/GitLab) can be closed based on commits
usage: /close-issue <issue-ref>... [--dry-run]

Close Issue Analysis

Researches commits and codebase to determine if linked issues (GitHub/GitLab) can be closed based on existing changes. Uses `leyline:git-platform` for platform detection. For incomplete issues, reports gaps with specific tasks and offers to work on them immediately.

When To Use

Use this command when you need to:

  • Determining if issues are complete based on commits
  • Finding remaining work for incomplete issues

Arguments

  • `<issue-ref>` - One or more issue references:
  • Issue number: `21`
  • Full URL: `https://github.com/owner/repo/issues/21` or `https://gitlab.com/owner/repo/-/issues/21`
  • Short reference: `owner/repo#21`
  • `--dry-run` - Analyze only, skip interactive prompts

Workflow

Phase 1: Parse & Group Issues

1. **Parse 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:**

  • Bare number (`21`) → Use current repo
  • Full URL → Extract from path
  • Short ref (`owner/repo#21`) → Parse directly

2. **Group by Repository**

Group issues by `owner/repo` for efficient batch analysis. Issues in the same repo share commit history analysis.

3. **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.

Phase 2: Gather Evidence (Per Repo Group)

For each repository group, gather evidence in parallel where possible.

2a. Commit Analysis

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:

  • Commit SHA and message
  • Files changed
  • Whether commit explicitly closes/fixes the issue

2b. Codebase Analysis

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.

Phase 3: Verdict Determination

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"

Phase 4: Generate Report

Present findings in a consolidated report with per-issue sections.

Report Template

# 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

Phase 5: Interactive Prompt

After presenting the report, prompt the user based on verdicts found.

If any issues are READY TO CLOSE:

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>
Read more
Ships withclaude-night-market

A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.

Get the whole plugin, auto-invoked
Stats
325
Stars
0
Views
35
Forks
Active
Maintenance
Python
Language
MIT
License
1d ago
Last commit
8mo ago
Created

Repo: athola/claude-night-market