guide: Command for Claude Code

.github/workflows/generate-ai-rules/commands/scaffold-python-package.md

scaffold-python-package is a command for Claude Code from rios0rios0/guide. It costs 0 tokens per session (1,023 once invoked), scanned A, original, MIT.

A command that creates the starting files for a Python package using common packaging, formatting, linting, typing, logging, and testing conventions. PEP 621 is a standard format for Python project metadata, while PDM manages the project environment and packages.

In plain words
What is it for?
Use it to start a Python package with source files, tests, examples, a README, Dockerfile, pyproject.toml, and development tools such as Black, isort, Flake8, pytest, and Loguru.
Why use it?
Setting up the same package structure and development tools by hand takes time and can produce inconsistent projects. This gives a defined starting layout and configuration.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

This is rios0rios0/guide's own configuration. It tells Claude Code how to work on guide itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything guide configures →

Part of the engineering-standards plugin — 5 skills, 8 commands, 7 agents shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to rios0rios0/guide. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/rios0rios0/guide/main/.github/workflows/generate-ai-rules/commands/scaffold-python-package.md
Clone the repo
git clone --depth 1 https://github.com/rios0rios0/guide

Made for: Claude Code.

Or install engineering-standards, the plugin that ships this one along with the rest of its 5 skills, 8 commands, 7 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for scaffold-python-package

README.md
[![agentmods](https://agentmods.dev/badge/commands/rios0rios0/guide/scaffold-python-package/github.svg)](https://agentmods.dev/commands/rios0rios0/guide/scaffold-python-package)
Your own site
<a href="https://agentmods.dev/commands/rios0rios0/guide/scaffold-python-package"><img src="https://agentmods.dev/badge/commands/rios0rios0/guide/scaffold-python-package/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for scaffold-python-package

Your own site · 80×15
<a href="https://agentmods.dev/commands/rios0rios0/guide/scaffold-python-package"><img src="https://agentmods.dev/badge/commands/rios0rios0/guide/scaffold-python-package.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,023 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.01023
Opus 5.5 $0.00000 $0.00409
Sonnet 5.5 $0.00000 $0.00205
Haiku 4.5 $0.00000 $0.00102

Measured 1mo ago against content hash 3021a0c104c8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

scaffold-python-package 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 1mo ago.

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.

.github/workflows/generate-ai-rules/commands/scaffold-python-package.md · 161 lines

How it starts

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

Scaffold a new Python package following PEP 621, PDM, Black/isort/Flake8, type hints, and Loguru logging.

For detailed Python conventions, refer to the Python rule. For testing patterns, refer to the Testing rule. For Makefile setup, refer to the CI/CD rule.

Directory Structure

<project>/
├── <package_name>/
│   ├── __init__.py
│   └── main.py
├── tests/
│   ├── __init__.py
│   └── test_main.py
├── examples/
│   └── example_usage.py
├── Dockerfile
├── pyproject.toml
└── README.md

Step-by-Step

1. Initialize with PDM

mkdir <project> && cd <project>
pdm init

2. Configure pyproject.toml (PEP 621)

[project]
name = "package-name"
version = "0.1.0"
description = "Brief description of the package"
readme = "README.md"
requires-python = ">=3.10"
license = {text = "MIT"}
authors = [
    {name = "Author Name", email = "[email protected]"},
]
dependencies = []

[project.optional-dependencies]
dev = [
    "black",
    "isort",
    "flake8",
    "pytest",
    "loguru",
]

[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"

[tool.black]
line-length = 120

[tool.isort]
profile = "black"
line_length = 120

[tool.flake8]
max-line-length = 120

3. Create the package module

# <package_name>/__init__.py
"""Package description."""

__version__ = "0.1.0"
# <package_name>/main.py
from loguru import logger


def main() -> None:
    """Entry point for the package."""
    logger.info("Starting application")

4. Add type hints everywhere

All functions must have type hints on parameters and return types:

def process_data(input_data: list[str], max_items: int = 10) -> dict[str, int]:
    """Process the input data and return counts."""
    result: dict[str, int] = {}
    for item in input_data[:max_items]:
        result[item] = result.get(item, 0) + 1
    return result

5. Set up logging with Loguru

Always use Loguru -- NEVER use the standard logging module or print():

Read the full file on GitHub · 161 lines

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. 1mo ago First seen · 161 lines · 0 tokens per session scan A 3021a0c104c8

Subscribe to this mod's changes

scaffold-python-package is a command published in the GitHub repository rios0rios0/guide (4 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,023 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.