agentleFS
niksavisniksavis/basicly/.agents/skills/python/SKILL.md

python

Skill0 starsChanged 55 days agoMITView on GitHub

Writes typed Python with pathlib and Windows-safe subprocesses, and judges whether an abstraction earns its keep. Use for .py edits, an except clause, a size gate or a silenced warning.

26 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use typescript, cicd and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    typescript

    Use this guide when working on TypeScript changes in the FAST monorepo — authoring Web Components, writing templates and styles, working with the observable/reactive system, and testing.

    Also in 9 projects that use this

  • ffsshhttiikkSkill

    cicd

    Continuous integration and delivery pipelines

    Also in 3 projects that use this

  • martinholovskySkill

    fastapi

    REST API and WebSocket development with FastAPI emphasizing security, performance, and async patterns

    Also in 3 projects that use this

  • 0xSeroSkill

    security

    Also in 7 projects that use this

  • akornmeierSkill

    docker

    Guide for using Docker - a containerization platform for building, running, and deploying applications in isolated containers. Use when containerizing applications, creating Dockerfiles, working with Docker Compose, managing images/containers, configuring networking and storage, optimizing builds, deploying to production, or implementing CI/CD pipelines with Docker.

    Also in 4 projects that use this

  • MicrosoftSkill

    code-quality

    Statically check changed C# against the same deterministic rules github-code-quality[bot] runs on pull requests, so a contributor can fix likely findings before opening the PR and keep the bot's inline comments to a minimum. Activate when a contributor asks to "check code quality", "run code quality on my changes", "will the code quality bot complain", "pre-check before I open the PR", "code quality check", or similar. Scoped to C#. Reads the diff and compares it against the enumerated csharp-code-quality rule set below — no CodeQL download or build required. This is a fast approximation of a dataflow engine, not a reproduction; report accordingly. Does NOT apply fixes unless explicitly asked.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write Python that passes the gates on every platform.

    line 9
  2. Very specific:

    Let the formatter own layout: Do not format by hand. Run ruff format and ruff check.

    line 26

“Common” is measured: kept by at least 6 in 10 of the 24 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
<!-- Generated by `basicly skills-build` from skill.yaml. Do not edit; edit the source. -->

Python

Write Python that passes the gates on every platform. The pre-commit hook runs every check that basicly.toml declares for mode fast, for example ruff and pyright. This skill holds the decisions that those gates cannot make.

Rules

  • Leave except A, B: unchanged. On Python 3.14 and later, PEP 758 makes it valid, and it catches either type. It is not the Python 2 capture form.
  • Keep the parentheses when the clause binds a name: except (A, B) as err:. Without them Python raises multiple exception types must be parenthesized when using 'as'.
  • Copy os.environ into a child environment. A bare env dict drops PATH, and Windows then raises [WinError 2].
  • Pass an argv list, not a shell string. shlex.split removes the backslashes of a Windows path.
  • Type-hint public functions, methods and dataclass fields. A public signature is a contract. Inference covers obvious local names.
  • Use pathlib.Path for filesystem work, not os.path string operations.
  • Let the formatter own layout. Do not format by hand. Run ruff format and ruff check.
  • Commit early and let the hook name a type error. A clean ruff check and a green pytest do not prove that pyright passes.

Type test doubles and helpers

Make a helper precise about the type it returns. Make a parameter structural about the double it receives.

  • Return the concrete type: def _fake_args() -> argparse.Namespace:, not -> object. An object trips reportArgumentType at the first call site that passes it on.
  • Type a captured container to its real value type: dict[str, list[str]], not dict[str, object]. An object value trips reportOperatorIssue when the test indexes or compares it.
  • Type a parameter that receives a double as Callable[..., _Proc] or a Protocol, never as a sibling fake class. A second fake or a lambda then fails with "_FakeB" is not assignable to "_FakeA" (reportArgumentType).

Shell out on every platform

Two subprocess mistakes pass on POSIX and fail only on Windows CI. The failure is deterministic, not flaky. Read references/cross-platform.md before you change code that starts a process or builds a command line.

Design decisions

A gate reports a size, a suppression or a complexity, but not the fix. Read references/design.md before you split a file, add an abstraction, silence a warning or choose what to raise and catch.

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.