Skip to content

Add /drupal-work-on-issue agentic workflow skill#297

Merged
mglaman merged 2 commits intomainfrom
feature/274-work-on-issue-skill
Feb 27, 2026
Merged

Add /drupal-work-on-issue agentic workflow skill#297
mglaman merged 2 commits intomainfrom
feature/274-work-on-issue-skill

Conversation

@mglaman
Copy link
Owner

@mglaman mglaman commented Feb 27, 2026

Closes #274

Summary

  • Adds skills/drupal-work-on-issue/SKILL.md — a new slash-command skill that Claude Code registers as /drupal-work-on-issue. It implements the "Contribution Pilot" workflow from the issue: fork verification → directory alignment → remote setup & checkout → inspect MR state → fix/push/pipeline loop.
  • Extends skill:install to deploy the new skill to .claude/skills/drupal-work-on-issue/SKILL.md alongside the existing drupalorg-cli skill.
  • Uses the drupal- prefix to avoid collisions with any /work-on-issue skill the user may have from another tool.
  • No box.json change needed — skills/ is already included as a directory.

Workflow overview

/drupal-work-on-issue <nid>
  1. Fetches issue:show + issue:get-fork and pauses for user confirmation on working directory and branch
  2. Runs issue:setup-remote + issue:checkout
  3. Fetches mr:list, mr:files, mr:diff, mr:status (+ mr:logs on failure) and pauses with a summary
  4. Enters a work loop: edit → commit → push → poll pipeline; pauses after each push

All structured reads use --format=llm as recommended by the reference guide.

Test plan

  • Run drupalorg skill:install in a project and confirm .claude/skills/drupal-work-on-issue/SKILL.md is created
  • In Claude Code, type /drupal-work-on-issue 3456789 and confirm the skill is picked up and the workflow begins
  • Run composer box-build and confirm the phar bundles the new skill file

🤖 Generated with Claude Code

Introduces a new slash-command skill that guides Claude through the
end-to-end Drupal.org contribution workflow: fork verification,
remote setup, branch checkout, MR inspection, and a fix→push→pipeline
loop. Uses the drupal- prefix to avoid collisions with other installed
skills. skill:install now deploys both skills in one pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new Claude Code agent skill /drupal-work-on-issue that implements an agentic workflow for contributing to Drupal.org issues via GitLab merge requests. The skill orchestrates the complete contribution process from fork verification through iterative code fixes and pipeline validation, acting as a "Contribution Pilot" that guides users through each step with pause points for authorization.

Changes:

  • Added new skill file skills/drupal-work-on-issue/SKILL.md defining a multi-step workflow with pause points for user confirmation
  • Extended skill:install command to deploy both the existing drupalorg-cli skill and the new drupal-work-on-issue skill

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Cli/Command/Skill/Install.php Extends the install command to deploy the new drupal-work-on-issue skill alongside drupalorg-cli
skills/drupal-work-on-issue/SKILL.md New agentic workflow skill implementing fork verification, remote setup, MR inspection, and iterative fix/push/pipeline loop
Comments suppressed due to low confidence (1)

src/Cli/Command/Skill/Install.php:106

  • The code for installing the drupal-work-on-issue skill duplicates the pattern used for installing the drupalorg-cli skill's SKILL.md file (lines 30-41). Consider extracting this into a helper method to reduce duplication and improve maintainability. For example, a method like installSkillFile(string $skillName, string $sourceDir, string $destDir): bool would make it easier to add additional skills in the future.
        // Install the standalone /drupal-work-on-issue skill.
        $woiSrcDir = __DIR__ . '/../../../../skills/drupal-work-on-issue';
        $woiDestDir = $cwd . DIRECTORY_SEPARATOR . '.claude' . DIRECTORY_SEPARATOR . 'skills' . DIRECTORY_SEPARATOR . 'drupal-work-on-issue';

        if (!is_dir($woiDestDir) && !mkdir($woiDestDir, 0755, true) && !is_dir($woiDestDir)) {
            $this->stdErr->writeln(sprintf('<error>Failed to create directory: %s</error>', $woiDestDir));
            return 1;
        }

        $woiSrc = $woiSrcDir . DIRECTORY_SEPARATOR . 'SKILL.md';
        $woiDest = $woiDestDir . DIRECTORY_SEPARATOR . 'SKILL.md';
        $woiContent = file_get_contents($woiSrc);
        if ($woiContent === false) {
            $this->stdErr->writeln(sprintf('<error>Could not read skill source: %s</error>', $woiSrc));
            return 1;
        }
        if (file_put_contents($woiDest, $woiContent) === false) {
            $this->stdErr->writeln(sprintf('<error>Failed to write skill file: %s</error>', $woiDest));
            return 1;
        }
        $this->stdOut->writeln(sprintf('<comment>Skill installed to %s</comment>', $woiDest));

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Matches the pattern established in skills/drupalorg-cli/SKILL.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mglaman mglaman merged commit 209a70d into main Feb 27, 2026
9 checks passed
@mglaman mglaman deleted the feature/274-work-on-issue-skill branch February 27, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Example Agentic Workflow: "Work on this issue"

2 participants