click-scaffolder
Generate Click-based Python CLI applications with decorators, groups, context, and modern Python patterns. Creates complete scaffolded CLI with proper project structure.
Best use case
click-scaffolder is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Generate Click-based Python CLI applications with decorators, groups, context, and modern Python patterns. Creates complete scaffolded CLI with proper project structure.
Teams using click-scaffolder should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/click-scaffolder/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How click-scaffolder Compares
| Feature / Agent | click-scaffolder | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Generate Click-based Python CLI applications with decorators, groups, context, and modern Python patterns. Creates complete scaffolded CLI with proper project structure.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Click Scaffolder
Generate a complete Click CLI application with Python, proper project structure, and best practices.
## Capabilities
- Generate Python-based Click CLI projects
- Create command groups with decorators
- Set up context passing between commands
- Configure type coercion and validation
- Implement custom parameter types
- Set up Poetry/pip project structure
## Usage
Invoke this skill when you need to:
- Bootstrap a new CLI application using Click
- Create a Python CLI with decorator-based commands
- Set up command groups and context
- Configure rich terminal output
## Inputs
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| projectName | string | Yes | Name of the CLI project (kebab-case) |
| description | string | Yes | Short description of the CLI |
| commands | array | No | List of commands to scaffold |
| usePoetry | boolean | No | Use Poetry for dependency management (default: true) |
| pythonVersion | string | No | Python version requirement (default: ">=3.9") |
### Command Structure
```json
{
"commands": [
{
"name": "init",
"description": "Initialize a new project",
"options": [
{ "name": "template", "type": "string", "help": "Template to use" },
{ "name": "force", "is_flag": true, "help": "Overwrite existing" }
],
"arguments": [
{ "name": "directory", "required": true }
]
}
],
"groups": [
{
"name": "config",
"description": "Configuration management",
"commands": ["get", "set", "list"]
}
]
}
```
## Output Structure
```
<projectName>/
├── pyproject.toml
├── README.md
├── .gitignore
├── src/
│ └── <package_name>/
│ ├── __init__.py
│ ├── __main__.py # Entry point
│ ├── cli.py # Main Click setup
│ ├── commands/
│ │ ├── __init__.py
│ │ └── <command>.py # Individual commands
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── config.py # Configuration
│ │ └── console.py # Rich console output
│ └── types/
│ ├── __init__.py
│ └── custom.py # Custom parameter types
└── tests/
├── __init__.py
├── conftest.py
└── test_<command>.py
```
## Generated Code Patterns
### Main CLI Entry (src/<package>/cli.py)
```python
import click
from rich.console import Console
from .commands import init, config
console = Console()
@click.group()
@click.version_option()
@click.option('--verbose', '-v', is_flag=True, help='Enable verbose output')
@click.pass_context
def cli(ctx: click.Context, verbose: bool) -> None:
"""<description>"""
ctx.ensure_object(dict)
ctx.obj['verbose'] = verbose
ctx.obj['console'] = console
cli.add_command(init.init)
cli.add_command(config.config)
def main() -> None:
cli(obj={})
if __name__ == '__main__':
main()
```
### Command Template
```python
import click
from rich.console import Console
@click.command()
@click.argument('directory', type=click.Path())
@click.option(
'--template', '-t',
type=click.Choice(['basic', 'advanced']),
default='basic',
help='Template to use'
)
@click.option('--force', '-f', is_flag=True, help='Overwrite existing files')
@click.pass_context
def init(ctx: click.Context, directory: str, template: str, force: bool) -> None:
"""Initialize a new project in DIRECTORY."""
console: Console = ctx.obj['console']
verbose: bool = ctx.obj['verbose']
if verbose:
console.print(f"[dim]Using template: {template}[/dim]")
console.print(f"[green]Initializing project in {directory}[/green]")
```
### Command Group Template
```python
import click
@click.group()
def config() -> None:
"""Configuration management commands."""
pass
@config.command()
@click.argument('key')
@click.pass_context
def get(ctx: click.Context, key: str) -> None:
"""Get a configuration value."""
console = ctx.obj['console']
console.print(f"Getting {key}")
@config.command()
@click.argument('key')
@click.argument('value')
def set(key: str, value: str) -> None:
"""Set a configuration value."""
click.echo(f"Setting {key} = {value}")
```
## Dependencies
```toml
[tool.poetry.dependencies]
python = ">=3.9"
click = "^8.1.0"
rich = "^13.0.0"
[tool.poetry.group.dev.dependencies]
pytest = "^8.0.0"
pytest-cov = "^4.0.0"
mypy = "^1.0.0"
ruff = "^0.1.0"
```
## Workflow
1. **Validate inputs** - Check project name, commands structure
2. **Create directory structure** - Set up folders and base files
3. **Generate pyproject.toml** - Configure project metadata
4. **Create CLI entry point** - Click group setup
5. **Generate commands** - Individual command files
6. **Create utilities** - Console, config helpers
7. **Set up tests** - pytest fixtures and command tests
8. **Initialize git** - Optional git initialization
## Best Practices Applied
- Type hints throughout
- Click context for shared state
- Rich library for terminal output
- Command groups for organization
- Custom parameter types
- Proper error handling
## References
- Click Documentation: https://click.palletsprojects.com/
- Click GitHub: https://github.com/pallets/click
- Rich Library: https://rich.readthedocs.io/
## Target Processes
- cli-application-bootstrap
- cli-command-structure-design
- argument-parser-setupRelated Skills
dotnet-clickonce-config
Configure ClickOnce deployment with auto-update, prerequisites, and publish settings for .NET applications
yargs-scaffolder
Generate Yargs-based CLI applications with commands, positional args, middleware, and TypeScript support. Creates a complete scaffolded CLI application with modern patterns.
textual-scaffolder
Generate Textual (Python) TUI application structure with widgets, screens, and CSS styling.
oclif-scaffolder
Generate oclif CLI framework projects with plugin support, topics, hooks, and TypeScript. Creates enterprise-grade CLI applications with extensibility.
commander-js-scaffolder
Generate Commander.js CLI project structure with TypeScript, commands, options, and best practices. Creates a complete scaffolded CLI application ready for development.
cobra-scaffolder
Generate Cobra/Viper-based Go CLI applications with persistent flags, subcommands, and configuration management. Creates production-ready Go CLI with modern patterns.
clap-scaffolder
Generate Clap-based Rust CLI applications with derive macros, subcommands, and modern Rust patterns. Creates production-ready Rust CLI with proper cargo structure.
bubble-tea-scaffolder
Generate Bubble Tea (Go) TUI application structure with models, commands, and views using the Elm architecture.
bats-test-scaffolder
Generate BATS test structure and fixtures for shell script testing with setup/teardown, assertions, and mocking.
argparse-scaffolder
Generate argparse-based Python CLI applications with subparsers, type converters, and standard library patterns. Creates lightweight Python CLIs without external dependencies.
process-builder
Scaffold new babysitter process definitions following SDK patterns, proper structure, and best practices. Guides the 3-phase workflow from research to implementation.
babysitter
Orchestrate via @babysitter. Use this skill when asked to babysit a run, orchestrate a process or whenever it is called explicitly. (babysit, babysitter, orchestrate, orchestrate a run, workflow, etc.)