Python code standards
Skill LIghtJUNction/lightjunction/skills/python-code-standards
I'M LIghtJUNction
npx -y skills add LIghtJUNction/lightjunction --skill python-code-standardsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
This skill should be used when the user asks to "write Python code", "add Python code standards", "review Python code", "fix Python style", "refactor Python", "run Python checks", or mentions ruff, ty, mypy, pytest, uv, type annotations, docstrings, exceptions, async Python, or Python project structure.
SKILL.md
2.1 KB, as published. Nobody here has run it
Python Code Standards
Apply this skill when editing, reviewing, or creating Python code. Keep changes small, typed, testable, and aligned with the local project structure.
Workflow
- Inspect the existing Python package layout,
pyproject.toml, tests, and current toolchain before changing files. - Load
references/python-code-standards.mdbefore making non-trivial Python edits or reviewing Python code. - Prefer existing local patterns when they are stricter than the reference. When local patterns conflict with the reference, keep behavior stable and call out the tradeoff.
- Add or update focused pytest coverage for new behavior and regressions.
- Run the narrowest useful validation first, then broader checks when the change affects shared behavior.
Required Defaults
- Use Python 3.13+ conventions when project constraints allow it.
- Use
uvfor environment and dependency workflows. - Use
ruff formatfor formatting andruff checkfor linting. - Use
ty checkormypy --strictfor type checking when configured. - Use
pytestfor tests. - Add complete type annotations for all new code.
- Add docstrings for modules, classes, and public functions.
Validation
Prefer commands already defined by the project. When no project command exists, use these direct checks where applicable:
ruff format
ruff check
ty check
pytest
If ty is not configured or unavailable, use:
mypy --strict src/
Report any check that could not be run and why.
Reference Files
references/python-code-standards.md- Detailed Python organization, typing, imports, docstrings, exceptions, functions, classes, async, testing, tooling, and prohibited-pattern rules.