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.

referenceswalrus-operator.md

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

Walrus Operator

Guidance

  • Use assignment expressions to avoid repeating expensive expressions.
  • Do not trade clarity for cleverness; keep the condition readable.

Bad Example

import re

LEADING_W_WORD = re.compile(r"\bw\w*?\b", re.I)
TRAILING_W_WORD = re.compile(r"\b\w*?w\b", re.I)


def find_w_word(s):
    if LEADING_W_WORD.search(s):
        word = LEADING_W_WORD.search(s).group()
        print(f"Found word starts with w: {word}")
    elif TRAILING_W_WORD.search(s):
        word = TRAILING_W_WORD.search(s).group()
        print(f"Found word ends with w: {word}")

Good Example

import re

LEADING_W_WORD = re.compile(r"\bw\w*?\b", re.I)
TRAILING_W_WORD = re.compile(r"\b\w*?w\b", re.I)


def find_w_word_v3(s):
    if (l_match := LEADING_W_WORD.search(s)):
        word = l_match.group()
        print(f"Found word starts with w: {word}")
    elif (t_match := TRAILING_W_WORD.search(s)):
        word = t_match.group()
        print(f"Found word ends with w: {word}")

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