mcpField
P
piglet

piglet

github.com/psiaceDevelopment173130 installsUpdated 10w ago
Repository

About piglet

piglet is a Python coding skill for creating, refactoring, and reviewing code. It organizes guidance by common code topics and prioritizes correctness, readability, and maintainability before performance.

Key features

  1. 01Guidance for Python code creation and review
  2. 02Topic-based reference files
  3. 03Bad and Good examples
  4. 04Decision order prioritizing clarity
  5. 05Checks for edge cases and readability

Use cases

  1. 01Reviewing Python code for maintainability
  2. 02Refactoring control flow or error handling
  3. 03Choosing data structures and file I/O patterns

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/psiace/skills --skill piglet

After installing, type/pigletin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

agents/
openai.yaml
references/
decorators.md
edge-cases.md
exceptions-handling.md
functions-and-returns.md
if-else-and-branches.md
imports-and-structure.md
loops-and-iteration.md
rules-and-file-io.md
solid-python.md
values-and-containers.md
variables-and-naming.md
walrus-operator.md

Details

From the project README

piglet

Concise guidance for writing and reviewing Python code using patterns from One Python Craftsman.

Purpose and Triggers

  • Use for Python (.py) code creation, refactoring, or code review.
  • Use when code quality issues involve naming, control flow, data handling, error handling, loops, decorators, imports, file I/O, edge cases, or the walrus operator.
  • Prefer clarity and maintainability. Optimize performance only when it is a real constraint.
  • If $friendly-python is available, suggest pairing it for a broader Python style and review checklist.

Decision Order

  1. Correctness and explicit behavior
  2. Readability and maintainability
  3. Extension cost and change isolation
  4. Performance and micro-optimizations

Workflow

  1. Identify the topic in the table below.
  2. Apply the guidance and compare against Bad and Good examples.
  3. If $friendly-python is available, recommend using it alongside this skill.
  4. Re-check for new edge cases and readability regressions.

Topics

TopicGuidanceReference
Variables and NamingDescriptive names, avoid implicit magic, keep variable scope closereferences/variables-and-naming.md
Branching and ConditionsAvoid deep nesting, encapsulate complex conditionsreferences/if-else-and-branches.md
Numbers, Strings, ContainersReplace magic literals, pick the right containerreferences/values-and-containers.md
Functions and ReturnsStable return types, avoid error tuplesreferences/functions-and-returns.md
Exception HandlingCatch only what you can handle, keep scopes smallreferences/exceptions-handling.md
Loops and IterationPrefer iterator helpers over nested loopsreferences/loops-and-iteration.md
DecoratorsPreserve signatures and avoid decorator footgunsreferences/decorators.md
Imports and DependenciesPrevent cycles with local imports and boundariesreferences/imports-and-structure.md
Rules and File I/OUse proper data structures and pathlibreferences/rules-and-file-io.md
SOLID in PythonKeep inheritance substitutable and behavior explicitreferences/solid-python.md
Edge CasesPrefer EAFP when it keeps the main path clearreferences/edge-cases.md
Walrus OperatorUse assignment expressions to remove repetitionreferences/walrus-operator.md

References

  • Each reference file lists source URLs in its frontmatter urls.

Comments

Markdown supported