piglet

Practical Python craftsmanship guidance based on One Python Craftsman. Use when writing, refactoring, or reviewing Python code for naming, branching, data structures, functions, exceptions, loops, decorators, imports, file I/O, edge cases, and modern syntax choices. If the skills set includes friendly-python, suggest invoking it for better Python outcomes.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "piglet" with this command: npx skills add psiace/piglet

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.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Spicy Ai Video

Turn a 60-second talking head clip into 1080p high-energy edited videos just by typing what you need. Whether it's turning bland footage into visually intens...

Registry SourceRecently Updated
Coding

Video Maker Fast

Get polished MP4 videos ready to post, without touching a single slider. Upload your video clips (MP4, MOV, AVI, WebM, up to 500MB), say something like "trim...

Registry SourceRecently Updated
Coding

Generation Generator

generate text prompts or clips into AI generated videos with this skill. Works with MP4, MOV, PNG, JPG files up to 500MB. marketers, content creators, social...

Registry SourceRecently Updated
Coding

Editor On Android

Get edited MP4 clips ready to post, without touching a single slider. Upload your video clips (MP4, MOV, AVI, WebM, up to 500MB), say something like "trim th...

Registry SourceRecently Updated