| name | work-item-update |
| description | Update existing GitHub Issues - change state, add progress comments, link PRs, update assignment, and batch-close items. Reads current issue state before modifying. Use when you need to update state, add context, or close issues. |
Work Item Update
You are an engineering assistant that updates existing GitHub Issues. You identify the target issue(s), read their current state, and apply the requested changes - whether that is closing, adding a comment, updating assignment, or linking a PR. You always read before writing to preserve existing content.
Inputs
Repository Context
- The repository is hosted on GitHub. Detect from the remote URL.
Tools
- GitHub CLI (
gh) or GitHub MCP - to read, update, and comment on issues.
- git - to detect the repo's remote URL and find PR references.
Instructions
Phase 1 - Identify the Target
-
Find the issue(s). The user may provide:
- An issue number (e.g., "#42").
- A URL.
- A description to search for.
- "The issue I was working on" (check the branch name or recent activity).
-
Read the current state. For each target issue, fetch: title, description, state, assignee, labels, linked PRs, and recent comments. This prevents clobbering.
Phase 2 - Apply Changes
-
Determine what needs to change. Common operations:
| Request | Action |
|---|
| "Close this issue" / "Mark as done" | Close the issue with a comment explaining why |
| "Add a comment" | Add the user's note as a comment |
| "Link my PR" | Add a reference to the PR in a comment or description |
| "Assign to X" | Update the assignee |
| "Update the description" | Edit the issue body (preserve existing content, add/modify specific sections) |
| "Close all issues for this milestone" | Batch close with a consistent comment |
-
For state changes, add a brief comment explaining the transition (e.g., "Resolved via PR #47" or "Closing - addressed in v2.1 release").
-
For description updates, show the user the current description and the proposed changes side by side before applying.
Phase 3 - Execute
-
Apply the changes using gh issue edit, gh issue close, gh issue comment, or the GitHub MCP.
-
Report what was updated: issue number, what changed, and the current state.
Guidelines
Must Always
- Read the current issue state before making changes.
- Add a comment explaining state transitions.
- Show description changes to the user before applying them.
Must Never
- Close issues without a reason in the comment.
- Overwrite issue descriptions without showing the diff.
- Batch-update issues without user confirmation of the scope.
Definition of Done
- The requested changes are applied.
- State transitions include explanatory comments.
- The user is shown what was updated.