Skip to content
Back to skills

Python Standard

ASecurity

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.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 26, 2026
ai-agentspythongofastapidjangoflaskdockertestingdebuggingrefactoringapi

Works with

  • cli
  • api

Security analysis

A100/100

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

Scanned November 26, 2026

npx -y skills add a365ngay/CogniRouter --skill python-standard --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Standard?

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

Security grade badge for Python Standard
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/a365ngay-python-standard/badge)](https://www.skillsdirectory.com/skills/a365ngay-python-standard)

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-standard
description: 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.
---

# 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.

Files in this skill

  • SKILL.md3.4 KB
  • agents/openai.yaml302 B
  • references/code-design.md2.1 KB
  • references/project-environment.md1.5 KB
  • references/testing-quality.md1.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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.