Back to Skills

cli-generator

verified

Generate AI-friendly Python CLIs using Click, Pydantic, and uv. Use when user wants to create a new CLI tool that follows best practices for agentic coding environments.

View on GitHub

Marketplace

marketplace-claude

kjgarza/marketplace-claude

Plugin

senior-software-developer

development

Repository

kjgarza/marketplace-claude
2stars

plugins/senior-software-developer/skills/cli-generator/SKILL.md

Last Verified

January 20, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/kjgarza/marketplace-claude/blob/main/plugins/senior-software-developer/skills/cli-generator/SKILL.md -a claude-code --skill cli-generator

Installation paths:

Claude
.claude/skills/cli-generator/
Powered by add-skill CLI

Instructions

# AI-Friendly CLI Generator Skill

Generate Python command-line interfaces optimized for AI agents and agentic coding environments.

## Core Principle: Every Output is a Prompt

In an agentic coding environment, every interaction with a CLI tool is a turn in a conversation. The tool's output—whether it succeeds or fails—should be designed as a helpful, guiding prompt for the agent's next action.

## Tech Stack

- **Python** - Primary language
- **Click** - CLI framework
- **Pydantic** - Data validation and response models
- **Rich** - Terminal formatting and tables
- **uv** - Package management

## Project Structure

```
my-cli/
├── pyproject.toml
├── README.md
├── src/
│   └── my_cli/
│       ├── __init__.py
│       ├── main.py              # CLI entry point
│       ├── commands/            # Command modules
│       │   └── __init__.py
│       ├── models/
│       │   ├── __init__.py
│       │   └── responses.py     # Pydantic response models
│       ├── output/
│       │   ├── __init__.py
│       │   └── conversational.py # AI-friendly output
│       └── core/
│           ├── __init__.py
│           ├── client.py        # API client
│           └── config.py        # Configuration
└── tests/
```

## Quick Start

1. Create project directory:
```bash
mkdir my-cli && cd my-cli
```

2. Initialize with uv:
```bash
uv init
```

3. Add dependencies to `pyproject.toml`:
```toml
dependencies = [
    "click>=8.1.0",
    "rich>=13.0.0",
    "pydantic>=2.0.0",
]
```

4. Create the source structure:
```bash
mkdir -p src/my_cli/{commands,models,output,core}
touch src/my_cli/__init__.py
touch src/my_cli/{commands,models,output,core}/__init__.py
```

5. Copy templates from `templates/` directory

## AI-Friendly Output Patterns

### Pattern 1: Success Output

A successful output confirms the action AND suggests next steps with exact commands:

**Bad (Traditional):**
```
Success!
```

**Good (AI-Friendly):**
```
✅ Found 4 documents matching 'AI'

📋 Available Resources:
  • Total do

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
10711 chars