skills/cli-builder/SKILL.md
Build a production-quality CLI tool for any module or application. Auto-detects language, recommends CLI libraries, and follows a 5-step approval-gated workflow: Analyze, Design, Plan, Execute, Summarize. Don't use for building GUI/TUI apps, web APIs, or authoring one-off shell scripts.
npx skillsauth add luongnv89/skills cli-builderInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build production-quality CLI tools for any module or application, in any language.
Reference files (read on demand, not upfront):
references/cli-libraries.md — read during Step 2 (Design) to recommend libraries and during Step 4 (Execute) for starter scaffoldsreferences/testing-patterns.md — read during Step 4 (Execute) when writing testsBefore creating/updating/deleting files in an existing repository, sync the current branch with remote:
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin
git pull --rebase origin "$branch"
If the working tree is not clean, stash first, sync, then restore:
git stash push -u -m "pre-sync"
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin && git pull --rebase origin "$branch"
git stash pop
If origin is missing, pull is unavailable, or rebase/stash conflicts occur, stop and ask the user before continuing.
Before changing any file, check the current branch. Only create a new branch if on main or master — otherwise continue on the existing branch (the user likely set it up already or is resuming work):
current_branch="$(git rev-parse --abbrev-ref HEAD)"
if [ "$current_branch" = "main" ] || [ "$current_branch" = "master" ]; then
slug="$(echo "${CLI_NAME:-cli}" | tr '[:upper:] ' '[:lower:]-' | tr -cd 'a-z0-9-')"
ts="$(date +%Y%m%d-%H%M%S)"
git checkout -b "feat/cli-${slug}-${ts}"
fi
Understand the project before proposing anything.
Auto-detect language by checking for manifest files:
package.json / tsconfig.json -> JavaScript/TypeScriptpyproject.toml / setup.py / setup.cfg / requirements.txt -> Pythongo.mod -> GoCargo.toml -> Rustpom.xml / build.gradle / build.gradle.kts -> Java/KotlinGemfile / *.gemspec -> RubyIdentify existing CLI/entry points: check for bin fields, __main__.py, main.go, fn main(), existing arg parsing code, or scripts in package.json.
Understand module structure: public API, core functions, data types, dependencies.
Ask clarifying questions (only what cannot be inferred):
Present findings and wait for approval before proceeding.
Present a structured CLI design document:
Iterate until user approves:
No implementation before design approval.
Break implementation into three phases, each with granular tasks.
Phase 1 — Foundation (get a working CLI skeleton):
Phase 2 — Complete (full feature set):
Phase 3 — Polish (optional, confirm with user):
Each task includes:
Iterate the plan with user until approved.
No execution before plan approval.
Implement the approved plan task by task:
If tests fail, fix before moving to the next task. If a design issue is discovered during implementation, pause and discuss with user.
Deliver a final summary:
After running this skill on a Python module called mylib, the final deliverable looks like:
feat/cli-mylib-20260419-143200 branch created
Files created:
cli/main.py — entry point with argparse/click/typer wiring
cli/commands/run.py — "mylib run" subcommand
cli/commands/info.py — "mylib info" subcommand
tests/test_cli.py — CLI smoke tests (help, version, run)
pyproject.toml — updated with [project.scripts] entry point
Usage quick-start:
pip install -e .
mylib --help
mylib run --input data.csv --output results.json
mylib info --format json
Step Completion Report (Steps 4-5):
◆ Execute + Summarize (step 4-5 of 5 — mylib CLI)
··································································
Implementation: √ pass (3 commands, 2 files)
Test coverage: √ pass (8/8 tests passing)
Phase demos completed: √ pass (help, version, run verified)
Summary delivered: √ pass
Criteria: √ 4/4 met
____________________________
Result: PASS
--help works at every command level and --version is implementedNO_COLOR env var or --no-color flag is respectedAfter completing each major step, output a status report in this format:
◆ [Step Name] ([step N of M] — [context])
··································································
[Check 1]: √ pass
[Check 2]: √ pass (note if relevant)
[Check 3]: × fail — [reason]
[Check 4]: √ pass
[Criteria]: √ N/M met
____________________________
Result: PASS | FAIL | PARTIAL
Adapt the check names to match what the step actually validates. Use √ for pass, × for fail, and — to add brief context. The "Criteria" line summarizes how many acceptance criteria were met. The "Result" line gives the overall verdict.
Phase: Analyze (Step 1) — checks: Project analysis, Language detected, Entry points identified, Clarifying questions asked
Phase: Design (Step 2) — checks: Design approval, Command tree defined, I/O behavior specified, Example invocations provided
Phase: Plan (Step 3) — checks: Plan approval, Phases broken down, Tasks have goals and tests, Effort estimated
Phase: Execute + Summarize (Steps 4–5) — checks: Implementation, Test coverage, Phase demos completed, Summary delivered
| Situation | Action | |-----------|--------| | No clear module to wrap | Ask user what functionality the CLI should expose | | Multiple languages detected | Ask user which language to use, recommend the one with more CLI code | | Existing CLI found | Offer to extend/refactor rather than rebuild; audit existing CLI first | | Unknown framework requested | Research the framework, ask user for docs link if needed | | Tests fail after implementation | Fix before proceeding; never skip broken tests |
Every CLI built with this skill must include:
--help works at every level)--long-flag, -s short flag, -- to end optionsNO_COLOR env var or --no-color flag--version prints version and exitsdocumentation
Manage software releases end-to-end: bump version, generate changelog, tag, push, GitHub release, publish to PyPI/npm. Use when user asks to ship, cut a release, tag a version, or list changes since last tag. Skip routine commits and marketplace publishing.
development
Review UI for usability issues using Steve Krug's principles and produce a scannable report. Use when asked for a usability audit, UX review, or UI feedback on screenshots, URLs, or code. Don't use for visual/brand design critique, accessibility (WCAG) audits, or backend/API review.
development
Validate app/startup ideas with market, feasibility, commercial, and open-source competitor analysis. Use when asked to evaluate, validate, or score a product idea. Don't use for PRDs, go-to-market plans, or investor decks.
testing
Install local-first security hardening: pre-commit secret detection, offline dependency scans, static analysis, reports, and gated free CI. Use when hardening repos or adding security hooks. Don't use for incident response or cloud security reviews.