Agent skill

CLI Builder

by luongnv89 in luongnv89/skills

Build production-quality CLIs with language detection and a five-step approval-gated workflow.

MITAuto-check passedDevelopment

Install CLI Builder

skills CLI
$ npx skills add luongnv89/skills --skill cli-builder -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install luongnv89/skills cli-builder --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/luongnv89/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cli-builder .claude/skills/cli-builder && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cli-builder
GitHub stars
131
Token cost
~3.7k tokens
SKILL.md length
1,785 words
Files
6 (incl. references)
Skills in repo
37
Repo updated
First seen
Licence
MIT

At a glance

Build production-quality CLIs with language detection and a five-step approval-gated workflow.

  • Works in 5 steps: Analyze → Design → Plan → …
  • Wrapping an existing module
  • SKILL.md covers Repo Sync Before Edits…, Branch-First Safety Rule, Mandatory 5-Step Workflow… and Expected Output, plus 5 more sections
  • Calls git, pip and npm

What it does

CLI Builder is an agent skill from luongnv89/skills. Build production-quality CLIs with language detection and a five-step approval-gated workflow. Use when wrapping an existing module or app. Don't use for GUI/TUI apps, web APIs, or one-off shell scripts.

Its SKILL.md is about 3.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including reference files (for example `docs/README.md`, `evals/evals.json` and `references/cli-libraries.md`).

It sits in Development, covering Shell scripting. It works with Git. The repository describes itself as: Supercharge your AI agents/bots with reusable skills. The licence is MIT.

When your agent uses it

  • Wrapping an existing module
  • One-off shell scripts

Example prompts

  • “/cli-builder”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Analyze
  2. Design
  3. Plan
  4. Execute
  5. Summarize

What it can do on your machine

Read from SKILL.md and the folder at commit 8f80262. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • pip
    • npm
    • go
    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, pip and npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

CLI Builder loads about 3.7k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 54 tokens; SKILL.md has 1,785 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~54
When it runs · the whole SKILL.md, loaded when a task matches
~3.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~11k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from luongnv89/skills at commit 8f80262, republished under its MIT licence (© luongnv89). 1,785 words, ~3,671 tokens.

Download SKILL.mdSave it as .claude/skills/cli-builder/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
cli-builder
description
Build production-quality CLIs with language detection and a five-step approval-gated workflow. Use when wrapping an existing module or app. Don't use for GUI/TUI apps, web APIs, or one-off shell scripts.
license
MIT
effort
high
metadata.version
1.2.0
metadata.author
Luong NGUYEN <luongnv89@gmail.com>

CLI Builder

Build production-quality CLI tools for any module or application, in any language.

Reference files (read each one on demand, not upfront, to keep the agent's context budget small):

  • references/cli-libraries.md — read during Step 2 (Design) to recommend libraries and during Step 4 (Execute) for starter scaffolds
  • references/testing-patterns.md — read during Step 4 (Execute) when writing tests
  • references/final-report.md — read during Step 5 (Summarize) to write the final report

Repo Sync Before Edits (mandatory)

Run this section once, before Step 1, so the analysis reads the current code. If git rev-parse --git-dir fails, the directory is not a git repository: skip this section, the Branch-First Safety Rule, and the Step 4 commits, and list no git repository: no branch or commits under Uncertainty: in the final report.

In a git repository, sync the current branch with remote:

bash
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:

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

Branch-First Safety Rule

Run this rule at the start of Step 4, before the first file write, with CLI_NAME set to the tool name approved in Step 2. 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):

bash
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

Mandatory 5-Step Workflow (approval-gated)

Explicit approval is a user reply that accepts the presented item as it stands, such as "approved" or "looks good, go ahead". A question, a change request, or no reply is not approval. Steps 1-3 write no files.

Step 1: Analyze

Understand the project before proposing anything.

Auto-detect language by checking for manifest files:

  • package.json / tsconfig.json -> JavaScript/TypeScript
  • pyproject.toml / setup.py / setup.cfg / requirements.txt -> Python
  • go.mod -> Go
  • Cargo.toml -> Rust
  • pom.xml / build.gradle / build.gradle.kts -> Java/Kotlin
  • Gemfile / *.gemspec -> Ruby

Identify existing CLI/entry points: check for bin fields, __main__.py, main.go, fn main(), existing arg parsing code, or scripts in package.json.

Record the module structure: list the public functions or classes the CLI will expose, their inputs and outputs, the core data types, and runtime dependencies.

Ask clarifying questions (only what cannot be inferred):

  • Primary use case (automation, developer tool, data processing, admin)
  • Target audience (developers, ops, end users)
  • Single command or multi-command (subcommand tree)
  • Output formats needed (text, JSON, table, CSV)
  • Distribution method (pip/npm/go install, standalone binary, source)

Present the findings: detected language, entry points, the list of exposed functions, and the open questions. Wait for explicit approval before Step 2.


Step 2: Design

Present a structured CLI design document:

  • Tool name and binary/entry point name
  • Command tree (visual hierarchy for multi-command tools)
  • Arguments and options per command (name, type, required/optional, default, help text)
  • Global options (verbose, quiet, output format, config file, no-color)
  • I/O behavior (stdin support, stdout/stderr separation, piping)
  • Config strategy (CLI args > env vars > config file > defaults)
  • Example invocations (at least 3 realistic examples showing common use cases)

Approval loop:

  1. Present the design document.
  2. Ask for feedback.
  3. If the reply is not explicit approval, revise the design and return to 1.

No implementation before design approval. If the user ends the run without approving the design, stop; the final status is BLOCKED.


Step 3: Plan

Break implementation into three phases, each with granular tasks.

Phase 1 — Foundation (get a working CLI skeleton):

  • Entry point and arg parsing setup
  • One core command (the most important one)
  • Help text and version flag
  • Basic tests (help output, version, one command)

Phase 2 — Complete (full feature set):

  • All remaining commands
  • Input validation and error handling
  • Output formatting (text, JSON, table as designed)
  • Comprehensive tests

Phase 3 — Polish (optional; include it only when the user confirms it):

  • Config file support
  • Environment variable overrides
  • Shell completions (bash, zsh, fish)
  • Distribution/packaging setup (setup.py, package.json bin, goreleaser, etc.)

Each task includes:

  • Goal: one sentence
  • Files: create or modify
  • Expected behavior: what the user can do after this task
  • Test: how to verify
  • Effort: S / M / L

Use the same approval loop as Step 2 for the plan.

No execution before plan approval. If the user ends the run without approving the plan, stop; the final status is BLOCKED.


Step 4: Execute

Before the first file write, apply the Branch-First Safety Rule. Then, for each task in the approved plan:

  1. Implement the task.
  2. Run the project's test command, taken from the manifest (for example pytest, npm test, go test ./..., cargo test).
  3. If a test fails, fix the code and re-run the test command. After 3 failed fix attempts on the same task, stop Step 4, show the failing output, and ask the user how to proceed. Do not start the next task while a test fails.
  4. If the test command cannot run (missing toolchain or test runner), tell the user. Continue only after explicit approval, and record that task's tests as not run.

At the end of each phase:

  1. Run the demo (--help plus at least one approved example invocation) and show the output. A demo that exits non-zero is a failing test (item 3).
  2. In a git repository, stage only the files this phase created or modified, then commit them with a descriptive message.

If a task needs a change to the approved design (a command, option, or output format differs), stop Step 4. Present the proposed change and wait for explicit approval before you continue.


Step 5: Summarize

Print the final report once, after the last Step Completion Report, as plain text in the chat. Do not write a report file unless the user asks for one. Read references/final-report.md for each part's contents, the status rules, and two examples. The four parts, in this order:

  1. Result: — the status first (COMPLETE, PARTIAL — <reason>, or BLOCKED — <reason>), then the tool name.
  2. Evidence: — only checks that ran: files, test counts, demo exit codes.
  3. Uncertainty: — untested behavior and assumptions, labeled apart from verified facts.
  4. Decision: — the approval needed, or No approval needed., then each remaining user action.

After the four parts, print the usage quick-start (install command and 3-5 example invocations) and the next steps (suggested improvements, missing features, distribution TODO).

Status rules — apply the first rule that matches:

  1. BLOCKED — the run stopped before the first file write, for example because the design or plan was not approved, there was no module to wrap and the user gave no answer, or Repo Sync hit a conflict or a missing origin the user did not approve working around.
  2. PARTIAL — at least one file was written, and then any of these happened: a test or demo still fails, a test command could not run, the user stopped Step 4 early, an approved task is not done, or a design change awaits approval.
  3. COMPLETE — every task in the approved plan is done, and every test command and demo ran and passed. A Phase 3 the user declined does not make the run partial.
Show full SKILL.md (641 more words)Show less

Expected Output

After running this skill on a Python module called mylib, the final report looks like this (full example: references/final-report.md):

Result: COMPLETE — mylib CLI (Python, click) with subcommands run and info
Evidence:
  Branch: feat/cli-mylib-20260419-143200
  Created: cli/main.py, cli/commands/run.py, cli/commands/info.py, tests/test_cli.py
  Modified: pyproject.toml ([project.scripts] entry point)
  pytest: 8 passed, 0 failed
  Demo: mylib --help, mylib --version, mylib run --input data.csv (all exit 0)
Uncertainty:
  Tested on macOS only. Shell completions not built (Phase 3 declined).
Decision: No approval needed.
  Remaining action: review the branch and push it.

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 (2 subcommands, 4 files created)
  Test coverage:          √ pass (8/8 tests passing)
  Phase demos completed:  √ pass (help, version, run verified)
  Final report delivered: √ pass
  Criteria:               √ 4/4 met
  ____________________________
  Result:                 PASS

Edge Cases

  • No clear module to wrap: Ask the user what functions/features the CLI should expose before proceeding with analysis.
  • Multiple languages detected: Present a choice; recommend the language with the most existing CLI-related code.
  • Existing CLI found: Offer to extend or refactor rather than rebuild; audit what already exists first.
  • Monorepo with many packages: Ask which package/service should get the CLI; scope the analysis to that subtree.
  • No test framework present: Add a minimal test setup (pytest, jest, go test) as part of Phase 1 foundation tasks.
  • Binary output required (standalone .exe / compiled): Note distribution method during Design phase and add build step (PyInstaller, pkg, goreleaser) to Phase 3 polish.
  • User approves design but rejects implementation: Return to Design phase; do not silently proceed with the rejected approach.

Acceptance Criteria

  • Language is auto-detected from manifest files before asking clarifying questions
  • CLI design document is presented and explicitly approved before any implementation begins
  • Implementation plan is presented and explicitly approved before execution starts
  • --help works at every command level and --version is implemented
  • Exit codes follow the canonical table in references/testing-patterns.md
  • Error messages go to stderr; clean output goes to stdout (pipeable)
  • NO_COLOR env var or --no-color flag is respected
  • Tests are written and pass before moving to the next phase
  • Final report includes install command and at least 3 usage examples
  • The final report opens with Result: and a status chosen by the Step 5 status rules, then Evidence:, Uncertainty:, and Decision:
  • A reader can find the result, separate verified checks from assumptions, trace each claim to a file or command, and see the next decision (reader checks in references/final-report.md). Human understanding stays unconfirmed until a user answers those checks

Step Completion Reports

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

Skill-specific checks per phase

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, Final report delivered

Error Handling

SituationAction
No clear module to wrapAsk user what functionality the CLI should expose
Multiple languages detectedAsk user which language to use, recommend the one with more CLI code
Existing CLI foundOffer to extend/refactor rather than rebuild; audit existing CLI first
Unknown framework requestedRead the framework's official documentation; if none is reachable, ask the user for a docs link
Tests fail after implementationFix and re-run; never skip broken tests. After 3 failed attempts on one task, stop and ask the user (Step 4)
Test command cannot runTell the user; continue only after explicit approval, and record the tests as not run (status PARTIAL)
Not a git repositorySkip Repo Sync, the branch rule, and commits; list it under Uncertainty:

Quality Guardrails

Every CLI built with this skill must include:

  • Help text: every command and option has a description (--help works at every level)
  • Error messages: written to stderr, include what went wrong and how to fix it
  • Exit codes: follow the canonical table in references/testing-patterns.md (0 = success, non-zero = failure)
  • POSIX conventions: --long-flag, -s short flag, -- to end options
  • Pipeable I/O: support stdin when it makes sense, clean stdout for piping
  • No-color support: respect NO_COLOR env var or --no-color flag
  • Version flag: --version prints version and exits

© luongnv89, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in skills/cli-builder of luongnv89/skills.

  • SKILL.md
  • docs/README.md
  • evals/evals.json
  • references/cli-libraries.md
  • references/final-report.md
  • references/testing-patterns.md

Open the folder on GitHubat commit 8f80262

Compare with similar skills

CLI Builder next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

CLI Builder compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
CLI Builder this skillluongnv89/skills131—~3.7kAutomated safety check: PassMIT
Superset Project Setupsuperset-sh/superset15k—~577Automated safety check: NotesCustom licence
Hns Moaiadk Dev Referencemodu-ai/moai-adk1.2k—~937Automated safety check: PassApache-2.0
Bash Scriptingericrisco/rsc-harness156—~2.5kAutomated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Superset Project Setup

    superset-sh/superset

    Makes a repository Superset-ready by writing .superset/config.json with setup, teardown and run scripts, then proving it with a real throwaway workspace.

    15k GitHub stars~577 tokensUpdated today
    DevelopmentAuto-check: notes
  • moai-adk-go local dev reference — version management/release process (sec 5), shell-script hook development (sec 7), build & dev commands (sec 10).

    1.2k GitHub stars~937 tokensUpdated today
    DevelopmentAuto-check passed
  • Bash Scripting

    ericrisco/rsc-harness

    A skill your agent uses when writing or hardening a shell script that must survive another machine — a CI step, install script, cron job, git hook, devcontainer entrypoint: strict-mode leaks…

    156 GitHub stars~2.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Codebase Knowledge Graph Q&A

    Egonex-AI/Understand-Anything

    Answers questions about a codebase by searching a prebuilt knowledge graph of its files, functions, classes and dependencies, not by rereading every source file.

    85k GitHub starsUsed in 1 repo~1.2k tokens
    DevelopmentAuto-check passed

More from luongnv89/skills

All 37 skills in this repo
  • Dont Make Me Think

    luongnv89/skills

    Review UI usability using Steve Krug's principles and produce a scannable report.

    131 GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Herdr Agent

    luongnv89/skills

    Manage AI agent fleets in Herdr: tile root + sub-agents in one tab, start/prompt/wait/read/monitor via the herdr agent CLI, steer any pane; help lists every operation.

    131 GitHub stars~4.8k tokensUpdated today
    Auto-check passed
  • Ollama Optimizer

    luongnv89/skills

    Optimize Ollama configuration for the current machine's hardware.

    131 GitHub stars~4.1k tokensUpdated today
    Auto-check: notes
  • Security Setup

    luongnv89/skills

    Install local-first security hardening: pre-commit secret detection, offline dependency scans, static analysis, reports, and gated free CI.

    131 GitHub stars~4.5k tokensUpdated today
    Auto-check passed
  • Tasks Generator

    luongnv89/skills

    Generate sprint-based development tasks from a PRD. An agent skill from luongnv89/skills.

    131 GitHub stars~3.8k tokensUpdated today
    Auto-check passed
  • Tmux Agent Comms

    luongnv89/skills

    Manage AI agents in tmux: spawn sessions, send messages, wait, capture replies, inspect fleets, and tear down safely.

    131 GitHub stars~3.4k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about CLI Builder

What does CLI Builder do?

Build production-quality CLIs with language detection and a five-step approval-gated workflow. CLI Builder is an agent skill from luongnv89/skills. Build production-quality CLIs with language detection and a five-step approval-gated workflow.

When should I use CLI Builder?

CLI Builder fits situations like: wrapping an existing module; one-off shell scripts.

How do I install CLI Builder in Claude Code?

Run `npx skills add luongnv89/skills --skill cli-builder -a claude-code`. Or copy the skill folder (skills/cli-builder in luongnv89/skills) into .claude/skills/cli-builder in your project. Claude Code loads it when a task matches its description.

How do I install CLI Builder in Codex?

Run `npx skills add luongnv89/skills --skill cli-builder -a codex`. Or copy the skill folder (skills/cli-builder in luongnv89/skills) into .agents/skills/cli-builder in your project. Codex loads it when a task matches its description.

Can I use CLI Builder in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add luongnv89/skills --skill cli-builder -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cli-builder, .gemini/skills/cli-builder, .github/skills/cli-builder and .opencode/skills/cli-builder in your project.

What does CLI Builder need to run?

Going by SKILL.md and its folder, CLI Builder needs the command-line tools its instructions call (git, pip, npm, go and cargo). Our summary lists: Python 3.

Does CLI Builder access the network?

SKILL.md contains no URLs. Its commands use git, pip and npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is CLI Builder safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does CLI Builder use?

CLI Builder is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does CLI Builder use?

About 3.7k tokens (SKILL.md is roughly 15k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6.9k tokens, read only when the agent opens those files.

What are the alternatives to CLI Builder?

Skills that share tags, products or a category with CLI Builder: Superset Project Setup (superset-sh/superset, 15k stars), Hns Moaiadk Dev Reference (modu-ai/moai-adk, 1.2k stars), Bash Scripting (ericrisco/rsc-harness, 156 stars) and Finishing a Development Branch (obra/superpowers, 296k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains CLI Builder?

luongnv89 (a GitHub user) maintains it in luongnv89/skills, which has 131 GitHub stars. The repository holds 37 skills in this directory. The repository was last updated on October 7, 2026.

Source: luongnv89/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.