

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1234567# Publish Package89> **HARD GATE** — Do not attempt to publish without verifying prerequisites. Missing auth tokens, stale builds, or duplicate versions cause CI failures that are hard to debug post-push.10>11> **HARD GATE** — Always run `--dry-run` first. Package registries are append-only — a bad publish cannot be fully undone on most registries.1213Publish packages to language-specific registries. Detects package type from manifest files, verifies publish prerequisites, runs the registry-specific publish command, and confirms the version appears on the registry.1415## Process1617### 1. Detect package type1819Read the project root for manifest files to determine the package type:2021| Manifest | Registry | Publish command |22|----------|----------|----------------|23| `package.json` | npm | `npm publish --access public` |24| `Cargo.toml` | crates.io | `cargo publish` |25| `setup.py` / `pyproject.toml` | PyPI | `twine upload dist/*` or `flit publish` |26| `Formula/<name>.rb` | Homebrew | `brew bump-formula-pr` |27| Multiple detected | Polyglot | Error: specify registry with `--registry <npm|crates.io|pypi|brew>` |2829If no manifest is found, prompt the user to specify the type or pass `--type <npm|crates.io|pypi|brew>`.3031### 2. Verify prerequisites3233Before attempting any publish, run all applicable checks:3435**npm (`package.json`):**36See [REFERENCE.md](REFERENCE.md)3738**crates.io (`Cargo.toml`):**39See [REFERENCE.md](REFERENCE.md)4041**PyPI (`setup.py` / `pyproject.toml`):**42See [REFERENCE.md](REFERENCE.md)4344### 3. Run publish4546After all prerequisite checks pass, run the registry-specific command:4748See [REFERENCE.md](REFERENCE.md)4950### 4. Verify publish success5152After publish, confirm the version appears on the registry:5354See [REFERENCE.md](REFERENCE.md)5556### 5. Error handling5758On failure, surface actionable hints:5960See [REFERENCE.md](REFERENCE.md)6162### 6. Dry-run mode (`--dry-run`)6364Run `--dry-run` to verify all prerequisites without actually publishing:6566See [REFERENCE.md](REFERENCE.md)6768### 7. Dry-run mode per registry6970See [REFERENCE.md](REFERENCE.md)7172## Verify7374→ verify: `test -f skills/publish-package/SKILL.md && test -f package.json`75→ verify: `grep -q publish-package SKILL-INDEX.md`7677---7879# Publish Package — Reference8081## Navigation8283| Lines | Section |84|-------|---------|85| 1 | Title |86| 3–23 | Navigation |87| 24–35 | Options |88| 36–37 | Examples |89| 38–51 | Publish an npm package |90| 52–59 | Publish a Rust crate |91| 60–69 | Missing token scenario |92| 70–80 | Integration with release-branch |93| 81–121 | Reference block 1 |94| 122–143 | Reference block 2 |95| 144–162 | Reference block 3 |96| 163–180 | Reference block 4 |97| 181–195 | Reference block 5 |98| 196–230 | Reference block 6 |99| 231–248 | Reference block 7 |100| 249–260 | Reference block 8 |101102## Options103104| Flag | Description |105|------|-------------|106| `--dry-run` | Verify prerequisites and show publish command without executing |107| `--registry <type>` | Force registry type (skip auto-detection) |108| `--otp <code>` | One-time password for npm 2FA |109| `--no-verify` | Skip prerequisite checks (use with caution) |110111112---113114## Examples115116### Publish an npm package117118```bash119# Verify first120publish-package --dry-run121122# Publish123publish-package124125# Output:126# [npm] Publishing my-package v0.4.0...127# OK: npm publish confirmed (my-package@0.4.0 on registry)128```129130### Publish a Rust crate131132```bash133export CARGO_REGISTRY_TOKEN=<token>134publish-package --dry-run135publish-package136```137138### Missing token scenario139140```bash141$ publish-package142FAIL: NPM_TOKEN not set. Set via: export NPM_TOKEN=<token> or add to .npmrc143```144145146---147148## Integration with release-branch149150When wired into `release-branch`, add a step after git push:151152```1536a. Run publish-package to publish to package registries154 → verify: publish-package --dry-run && publish-package155```156157---158159## Reference block 1160161```bash162# Check auth token exists163if [ -z "${NPM_TOKEN:-}" ]; then164 if [ ! -f ~/.npmrc ] || ! grep -q "_authToken" ~/.npmrc; then165 echo "FAIL: NPM_TOKEN not set. Set via: export NPM_TOKEN=<token> or add //registry.npmjs.org/:_authToken=<token> to .npmrc"166 exit 1167 fi168fi169170# Check version not already published171PACKAGE_NAME=$(node -p "require('./package.json').name")172CURRENT_VER=$(node -p "require('./package.json').version")173if npm view "$PACKAGE_NAME@$CURRENT_VER" version 2>/dev/null; then174 echo "FAIL: Version $CURRENT_VER already published for $PACKAGE_NAME. Bump version first."175 exit 1176fi177178# Check build artifacts are fresh179if [ -d dist ] || [ -d lib ]; then180 LATEST_BUILD=$(find dist lib 2>/dev/null -name "*.js" -o -name "*.cjs" -o -name "*.mjs" | xargs ls -t 2>/dev/null | head -1)181 PACKAGE_MODIFIED=$(stat -f %m package.json 2>/dev/null || stat -c %Y package.json 2>/dev/null)182 if [ -n "$LATEST_BUILD" ] && [ -n "$PACKAGE_MODIFIED" ]; then183 BUILD_TIME=$(stat -f %m "$LATEST_BUILD" 2>/dev/null || stat -c %Y "$LATEST_BUILD" 2>/dev/null)184 if [ "$BUILD_TIME" -lt "$PACKAGE_MODIFIED" ]; then185 echo "WARNING: Build artifacts may be stale (package.json modified after last build). Run npm run build first."186 fi187 fi188fi189190# Check CHANGELOG is updated191if [ -f CHANGELOG.md ]; then192 if ! grep -q "$CURRENT_VER" CHANGELOG.md 2>/dev/null; then193 echo "WARNING: Version $CURRENT_VER not found in CHANGELOG.md. Update changelog before publish."194 fi195fi196```197198---199200## Reference block 2201202```bash203# Check auth token exists204if [ -z "${CARGO_REGISTRY_TOKEN:-}" ]; then205 if [ ! -f ~/.cargo/config.toml ] || ! grep -q "token" ~/.cargo/config.toml; then206 echo "FAIL: CARGO_REGISTRY_TOKEN not set. Set via: export CARGO_REGISTRY_TOKEN=<token> or add to ~/.cargo/config.toml"207 exit 1208 fi209fi210211# Check version not already published212CRATE_NAME=$(grep '^name' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')213CURRENT_VER=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')214if cargo search "$CRATE_NAME" 2>/dev/null | grep -q "^${CRATE_NAME}.*\"$CURRENT_VER\""; then215 echo "FAIL: Version $CURRENT_VER already published for $CRATE_NAME. Bump version in Cargo.toml first."216 exit 1217fi218```219220---221222## Reference block 3223224```bash225# Check auth token exists226if [ -z "${TWINE_PASSWORD:-}" ] && [ -z "${POETRY_PYPI_TOKEN_PYPI:-}" ]; then227 if [ ! -f ~/.pypirc ]; then228 echo "FAIL: PyPI token not configured. Set TWINE_PASSWORD or create ~/.pypirc"229 exit 1230 fi231fi232233# Check for build artifacts234if [ ! -d dist ] || [ -z "$(ls dist/*.whl 2>/dev/null)" ]; then235 echo "WARNING: No .whl files found in dist/. Run: python -m build"236fi237```238239---240241## Reference block 4242243```bash244# npm245npm publish --access public246247# crates.io248cargo publish249250# PyPI251python -m twine upload dist/* # or: poetry publish252253# Homebrew (opens PR, does not publish directly)254brew bump-formula-pr --url=<tarball-url> <formula-name>255```256257---258259## Reference block 5260261```bash262# npm263npm view "$PACKAGE_NAME" versions --json 2>/dev/null | grep -q "\"$CURRENT_VER\"" && echo "OK: npm publish confirmed"264265# crates.io266cargo search "$CRATE_NAME" 2>/dev/null | grep -q "^${CRATE_NAME}.*\"$CURRENT_VER\"" && echo "OK: crates.io publish confirmed"267268# PyPI269pip index versions "$PACKAGE_NAME" 2>/dev/null | grep -q "$CURRENT_VER" && echo "OK: PyPI publish confirmed"270```271272---273274## Reference block 6275276```bash277# Generic failure handler278if [ $? -ne 0 ]; then279 case "$REGISTRY" in280 npm)281 echo "FAIL: npm publish failed."282 echo " Common causes:"283 echo " - NPM_TOKEN not set in secrets: add to GitHub repo secrets"284 echo " - Version already published: bump version in package.json"285 echo " - Two-factor auth required: use --otp=<code> flag"286 echo " - Package scoped but not public: add --access public"287 ;;288 crates.io)289 echo "FAIL: cargo publish failed."290 echo " Common causes:"291 echo " - CARGO_REGISTRY_TOKEN not configured: see ~/.cargo/config.toml"292 echo " - Version already published: bump version in Cargo.toml"293 echo " - Local changes not committed: cargo publish requires clean working tree"294 ;;295 pypi)296 echo "FAIL: PyPI publish failed."297 echo " Common causes:"298 echo " - TWINE_PASSWORD not configured: set env var or ~/.pypirc"299 echo " - Build artifacts missing: run python -m build first"300 echo " - Version conflict: version already exists on PyPI"301 ;;302 esac303 exit 1304fi305```306307---308309## Reference block 7310311```bash312# Example output313$ publish-package --dry-run314315[DRY-RUN] Detected package type: npm316[DRY-RUN] Package: my-package v0.4.0317[DRY-RUN] Checking NPM_TOKEN... OK318[DRY-RUN] Checking version 0.4.0 not already published... OK319[DRY-RUN] Checking build artifacts... WARNING: package.json modified after build320[DRY-RUN] Checking CHANGELOG... OK321[DRY-RUN] Would run: npm publish --access public322[DRY-RUN] Exiting without publishing.323```324325---326327## Reference block 8328329```bash330# npm dry-run331npm publish --access public --dry-run332333# crates.io dry-run (cargo does not have a publish dry-run; use --dry-run flag for validation only)334cargo package --list 2>/dev/null335336# PyPI dry-run337python -m twine upload --repository testpypi dist/* # test.pypi.org338```339
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| danielvm-git/bigpowers.cursor/rules/simple-english.mdc · 139 | Cursor rules | styletypesgitdatabase+6 | 47/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/assess-impact.mdc · 139 | Cursor rules | testtesting-strategydeployment | 66/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/audit-plan.mdc · 139 | Cursor rules | buildteststylegit | 74/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/build-epic.mdc · 139 | Cursor rules | buildgit | 58/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/change-request.mdc · 139 | Cursor rules | no sections | 48/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/commit-message.mdc · 139 | Cursor rules | lint-formatstyletypesgit+3 | 82/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/compose-workflow.mdc · 139 | Cursor rules | styledo-notagent-behaviour | 65/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/context7-mcp.mdc · 139 | Cursor rules | style | 54/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/deepen-architecture.mdc · 139 | Cursor rules | testtesting-strategydo-not | 57/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/define-language.mdc · 139 | Cursor rules | lint-formatdo-not | 65/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/define-success.mdc · 139 | Cursor rules | no sections | 4/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/delegate-task.mdc · 139 | Cursor rules | git | 62/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/deploy.mdc · 139 | Cursor rules | setupbuildtestdeployment | 77/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/verify-work.md · 139 | Windsurf rules | buildtestlint-formatagent-behaviour | 74/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/develop-tdd.mdc · 139 | Cursor rules | teststylearchtesting-strategy+5 | 85/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/diagnose-root.mdc · 139 | Cursor rules | no sections | 39/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/diagnose-stall.mdc · 139 | Cursor rules | no sections | 44/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/dispatch-agents.mdc · 139 | Cursor rules | git | 54/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/edit-document.mdc · 139 | Cursor rules | no sections | 39/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/elaborate-spec.mdc · 139 | Cursor rules | test | 58/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| danielvm-git/bigpowers.windsurf/rules/organize-workspace.md · 139 | Windsurf rules | buildstylegitdeployment+2 | 89/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/guard-git.md · 139 | Windsurf rules | stylearchgitsecurity+2 | 89/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/quick-fix.md · 139 | Windsurf rules | teststylegitdeployment+1 | 85/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/develop-tdd.md · 139 | Windsurf rules | teststylearchtesting-strategy+5 | 85/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/extract-design.md · 139 | Windsurf rules | lint-formatstyledependenciesui | 82/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/commit-message.md · 139 | Windsurf rules | lint-formatstyletypesgit+3 | 82/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/session-state.md · 139 | Windsurf rules | lint-formatstyleagent-behaviour | 82/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/setup-environment.md · 139 | Windsurf rules | setupstylesecuritydo-not+1 | 81/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/danielvm-git-bigpowers-windsurf-rules-publish-package)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.