python-cli-guidelines

A set of guidelines for building Python command-line tools, which are programs operated through a terminal. It covers Typer, Pydantic, UV, testing with pytest, and type checking with ty.

In plain words
What is it for?
Use it when developing Python terminal commands, defining typed configuration and data validation, managing environments, writing tests, and packaging the project.
Why use it?
It gives developers established patterns for organizing, validating, packaging, testing, and checking Python CLI projects.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/wislertt/bakefile/python-cli-guidelines
Any agent
npx skills add wislertt/bakefile --skill python-cli-guidelines
Clone the repo
git clone --depth 1 https://github.com/wislertt/bakefile

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 827 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00827
Opus 5 $0.00000 $0.00413
Sonnet 5 $0.00000 $0.00165
Haiku 4.5 $0.00000 $0.00083

Measured yesterday against content hash 2c041b078985, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

python-cli-guidelines scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/python-cli-guidelines/SKILL.md · 151 lines

How it starts

The opening of the file, as written. The whole thing — 151 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python CLI Guidelines

Production-tested patterns for building Python CLI tools using Typer, Pydantic, and UV.

Overview

This skill provides guidelines for developing bakefile - a Python-based build system with OOP reusability.

Tech Stack:

  • Typer - CLI framework
  • Pydantic - Data validation
  • UV - Package manager (auto-resolve Python environments)
  • pytest - Testing
  • ty - Type checking

Quick Reference

Topic Resource
Typer CLI patterns resources/typer-patterns.md
Pydantic validation resources/pydantic-patterns.md
OOP design for bakefile resources/oop-design.md
Testing CLI tools resources/testing.md
UV packaging resources/packaging.md
UV integration resources/uv-integration.md

Project Structure

src/bakefile/
├── __init__.py
├── cli.py              # Typer app entry point
├── core/               # Core abstractions
│   ├── task.py         # Task base class
│   └── recipe.py       # Recipe base class
├── commands/           # Built-in commands
│   ├── init.py
│   ├── lint.py
│   └── docs.py
└── utils/              # Utilities

Key Patterns

1. Command Definition (Typer)

import typer

app = typer.Typer()


@app.command()
def init():
    """Initialize a new bakefile.py in current directory."""
    typer.echo("Creating bakefile.py...")

2. Data Validation (Pydantic)

from pydantic import BaseModel, Field


class TaskConfig(BaseModel):
    name: str = Field(..., min_length=1)
    command: str
    description: str | None = None

3. OOP Reusability

from abc import ABC, abstractmethod


class Task(ABC):
    @abstractmethod
    def execute(self) -> int:
        """Execute task, return exit code."""
        pass

Common Tasks

Read the full file on GitHub · 151 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 151 lines · 0 tokens per session scan A 2c041b078985

Subscribe to this mod's changes

python-cli-guidelines is a skill published in the GitHub repository wislertt/bakefile (5 stars, last pushed 4d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 827 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

design

Comprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini or Atlas Cloud AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG, Gemini 3.1 Pro), social…

nextlevelbuilder/ui-ux-pro-max-skill · 144 tokens

ui-styling

Create beautiful, accessible user interfaces with shadcn/ui components (built on Radix UI + Tailwind), Tailwind CSS utility-first styling, and canvas-based visual designs. Use when building user interfaces, implementing design systems, creating responsive layouts, adding accessible components (dialogs, dropdowns…

nextlevelbuilder/ui-ux-pro-max-skill · 90 tokens

banner-design

Design banners for social media, ads, website heroes, creative assets, and print. Multiple art direction options with AI-generated visuals. Actions: design, create, generate banner. Platforms: Facebook, Twitter/X, LinkedIn, YouTube, Instagram, Google Display, website hero, print. Styles: minimalist, gradient, bold…

nextlevelbuilder/ui-ux-pro-max-skill · 118 tokens

design-system

Token architecture, component specifications, and slide generation. Three-layer tokens (primitive→semantic→component), CSS variables, spacing/typography scales, component specs, strategic slide creation. Use for design tokens, systematic design, brand-compliant presentations.

nextlevelbuilder/ui-ux-pro-max-skill · 52 tokens

brand

Brand voice, visual identity, messaging frameworks, asset management, brand consistency. Activate for branded content, tone of voice, marketing assets, brand compliance, style guides.

nextlevelbuilder/ui-ux-pro-max-skill · 35 tokens

review-pr

Deep code review of a single open PR in nrwl/nx. Checks the PR out only inside an isolated sandbox, then runs four fixed reviewers: implementation (correctness, errors, types, performance), verification (tests, ticket grounding, comments, and docs), approach, and security. A reproduce-verifier executes a runnable…

nrwl/nx · 118 tokens