Skip to content
Back to skills

Python Professional Usage

ASecurity

`analysis-agent`/`task-agent`/`review-agent`: use when Python changes cross import, async, resource, typing, mutability, or serialization boundaries; skip tool-only work.

  • 7 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 8, 2026
databasespythonrustapisecurityperformance

Works with

  • cursor
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 22, 2026

npx -y skills add machenjie/rd-skills --skill python-professional-usage --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Professional Usage?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python Professional Usage
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/machenjie-python-professional-usage/badge)](https://www.skillsdirectory.com/skills/machenjie-python-professional-usage)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: python-professional-usage
description: "`analysis-agent`/`task-agent`/`review-agent`: use when Python changes cross import, async, resource, typing, mutability, or serialization boundaries; skip tool-only work."
---

# python-professional-usage

## Registry Trigger

**Use when**

- Inspect or change Python import or initialization, async and blocking work, owned resources, public typing, shared mutability, or serialization behavior.
- Python runtime semantics can change failure, cleanup, cancellation, isolation, or consumer compatibility in the current scope.

**Do not use when**

- The open decision is language/runtime selection, dependency policy, build mechanics, test strategy, or a measured performance bottleneck.
- No task-local Python-specific runtime or data boundary requires inspection or change.

## Skill Role

Protect Python import and initialization behavior, async and blocking boundaries, resource lifetime, dynamic type and mutability hazards, and serialization semantics.

## High-Value Rules

- Identify import side effects, ordering, reload, fork/spawn, and failure behavior.
- Reject irreversible external effects during module import. Permit explicit immutable environment or configuration reads when deterministic, side-effect-bounded, reload/fork-safe, failure-defined, and validated across supported entrypoints.
- Classify blocking calls, spawned tasks, cancellation, exception observation, and context propagation on async paths.
- Bind files, responses, sessions, cursors, temporary resources, and locks to an explicit cleanup owner.
- Parse untrusted values before relying on static types; preserve missing, `None`, falsey, subclass, and coercion semantics.
- Define reset and synchronization ownership for mutable defaults, caches, and process or task globals.
- Bound serialization by format, version, admitted types, unknown fields, numeric/time semantics, and construction hooks.
- Preserve exception causes, cleanup, partial state, transaction outcome, and retry classification across layers.

## Anti-Patterns

- An async function calls blocking code or starts background work whose lifetime and failure have no owner.
- Import performs network, migration, registration, or mutable or implicit configuration work that changes under reload, workers, or fork/spawn.
- A type annotation, `Any`, cast, or successful deserialize is treated as proof that runtime input is valid and compatible.
- A mutable default, cached singleton, or shallow copy leaks state between requests or tests, while cleanup covers the happy path alone.

## Stop Conditions

- Route language, package, build, test, and performance decisions to their specialist owners.
- Route hostile deserialization or command execution to `security-privacy-gate`, public schemas to `data-api-contract-changer`, and money or timezone semantics to `i18n-timezone-money-safety`.

## Output Contract

- Python boundary decision with inspected import and initialization, async and cancellation, resource lifetime, typing and mutability, serialization and exception behavior, validation evidence, proof limits, residual risk, and specialist handoffs

## Targeted References

| Path | Type | Load when | Do not load when | Required by | Required output |
|---|---|---|---|---|---|
| [benchmarks and patterns](references/benchmarks-and-patterns.md) | benchmark-pattern | Python change crosses import async resource mutability typing serialization or exception boundary whose failure semantics remain unclear | Current Python entrypoints value contracts and focused checks settle the changed boundary | task-agent, analysis-agent, review-agent | option-comparison, selected-approach |

Files in this skill

  • SKILL.md3.6 KB
  • references/benchmarks-and-patterns.md2.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…