python-essentials
Python product discipline — ruff/pytest, pyproject+venv, type hints, parameterized data access, Docker-always services. Use when the product stack is python.
- License 许可
- MIT
- 最近更新
- 2026-10-20
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- python-essentials
- license
- MIT
- description
- Python product discipline — ruff/pytest, pyproject+venv, type hints, parameterized data access, Docker-always services. Use when the product stack is python.
- compatibility
- opencode
03 SKILL.md 正文
What I do
- Keep Python products clean per PEP 8 / PEP 484: typed, linted, pytest-verified, Docker-backed.
When to use me
Use on every task whose effective stack (task.stack ?? roadmap.stack, or workspace/pyproject.toml / requirements.txt) is python.
Rules
- Toolchain only:
pip install(inside venv) /python -m <mod>/python -m pytest -q/python -m compileall .. Gate onruff check .ANDruff format --check .clean before exit; dependencies pinned inpyproject.tomlorrequirements.txt. - Verify:
python -m pytest -q(0 failures, including at least one error-path case per new behavior) before exit; paste real output intoworkspace/TASK_PROGRESS.md. Fixtures for setup,parametrizefor cases,tmp_path/monkeypatchover manual teardown; HTTP viaTestClient/httpxASGI transport — never a live background server in tests. Categorize with@pytest.mark.unit/@pytest.mark.integration; coverage viapytest --cov=src --cov-report=term-missingevery run, pasted; <80% on new domain logic fails review. - Style:
snake_casefunctions/vars,PascalCaseclasses; full type hints on public functions (check with the configured checker when present); stdlib first (pathlib,dataclasses); no bareexcept, noprintdebugging leftovers. - Data access: connect via env to declared Docker services; parameterized queries (DB-API
%s/$1placeholders or ORM expressions, never f-string SQL). No SQLite/sqlite3fallback layers — fail fast when a service is unreachable. - Layout:
src/package layout with an explicit package name; tests intests/mirroring the package; never commit.venv/,__pycache__/, or.pytest_cache/.
Depth (vendored ECC reference, MIT © 2026 Affaan Mustafa — read on demand)
-
vendor/ecc/rules/python/coding-style.md,patterns.md,security.md,testing.md,fastapi.md(FastAPI projects) -
vendor/ecc/skills/python-patterns/SKILL.md,vendor/ecc/skills/python-testing/SKILL.md -
Review checklist:
vendor/ecc/agents/python-reviewer.md -
Reloadable staged IDs:
ecc-python-patterns,ecc-python-testing(skill tool, on-demand — staged by workflow/runner, never auto-injected)
04 同仓库更多 Skills
demo-skill
暂无简介
web-accessibility
WCAG 2.2 AA practice for keyboard, screen reader, contrast, and motion. Use when building or auditing user interfaces.
ui-conventions
Black/white token system, accessible components, and copy rules for frontend work. Use when building screens, components, or design tokens.
test-evidence
stack-toolchain test matrices, concurrency cases, and TASK_PROGRESS proof format for QA verification. Use when writing tests or proving deliverables work.
test-driven-development
RED-GREEN-REFACTOR cycle for new behavior. Use when implementing any feature, fix, or endpoint before writing production code.
systematic-debugging
Reproduce-isolate-fix-verify loop for defects and flaky behavior. Use when facing a bug, test failure, or unexpected behavior.