finish-issue

Close Drupal issue worktrees via MR, patch, WIP, or discard with cleanup.

Updated Feb 28, 2026
One-click install
npx skills add https://github.com/cosmicdreams/claude-plugins --skill finish-issue-cosmicdreams
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finish-issue
Source: https://github.com/cosmicdreams/claude-plugins/tree/main/drupal-lab/skills/finish-issue
Command: npx skills add https://github.com/cosmicdreams/claude-plugins --skill finish-issue-cosmicdreams

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents Drupal issue worktrees from lingering in an unfinished state by guiding you to make a deliberate final decision (submit as MR, submit as patch, keep as WIP, or discard) with the right cleanup steps.

Core Features & Use Cases

  • State assessment and safety checks: inspects uncommitted changes, commit differences from main, and whether DDEV is running so you finish from a known-good state.
  • Deliberate end-of-session outcomes: supports four explicit paths—MR submission, patch generation, WIP parking, or full discard—so worktrees never drift indefinitely.
  • Production-style cleanup and coordination: handles DDEV shutdown and provides user-facing commands (push/upload) while protecting agents from performing guarded git actions.

Use case example: You complete a Drupal fix in an issue worktree, run tests locally under DDEV, and now need to either create a drupal.org merge request with a ready-to-paste contribution comment or export a patch file for manual submission.

Quick Start

Run finish-issue when you’re done with issue worktree <ISSUE> and want to close it by submitting as an MR, patch, WIP, or discard while ensuring DDEV is stopped appropriately.

Frequently Asked Questions about finish-issue

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely close a Drupal issue worktree and clean up DDEV?

To safely close a Drupal issue worktree, you choose a final outcome like merge request submission, patch generation, WIP parking, or discard. The process then validates your git state against main and handles DDEV stop/delete and worktree removal.

What is the best way to generate a patch for manual upload to drupal.org?

Generating a patch for manual upload is a supported final outcome when finishing an issue worktree. The workflow inspects uncommitted changes and commit differences to produce the patch file while providing user-facing commands for upload.

Can I create a merge request from a Drupal git worktree using DDEV?

Yes, creating a merge request is a supported final outcome. The workflow prepares the MR submission and provides a ready-to-paste contribution comment after verifying your local DDEV environment and validating the branch state against main.

How do I park uncommitted changes in a Drupal worktree as a WIP?

Parking uncommitted changes as a WIP is a deliberate end-of-session outcome that prevents Drupal issue worktrees from lingering unfinished. The workflow assesses your current state and applies the correct steps to safely preserve your work.

Does finishing an issue worktree require a running DDEV environment?

Finishing an issue worktree does not require a running DDEV environment, but the workflow checks if DDEV is running to ensure you finish from a known-good state. It then handles DDEV shutdown appropriately based on your chosen submission path.

When should I discard a Drupal issue worktree instead of submitting a patch?

You should discard a Drupal issue worktree when the work is no longer needed or you want a clean removal. The workflow validates the git state against main and safely handles DDEV stop/delete and worktree removal to prevent lingering branches.