Skip to content
Back to skills

Python Language

ASecurity

Core Python 3.11+ language standards for typing, dataclasses, imports, pathlib, and stdlib-first code. Use for idiomatic language constructs in Python modules or stubs; defer pytest fixtures, database/client configuration, subprocess security, and other specialized concerns.

  • 549 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 5, 2026
developmentpythongodatabasesecurity

Works with

  • cli

Security analysis

A100/100

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

Scanned September 5, 2026

npx -y skills add HoangNguyen0403/agent-skills-standard --skill python-language --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Language?

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

Security grade badge for Python Language
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hoangnguyen0403-python-language-7b602ea5/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-python-language-7b602ea5)

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-language
description: Core Python 3.11+ language standards for typing, dataclasses, imports, pathlib, and stdlib-first code. Use for idiomatic language constructs in Python modules or stubs; defer pytest fixtures, database/client configuration, subprocess security, and other specialized concerns.
metadata:
  triggers:
    files:
      - "**/*.py"
      - "**/*.pyi"
      - "pyproject.toml"
    keywords:
      - python
      - dataclass
      - typing
      - pathlib
      - protocol
      - typeddict
---

# Python Language

## **Priority: P0 (CRITICAL)**

## Rules

- Prefer `from __future__ import annotations` in modern modules.
- Type public functions, return values, and boundary data shapes.
- Use `pathlib.Path`, `contextlib`, `enum`, and stdlib helpers before custom wrappers.
- Use `@dataclass(frozen=True)` for immutable contracts and value objects.
- Prefer `Protocol`, `TypedDict`, or small dataclasses over `dict[str, Any]` sprawl.

## Recipe

1. **Model contracts explicitly** with dataclasses, typed dicts, or pydantic at I/O boundaries.
2. **Keep imports stable**: stdlib, third-party, local.
3. **Use comprehensions and generators carefully**; stop when readability drops.
4. **Choose explicit timezone-aware datetimes** for persisted or user-visible timestamps.
5. **Keep module side effects minimal**; import should not start work.

## Anti-Patterns

- **No mutable defaults**: use `field(default_factory=...)`.
- **No `os.path` in new code**: prefer `Path`.
- **No `Any` as escape hatch**: narrow unknown shapes or validate them.
- **No import-time env reads for volatile runtime state** unless cached config is intentional.

## Verify

- Run parser/type checks after cross-module type changes.
- Load [Framework Map](../references/framework-map.md) for category defaults.

## References

- [Framework Map](../references/framework-map.md)

Files in this skill

  • SKILL.md1.8 KB
  • evals/evals.json1.1 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…