agentleFS
atsushi-greenatsushi-green/ds-ai-coding-skills/.claude/skills/python-style/SKILL.md

python-style

Skill86 starsChanged 49 days agoMITView on GitHub

Use this when creating, editing, or reviewing Python code — including type hints, docstrings, naming conventions, imports, error handling, and code structure.

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when creating, editing, or reviewing Python code.

    line 8
  2. Distinctive:

    Add type hints to all public function signatures.

    line 12
  3. Very specific:

    Use from __future__ import annotations when convenient.

    line 13
  4. Distinctive:

    Use Google-style docstrings for all public modules, classes, functions, and methods.

    line 17
  5. Distinctive:

    Do not comment obvious syntax.

    line 30
  6. Distinctive:

    Prefer small, pure functions where practical.

    line 34
  7. Very specific:

    Prefer explicit error handling over bare except.

    line 35
  8. Very specific:

    Use pathlib.Path for file paths — see path-and-io skill.

    line 36
  9. Very specific:

    Follow ruff linting and formatting rules configured in pyproject.toml.

    line 37

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: Python Style

Use this skill when creating, editing, or reviewing Python code.

Type Hints

  • Add type hints to all public function signatures.
  • Use from __future__ import annotations when convenient.

Docstrings

  • Use Google-style docstrings for all public modules, classes, functions, and methods.
  • Docstrings should describe:
    • Purpose
    • Args
    • Returns
    • Raises (if applicable)
    • Examples (when helpful)
    • Important assumptions

Comments

  • Inline comments and explanatory comments must be written in Japanese.
  • Comments should explain non-obvious intent, assumptions, or business logic.
  • Do not comment obvious syntax.

Code Style

  • Prefer small, pure functions where practical.
  • Prefer explicit error handling over bare except.
  • Use pathlib.Path for file paths — see path-and-io skill.
  • Follow ruff linting and formatting rules configured in pyproject.toml.

Example

import json
from pathlib import Path


def load_config(config_path: Path) -> dict:
    """設定ファイルを読み込んで辞書として返す。

    Args:
        config_path: 設定ファイルのパス。

    Returns:
        設定内容を格納した辞書。

    Raises:
        FileNotFoundError: 指定されたパスにファイルが存在しない場合。
    """
    # JSONファイルを読み込む
    with config_path.open("r", encoding="utf-8") as f:
        return json.load(f)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.