good-python

Codify test-backed Python guidelines for explicit behavior and documentation.

6|Updated Feb 9, 2025
One-click install
npx skills add https://github.com/alberti42/dotfiles --skill good-python
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: good-python
Source: https://github.com/alberti42/dotfiles/tree/main/.config/opencode/skills/good-python
Command: npx skills add https://github.com/alberti42/dotfiles --skill good-python

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guideline set helps developers write clear, maintainable, and test-backed Python code, reducing technical debt and increasing reproducibility across projects.

Core Features & Use Cases

  • Explicit behavior: Encourage code that makes decisions and outcomes clear instead of hidden magic.
  • Small, test-backed steps: Promote incremental changes with tests or verifiable reproduce cases.
  • Removal of dead, obscured code: Guide pruning of unclear blocks to reduce future confusion.
  • Documentation that teaches why: Emphasize explanations that help future maintainers. These guidelines are applicable to everyday scripting, data science prototypes matured into real projects, and educational contexts for junior developers who need reliable patterns.

Quick Start

Provide a minimal, testable plan to improve a given Python function by clarifying intent and adding a basic test.

Frequently Asked Questions about good-python

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

FAQPage Schema
How do I improve Python code maintainability when refactoring a prototype?

Improve Python code maintainability by applying explicit behavior guidelines, pruning dead code, and making incremental changes with tests to ensure reproducibility across refactoring projects.

What is the best way to write clear Python code for junior developers?

The best way to write clear Python code is to enforce explicit behavior, take small tested steps, and add documentation that teaches why decisions were made to guide future maintainers.

How do I add tests to existing Python code without breaking functionality?

Add tests to existing Python code by promoting small, test-backed incremental changes and verifiable reproduce cases, ensuring outcomes remain clear while reducing hidden technical debt.

Why does removing dead code help with Python refactoring?

Removing dead code helps Python refactoring by pruning obscured blocks, which reduces future confusion and technical debt while making code intent explicit and maintainable.

Can I use these Python best practices for data science scripts?

Yes, you can use these Python best practices for data science scripts, specifically when maturing prototypes into real projects by enforcing explicit behavior, tested steps, and clear documentation.

When do I need explicit behavior in Python coding?

You need explicit behavior in Python coding when you want to make decisions and outcomes clear instead of relying on hidden magic, which is essential for everyday scripting and educational contexts.