feat: list available skills when skill:get is run without a name - #371
Open
mglaman wants to merge 1 commit into
Open
feat: list available skills when skill:get is run without a name#371mglaman wants to merge 1 commit into
mglaman wants to merge 1 commit into
Conversation
Running `skill:get` with no argument used to fail with a missing-argument error. It now lists every bundled skill with the description from its SKILL.md frontmatter, in text, json, md, or llm format, through a new ListSkillsAction and SkillListResult. The named form and --full are unchanged. Closes #344 Co-Authored-By: Claude Fable 5 <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.
What changed
skill:getnow takesnameas an optional argument. With no name it lists every skill bundled inskill-data/, showing thenameanddescriptionfrom eachSKILL.mdfrontmatter.--formatoption onskill:get(text|json|md|llm, defaulttext) for the list output. Text is a two-column table plus aRun: drupalorg skill:get <name>hint; llm output is wrapped in<skills>tags.ListSkillsActionandSkillListResult/SkillItemfollowing the Action/Result/Command layering. The Action parses frontmatter by hand (plainkey: valueand foldedkey: >scalars) so the phar needs no YAML dependency. Skill paths are resolved withrealpath()and fall back to the raw path inside a phar.SkillListResultinAbstractFormatter::format()with a new abstractformatSkillList(), implemented inMarkdownFormatterandLlmFormatter.README.md,skill-data/drupalorg-cli/SKILL.md, and theskills/drupalorg-cli/SKILL.mddiscovery stub.skill:get <name>and--fullbehave exactly as before.Why
Closes #344.
drupalorg skill:getwith no argument failed withNot enough arguments (missing: "name"), leaving users and agents with no way to discover which skills the installed CLI ships.Testing
New tests:
tests/src/Action/Skill/ListSkillsActionTest.php(reads the realskill-data/),CommandTestercases intests/src/Command/Skill/GetTest.phpfor the no-argument, json, llm, named, and unknown-name paths, and formatter cases forSkillListResult.🤖 Generated with Claude Code