skills/shipit/SKILL.md
2026-06-12 13:51:20 +08:00

33 lines
2.7 KiB
Markdown

---
name: shipit
description: Run the full BlockNinja plugin/theme pre-publish pipeline — clean-tree check, make, archive-check, check-safety, version bump, tag, push, ninja plugin publish, registry verification — halting at the first failure with evidence. Use when publishing a plugin or theme version, or when asked to "ship" or "release" a plugin.
args: "[patch|minor|major] (default: patch)"
---
# Ship It — Plugin Publish Pipeline
Executes the mandatory pre-publish checklist from `plugins/CLAUDE.md` as a single halting pipeline. Run from (or pointed at) a plugin/theme repo under `~/src/blockninja/plugins/` or `~/src/blockninja/themes/`.
## Pipeline (halt at first failure; report each step verified-with-evidence)
1. **Clean tree**: `git status --porcelain` must be empty (untracked files won't ship — `ninja plugin publish` ships `git archive HEAD`). If dirty: stop and show what's uncommitted; never auto-stage.
2. **Branch check**: `git branch --show-current` — must be `main`.
3. **Build**: `make` — the `.so` must compile (CGO). Stale `*_templ.go` is the usual failure: run `make templ`, commit, retry once.
4. **Archive check**: `make archive-check` must exit 0 (proves a clean `git archive HEAD` compiles — exactly what publish ships). If the Makefile lacks the target, flag it instead of skipping.
5. **Safety**: `cd ~/src/blockninja/check-safety && go run . <plugin-path>` must exit 0. Fix violations; never baseline, skip, or defer.
6. **Generated-files policy spot-check**: confirm committed `web/dist` (if the plugin has one) is fresh — rebuilt this session or newer than the newest `web/src` file. A stale tracked dist gets silently embedded.
7. **Bump**: `ninja plugin bump <patch|minor|major>` (from args; default patch). This edits plugin.mod and commits but does NOT tag.
8. **Tag + push**: `git tag vX.Y.Z` matching the new plugin.mod version, then `git push origin main vX.Y.Z` (push the tag explicitly — `--follow-tags` skips lightweight tags).
9. **Publish**: `ninja plugin publish` (add `--channel <c>` or `--private` if the user said so).
10. **Verify**: `ninja plugin version` must show the new version in the registry. This is the runtime evidence — without it the publish is **unverified**.
## Report format
One line per step: `✓ <step> — <evidence (exact command + key output line)>` or `✗ <step> — <failure + root cause + what to fix>`. Stop at ✗; everything after is "not run".
## Notes
- Theme repos: `kind = "theme"` in plugin.mod (DB CHECK constraint rejects "plugin").
- Version source of truth is plugin.mod; tag must match exactly.
- First-ever publish of a new plugin needs `ninja plugin init` + registry review flow — see `plugins/CLAUDE.md`; this skill covers subsequent versions.