python

Generate and refactor idiomatic Python code with performance optimization.

77|4|Updated Jun 20, 2022
One-click install
npx skills add https://github.com/htlin222/dotfiles --skill python-htlin222
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python
Source: https://github.com/htlin222/dotfiles/tree/main/claude.symlink/skills/python
Command: npx skills add https://github.com/htlin222/dotfiles --skill python-htlin222

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers write clean, performant, and idiomatic Python code, addressing challenges in code quality, optimization, and modern feature adoption.

Core Features & Use Cases

  • Code Generation & Refactoring: Generates Python code following best practices, refactors existing code for clarity and efficiency.
  • Performance Optimization: Identifies and resolves performance bottlenecks in Python applications.
  • Tooling Setup: Assists in setting up standard Python development tools like linters and type checkers.
  • Use Case: You need to refactor a legacy Python script to use modern features like type hints and dataclasses, and ensure it adheres to PEP 8 standards.

Quick Start

Use the python skill to refactor the provided code snippet to be more idiomatic and performant.

Frequently Asked Questions about python

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor legacy Python code to use modern features?

To refactor legacy Python code, you can update existing scripts to use modern features like type hints and dataclasses, ensuring the refactored code adheres to PEP 8 standards for clarity and efficiency.

What is the best way to optimize Python code for performance bottlenecks?

Optimizing Python performance requires identifying bottlenecks and refactoring the code to be more idiomatic, utilizing efficient constructs like generators and context managers to resolve performance issues.

How do I set up Python linters and type checkers for my project?

Setting up Python linters and type checkers involves configuring standard development tools that enforce PEP 8 compliance and verify type hints, ensuring clean and performant code generation.

Does writing idiomatic Python require understanding specific PEP standards?

Writing idiomatic Python requires understanding PEP 8, type hints, dataclasses, context managers, and generators to ensure code generation and refactoring meet modern best practices.

Can I use this approach to review Python code for best practices?

Yes, you can review Python code for best practices by analyzing existing scripts against modern standards, refactoring for clarity and efficiency, and ensuring proper tooling setup with linters.