agentleFS
adymireadymire/CraftLayer/skills/python-engineering/SKILL.md

python-engineering

Skill0 starsChanged 3 days agoMITView on GitHub

Implement maintainable Python features using the project's supported versions, packaging, typing, tests, and runtime conventions.

8 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use rust-engineering, go-engineering and 1 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.
  • pirafrankSkill

    rust-engineering

    Apply pragmatic Rust engineering conventions when implementing, modifying, reviewing, or refactoring Rust code. Use for Rust CLI tools, system utilities, daemons, filesystem operations, network integrations, and security-sensitive code. Based on the official Rust guidelines and selected Google Rust Style Guide practices.

    Also in 4 projects that use this

  • caseyngSkill

    go-engineering

    Senior Go engineering standards for production code. Module structure, error handling, interface design, concurrency, context propagation, testing, security, observability. Includes gomobile-specific constraints for cross-language bindings. Compose with code-integrity-guardrail go for verification. Trigger on: any Go implementation task, any gomobile binding, any Go component in pipeline.

    Also in 4 projects that use this

  • SentrySkill

    security-review

    Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 11 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use for Python application, library, CLI, automation, data, or backend code.

    line 10
  2. Distinctive:

    Do not add Python as a second runtime to a TypeScript-only product without an explicit need.

    line 16
  3. Distinctive:

    Follow the existing package and import structure.

    line 28
  4. Distinctive:

    Keep side effects (filesystem, network, subprocess, database) explicit and injectable where project tests require it.

    line 33
  5. Distinctive:

    Use context managers for resources and structured exceptions that callers can handle.

    line 35
  6. Distinctive:

    Add tests for normal, boundary, and failure behavior with isolated temporary resources.

    line 37
  7. Distinctive:

    Run the configured formatter, linter, type checker, and tests under the project's supported interpreter.

    line 39
  8. Very specific:

    Avoid mutable default arguments, broad except Exception, and hidden module-level I/O.

    line 45
  9. Distinctive:

    Use standard library facilities unless a dependency has a clear purpose.

    line 47
  10. Distinctive:

    Do not build shell commands by concatenating untrusted values.

    line 48
  11. Distinctive:

    Document when a function mutates data or performs I/O.

    line 50
  12. Distinctive:

    Run the repository's formatter, linter, type checker, and test suite.

    line 72

“Common” is measured: kept by at least 6 in 10 of the 6 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

Python Engineering

When to use

Use for Python application, library, CLI, automation, data, or backend code. It is also useful when a repository contains Python tooling alongside TypeScript/JavaScript.

When not to use

Do not add Python as a second runtime to a TypeScript-only product without an explicit need. Do not change the supported Python range or package manager as unrelated cleanup.

Inputs and assumptions

Inspect pyproject.toml, lockfiles, supported Python range, virtual environment, package layout, formatter/linter/type checker, test runner, and neighboring code. Confirm whether the module is public API or internal.

Workflow

  1. Follow the existing package and import structure; avoid implicit dependencies on the current working directory.
  2. Type public functions and domain boundaries. Use precise built-in or project-defined types; model invalid/optional states explicitly.
  3. Validate external data and configuration at entry points.
  4. Keep side effects (filesystem, network, subprocess, database) explicit and injectable where project tests require it.
  5. Use context managers for resources and structured exceptions that callers can handle; do not catch broadly and suppress failures.
  6. Add tests for normal, boundary, and failure behavior with isolated temporary resources.
  7. Run the configured formatter, linter, type checker, and tests under the project's supported interpreter.

Decision rules

  • Preserve the project's minimum and maximum tested Python versions.
  • Avoid mutable default arguments, broad except Exception, and hidden module-level I/O.
  • Use standard library facilities unless a dependency has a clear purpose.
  • Do not build shell commands by concatenating untrusted values; pass argument arrays and validate paths.
  • Document when a function mutates data or performs I/O.

Example

from pathlib import Path

def read_config(path: Path) -> str:
    if not path.is_file():
        raise FileNotFoundError(f"Configuration file not found: {path}")
    return path.read_text(encoding="utf-8")

Common failures

  • Testing only on the developer's interpreter instead of the declared range.
  • Returning None for unrelated failures without documenting it.
  • Assuming strings, decoded JSON, or environment values have valid shapes.
  • Adding a global cache that leaks test state or tenant data.

Validation

Run the repository's formatter, linter, type checker, and test suite. Exercise missing/invalid input and filesystem/network failures. Confirm packaging and imports work from outside the repository root.

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.