agentleFS
cisco-opencisco-open/ai-harness-toolkit/skills/python-best-practices/SKILL.md

python-best-practices

Skill13 starsChanged 7 months agoApache-2.0View on GitHub

Review and improve Python code using focused guidance on common anti-patterns, performance bottlenecks, test quality, and error handling. Use this skill when writing or reviewing Python code that needs judgment beyond linters and type checkers.

15 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use typescript-best-practices, react-best-practices and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ofershapSkill

    typescript-best-practices

    Also in 3 projects that use this

  • OpenAISkill

    react-best-practices

    React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

    Also in 3 projects that use this

  • VercelSkill

    frontend-design

    Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.

    Also in 4 projects that use this

  • MicrosoftSkill

    skill-creator

    Guide for creating effective GitHub Copilot skills (.github/skills/) in this repository. Use when creating a new skill, updating an existing skill, or when asked about skill structure, format, or best practices for the vscode-documentdb project.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when reviewing or writing Python code that needs human-style engineering judgment: code smells, hot-path performance issues, …

    line 11
  2. Distinctive:

    Start by identifying the kind of Python work in front of you, then read only the matching reference files.

    line 15
  3. Very specific:

    Read references/anti-patterns.md when reviewing general code quality, maintainability, architecture smells, configuration handling, …

    line 17
  4. Very specific:

    Read references/performance.md when the code is latency-sensitive, CPU-heavy, memory-heavy, uses async execution, or appears to sit on a …

    line 18
  5. Very specific:

    Read references/testing.md when reviewing test code, coverage quality, fixtures, mocking strategy, parameterization, or the structure of a …

    line 19
  6. Very specific:

    Read references/error-handling.md when reviewing validation, exceptions, failure modes, batch processing, recovery behavior, or API/service …

    line 20
  7. Distinctive:

    Use the references to look for issues that mechanical tools often miss:

    line 30
  8. Distinctive:

    Do not inline the full guidance from the references into your response unless the user asks for it.

    line 38

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Python Best Practices

Use this skill when reviewing or writing Python code that needs human-style engineering judgment: code smells, hot-path performance issues, test quality, and robust failure handling.

How To Use This Skill

Start by identifying the kind of Python work in front of you, then read only the matching reference files.

  • Read references/anti-patterns.md when reviewing general code quality, maintainability, architecture smells, configuration handling, resource usage, or type-safety issues.
  • Read references/performance.md when the code is latency-sensitive, CPU-heavy, memory-heavy, uses async execution, or appears to sit on a hot path.
  • Read references/testing.md when reviewing test code, coverage quality, fixtures, mocking strategy, parameterization, or the structure of a pytest suite.
  • Read references/error-handling.md when reviewing validation, exceptions, failure modes, batch processing, recovery behavior, or API/service robustness.

Load more than one reference when the change crosses concerns. Examples:

  • API handlers often need both references/error-handling.md and references/testing.md.
  • Async services often need both references/performance.md and references/anti-patterns.md.
  • Refactors of business logic and persistence boundaries often need both references/anti-patterns.md and references/error-handling.md.

Review Focus

Use the references to look for issues that mechanical tools often miss:

  • brittle boundaries between I/O and business logic
  • retries, timeouts, and configuration scattered through the code
  • blocking work inside async flows
  • tests that only cover happy paths or overuse mocks
  • exceptions that lose context or hide partial failures

Do not inline the full guidance from the references into your response unless the user asks for it. Read the relevant file, apply it to the code at hand, and return concrete findings or edits.

Reference Map

  • references/anti-patterns.md
  • references/performance.md
  • references/testing.md
  • references/error-handling.md

Attribution

The reference material in this skill is adapted from wshobson/agents and used under the MIT license. See NOTICE for the full license text and copyright notice.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.