Publish Kit
One release must leave every channel in agreement: package registry version, git tag, both git remotes, marketplace listing, repo RP fields, and README. Ship all of them or none.
Quick start
A standard release for an npm package (DSH plugin or not):
- Bump version in package.json; commit with the version number in the message.
- Build (
prepublishOnly) and run tests.
npm publish --registry=https://registry.npmjs.org/ with a throwaway token in .npmrc, then delete .npmrc.
git tag v<x.y.z> on that exact commit, verify with git show v<x.y.z> --format=%s --no-patch, then git push origin main --tags and git push gitee main --tags.
- Update repo Description + Topics (topic
dsh-plugin for plugins), submit PR/Issue to marketplaces if applicable.
Why
Every channel is an independent silo. npm knows a version, git knows a commit, marketplaces scan topics: skipping one step leaves them disagreeing, and backfilling later is error-prone (40 versions had to be retagged by hand once).
Workflow
- Classify the release: npm package, DSH plugin, git-only project, cargo crate, PyPI/exe artifact. See REFERENCE for per-track steps.
- Pre-release first, then promote. For non-trivial changes: publish a pre-release (
./scripts/bootstrap-release.sh patch --pre-release beta) to npm next dist-tag + GitHub Pre-release; iterate (--pre-release-bump 2/3/...); once stable, promote (--promote-from-beta) to latest. See REFERENCE section K.
- Pre-flight: registry version check (
npm view <pkg> version), lock npx versions, confirm files whitelist separates runtime assets from showcase assets.
- README gate: bilingual split files, banner/badges/install/features/changelog order, GIF under 10 MB. See REFERENCE section F.
- Publish in the Quick start order; never reorder (tag before push, verify before push tags).
- Post-publish: marketplace submissions (section B), RP fields via GitHub API (section A), smoke-test install.
Anti-patterns
WRONG: commit + push + publish, skip the tag. Later git tag by guessing commit~N creates phantom tags pointing at doc commits.
RIGHT: resolve the real hash from git log messages, tag it, verify the subject line, then push tags.
Checklist
See also
| File |
Use when you need |
| REFERENCE.md |
dense facts per track: marketplace table, token handling, semver ranges, slimming, cargo/PyPI, troubleshooting |
| EXAMPLES.md |
end-to-end worked transcripts: this skill's own v0.1.0 release and a full DSH plugin npm flow |
| TEMPLATE.md |
copy-paste skeletons: package.json, bilingual README, marketplace yml, publish.bat, GitHub Actions release, Cargo.toml, pyproject.toml |
| INSTALL.md |
install this skill into DSH, Claude Code, Codex, Gemini, or Cursor |
| DSH-DEPLOY.md |
DSH-specific deployment: where the runtime finds skills, watch semantics, ranks, distribution channels |
| COMPATIBILITY.md |
platform + frontmatter matrix, body-format limits |
Complementary skills (install separately, not part of this bundle): git-guardrails-claude-code for blocking destructive git commands, find-skills for locating more skills, setup-pre-commit for repo-local lint gates, remember for capturing release lessons back into agentmemory.
1---2name: publish-kit3description: 发布工具箱,覆盖 npm / GitHub / Gitee / DSH 插件市场 / cargo crates.io / PyPI 多渠道发布,README 双语排版设计,git tag 发版 SOP,以及 npm 包瘦身。Use when the user wants to publish or release a package/plugin, submit to a marketplace, bump a version, cut git tags, write or restructure a README, slim an npm package, or push to GitHub/Gitee remotes.4---56# Publish Kit78One release must leave every channel in agreement: package registry version, git tag, both git remotes, marketplace listing, repo RP fields, and README. Ship all of them or none.910## Quick start1112A standard release for an npm package (DSH plugin or not):13141. Bump version in package.json; commit with the version number in the message.152. Build (`prepublishOnly`) and run tests.163. `npm publish --registry=https://registry.npmjs.org/` with a throwaway token in `.npmrc`, then delete `.npmrc`.174. `git tag v<x.y.z>` on that exact commit, verify with `git show v<x.y.z> --format=%s --no-patch`, then `git push origin main --tags` and `git push gitee main --tags`.185. Update repo Description + Topics (topic `dsh-plugin` for plugins), submit PR/Issue to marketplaces if applicable.1920## Why2122Every channel is an independent silo. npm knows a version, git knows a commit, marketplaces scan topics: skipping one step leaves them disagreeing, and backfilling later is error-prone (40 versions had to be retagged by hand once).2324## Workflow25261. Classify the release: npm package, DSH plugin, git-only project, cargo crate, PyPI/exe artifact. See REFERENCE for per-track steps.272. **Pre-release first, then promote.** For non-trivial changes: publish a pre-release (`./scripts/bootstrap-release.sh patch --pre-release beta`) to npm `next` dist-tag + GitHub Pre-release; iterate (`--pre-release-bump 2/3/...`); once stable, promote (`--promote-from-beta`) to `latest`. See REFERENCE section K.283. Pre-flight: registry version check (`npm view <pkg> version`), lock npx versions, confirm files whitelist separates runtime assets from showcase assets.294. README gate: bilingual split files, banner/badges/install/features/changelog order, GIF under 10 MB. See REFERENCE section F.305. Publish in the Quick start order; never reorder (tag before push, verify before push tags).316. Post-publish: marketplace submissions (section B), RP fields via GitHub API (section A), smoke-test install.3233## Anti-patterns3435WRONG: commit + push + publish, skip the tag. Later `git tag` by guessing `commit~N` creates phantom tags pointing at doc commits.36RIGHT: resolve the real hash from `git log` messages, tag it, verify the subject line, then push tags.3738## Checklist3940- [ ] Version bumped; commit message carries the version41- [ ] `npm pack --dry-run` file list and size reviewed42- [ ] Published with explicit `--registry=https://registry.npmjs.org/`; token file deleted43- [ ] Tag created on the exact commit and verified before pushing44- [ ] Both remotes (origin GitHub, gitee) pushed including tags45- [ ] Repo Description + Topics set (independent topics endpoint)46- [ ] README: bilingual files, language switch links, GIF under 10 MB47- [ ] Marketplace requirements met (topic `dsh-plugin`, `dsh.marketplace` metadata, PR/Issue where manual)4849## See also5051| File | Use when you need |52| --- | --- |53| [REFERENCE.md](REFERENCE.md) | dense facts per track: marketplace table, token handling, semver ranges, slimming, cargo/PyPI, troubleshooting |54| [EXAMPLES.md](EXAMPLES.md) | end-to-end worked transcripts: this skill's own v0.1.0 release and a full DSH plugin npm flow |55| [TEMPLATE.md](TEMPLATE.md) | copy-paste skeletons: package.json, bilingual README, marketplace yml, publish.bat, GitHub Actions release, Cargo.toml, pyproject.toml |56| [INSTALL.md](INSTALL.md) | install this skill into DSH, Claude Code, Codex, Gemini, or Cursor |57| [DSH-DEPLOY.md](DSH-DEPLOY.md) | DSH-specific deployment: where the runtime finds skills, watch semantics, ranks, distribution channels |58| [COMPATIBILITY.md](COMPATIBILITY.md) | platform + frontmatter matrix, body-format limits |5960Complementary skills (install separately, not part of this bundle): `git-guardrails-claude-code` for blocking destructive git commands, `find-skills` for locating more skills, `setup-pre-commit` for repo-local lint gates, `remember` for capturing release lessons back into agentmemory.