feat: replace skill:install file copy with discovery stubs + skill:get#339
Merged
Conversation
…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>
Contributor
There was a problem hiding this comment.
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:installnow writes a generated discovery stub (preserving originalname/descriptionfrontmatter and addingallowed-tools) instead of copying SKILL.md plusreferences/.- 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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
skill:installnow writes thin discovery stubs instead of copying full SKILL.md files — installed skills never go stale when the phar is updatedskill:get <name>command outputs current skill content from the phar;--fullappends reference filesname/descriptionfrontmatter (trigger matching intact) and addallowed-tools: Bash(drupalorg:*)so agents can invoke the CLI without extra permission promptsHow it works
Mirrors the agent-browser discovery pattern. The installed stub is just a redirect:
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 copieddrupalorg skill:get drupalorg-cli— outputs full SKILL.mddrupalorg skill:get drupalorg-cli --full— outputs SKILL.md + reference filesdrupalorg skill:get nonexistent— exits 1 with available skills listedvendor/bin/phpstan analyse src— no errorsvendor/bin/phpcs src— no errors🤖 Generated with Claude Code