agentleFS
a365ngaya365ngay/CogniRouter/skills/python-standard/SKILL.md

python-standard

Skill2 starsChanged 5 days agoMITView on GitHub

Standards and workflows for implementing, reviewing, debugging, packaging, testing, and refactoring Python code. Use when working on Python applications, scripts, libraries, APIs, CLIs, data processing jobs, async code, dependency management, pyproject/setup files, pytest tests, type checking, linting, or production hardening. Prefer this skill for existing Python repositories where the agent must detect the runtime, package manager, framework, and local conventions before changing code.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 11 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill to make Python changes that fit the repository's runtime, packaging, typing, and test conventions.

    line 8
  2. Distinctive:

    Prefer existing patterns over new abstractions.

    line 13
  3. Distinctive:

    Keep public APIs, CLI flags, serialized schemas, database migrations, and file formats backward-compatible unless the request says …

    line 14
  4. Distinctive:

    Use type hints for new or changed code when the project is typed.

    line 15
  5. Distinctive:

    Verify with the narrowest useful command: targeted pytest, typecheck, lint/format check, package build, or the repo's own scripts.

    line 17
  6. Distinctive:

    Before changing Python code, identify:

    line 21
  7. Distinctive:

    Test stack: pytest, unittest, tox, nox, coverage, hypothesis.

    line 26
  8. Distinctive:

    Read only what the task needs:

    line 32
  9. Distinctive:

    Add or update tests around changed behavior, especially edge cases and error paths.

    line 42
  10. Distinctive:

    Update dependency/config files only when required, using the repo's package manager.

    line 43
  11. Distinctive:

    Run focused verification and report any command that cannot run.

    line 44

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “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

Python Standard

Use this skill to make Python changes that fit the repository's runtime, packaging, typing, and test conventions. Do not impose a framework or toolchain before discovering what the project already uses.

Operating Rules

  1. Inspect the project before editing: Python version, package manager, framework, test runner, type checker, linter/formatter, and entry points.
  2. Prefer existing patterns over new abstractions. Add dataclasses, Pydantic models, async APIs, dependency injection, or package restructuring only when the task benefits from them.
  3. Keep public APIs, CLI flags, serialized schemas, database migrations, and file formats backward-compatible unless the request says otherwise.
  4. Use type hints for new or changed code when the project is typed. Do not perform noisy whole-repo typing conversions during small fixes.
  5. Separate pure logic from I/O where it improves testability. Keep scripts executable and libraries importable.
  6. Verify with the narrowest useful command: targeted pytest, typecheck, lint/format check, package build, or the repo's own scripts.

Discovery Checklist

Before changing Python code, identify:

  • Python version from .python-version, pyproject.toml, runtime.txt, Dockerfile, CI, or README.
  • Package manager: uv, Poetry, PDM, Hatch, pip-tools, pip/venv, Conda.
  • Framework: FastAPI, Django, Flask, Typer/Click, Celery/RQ, pandas, notebooks, plain scripts.
  • Test stack: pytest, unittest, tox, nox, coverage, hypothesis.
  • Quality tools: ruff, black, isort, mypy, pyright, pylint, pre-commit.
  • Config files: pyproject.toml, setup.cfg, tox.ini, .pre-commit-config.yaml, CI workflows.

Reference Routing

Read only what the task needs:

  • references/project-environment.md: packaging, dependencies, environments, entry points, config.
  • references/code-design.md: Python design, typing, dataclasses/Pydantic, errors, async, I/O boundaries.
  • references/testing-quality.md: pytest, mocks, fixtures, coverage, type/lint/format verification.

Implementation Workflow

  1. Find the closest existing module/test and mirror its style.
  2. Make the smallest behavioral change first.
  3. Add or update tests around changed behavior, especially edge cases and error paths.
  4. Update dependency/config files only when required, using the repo's package manager.
  5. Run focused verification and report any command that cannot run.

Review Workflow

Prioritize findings in this order:

  1. Incorrect behavior, data loss, security issues, unsafe deserialization, path traversal, command injection, or secret leaks.
  2. Broken async/concurrency behavior, resource leaks, file/socket/session cleanup gaps.
  3. Public API, CLI, schema, or migration regressions.
  4. Missing tests for changed behavior and brittle tests that mock the wrong boundary.
  5. Typing, lint, and maintainability issues that hide real defects.

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.