Skip to content

[Feat]: cli skillware examples command and list --examples coverage flag #126

@rosspeili

Description

@rosspeili

Feature Description

skillware list already shows installed skills with --category, --issuer, and --skills-root. After v0.3.1, runnable scripts are documented separately in examples/README.md and docs/usage/agent_loops.md, contributors must open those files to see which skills have examples or which scripts exist.

Add CLI support in two layers (do not duplicate the full markdown index in the terminal):

1. skillware list --examples

Optional flag on the existing list command. Adds an EXAMPLES column:

  • Show a count of indexed scripts per skill (e.g. 5, 1, 0 or -).
  • Handle multi-skill scripts (e.g. ollama_skills_test.py) by counting toward each listed skill ID in examples/README.md.
  • Works with existing --category, --issuer, --skills-root filters.

Use case: quick audit of which registry skills lack runnable examples (e.g. dev_tools/issue_resolver).

2. skillware examples [skill_id]

New subcommand:

  • skillware examples — flat table of all scripts from the index (script-first view).
  • skillware examples <category/name> — scripts for one skill only (e.g. skillware examples compliance/tos_evaluator).

Columns (match the index where practical): Script, Skill ID(s), Provider, Required extra, Required env vars. Keep output compact; print a one-line pointer to examples/README.md for full notes.

Source of truth: parse examples/README.md only. Do not heuristically scan examples/*.py.

Out of scope: loader API changes; generating or validating the index in CI; replacing examples/README.md or agent_loops.md.

Rationale

skillware list answers “what skills can I load?” Examples answer “how do I run them?” — a different question, and one skill can have many scripts (compliance/tos_evaluator has five provider loops).

A count on list --examples spots coverage gaps without widening the default table. skillware examples [skill_id] gives the next step after discovery without maintaining a third manual doc. Improves contributor and agent UX; ships real terminal workflow on top of the index we already maintain (#107, #122).

Implementation Idea

  1. Add a helper (e.g. in skillware/cli.py) to parse the Runnable Scripts table in examples/README.md:
    • Resolve path relative to package/repo root (bundled install vs editable checkout).
    • Build skill_id → [script rows] and handle comma-separated Skill ID cells.
  2. cmd_list: if --examples, add EXAMPLES column with script count per skill.
  3. cmd_examples: new subcommand; optional positional skill_id filters rows.
  4. main(): register examples parser; add --examples to list parser.
  5. Tests: tests/test_cli.py with a minimal fake examples/README.md snippet and temp skill roots.
  6. Docs: update docs/usage/cli.md with both commands, flags, and sample output.

Do not add a permanent wide EXAMPLES column to default skillware list — flag only.

Acceptance criteria

  • skillware list --examples shows per-skill script count; skills with no index row show - or 0.
  • Multi-skill rows in the index count toward each listed skill ID.
  • skillware examples lists all indexed scripts.
  • skillware examples <skill_id> lists only that skill’s scripts; unknown ID exits cleanly with a helpful message.
  • Data comes from examples/README.md, not Python file parsing.
  • tests/test_cli.py covers parsing and both commands.
  • docs/usage/cli.md updated.
  • No breaking changes to skillware list default output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    core frameworkChanges to loader, env, or base classes.enhancementNew feature or requesthelp wantedExtra attention is needed
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions