refactor-cli

Audits and refactors CLI command structures against standard design conventions.

1|Updated Jun 29, 2026
One-click install
npx skills add https://github.com/natthasath/natthasath-marketplace --skill refactor-cli-natthasath
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: refactor-cli
Source: https://github.com/natthasath/natthasath-marketplace/tree/main/plugins/refactor/skills/refactor-cli
Command: npx skills add https://github.com/natthasath/natthasath-marketplace --skill refactor-cli-natthasath

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? CLI tools often grow inconsistent command hierarchies, mismatched verb sets, unclear exit codes, and missing safety models, making them hard to predict and risky to automate. This Skill inspects a CLI tool's actual command structure and refactors the source code to match established CLI design standards. ## Core Features & Use Cases - Language-aware refactoring: Detects the implementation language and framework (Rust clap, Python Click/Typer/argparse, Go Cobra, Node Commander) from manifests or help-text fingerprints before editing any code. - Checklist-driven audit: Compares the tool against eight reference categories covering command hierarchy, I/O contracts, exit codes, safety models, session/state management, resource CRUD, config, and shell completion. - Documentation sync: Updates README, shell completion scripts, and CHANGELOG so docs match the refactored structure, and renders --help output in a standard English format. - Use Case: Point it at a Go CLI project where one resource group uses ls/show/create/delete and another uses list/get/add/remove; it unifies the verb set, fixes exit codes, adds a dry-run flag, and regenerates help text. ## Quick Start Run /refactor-cli with the path to your CLI tool project to audit and refactor its command structure.

Frequently Asked Questions about refactor-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor a CLI tool's command structure?▼

Run /refactor-cli with the path to your CLI project. It detects the language and framework, surveys the real --help output, compares against a standards checklist, then edits the source code and syncs related docs like README and completion scripts.

What CLI frameworks does this refactoring skill support?▼

It supports Rust clap, Python Click, Typer, and argparse, Go Cobra, and Node Commander, plus Thor, System.CommandLine, and picocli. It detects the framework from manifest files like Cargo.toml, package.json, pyproject.toml, or go.mod.

Can it audit a CLI tool without source code?▼

Yes. If only --help output is available with no source to edit, it switches to audit-only mode, comparing the output against the checklist and producing a gap report with the recommended structure instead of modifying files.

Does it support CLI tools on Windows, Linux, and macOS?▼

Yes. Its lifecycle reference covers cross-platform concerns including home directory resolution, path separators, XDG versus APPDATA config locations, CRLF line endings, and PowerShell completion alongside bash, zsh, and fish.

Will refactoring rename existing flags or subcommands?▼

Not silently. The skill never makes breaking changes without explanation; if an existing flag or subcommand name must change, it explains the reasoning and asks for confirmation before proceeding.