scaffold-python-package

A starter-project generator for Python packages using PEP 621 project metadata, PDM for package management, common code-formatting and linting tools, type hints, and Loguru logging.

In plain words
What is it for?
It helps create a package directory, tests, examples, Dockerfile, project configuration, and README with tools such as Black, isort, Flake8, pytest, and Loguru.
Why use it?
It removes the repetitive setup needed to make a new Python package installable, testable, formatted, and checked for common code issues.

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/rios0rios0/guide/scaffold-python-package
Any agent
npx skills add rios0rios0/guide --skill scaffold-python-package
Clone the repo
git clone --depth 1 https://github.com/rios0rios0/guide

Made for: Claude Code, Codex.

Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,082 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.00055 $0.01082
Opus 5 $0.00028 $0.00541
Sonnet 5 $0.00011 $0.00216
Haiku 4.5 $0.00006 $0.00108

Measured 2d ago against content hash 0de39779b0c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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/skills/scaffold-python-package/SKILL.md · 166 lines

How it starts

The opening of the file, as written. The whole thing — 166 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 · 166 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. 2d ago First seen · 166 lines · 55 tokens per session scan A 0de39779b0c6

Subscribe to this mod's changes

scaffold-python-package is a skill published in the GitHub repository rios0rios0/guide (2 stars, last pushed 4d ago), licensed MIT. It adds 55 tokens to every session and 1,082 once invoked, about $0.0003 per session on Opus 5. 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

common-session-retrospective

Analyze conversation corrections to detect skill gaps and prepare targeted skill-library maintenance tasks. Use after any session with user corrections, rework, or retrospective requests. After finding correction loops, also load +common/common-learning-log to persist mistake entries to AGENTSLEARNING.md.

HoangNguyen0403/agent-skills-standard · 59 tokens

JavaScript Tooling

Development tools, linting, and testing for JavaScript projects.

HoangNguyen0403/agent-skills-standard · 18 tokens

to-issues

Decompose a PRD and/or SPEC into implementable, vertically-sliced Issues with real blocking edges, then create them in your chosen platform (GitHub or Local). Use after /prd (and optionally /prd-to-spec) to turn requirements into agent-ready tickets. Triggers on: create issues, to-issues, 创建issue, 拆解issue, 生成卡片, 创建卡片…

smallnest/goal-workflow · 96 tokens

article-icons

Illustrate an article (Markdown, HTML, etc.) with animated-style icons from itshover.com/icons. Fetches icons as clean inline SVG and places them at section headings, key concepts, lists, and callouts. Triggers on: /article-icons, 配图, 给文章配图标, add icons to article, illustrate with icons.

smallnest/goal-workflow · 74 tokens

code-comment-generator

Generates meaningful comments and documentation for code to improve maintenance and readability. Use when adding documentation to Python or Java code, including function/method docstrings, class documentation, inline explanations for complex logic, and code annotations (TODO, FIXME). Analyzes existing comment style in…

ArabelaTso/Skills-4-SE · 91 tokens

code-smell-detector

Identify and report code smells indicating poor design or maintainability issues in Python code, including duplicate code, magic numbers, hardcoded values, God classes, feature envy, inappropriate intimacy, data clumps, primitive obsession, and long parameter lists. Use when conducting code quality audits, preparing…

ArabelaTso/Skills-4-SE · 129 tokens