一键导入
shareable-packages
Making Python or TypeScript packages shareable (pip/npm)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Making Python or TypeScript packages shareable (pip/npm)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Debug code using detailed profiling and critical path timing before making suggestions
Workflow for investigating and fixing failing tests in this project
Setup pytest with coverage reporting and watch mode for this Python project
Commands to execute tests in this project with various options and configurations
Format code according to project standards and fix linting issues
Git branch strategy, commit conventions, and PR process for this project
| name | shareable-packages |
| description | Making Python or TypeScript packages shareable (pip/npm) |
| auto-activates | ["make packages shareable","shareable package","prepare for pip publish","prepare for npm publish","automate packaging","publish to PyPI","publish to npm","installable package","portable package"] |
Portable workflow for making a codebase installable and publishable. Detect the project language first, then follow the matching section.
pyproject.toml, setup.py, setup.cfg, or requirements*.txt at repo root.package.json at repo root (and optionally tsconfig.json).If both exist, ask the user which package(s) they want to make shareable, or apply the relevant section per directory (e.g. a monorepo with packages/python and packages/ts).
pyproject.toml (PEP 517/518):
[build-system] with build-backend = "setuptools.build_meta" (or hatchling, flit).[project] with name, version, description, readme, requires-python, dependencies.setup.py, move metadata and install_requires into pyproject.toml; keep a minimal setup.py only if needed for editable installs.packages (or [tool.setuptools.packages.find]) so all installable packages are included; exclude test*, docs*, etc.from mypackage.module import foo). No reliance on repo root in sys.path for production code.src/ layout (src/<package_name>/) for a cleaner install.pip install -e . then run the project's test command (e.g. pytest tests/ -q). No PYTHONPATH hacks.version in pyproject.toml or a version.py read by it.pip install build && python -m build → dist/*.whl and dist/*.tar.gz.pip install <package-name> or pip install --index-url ... <package-name>.scripts/ensure_shareable.sh: create temp venv, pip install -e ., run tests (e.g. pytest tests/ -q); exit 0 only if all pass.scripts/build.sh: install build, run python -m build, list dist/. No upload.package.json has: name, version, description, main (and/or module, types), files (e.g. ["dist", "src"]), scripts.build.tsconfig.json with correct outDir (e.g. dist/); build produces output that main/module/types point to.@org/package-name for private npm or org-scoped publish).main (CJS), module (ESM), types (TypeScript) must resolve to built files (e.g. dist/index.js, dist/index.d.ts).node_modules.npm pack (or pnpm pack), then npm install ./<package>-*.tgz in another folder and require() or import the package; run the library's tests if present.version in package.json (or tool that writes it, e.g. from git tag).npm run build (or pnpm build); then npm pack → <name>-<version>.tgz. Optionally prepare for npm publish --dry-run.npm install <package-name> or npm install --registry=... <package-name>.scripts/ensure_shareable.sh: in temp dir, npm pack from project, install the tarball elsewhere, run consumer smoke test or the project's test script.scripts/build.sh: npm run build (or pnpm build), then npm pack; list the generated .tgz. No publish.| Goal | Python | TypeScript |
|---|---|---|
| Build config | pyproject.toml [build-system] + [project] | package.json name, version, main/module/types, files |
| Install local | pip install -e . | npm link or npm install /path/to/tarball.tgz |
| Build artifacts | python -m build → dist/ | npm run build then npm pack → .tgz |
| Verify shareable | New venv, pip install -e ., run tests | New dir, install from npm pack, run tests |
| Publish | Document only; use twine/CI when asked | Document only; use npm publish when asked |
For larger repos, the agent can create or update a plan document (e.g. docs/shareable_packages_plan.md) that:
Use the same checklist order (A → B → C → D) and "do not publish/bump/split unless asked" rules.