Skip to content

feat: add project:search command and drupalorg-issue-search skill#318

Merged
mglaman merged 4 commits intomglaman:mainfrom
andyg5000:main
Mar 13, 2026
Merged

feat: add project:search command and drupalorg-issue-search skill#318
mglaman merged 4 commits intomglaman:mainfrom
andyg5000:main

Conversation

@andyg5000
Copy link
Contributor

New command: project:search (ps) — searches a project's issues by title keyword with --status filtering (all/open/closed/rtbc/review, defaults to all)

New skill: /drupalorg-issue-search — combines three search channels:

  1. API search — project:search CLI command
  2. Drupal.org issue queue scrape — fetches drupal.org/project/issues/?text=...&status=All directly
  3. Web search — general web search scoped to drupal.org

Supports --skip=api,drupal,web to selectively disable channels, --project and --status flags.

Other changes: MCP tool registration, CLAUDE.md updates, skill install support.

Add a new `project:search` (alias `ps`) command that searches a project's
issues by title keyword, with status filtering and all output formats.
Includes the Action class, CLI command, MCP tool registration, and a new
`/drupalorg-issue-search` skill that combines API search, Drupal.org
issue queue scraping, and web search for comprehensive results.

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

Here's an example of this working for a commerce stripe issue I'm familiar with. I've realized we probably want to add more filters for branch, component, etc... Let' me know your feels on the overall approach, including if you think we'd be spamming d.o with the web scrape flag and I'll update the MR.

❯ /drupalorg-issue-search commerce_stripe MOTO payment

● Query: MOTO payment, project: commerce_stripe. Running all three channels in parallel.

● Bash(php /var/www/drupalorg-cli/drupalorg project:search commerce_stripe "MOTO payment" --status=all --format=json 2>&1 | head -100)
  ⎿  {
         "project_title": "Commerce Stripe",
         "issues": []
     }
  ⎿  (timeout 30s)

● Fetch(https://www.drupal.org/project/issues/commerce_stripe?text=MOTO+payment&status=All)
  ⎿  Received 42.8KB (200 OK)

● Web Search("MOTO payment site:https://www.drupal.org/project/issues/commerce_stripe")
  ⎿  Did 1 search in 3s

● The Drupal.org scrape found the most relevant results. Let me fetch details on the key issues.

● Bash(php /var/www/drupalorg-cli/drupalorg issue:show 3222298 --format=llm 2>&1 | head -40)
  ⎿  <drupal_context>
       <issue_id>3222298</issue_id>
       <title>Allow administrators to add payment methods &amp; take payments</title>
     … +26 lines (ctrl+o to expand)

● Bash(php /var/www/drupalorg-cli/drupalorg issue:show 3506788 --format=llm 2>&1 | head -40)
  ⎿  <drupal_context>
       <issue_id>3506788</issue_id>
       <title>Allow administrators to be able to enter payment on orders via the Payment Element</title>
     … +12 lines (ctrl+o to expand)

● Bash(php /var/www/drupalorg-cli/drupalorg issue:show 3406817 --format=llm 2>&1 | head -40)
  ⎿  <drupal_context>
       <issue_id>3406817</issue_id>
       <title>Create add-payment-method for Stripe Payment Element</title>
     … +24 lines (ctrl+o to expand)

● Search Results: commerce_stripe "MOTO payment"

  API Search

  No results (issue titles don't contain "MOTO payment" in the recent window).

  Drupal.org Issue Queue Scrape

  ┌─────────┬────────────────────────────────────────────────────────────────────────────────────┬───────────────────┬─────────────────────────────────────┐
  │   NID   │                                       Title                                        │      Status       │                Link                 │
  ├─────────┼────────────────────────────────────────────────────────────────────────────────────┼───────────────────┼─────────────────────────────────────┤
  │ 3506788 │ Allow administrators to be able to enter payment on orders via the Payment Element │ Active            │ https://www.drupal.org/node/3506788 │
  ├─────────┼────────────────────────────────────────────────────────────────────────────────────┼───────────────────┼─────────────────────────────────────┤
  │ 3222298 │ Allow administrators to add payment methods & take payments                        │ Needs Review      │ https://www.drupal.org/node/3222298 │
  ├─────────┼────────────────────────────────────────────────────────────────────────────────────┼───────────────────┼─────────────────────────────────────┤
  │ 3406817 │ Create add-payment-method for Stripe Payment Element                               │ Closed (outdated) │ https://www.drupal.org/node/3406817 │
  └─────────┴────────────────────────────────────────────────────────────────────────────────────┴───────────────────┴─────────────────────────────────────┘

  Web Search

  No additional unique issues found.

  Most relevant: https://www.drupal.org/node/3506788 — explicitly scoped to adding Payment Element support to the order management UI, noting it "whether or not that requires
  additional MOTO integration parameters." https://www.drupal.org/node/3222298 is the older 1.x version of the same feature request.

  Sources:
  - https://www.drupal.org/project/commerce_stripe/issues/3506788
  - https://www.drupal.org/project/commerce_stripe/issues/3222298
  - https://www.drupal.org/project/commerce_stripe/issues/3406817

Copy link
Owner

@mglaman mglaman left a comment

Choose a reason for hiding this comment

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

Some projects are migrating to Gitlab issues. I don't think there's anyway to detect that. Can be a follow up for support, but that would fix searching.

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

Adds a project:search command for searching Drupal.org project issues by title keyword, with corresponding MCP tool registration and a new drupalorg-issue-search agent skill that combines API, scrape, and web search channels.

Changes:

  • New SearchProjectIssuesAction that queries the Drupal.org API and filters results client-side by title substring match
  • New ProjectSearch CLI command with --status, --limit, and --format options, plus MCP tool project_search_issues
  • New drupalorg-issue-search skill and documentation updates in CLAUDE.md and SKILL.md

Reviewed changes

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

Show a summary per file
File Description
src/Api/Action/Project/SearchProjectIssuesAction.php New action: fetches issues from API and filters by query client-side
src/Cli/Command/Project/ProjectSearch.php New CLI command project:search with status/limit/format options
src/Cli/Application.php Registers the new ProjectSearch command
src/Api/Mcp/ToolRegistry.php Adds project_search_issues MCP tool
skills/drupalorg-issue-search/SKILL.md New agent skill for multi-channel issue search
skills/drupalorg-cli/SKILL.md Documents the new project:search command
CLAUDE.md Adds skill and command references

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

}

$status = (string) $this->stdIn->getOption('status');
$statuses = self::STATUS_MAP[$status] ?? self::STATUS_MAP['open'];
Comment on lines +30 to +46
'limit' => $limit * 3,
];
if ($statuses !== []) {
$params['field_issue_status[value]'] = $statuses;
}
$rawIssues = $this->client->requestRaw(new Request('node.json', $params));
$issueList = (array) ($rawIssues->list ?? []);
$issues = array_map(
static fn(\stdClass $issue) => IssueNode::fromStdClass($issue),
$issueList
);

$issues = array_filter(
$issues,
static fn(IssueNode $issue) => stripos($issue->title, $query) !== false
);
$issues = array_slice(array_values($issues), 0, $limit);
@mglaman mglaman merged commit 49fc92f into mglaman:main Mar 13, 2026
9 checks passed
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.

3 participants