---
name: "black-uncompromising-code-formatter"
description: "Format Python code deterministically to eliminate style debates during team pull requests."
metadata:
  author: "Python Software Foundation"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "format python with black"
  - "configure pyproject.toml black"
  - "black check in ci"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Black Uncompromising Python Code Formatter

Configures Black: setting line-length in pyproject.toml, formatting files recursively (black .), check mode in CI (black --check), configuring exclusion regexes, and integrating into pre-commit.

## When to Invoke
Invoke this skill whenever you need to:
- format python with black
- configure pyproject.toml black
- black check in ci

## Execution SOP & Rules
1. Add configuration in pyproject.toml: [tool.black] line-length = 88, target-version = ['py312'].
2. Format codebase: black . to rewrite files in-place with clean deterministic AST formatting.
3. Verify in CI: black --check --diff . exiting with code 1 on formatting discrepancies.
4. Add to .pre-commit-config.yaml hook repository psf/black.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
