skills/team/pypi-package-scaffold/SKILL.md
Scaffolds production-ready PyPI packages with pyproject.toml, hatch/flit/build tooling, GitHub Actions publish workflow, test harness, and documentation. Python analog of nuget-package-scaffold. Use when creating Python packages, setting up PyPI publishing, configuring package metadata, or building Python libraries.
npx skillsauth add michaelalber/ai-toolkit pypi-package-scaffoldInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
"A library is only as good as its documentation and its tests. Semantic versioning is a contract with your users — break it and you break trust."
A Python package is a contract with its users in three parts: the API surface (what's public), the
version (what changes are breaking), and the metadata (who maintains it, license, supported Python
versions). Packaging is not an afterthought — a package that cannot be installed reliably, has no
tests, ships without type stubs, or lacks documentation is not ready for PyPI. The scaffold
establishes all of these before the first publish, using the src/ layout and Trusted Publishing.
Non-Negotiable Constraints:
pytest must pass (the publish job needs: test) before any upload.requires-python = ">=3.10" minimum; test matrix covers 3.10–3.14.PYTHONHASHSEED=0 in CI; ship both sdist and wheel.Full principle table, KB lookups, command sequences, anti-patterns, discipline rules, and error
recovery live in references/conventions.md.
SCAFFOLD Create the src-layout structure:
src/<package>/{__init__.py (+__all__), py.typed, _internal/}
tests/ docs/ pyproject.toml README.md LICENSE CHANGELOG.md
.github/workflows/{ci.yml, publish.yml}
(Full pyproject.toml in references/pyproject-template.md.)
CONFIGURE Set all required metadata + classifiers + [project.urls] (checklist in conventions.md).
TEST pip install -e ".[dev]"; pytest --cov; mypy --strict; ruff check + format --check.
BUILD python -m build; twine check dist/*; inspect wheel contents.
PUBLISH TestPyPI first (upload + install-verify), then PyPI. Use Trusted Publishing (OIDC), no tokens.
(Automated workflow in references/ci-publish-workflow.md.)
Exit criteria: required metadata complete; pytest, mypy --strict, ruff, and
twine check dist/* all pass; sdist + wheel built; TestPyPI install verified; publish workflow gated
on the test matrix via needs: test.
<pypi-package-state>
phase: SCAFFOLD | CONFIGURE | TEST | BUILD | PUBLISH | COMPLETE
package_name: [name]
version: [semver]
python_requires: [version]
build_tool: hatchling | flit | setuptools | build
type_stubs: true | false
ci_configured: true | false
testpypi_published: true | false
pypi_published: true | false
last_action: [description]
next_action: [description]
</pypi-package-state>
references/output-templates.md.pyproject.toml (metadata, tool config, build-system) — references/pyproject-template.md.references/ci-publish-workflow.md.references/conventions.md.| Skill | Relationship |
|-------|-------------|
| supply-chain-audit | After scaffolding, audit the package's dependencies for CVEs and license compliance. |
| python-security-review | Review the package for security issues before publishing to PyPI. |
| python-architecture-checklist | Ensure the package's internal structure is maintainable. |
| nuget-package-scaffold | Cross-reference for teams publishing both Python and .NET packages — identical philosophy, different tooling. |
development
Interviews the user relentlessly about a plan, decision, or idea — one question at a time, each with a recommended answer. Shared engine behind "grill-me" and "grill-with-docs". Use on any "grill" trigger phrase or to stress-test thinking. Do NOT use to build the plan; it ends at shared understanding, not implementation.
testing
Runs a relentless interview to sharpen a plan or design, capturing the decisions as ADRs and a glossary along the way. Use when the user wants to be grilled AND wants the session to leave durable domain documentation behind. Do NOT use for a throwaway stress-test with no artifacts; use grill-me instead.
tools
OWASP-based security review of Vue/TypeScript front-ends. Detects framework (Vite/Vue CLI/Nuxt), entry points, and data flows; scans the OWASP Top 10 (2025) mapped to Vue client-side risks (raw-HTML XSS via v-html, URL/protocol injection, bundled secrets, insecure token storage, dependency CVEs, missing CSP, open redirects, router guard bypass); emits an exec summary plus graded findings. Use to audit Vue for vulnerabilities. Not for architecture grading (vue-architecture-checklist).
tools
Analyzes legacy Vue codebases and produces actionable modernization plans. Primary migration paths include Options API to Composition API, Vue 2 to Vue 3, Vue CLI to Vite, JavaScript to TypeScript, Vue Test Utils/Karma/Mocha to Vitest + Vue Testing Library, legacy Vuex to Pinia, and removed-in-Vue-3 pattern cleanup (filters, event bus, `$listeners`). Does NOT perform the migration — assesses, quantifies risk, and plans.