From cli-skill-generator
Use when creating a new CLI tool documentation plugin. Guides discovery of CLI commands, grouping into skills, and generating all plugin files. Trigger on requests like 'create a plugin for <tool> CLI' or 'generate skills for <tool>'.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cli-skill-generator:generateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate a complete CLI tool documentation plugin by following these steps in order. Do not skip steps.
Generate a complete CLI tool documentation plugin by following these steps in order. Do not skip steps.
Ask the user which CLI tool to generate a plugin for. Get the exact command name (e.g., docker, kubectl, gh, aws).
Verify the tool is installed:
On Windows:
where <tool>
On macOS/Linux:
which <tool>
If the tool is NOT found: Stop immediately. Tell the user:
The
<tool>CLI is not installed or not on PATH. Please install it first, then re-run this skill.
If found: Continue. Store the tool name as TOOL_NAME for the rest of the workflow.
Capture the CLI tool version:
Run:
<TOOL_NAME> --version
If that fails or produces no parseable version, try:
<TOOL_NAME> version
Extract the semantic version string (strip any leading v, e.g., v2.27.0 becomes 2.27.0). Store this as TOOL_VERSION.
If neither command produces a parseable version, set TOOL_VERSION to "unknown" and inform the user:
Could not determine the version of
<TOOL_NAME>. The generated plugin will not include version checking.
Ask where to save the generated plugin. Suggest a default of .claude/plugins/<TOOL_NAME>-cli/ in the user's current project directory, but let them specify any path. Store the chosen path as OUTPUT_DIR.
Ask for author name. Ask the user for their name or organization to use as the plugin author. Store this as AUTHOR_NAME.
Run the tool's help to enumerate all available commands. Run help commands in parallel using parallel tool calls.
<TOOL_NAME> --help
If the tool uses subcommand groups (e.g., docker container, aws s3), also run help on each group to get the full command tree. Limit depth to 2 levels.
If the top-level help reveals more than 15 command groups:
--help).--help.--help on these.--help on Tier 1 and Tier 2 groups in parallel.All tiers are captured in the command manifest and assigned to skills — none are skipped.
After running help, produce a complete structured list of ALL discovered top-level commands/groups. This is the ground truth for the rest of the workflow. Every subsequent step must account for every entry.
Capture for each command:
Do NOT document every flag. Focus on the flags a developer would use daily.
Present the manifest to the user:
Command Manifest for <TOOL_NAME> (<count> commands/groups discovered):
Tier 1 (Core):
<command> — <description>
...
Tier 2 (Common):
<command> — <description>
...
Tier 3 (Niche):
<command> — <description>
...
For small tools (under 15 groups), tier classification is optional — list all commands directly.
Analyze the command manifest and autonomously group ALL commands into skill domains.
Scaling guidelines:
Each group should:
container-management, image-building)For large tools with Tier 3/niche groups: fold them into broader catch-all skill domains (e.g., administration-and-extensions, data-services) rather than skipping them.
Present the grouping to the user as an informational summary:
Skill grouping for <TOOL_NAME> (<N> skills covering <M> commands — 100% manifest coverage):
1. <group-name> — <brief description> (N commands)
Commands: <cmd1>, <cmd2>, ...
2. <group-name> — <brief description> (N commands)
Commands: <cmd1>, <cmd2>, ...
...
The user may suggest adjustments. Apply any feedback, then continue. Do not block on confirmation — this is informational, not a gate.
Now create the full plugin. Use the templates in references/ as your guide.
Create the following structure under OUTPUT_DIR:
<OUTPUT_DIR>/
├── .claude-plugin/
│ └── plugin.json
├── skills/
│ ├── <group-1>/
│ │ └── SKILL.md
│ ├── <group-2>/
│ │ └── SKILL.md
│ └── ... (one per group)
├── references/ # Shared reference files (if applicable)
│ ├── version-check.md # Version check instructions (if cliVersion known)
│ └── global-patterns.md # Global flags & patterns (if tool has 3+ global flags)
└── README.md
Follow the template in references/plugin-structure.md.
Set:
name: <TOOL_NAME>-cliversion: 1.0.0description: A concise description of what the plugin coversauthor: { "name": "AUTHOR_NAME" } (as an object, from Step 1)skills: "./skills/" (top-level string path, not nested under capabilities)cliVersion: TOOL_VERSION from Step 1 (omit this field entirely if TOOL_VERSION is "unknown")Generate SKILL.md files in parallel since they are independent.
For each skill group, create a SKILL.md following references/skill-template.md.
Total plugin size budget: ~16 KB target, 32 KB max across all files. For 7+ skills, aim for 100-200 lines per skill. Limit flag tables to 3 flags per command.
Key rules:
TOOL_VERSION is not "unknown", generate a shared references/version-check.md and link to it from each SKILL.md (see Step 4d)description in frontmatter must start with "Use when working with..."references/ subdirectoryTwo-tier command documentation within each skill:
This gives full coverage while keeping each skill under 300 lines even with 15+ commands.
If TOOL_VERSION is not "unknown", create OUTPUT_DIR/references/version-check.md containing the version check instructions (see references/skill-template.md for the full version check logic).
In each generated SKILL.md, instead of repeating the full version check block, include:
## Version Check
See [version-check.md](../references/version-check.md) for version verification.
If TOOL_VERSION is "unknown", skip creating the shared file and omit the section from each SKILL.md.
If the CLI tool has 3 or more global flags (flags that apply to every or most commands — e.g., --output, --query, --verbose, --subscription):
Create OUTPUT_DIR/references/global-patterns.md covering:
Reference it from each SKILL.md where relevant:
See [global-patterns.md](../references/global-patterns.md) for global flags and output formatting.
Do NOT duplicate global flags in individual skill flag tables — reference the shared file instead.
After generating all SKILL.md files, cross-reference the command manifest from Step 2 against generated content:
This step is mandatory. Do not proceed to Step 4g until 100% coverage is confirmed.
Follow the template in references/plugin-structure.md. Include:
## Overview — what the plugin provides## Installation — how to add the plugin to Claude Code## Usage — list of skills with one-line descriptionsRead back each generated file from disk (do not rely on memory). For plugins with 5+ skills, use a subagent to validate.
Required files exist:
OUTPUT_DIR/.claude-plugin/plugin.json existsOUTPUT_DIR/README.md existsplugin.json is valid:
name, version, description, author, skillsauthor is an object with a name fieldskills is a string path (e.g., "./skills/")Skills match directory:
OUTPUT_DIR/skills/, verify SKILL.md existsname and description fieldsdescription starts with "Use when working with..."README structure:
# Title)## Overview, ## Installation, and ## Usage sectionsVersion information (only if TOOL_VERSION is not "unknown"):
plugin.json contains a cliVersion field matching TOOL_VERSIONOUTPUT_DIR/references/version-check.md exists## Version Check section linking to the shared referenceGlobal patterns (only if references/global-patterns.md was created):
Command coverage:
If any check fails: Fix the issue and re-check until all validations pass.
See references/validation-checklist.md for the full checklist.
Present the user with a summary:
Plugin created: <TOOL_NAME>-cli
Location: <OUTPUT_DIR>
Author: <AUTHOR_NAME>
CLI Version: <TOOL_VERSION>
Skills: <count> skills covering <count> commands
Command coverage: 100% (<count>/<count> manifest entries)
Validation: Passed
Skills:
- <group-1>: <brief description>
- <group-2>: <brief description>
...
Shared references:
- version-check.md (if applicable)
- global-patterns.md (if applicable)
After presenting the summary:
/plugin add <OUTPUT_DIR>./<TOOL_NAME>-cli:<first-skill-name>).Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub filipmares/agent-plugins --plugin cli-skill-generator