All skills
psiace avatar

/piglet

@aafd21d
by Chojan Shangpsiace/skills172 stars
7

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.

Use this Skill: https://skilld.dev/gh/psiace/skills/piglet

This session only. Nothing lands on disk.

referencesvalues-and-containers.md

≈354 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Numbers, Strings, Containers

Guidance

  • Replace repeated magic literals with named constants or enums.
  • Prefer sets or dicts for membership checks.
  • Use lazy iterables when possible to avoid large allocations.

Bad Example

def mark_trip_as_featured(trip):
    if trip.source == 11:
        do_some_thing(trip)
    elif trip.source == 12:
        do_some_other_thing(trip)
    return

Good Example

from enum import IntEnum

class TripSource(IntEnum):
    FROM_WEBSITE = 11
    FROM_IOS_CLIENT = 12


def mark_trip_as_featured(trip):
    if trip.source == TripSource.FROM_WEBSITE:
        do_some_thing(trip)
    elif trip.source == TripSource.FROM_IOS_CLIENT:
        do_some_other_thing(trip)
    return

Bad Example

VALID_NAMES = ["piglei", "raymond", "bojack", "caroline"]

def validate_name(name):
    if name not in VALID_NAMES:
        raise ValueError(f"{name} is not a valid name!")

Good Example

VALID_NAMES = ["piglei", "raymond", "bojack", "caroline"]
VALID_NAMES_SET = set(VALID_NAMES)

def validate_name(name):
    if name not in VALID_NAMES_SET:
        raise ValueError(f"{name} is not a valid name!")

Source: SKILL.md on GitHub

No alerts8d4 checks · Risk SAFE
  • Gen Agent Trust Hub8d

    The 'piglet' skill provides Python craftsmanship guidance and code examples based on the 'One Python Craftsman' repository. It contains no malicious patterns, unauthorized network operations, or security vulnerabilities.

  • Socket8d

    No alerts

  • Snyk8d

    Risk: LOW · No issues

  • Runlayer7mo

    1/14 files flagged

Signed by skilld at aafd21d. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Activeupdated 8 months ago

README badge

README badge for psiace/skills/piglet