python-code

Guide Python project design, refactoring, testing, and SQLite access patterns.

2|Updated May 20, 2026
One-click install
npx skills add https://github.com/Dianshu-Liao/SkilLGuard --skill python-code-dianshu-liao
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-code
Source: https://github.com/Dianshu-Liao/SkilLGuard/tree/main/data/skills/python-code
Command: npx skills add https://github.com/Dianshu-Liao/SkilLGuard --skill python-code-dianshu-liao

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you design, structure, debug, and maintain Python projects so you can ship reliable code without turning setup, testing, and documentation into recurring problems.

Core Features & Use Cases

  • Project scaffolding and organization: Selects practical folder layouts (including src/ layouts), package naming, and configuration structure so the codebase stays understandable as it grows.
  • Safe evolution of existing code: Encourages preserving APIs, splitting overly large modules, adding or updating tests before/refactoring, and documenting behavior changes clearly.
  • SQLite (sql3) implementation guidance: Recommends safe connection patterns, parameterized queries, explicit schemas, and cautious handling of destructive operations.
  • Bug-fix documentation standards: Produces guidance for minimal reproductions, regression tests, commit messages, and optional changelog entries.
  • Code clarity practices: Promotes docstrings for public APIs, signal-rich comments for “why,” and PEP 8 style consistency.

Quick Start

Use the python-code skill to help you scaffold and structure a new Python package with a clean src/ layout, add a basic test setup, and outline how to record a bug fix with a clear commit message.

Frequently Asked Questions about python-code

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

FAQPage Schema
How do I structure a Python project with a src layout?

To structure a Python project with a src layout, you should organize package code under a src/ directory, separate tests, and define configuration files. This approach keeps your codebase understandable and prevents import errors as the project grows.

What's the best way to write safe SQLite queries in Python?

The best way to write safe SQLite queries in Python is to use parameterized queries and explicit schemas. Safe connection patterns and cautious handling of destructive operations prevent SQL injection and ensure transaction-aware database access.

How do I refactor Python code without breaking existing APIs?

To refactor Python code without breaking existing APIs, preserve public interfaces and split overly large modules. You should add or update tests before refactoring and document behavior changes clearly to ensure safe evolution of existing code.

How do I document a bug fix with a regression test in Python?

To document a bug fix with a regression test in Python, create a minimal reproduction, write a failing test, and fix the behavior. You should then produce clear commit messages and optional changelog entries to reduce future regressions.

Does Python code refactoring require PEP 8 style consistency and docstrings?

Python code refactoring requires PEP 8 style consistency and docstrings for public APIs. Promoting code clarity practices, including signal-rich comments explaining the “why,” ensures the refactored modules remain maintainable and understandable.

When should I split large Python modules during refactoring?

You should split large Python modules during refactoring when module boundaries become unclear or files grow overly complex. This improves code structure, preserves existing APIs, and maintains a manageable project scaffold as the codebase evolves.