Skip to content

feat: list available skills when skill:get is run without a name - #371

Open
mglaman wants to merge 1 commit into
mainfrom
skill-get-lists-skills
Open

feat: list available skills when skill:get is run without a name#371
mglaman wants to merge 1 commit into
mainfrom
skill-get-lists-skills

Conversation

@mglaman

@mglaman mglaman commented Aug 28, 2026

Copy link
Copy Markdown
Owner

What changed

  • skill:get now takes name as an optional argument. With no name it lists every skill bundled in skill-data/, showing the name and description from each SKILL.md frontmatter.
  • New --format option on skill:get (text|json|md|llm, default text) for the list output. Text is a two-column table plus a Run: drupalorg skill:get <name> hint; llm output is wrapped in <skills> tags.
  • Added ListSkillsAction and SkillListResult/SkillItem following the Action/Result/Command layering. The Action parses frontmatter by hand (plain key: value and folded key: > scalars) so the phar needs no YAML dependency. Skill paths are resolved with realpath() and fall back to the raw path inside a phar.
  • Registered SkillListResult in AbstractFormatter::format() with a new abstract formatSkillList(), implemented in MarkdownFormatter and LlmFormatter.
  • The "Skill not found" hint now reuses the Action instead of a private directory scan in the command.
  • Documented the no-argument form in README.md, skill-data/drupalorg-cli/SKILL.md, and the skills/drupalorg-cli/SKILL.md discovery stub.

skill:get <name> and --full behave exactly as before.

Why

Closes #344. drupalorg skill:get with no argument failed with Not enough arguments (missing: "name"), leaving users and agents with no way to discover which skills the installed CLI ships.

Testing

vendor/bin/phpcs src tests
vendor/bin/phpstan analyse src   # [OK] No errors
vendor/bin/phpunit               # OK (181 tests, 601 assertions)

New tests: tests/src/Action/Skill/ListSkillsActionTest.php (reads the real skill-data/), CommandTester cases in tests/src/Command/Skill/GetTest.php for the no-argument, json, llm, named, and unknown-name paths, and formatter cases for SkillListResult.

$ php drupalorg skill:get
+--------------------------------+---------------------------------------------------------------------------------+
| Skill                          | Description                                                                     |
+--------------------------------+---------------------------------------------------------------------------------+
| drupalorg-cli                  | CLI for Drupal.org issue lifecycle management. Use when fetching issue details, |
|                                | generating patches/interdiffs, listing project or maintainer issues, looking up |
...
| drupalorg-work-on-issue        | Agentic workflow for contributing to a Drupal.org issue via GitLab MR.          |
+--------------------------------+---------------------------------------------------------------------------------+

Run: drupalorg skill:get <name>

$ php drupalorg skill:get --format=llm
<skills>
  <usage>drupalorg skill:get &lt;name&gt;</usage>
  <items>
    <skill>
      <name>drupalorg-cli</name>
      <description>CLI for Drupal.org issue lifecycle management. ...</description>
    </skill>
...
</skills>

$ php drupalorg skill:get drupalorg-cli | head -3
---
name: drupalorg-cli
description: >

🤖 Generated with Claude Code

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>
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.

drupalorg skill:get should return a list of all available skills when none is specified

1 participant