# Gh Close Plan

> Close a GitHub plan issue with a summary. Use when the user tells you to "close the github plan issue".

- **Type:** Skill
- **Install:** `agentstack add skill-gjoranv-claude-plan-skills-gh-close-plan`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [gjoranv](https://agentstack.voostack.com/s/gjoranv)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [gjoranv](https://github.com/gjoranv)
- **Source:** https://github.com/gjoranv/claude-plan-skills/tree/main/gh-close-plan

## Install

```sh
agentstack add skill-gjoranv-claude-plan-skills-gh-close-plan
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

Never @mention other users in plan issues or comments.

Close the GitHub issue $ARGUMENTS (issue URL or `owner/repo#number`). If no argument is given, use the issue referenced earlier in this conversation. If no issue can be determined, ask the user.

**Workflow for editing issue bodies and comments:**
1. Create a unique temp directory: `mktemp -d /tmp/plan-close-XXXXX`
2. Fetch content from GitHub using `gh api` and capture the output. Use the Write tool to save it to files in the temp directory (e.g. `body.md`, `comment-COMMENTID.md`). Do NOT use shell redirects (`>`) to write files, as this triggers permission prompts.
3. Use the Read and Edit tools to modify the temp files (not shell commands like sed/awk).
4. Upload using `--input` with `jq` to properly JSON-encode the content:

- Edit issue body: `jq -Rs '{body: .}' /body.md | gh api repos/OWNER/REPO/issues/NUMBER -X PATCH --input -`
- Create comment: `jq -Rs '{body: .}' /comment.md | gh api repos/OWNER/REPO/issues/NUMBER/comments --input -`
- Edit comment: `jq -Rs '{body: .}' /comment-COMMENTID.md | gh api repos/OWNER/REPO/issues/comments/COMMENT_ID -X PATCH --input -`

Never embed content directly in shell arguments or use `-f body=@file` (it uploads the literal string, not the file contents). Always fetch the latest from GitHub before making changes. Do not rely on previously fetched copies that may be stale.

1. Read the issue and its comments to understand the full history of the work.
2. Check off completed steps (`- [x]`) based on the work done. Steps may be in a separate **Steps** comment (new format) or in the issue body (old format). Check both locations.
3. Verify that all steps are checked off. If any are incomplete, ask the user whether to proceed or leave the issue open.
4. Finalize the **PRs** comment as a table: `| PR | What | Agent session |`. PR column: `org/repo#N` as a link. What column: brief description. Agent session column: the session that added the PR. If the existing comment uses a different format (bullet list, old-style table), reformat it to this table structure.
5. **Clean up comments**: Non-structural comments fall into two categories based on their heading:
   - **`### Session:` prefix**: These are session summaries. Delete them and consolidate into a single **Session Log** comment with dated sections (`### YYYY-MM-DD`). Keep only key findings, decisions, and insights. Drop sessions with nothing noteworthy.
   - **Any other heading** (e.g. "Research:", "Considered:", "Implementation notes:", "Verification:"): These are standalone findings with lasting value. Keep them as separate comments, or merge into the Design comment if they are design decisions.
   **Never delete structural comments** (Steps, Design, Diagram, Links, Useful commands, Agent sessions, PRs). See `gh-create-plan` for the canonical list and order.
6. **Capture learnings**: Before closing, review the work for non-obvious discoveries worth persisting. If a durable-memory CLI is configured, offer its capture flow. Otherwise, ask the user "Anything worth capturing?" and propose where each belongs:
   - **Instructions file** (CLAUDE.md, AGENTS.md, or similar): conventions, gotchas, build quirks
   - **Repo docs** (`docs/` or similar): architecture insights, design rationale
   - **Memory**: cross-project patterns, user preferences

   Apply confirmed items. If the user says nothing to capture, move on.
7. Add a closing comment summarizing:
   * What was accomplished
   * Links to the final PR(s)
   * Any follow-up work or known limitations
8. Close the issue.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [gjoranv](https://github.com/gjoranv)
- **Source:** [gjoranv/claude-plan-skills](https://github.com/gjoranv/claude-plan-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-gjoranv-claude-plan-skills-gh-close-plan
- Seller: https://agentstack.voostack.com/s/gjoranv
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
