Skip to content

feat: replace skill:install file copy with discovery stubs + skill:get#339

Merged
mglaman merged 4 commits into
mainfrom
feat/skill-discovery-pattern
May 19, 2026
Merged

feat: replace skill:install file copy with discovery stubs + skill:get#339
mglaman merged 4 commits into
mainfrom
feat/skill-discovery-pattern

Conversation

@mglaman
Copy link
Copy Markdown
Owner

@mglaman mglaman commented May 19, 2026

Summary

  • Closes Change skills workflow to how agent-browser works #334
  • skill:install now writes thin discovery stubs instead of copying full SKILL.md files — installed skills never go stale when the phar is updated
  • New skill:get <name> command outputs current skill content from the phar; --full appends reference files
  • Stubs preserve original name/description frontmatter (trigger matching intact) and add allowed-tools: Bash(drupalorg:*) so agents can invoke the CLI without extra permission prompts

How it works

Mirrors the agent-browser discovery pattern. The installed stub is just a redirect:

drupalorg skill:get drupalorg-cli
drupalorg skill:get drupalorg-cli --full  # includes references/

Agents fetch instructions on demand from the installed binary — always current, no re-install needed after upgrades.

Test plan

  • drupalorg skill:install — verify stubs written to .claude/skills/, no reference dirs copied
  • drupalorg skill:get drupalorg-cli — outputs full SKILL.md
  • drupalorg skill:get drupalorg-cli --full — outputs SKILL.md + reference files
  • drupalorg skill:get nonexistent — exits 1 with available skills listed
  • vendor/bin/phpstan analyse src — no errors
  • vendor/bin/phpcs src — no errors

🤖 Generated with Claude Code

…t command

Closes #334. Mirrors the pattern used by agent-browser: install once,
stay current. `skill:install` now writes a thin discovery stub that
preserves the skill's name/description (for trigger matching) and
instructs agents to run `drupalorg skill:get <name>` for the actual
content. `skill:get` reads the skill from the installed phar, so
instructions are never stale.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reference files are no longer copied; stubs redirect to skill:get.
Add skill:get smoke tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
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

Replaces the file-copying behavior of skill:install with thin "discovery stub" SKILL.md files and introduces a new skill:get command that streams the up-to-date skill content (and optional reference files) directly from the packaged phar. This mirrors the agent-browser discovery pattern so installed skills don't go stale when the CLI is upgraded.

Changes:

  • skill:install now writes a generated discovery stub (preserving original name/description frontmatter and adding allowed-tools) instead of copying SKILL.md plus references/.
  • New skill:get <name> [--full] command outputs the canonical SKILL.md from the phar, optionally appending reference markdown files.
  • Documentation (CLAUDE.md, skills/drupalorg-cli/SKILL.md) updated to describe the new commands.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Cli/Command/Skill/Install.php Replaces full-copy logic with discovery stub generator that injects allowed-tools and references skill:get.
src/Cli/Command/Skill/Get.php New command that prints SKILL.md (and optionally reference .md files) from the bundled skills directory.
src/Cli/Application.php Registers the new Skill\Get command.
skills/drupalorg-cli/SKILL.md Documents the new skill:get command alongside skill:install.
CLAUDE.md Adds skill:install and skill:get to the command reference table.

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

Comment thread src/Cli/Command/Skill/Get.php
mglaman and others added 2 commits May 19, 2026 09:32
Other skills (issue-search, issue-summary-update, work-on-issue) are
fetched on demand via `drupalorg skill:get <name>` — no stub needed.
The drupalorg-cli SKILL.md now lists all available skills so agents
know they exist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mirrors InstallTest — asserts class instantiates and name is registered.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mglaman mglaman merged commit 83c1792 into main May 19, 2026
9 checks passed
@mglaman mglaman deleted the feat/skill-discovery-pattern branch May 19, 2026 14:36
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.

Change skills workflow to how agent-browser works

2 participants