- For any python file, be sure to ALWAYS add typing annotations to each function or class. Be sure to include return types when necessary.
- Add descriptive docstrings to all python functions and classes as well. Please use pep257 convention. Update existing docstrings if need be.
- Make sure you keep any comments that exist in a file.
- When writing tests, make sure that you ONLY use pytest or pytest plugins, do NOT use the unittest module.
- All tests should have typing annotations as well.
- All tests should be in ./tests. Be sure to create all necessary files and folders. If you are creating files inside of ./tests or ./src/goob_ai, be sure to make a init.py file if one does not exist.
- All tests should be fully annotated and should contain docstrings.
- Be sure to import the following if TYPE_CHECKING: from _pytest.capture import CaptureFixture from _pytest.fixtures import FixtureRequest from _pytest.logging import LogCaptureFixture from _pytest.monkeypatch import MonkeyPatch from pytest_mock.plugin import MockerFixture
- Dependency management via https://github.com/astral-sh/uv and virtual environments.
- Code style consistency using Ruff.
Python General Rules
[Applies to: **/*.py] Applies general Python development guidelines including typing, docstrings, dependency management, testing with pytest, and code style using Ruff.
Python General Rules by Tryboy869 · 29b9bc0
npx skillmds add tryboy869/python-general-rules File contents
---name: python-general-rulesdescription: [Applies to: **/*.py] Applies general Python development guidelines including typing, docstrings, dependency management, testing with pytest, and code style using Ruff.---- For any python file, be sure to ALWAYS add typing annotations to each function or class. Be sure to include return types when necessary.- Add descriptive docstrings to all python functions and classes as well. Please use pep257 convention. Update existing docstrings if need be.- Make sure you keep any comments that exist in a file.- When writing tests, make sure that you ONLY use pytest or pytest plugins, do NOT use the unittest module.- All tests should have typing annotations as well.- All tests should be in ./tests. Be sure to create all necessary files and folders. If you are creating files inside of ./tests or ./src/goob_ai, be sure to make a init.py file if one does not exist.- All tests should be fully annotated and should contain docstrings.- Be sure to import the following if TYPE_CHECKING: from _pytest.capture import CaptureFixture from _pytest.fixtures import FixtureRequest from _pytest.logging import LogCaptureFixture from _pytest.monkeypatch import MonkeyPatch from pytest_mock.plugin import MockerFixture- Dependency management via https://github.com/astral-sh/uv and virtual environments.- Code style consistency using Ruff.
Tryboy869/dojutsu-for-ai/tree/main/senjutsu/skills/python-general-rules commit 29b9bc0ecc
Frequently asked questions
Run npx skillmds add tryboy869/python-general-rules in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
[Applies to: **/*.py] Applies general Python development guidelines including typing, docstrings, dependency management, testing with pytest, and code style using Ruff. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: executes scripts, makes network calls. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Tryboy869 (@tryboy869) published this skill. Their other Agent Skills are listed on their SkillMD profile.