Install
$ agentstack add skill-robhowley-py-pit-skills-click-cli ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
click-cli
Use this skill when designing or implementing Python command-line interfaces with Click.
This skill should add value above baseline Click knowledge by enforcing:
- good CLI architecture
- clear command hierarchy
- consistent argument and option design
- idiomatic Click usage
- avoidance of common Click anti-patterns
Apply this skill when the user:
- asks to create or design a Click CLI
- wants a Python CLI built with Click
- needs help structuring commands or subcommands
- wants idiomatic Click code rather than generic CLI code
- asks for help improving a Click-based command-line tool
Do not apply when:
- the task is unrelated to Python CLIs
- the user explicitly wants another CLI framework
- the question is purely about general application design rather than CLI behavior
Invocation heuristics
Prefer this skill when the user:
- mentions
click - asks for command groups, subcommands, options, or arguments
- wants a CLI architecture recommendation
- is starting a new Python CLI project
- wants help fixing non-idiomatic Click code
Do not prefer this skill when:
- the user explicitly wants
argparse,typer,cement, or another framework - the task is general Python coding with no CLI component
Mission
Produce production-quality Click CLIs that are:
- idiomatic
- modular
- easy to extend
- clear to use from the command line
- consistent in help text and option design
Do not merely explain Click syntax unless the user explicitly asks for explanation.
Core Click mental model
Click is best used to build CLIs around:
- a root command
- optional command groups
- small, composable subcommands
- explicit arguments and options
- predictable help output
Prefer clear command hierarchy over monolithic single-file command handlers.
The 5 Click invariants
Always follow these rules.
1. Model the CLI before writing code
Define:
- root command
- subcommands
- arguments
- options
- shared context if needed
Do not jump straight into decorators without first clarifying the command structure in the answer.
2. Use Click-native constructs
Prefer:
@click.group()@click.command()@click.option()@click.argument()@click.pass_context()when context is needed
Avoid mixing in patterns from other CLI frameworks unless explicitly requested.
3. Prefer click.echo() for user-facing output
Correct:
click.echo("Done")
Avoid defaulting to:
print("Done")
unless the user explicitly wants raw Python output behavior.
4. Prefer modular command layouts for multi-command CLIs
For anything beyond a very small CLI, prefer structure like:
project/ cli.py commands/ init.py run.py status.py
Avoid placing every command in one large file when the CLI clearly has multiple concerns.
5. Design the CLI UX deliberately
Ensure:
- option names are consistent
- help text is useful
- positional arguments are used sparingly and intentionally
- subcommands are discoverable
- command names are short and predictable
Standard operating procedure
Step 1 — Design the CLI shape
Identify:
- root command name
- subcommands
- argument vs option boundaries
- shared/global options
- whether grouping is needed
Return a compact command tree when useful, for example:
dataset ingest validate publish
Step 2 — Recommend file layout
If the CLI is trivial, a single file may be acceptable.
If the CLI has multiple commands or domains, prefer modular layout.
Step 3 — Generate idiomatic Click code
Use:
- typed options where appropriate
- clear help strings
- small command handlers
click.echo()for output- context objects only when they provide real value
Step 4 — Validate the design
Before finishing, verify:
- the hierarchy is logical
- the code matches the designed command structure
- option names are consistent
- help text is present where needed
- the solution uses Click idioms rather than generic CLI habits
Output contract
When generating or designing a Click CLI, prefer this structure in your answer:
- CLI Architecture
- Recommended File Layout
- Click Implementation
- Usage Examples
If the user asks for only code, still internally follow the same structure and provide the code cleanly.
Anti-pattern detection
Call out these problems explicitly when they appear:
- monolithic all-in-one CLI files
print()instead ofclick.echo()- argparse-style logic mixed into Click code
- manual help formatting that Click should generate
- inconsistent option naming
- excessive positional arguments
- unnecessary global state
Response style
- concise
- concrete
- code-first when implementation is requested
- architecture-aware
- no unnecessary framework comparisons unless relevant
Completion checklist
Before finishing an answer verify:
- the CLI structure is clear
- Click-native decorators and patterns are used
- output uses
click.echo()where appropriate - the layout is modular when the CLI complexity warrants it
- the answer adds architectural guidance, not just decorator syntax
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: robhowley
- Source: robhowley/py-pit-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.