Agent skill

Python Patterns

by diegosouzapw in diegosouzapw/awesome-omni-skills

Python Patterns workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

MITAuto-check passedDevelopment

Install Python Patterns

skills CLI
$ npx skills add diegosouzapw/awesome-omni-skills --skill python-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install diegosouzapw/awesome-omni-skills python-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/diegosouzapw/awesome-omni-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills_omni/python-patterns .claude/skills/python-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
python-patterns
GitHub stars
159
Token cost
~3.2k tokens
SKILL.md length
1,463 words
Files
18 (incl. scripts, references, assets)
Skills in repo
39
Repo updated
First seen
Licence
MIT

At a glance

Python Patterns workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

  • Works in 5 steps: Framework and stack selection → Async vs sync → Background work → …
  • The user needs Python development principles and decision-making
  • SKILL.md covers Overview, When to Use This Skill, Operating Table and Workflow, plus 6 more sections
  • Runs Python scripts from its folder; calls python

What it does

Python Patterns is an agent skill from diegosouzapw/awesome-omni-skills. Python Patterns workflow skill. Use this skill when the user needs Python development principles and decision-making. Framework selection, async patterns, type hints, project structure. Teaches thinking, not copying and the operator should rely on the packaged workflow, runtime references, implementation examples, and validation script before merging or handing off.

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 22 other files, including scripts, reference files and assets (for example `ATTRIBUTION.md`, `OMNI_ENHANCED.json` and `ORIGIN.md`).

It sits in Development, covering Type safety. It works with Python. The repository describes itself as: Public repository of AI coding skills, curated improved best-practice skills, and runtime surfaces for CLI, API, MCP, and A2A. The licence is MIT.

When your agent uses it

  • The user needs Python development principles and decision-making
  • Tasks that involve Type safety

Example prompts

  • “/python-patterns”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Framework and stack selection
  2. Async vs sync
  3. Background work
  4. Type hints
  5. Project structure

What it can do on your machine

Read from SKILL.md and the folder at commit c3af004. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Python Patterns loads about 3.2k tokens when it runs, and up to ~5.2k if it reads all its reference files. Until then it costs about 96 tokens; SKILL.md has 1,463 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~96
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from diegosouzapw/awesome-omni-skills at commit c3af004, republished under its MIT licence (© diegosouzapw). 1,463 words, ~3,175 tokens.

Download SKILL.mdSave it as .claude/skills/python-patterns/SKILL.md (or your agent's skills folder). This skill also uses 17 other files; get the full folder from GitHub.
name
python-patterns
description
Python Patterns workflow skill. Use this skill when the user needs Python development principles and decision-making. Framework selection, async patterns, type hints, project structure. Teaches thinking, not copying and the operator should rely on the packaged workflow, runtime references, implementation examples, and validation script before merging or handing off.
version
0.0.1
category
development
tags
python-patterns, python, development, principles, decision-making, architecture, async, typing, project-structure, omni-enhanced
complexity
advanced
risk
safe
tools
codex-cli, claude-code, cursor, gemini-cli, opencode
source
omni-team
author
Omni Skills Team
date_added
2026-04-15
date_updated
2026-04-19

Python Patterns

Overview

This skill curates the upstream python-patterns workflow from sickn33/antigravity-awesome-skills into a practical decision aid for real Python work.

Use it when the task is not “write some Python,” but “choose the right Python approach.” The core idea from upstream remains intact: teach decision-making, not pattern memorization.

This skill is strongest when the operator must decide among:

  • sync vs async execution models
  • threads vs processes vs in-process work
  • framework or stack fit based on constraints
  • where type hints add the most leverage
  • how to structure a project around pyproject.toml, tests, and imports
  • how to verify that a chosen pattern is actually working

Open the support files when needed:

  • references/runtime-practices.md for decision matrices and failure modes
  • examples/implementation-example.md for worked before/after scenarios
  • scripts/validate-runtime.py to inspect a repository for layout, tooling, async, and subprocess risks

When to Use This Skill

Use this skill when:

  • the user wants Python architecture guidance rather than a single code snippet
  • the task involves framework selection, concurrency choices, typing strategy, packaging, or project layout
  • the request asks whether a system should be async, typed, packaged, or reorganized
  • the operator needs to justify tradeoffs, not just produce an implementation
  • a repository should be checked for Python structure or runtime-pattern mismatches before changes are proposed

Do not use this skill as the primary router when:

  • the task is language-agnostic system design with little Python-specific impact
  • the user already chose the architecture and only needs feature implementation
  • the work is mainly deployment, containerization, CI, or cloud operations rather than Python design

Operating Table

SituationStart hereWhy it matters
Need to decide sync vs asyncreferences/runtime-practices.mdGives a concrete decision matrix instead of treating async as a default
Need to choose how work runs in the backgroundreferences/runtime-practices.mdSeparates in-request work, thread/process offloading, and external job systems
Need to improve project structureexamples/implementation-example.mdShows realistic pyproject.toml and src/ tradeoffs with expected outcomes
Need typing guidancereferences/runtime-practices.mdFocuses typing on API boundaries and static-analysis value
Need to inspect an existing reposcripts/validate-runtime.pyReports concrete findings on metadata, layout, test/import risks, async smells, and subprocess safety
Need to explain a recommendationSKILL.md + linked support filesKeeps the answer tied to explicit tradeoffs and verification steps

Workflow

  1. Clarify the decision.

    • What is being chosen: framework, concurrency model, typing depth, layout, or background-task pattern?
    • What constraints matter: latency, throughput, CPU load, I/O wait, packaging needs, team familiarity, deployment model?
  2. Classify the workload.

    • Mostly sequential business logic: start sync.
    • High I/O concurrency with async-capable dependencies: consider async.
    • Blocking I/O from libraries you cannot replace: consider thread offloading.
    • CPU-heavy work: consider processes or external workers.
  3. Inventory the dependency stack.

    • Are the database, HTTP, messaging, and framework layers async-capable end to end?
    • Are there blocking SDKs that would negate async benefits?
    • Is this a package, an internal service, or a script repo?
  4. Choose the smallest sound pattern.

    • Prefer the least complex model that fits the workload.
    • Do not adopt async only because it is modern.
    • Do not force src/ layout or heavy typing if the repo is a small script-only tool.
  5. Define verification gates before implementation.

    • tests run in the intended import mode
    • lint/format checks run cleanly
    • type checking is applied where it adds signal
    • blocking calls are identified in async paths
    • performance claims are measured, not assumed
  6. Implement or recommend with explicit tradeoffs. Include:

    • why this pattern was chosen
    • what alternative was rejected
    • what failure mode the choice avoids
    • how the team can verify the result
  7. Validate the repository when relevant. Run:

    bash
    python scripts/validate-runtime.py .

    Then use the findings to refine the recommendation.

Decision Principles

1. Framework and stack selection

Do not rank frameworks generically. Choose based on constraints.

Prefer questions like:

  • Does the app need high fan-out I/O concurrency?
  • Are the core dependencies async-native?
  • Is this a small internal service where simplicity matters more than concurrency features?
  • Does the team need strong typing, validation, or admin tooling?
  • Will the app be packaged and reused, or only deployed as one service?

A good answer names selection criteria and tradeoffs. A weak answer says “always use X.”

2. Async vs sync

Default to synchronous code unless there is a real need for structured I/O concurrency.

Use async when:

  • the workload is I/O-bound
  • the framework and key dependencies are async-capable
  • request handlers would otherwise spend significant time waiting on sockets or similar external operations
  • the team can debug event-loop behavior and cancellation correctly

Stay sync when:

  • work is mostly CPU or straightforward request/response logic
  • important libraries are blocking
  • concurrency demands are low
  • introducing async would create a mixed model with little benefit

Do not claim async is inherently faster. It is often better for coordinating many I/O-bound operations, not as a blanket performance upgrade.

3. Background work

Separate these cases clearly:

  • small in-process follow-up work: safe only if it is brief, observable, and failure handling is explicit
  • blocking I/O offload: use threads or executor-style offloading where appropriate
  • CPU-heavy work: prefer processes or an external worker system
  • durable long-running jobs: use an external queue/worker model rather than pretending in-request background tasks are reliable job infrastructure

If subprocesses are involved, prefer argument lists over shell command strings, validate inputs, and make timeouts explicit.

Show full SKILL.md (605 more words)Show less
4. Type hints

Treat typing as a way to improve API clarity and static analysis.

Prioritize:

  1. public interfaces
  2. module boundaries
  3. complex data structures and return types
  4. internal helpers only when the signal is worth the maintenance cost

Important boundary:

  • type hints help static tools and readers
  • they do not automatically enforce runtime validation
5. Project structure

Use pyproject.toml as the default metadata and tool-configuration anchor.

Use src/ layout when:

  • you are building a package
  • you want tests to exercise installed/importable code more reliably
  • import-path mistakes have caused issues before

A flat layout can still be reasonable when:

  • the repo is a small script collection
  • packaging is not a goal
  • the extra structure would add ceremony without operational benefit

The goal is not aesthetic purity. The goal is predictable imports, packaging behavior, and test execution.

Examples

See examples/implementation-example.md for complete worked scenarios.

Typical use cases covered there:

  • fixing an async endpoint that still performs blocking work
  • choosing src/ layout for a reusable package while avoiding unnecessary structure for simple script repos
  • introducing gradual typing at module boundaries instead of annotating everything at once

Troubleshooting

RuntimeError: event loop is already running

Usually means async code is being started from an environment that already owns the loop, or async entry points are being nested incorrectly.

Check:

  • where the loop is created
  • whether framework code already manages it
  • whether helper code is calling top-level loop runners from inside async contexts
Service stayed slow after async adoption

Common causes:

  • blocking database or HTTP clients remain in the request path
  • CPU-heavy work still runs on the event loop
  • concurrency was added without measuring the actual bottleneck

Check dependencies, profile the hot path, and confirm the workload was actually I/O-bound.

Tests pass locally but imports fail after packaging or install

Common causes:

  • flat-layout imports accidentally rely on the repository root being on PYTHONPATH
  • tests import source files directly rather than the installable package
  • project metadata and package discovery are incomplete

Inspect layout choices and run the validator script for import-risk hints.

Type checker noise exploded after partial adoption

Common causes:

  • typing was started in unstable internal code rather than stable boundaries
  • strictness was enabled repo-wide too early
  • untyped third-party interfaces were not isolated behind typed wrappers

Adopt types module by module. Raise strictness where signal is high.

Background task blocks the server

Common causes:

  • CPU-heavy work left in request handlers
  • “fire-and-forget” tasks still use blocking code
  • exceptions are not surfaced or monitored

Move work to the right execution model and make timeout, retry, and cancellation behavior explicit.

shell=True or shell-string command construction appears in helpers

This is a security review point.

Prefer:

python
subprocess.run(["python", "-m", "pytest"], check=True)

Over:

python
subprocess.run("python -m pytest", shell=True, check=True)

Especially when any input is dynamic.

Additional Resources

  • references/runtime-practices.md — decision matrices, checklists, and common failure modes
  • examples/implementation-example.md — concrete scenarios with chosen and rejected patterns
  • scripts/validate-runtime.py — repository scanner for Python runtime-pattern mismatches

Suggested validation commands when appropriate:

bash
python scripts/validate-runtime.py .
python -m pytest

If the repo already uses Ruff or mypy, include them in the verification gate rather than adding tools unconditionally.

Use a different or additional skill when the center of gravity shifts to:

  • framework-specific implementation details
  • packaging and publishing mechanics beyond architecture choice
  • deployment, containers, CI/CD, or production operations
  • deep performance profiling beyond pattern selection

Operator Notes

A strong answer from this skill:

  • starts from workload and constraints
  • recommends the least complex sound pattern
  • avoids universal claims about frameworks or async
  • makes typing and structure decisions intentionally
  • includes a verification plan, not just a recommendation

A weak answer:

  • prescribes one framework by habit
  • treats async as automatically faster
  • equates type hints with runtime validation
  • forces src/ layout everywhere
  • gives no way to verify the recommendation in the repository

© diegosouzapw, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 17 other files (scripts, references, assets) in skills_omni/python-patterns of diegosouzapw/awesome-omni-skills.

  • SKILL.md
  • ATTRIBUTION.md
  • OMNI_ENHANCED.json
  • ORIGIN.md
  • agents/omni-import-router.md
  • assets/omni-import-source-manifest.json
  • examples/implementation-example.md
  • examples/omni-import-operator-packet.md
  • examples/omni-import-prompt-template.md
  • metadata.json
  • references/omni-import-checklist.md
  • references/omni-import-playbook.md
  • references/omni-import-rubric.md
  • references/omni-import-source-summary.md
  • references/runtime-practices.md
  • scripts/omni_import_list_support_pack.py
  • … and 2 more

Open the folder on GitHubat commit c3af004

Compare with similar skills

Python Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Python Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Python Patterns this skilldiegosouzapw/awesome-omni-skills159—~3.2kAutomated safety check: PassMIT
Minimizing Ty Ecosystem Changesastral-sh/ruff50k—~4.6kAutomated safety check: PassMIT
Kedro Babysitkedro-org/kedro11k—~4kAutomated safety check: PassCustom licence
Dignified Python Standardsdocling-project/docling69k—~1.5kAutomated safety check: PassApache-2.0
Rust Ffiariebovenberg/whenever2.4k—~2.5kAutomated safety check: PassMIT
Diataxis Docs Writercalf-ai/calfkit-sdk1491 repos~3kAutomated safety check: PassApache-2.0

Similar skills

  • Official

    A skill your agent uses when a user says "minimize this ty ecosystem change", "reproduce this ecosystem result", "investigate a primer difference", "investigate a mypyprimer difference"…

    50k GitHub stars~4.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Kedro Babysit

    kedro-org/kedro

    Run Kedro's local lint / format / type-check / tests on changed files (uses the project's pre-commit hooks, ruff, mypy, pytest, lint-imports, detect-secrets, Make targets — in the right venv), or…

    11k GitHub stars~4k tokensUpdated today
    DevelopmentAuto-check passed
  • Dignified Python Standards

    docling-project/docling

    Applies opinionated production Python conventions chosen by the project's Python version: modern type syntax, pathlib, explicit checks and interface guidance.

    69k GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Rust Ffi

    ariebovenberg/whenever

    Instructions for using whenever's internal Rust FFI abstractions

    2.4k GitHub stars~2.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Diataxis Docs Writer

    calf-ai/calfkit-sdk

    Write or improve software documentation using the Diátaxis framework — four documentation types (tutorials, how-to guides, reference, explanation), each serving a different user need.

    149 GitHub starsUsed in 1 repo~3k tokens
    DevelopmentAuto-check passed
  • Update Dependencies

    alorence/django-modern-rpc

    Routine update of all project dependencies — uv itself, uv.lock (all groups), tool versions pinned in GitHub workflows and .pre-commit-config.yaml (uv, ruff, mypy...), and SHA-pinned GitHub Actions.

    111 GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed

More from diegosouzapw/awesome-omni-skills

All 39 skills in this repo
  • Content Creator

    diegosouzapw/awesome-omni-skills

    Content Creator workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

    159 GitHub stars~4k tokensUpdated 3 mo ago
    Auto-check passed
  • Helm Chart Scaffolding

    diegosouzapw/awesome-omni-skills

    Helm Chart Scaffolding workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

    159 GitHub stars~2.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Prompt Engineering

    diegosouzapw/awesome-omni-skills

    Prompt Engineering Patterns workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

    159 GitHub stars~3.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Prompt Engineering Patterns

    diegosouzapw/awesome-omni-skills

    Prompt Engineering Patterns workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

    159 GitHub stars~4k tokensUpdated 3 mo ago
    Auto-check passed
  • Prompt Library

    diegosouzapw/awesome-omni-skills

    📝 Prompt Library workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

    159 GitHub stars~3.1k tokensUpdated 3 mo ago
    Auto-check passed
  • Protocol Reverse Engineering

    diegosouzapw/awesome-omni-skills

    Protocol Reverse Engineering workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

    159 GitHub stars~3.8k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about Python Patterns

What does Python Patterns do?

Python Patterns workflow skill. An agent skill from diegosouzapw/awesome-omni-skills. Python Patterns is an agent skill from diegosouzapw/awesome-omni-skills. Python Patterns workflow skill.

When should I use Python Patterns?

Python Patterns fits situations like: the user needs Python development principles and decision-making; tasks that involve Type safety.

How do I install Python Patterns in Claude Code?

Run `npx skills add diegosouzapw/awesome-omni-skills --skill python-patterns -a claude-code`. Or copy the skill folder (skills_omni/python-patterns in diegosouzapw/awesome-omni-skills) into .claude/skills/python-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Python Patterns in Codex?

Run `npx skills add diegosouzapw/awesome-omni-skills --skill python-patterns -a codex`. Or copy the skill folder (skills_omni/python-patterns in diegosouzapw/awesome-omni-skills) into .agents/skills/python-patterns in your project. Codex loads it when a task matches its description.

Can I use Python Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add diegosouzapw/awesome-omni-skills --skill python-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/python-patterns, .gemini/skills/python-patterns, .github/skills/python-patterns and .opencode/skills/python-patterns in your project.

What does Python Patterns need to run?

Going by SKILL.md and its folder, Python Patterns needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Python Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Python Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Python Patterns use?

Python Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Python Patterns use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2k tokens, read only when the agent opens those files.

What are the alternatives to Python Patterns?

Skills that share tags, products or a category with Python Patterns: Minimizing Ty Ecosystem Changes (astral-sh/ruff, 50k stars), Kedro Babysit (kedro-org/kedro, 11k stars), Dignified Python Standards (docling-project/docling, 69k stars) and Rust Ffi (ariebovenberg/whenever, 2.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Python Patterns?

diegosouzapw (a GitHub user) maintains it in diegosouzapw/awesome-omni-skills, which has 159 GitHub stars. The repository holds 39 skills in this directory. The repository was last updated on July 8, 2026.

Source: diegosouzapw/awesome-omni-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.