Back to list
cardoso-neto

python

by cardoso-neto

0🍴 0📅 Jan 23, 2026

SKILL.md


name: python description: Always use this skill when writing or editing python code!

python

  • Keep lines short and avoid horizontal alignment.
  • isort and black (unless the project specifies otherwise).
    • Install them with pip if not already installed.
  • Avoid try except Exception that swallows errors.
    • Prefer logging, re-raising it, or handling specific exceptions.
  • Always add type hints to code; especially anything non-obvious.
    • Prefer | over Union[] and | None over Optional.
    • Run a type checker (e.g.: mypy) and fix all errors after writing the code.
  • Whenever possible, extract logic out to staticmethods and classmethods.
  • Don't return multiline statements; prefer assigning then returning.
  • When using pydantic, prefer the new validators over the older @validator decorators.
    • e.g.: number: Annotated[int, AfterValidator(is_even)]
  • Don't write useless getters and setters such as:
      def get_my_items(self) -> list[MyItem]:
        return self.my_items
    
    • Access the attributes directly.
  • Don't setup logging in libraries; leave that to the application using the library.

dependencies

  • Prefer adding dependencies without version constraints unless absolutely necessary.
  • Never try except missing imports; assume users of our code will install all needed dependencies.
    • Add them to requirements.txt or equivalent.
    • Also, imports should always be at the top of the file.
  • When installing packages for source code that's local, use pip install -e ./path.
    • So we don't confuse ourselves editing local code and running things from site-packages.

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon