cleanmatic:release
Cut a versioned release of the product-spec bundle: pack opt-in .claude/ artifacts into a deterministic tar.gz AND manage the root CHANGELOG.md release lifecycle (lock [Unreleased] → [X.Y.Z], bump manifest, hand the owner the tag push that fires release CI). Manifest-first selection; multiplatform recipient installer.
- License 许可
- AGPL-3.0
- 最近更新
- 2026-07-21
- Stars
- ★ 17
- Forks
- 9
01 前言 Front Matter
- name
- cleanmatic:release
- category
- release
- keywords
- [ "release", "packaging", "distribution", "tarball", "manifest", "changelog", "versioning", "claude", "skill-distribution" ]
- metadata
- { "author": "cleanmatic", "version": "1.2.1" }
- description
- Cut a versioned release of the product-spec bundle: pack opt-in .claude/ artifacts into a deterministic tar.gz AND manage the root CHANGELOG.md release lifecycle (lock [Unreleased] → [X.Y.Z], bump manifest, hand the owner the tag push that fires release CI). Manifest-first selection; multiplatform recipient installer.
- when_to_use
- When you need to bundle a curated subset of this repo's .claude/ tree for sharing/installing, OR cut a versioned release (lock the changelog, bump the version, print the owner-owned tag-push command).
- argument-hint
- [--manifest <path>] [--version <semver>] [--skills <list>] [--dry-run] | release.py [--release X.Y.Z | --bump major|minor|patch] [--apply] [--push]
- user-invocable
- true
02 资源文件 80
- 资产文件assets/recipient/CLAUDE.md3.6 KB
- 资产文件assets/recipient/README.md1.5 KB
- 资产文件assets/templates/INSTALL.md.template6.9 KB
- 资产文件assets/templates/install.ps1.template17.1 KB
- 资产文件assets/templates/install.sh.template21.0 KB
- 资产文件assets/templates/manifest.example.yaml2.0 KB
- 资产文件assets/templates/spec-validate.yml.template2.8 KB
- 资产文件assets/templates/upgrade.ps1.template6.4 KB
- 资产文件assets/templates/upgrade.sh.template6.6 KB
- 资产文件assets/upgrade/legacy-map.json3.5 KB
- 参考文档CHANGELOG.md9.8 KB
- 参考文档eval/evals.json4.5 KB
- 参考文档eval/fixtures/interactive-answers.json290 B
- 参考文档eval/fixtures/minimal.manifest.yaml326 B
- 参考文档GUIDE-EN.md19.7 KB
- 参考文档GUIDE-VI.md20.9 KB
- 脚本install.ps13.6 KB
- 脚本install.sh3.5 KB
- 参考文档plans/reports/cycle-01-dual-skill-review-260529-0940-findings-and-fixes-report.md5.2 KB
- 其他pyproject.toml307 B
- 参考文档README.md7.1 KB
- 参考文档references/error-catalog.md6.7 KB
- 参考文档references/flag-reference.md5.2 KB
- 参考文档references/maintainers-guide.md5.0 KB
- 参考文档references/manifest-spec.md5.1 KB
- 参考文档references/safety-rules.md5.9 KB
- 参考文档references/troubleshooting.md2.6 KB
- 参考文档references/workflow-pack.md5.3 KB
- 脚本scripts/build_manifest_discover.py2.8 KB
- 脚本scripts/build_manifest_questions.py4.0 KB
- 脚本scripts/build_manifest_writer.py5.1 KB
- 脚本scripts/build_manifest.py3.8 KB
- 脚本scripts/manifest_constants.py1.7 KB
- 脚本scripts/manifest_loader.py7.3 KB
- 脚本scripts/manifest_on_disk_checks.py5.4 KB
- 脚本scripts/manifest_path_guards.py4.7 KB
- 脚本scripts/manifest_validator.py7.9 KB
- 脚本scripts/pack/__init__.py496 B
- 脚本scripts/pack/__main__.py163 B
- 脚本scripts/pack/args.py4.5 KB
- 脚本scripts/pack/cli.py6.3 KB
- 脚本scripts/pack/manifest_io.py7.3 KB
- 脚本scripts/pack/pipeline.py5.8 KB
- 脚本scripts/pack/selection.py8.6 KB
- 脚本scripts/pack/tarball.py4.3 KB
- 脚本scripts/pack/templates.py1.6 KB
- 脚本scripts/release_check_guard.py2.9 KB
- 脚本scripts/release.py7.0 KB
- 脚本scripts/requirements-dev.txt24 B
- 脚本scripts/requirements.txt15 B
- 脚本scripts/safety_catalog.py6.1 KB
- 脚本scripts/safety_check.py6.3 KB
- 脚本scripts/tests/conftest.py3.0 KB
- 脚本scripts/tests/test_build_manifest.py6.5 KB
- 脚本scripts/tests/test_bundle_includes_telemetry.py8.1 KB
- 脚本scripts/tests/test_bundle_recipient_variant.py12.5 KB
- 脚本scripts/tests/test_bundle_ships_memory_artifacts.py3.3 KB
- 脚本scripts/tests/test_bundle_ships_product_spec_critique_artifacts.py3.1 KB
- 脚本scripts/tests/test_golden_product_spec.py2.8 KB
- 脚本scripts/tests/test_golden_synthetic.py2.8 KB
- 脚本scripts/tests/test_installer_bash32_compat.py4.8 KB
- 脚本scripts/tests/test_installer_branding.py4.6 KB
- 脚本scripts/tests/test_installer_e2e.py9.8 KB
- 脚本scripts/tests/test_installer_gitignore_telemetry.py7.5 KB
- 脚本scripts/tests/test_installer_semver.py4.6 KB
- 脚本scripts/tests/test_manifest_loader.py19.1 KB
- 脚本scripts/tests/test_pack_determinism.py13.7 KB
- 脚本scripts/tests/test_pack_io_args_cli_hardening.py14.2 KB
- 脚本scripts/tests/test_release.py6.1 KB
- 脚本scripts/tests/test_safety_check.py7.4 KB
- 脚本scripts/tests/test_spec_validate_workflow.py5.4 KB
- 脚本scripts/tests/test_templates.py1.0 KB
- 脚本scripts/tests/test_upgrade_apply.py14.0 KB
- 脚本scripts/tests/test_upgrade_e2e.py27.1 KB
- 脚本scripts/tests/test_upgrade_planner.py11.9 KB
- 脚本scripts/tests/test_verify_skill_versions.py2.6 KB
- 脚本scripts/tests/test_version_sync.py4.4 KB
- 脚本scripts/upgrade_apply.py9.7 KB
- 脚本scripts/upgrade_planner.py11.0 KB
- 脚本scripts/verify_skill_versions.py5.1 KB
03 SKILL.md 正文
cleanmatic:release
Developer-facing skill with two halves of one job — cutting a release of the product-spec bundle:
- Pack — bundle a curated subset of this repo's
.claude/tree (skills, agents, hooks, rules, scripts, schemas) + optional top-level files (README.md,CLAUDE.md) into a versioned, deterministictar.gz. Each bundle ships aMANIFEST.json(per-file SHA256), anINSTALL.md, and bundled multiplatform installers (install.shPOSIX +install.ps1Windows) so the recipient extracts once and runs. - Release lifecycle (
scripts/release.py) — manage the rootCHANGELOG.mdKeep-a-Changelog flow: lock## [Unreleased]→## [X.Y.Z] — <date>, bumppack.manifest.yaml, and hand the owner the exactgit tag product-spec-vX.Y.Z && git pushthat fires the release CI. The GitHub Release body is the just-locked CHANGELOG section (release.py --extract). Dry-run by default; the tag push is owner-owned.
Renamed from
cleanmatic:claude-pack(≤ 0.3.0). The bundle artifact is nowproduct-spec-{version}.tar.gzand the release tag isproduct-spec-v*.
📘 Developer usage guide:
GUIDE-VI.md(Tiếng Việt) /GUIDE-EN.md(English) — every use case as a sample conversation, covering both the natural-language way (preferred) and the CLI-equivalent (python -m pack). Read this for a task-oriented walkthrough; thisSKILL.mdis the operating contract.
When to Use
- A developer wants to share a curated set of skills/agents/rules with a teammate.
- You need to seed a new repo's
.claude/from an existing repo's working setup. - You want a reproducible, content-hashed snapshot of
.claude/for CI artifacts. - You want to cut a release: lock the changelog, bump the version, and publish a versioned
product-spec-{version}.tar.gzto GitHub Releases.
Flags
| Flag | Purpose |
|---|---|
| (no flag) | Interactive menu → build manifest → preview → confirm → pack. |
--manifest <path> |
Manifest file (default .claude/pack.manifest.yaml). |
--skills <list> |
Comma-separated skill slugs (override manifest). |
--agents <list> |
Comma-separated agent slugs (override manifest). |
--hooks <list> |
Comma-separated hook filenames (override manifest). |
--rules <list> |
Comma-separated rule filenames (override manifest). |
--extra <paths> |
Extra repo-relative paths (no .., no absolute). |
--version <semver> |
Override manifest.version for ad-hoc builds. |
--bundle-name <name> |
Override output filename stem. |
--out <dir> |
Output dir (default dist/). |
--dry-run |
Print would-be file list + total size; no tarball. |
--dry-run --compute-sha |
Add would-be SHA256 (opt-in; avoids double-pass). |
--include-settings |
Include .claude/settings.json (opt-in). |
--include-ck-config |
Include .claude/.ck.json (opt-in). |
--include-scripts / --include-schemas |
Include .claude/scripts/ or schemas/ (CK-framework internals; opt-in, off by default). |
--include-shared <list> |
Opt-in skills/_shared/<name> (warn-only otherwise). |
--max-size <bytes> |
Reject if compressed tar.gz > limit (default 100MB). |
--source-date-epoch <int|env> |
Override mtime root (default 0 = fully deterministic). |
--strict |
Treat un-included _shared/ references as errors (exit 2). |
--json |
Emit JSON status to stdout (machine-parseable). |
Full descriptions: references/flag-reference.md.
No-Flag Menu
When invoked without a flag, the skill runs python -m build_manifest --discover, presents an AskUserQuestion-driven walk through skills/agents/rules/extra/top_level/follow_shared, then writes .claude/pack.manifest.yaml and previews the build. Full interactive flow + question bank: references/workflow-pack.md.
Output Contract
dist/
├── product-spec-{version}.tar.gz # the bundle
└── product-spec-{version}.tar.gz.sha256 # coreutils-format sidecar
Tarball internal layout:
product-spec-{version}/
├── MANIFEST.json # schema_version "1.0", per-file SHA256
├── INSTALL.md # rendered from INSTALL.md.template
├── install.sh # POSIX recipient installer
├── install.ps1 # Windows recipient installer
└── .claude/ # selected subtree
Determinism: PAX format, sorted walk (file-granular), mtime=0, uid=gid=0, gzip header mtime=0. Same inputs → byte-identical tar.gz.
Workflow Map
flowchart LR
M[pack.manifest.yaml] --> L[manifest_loader]
CLI[CLI flags] --> L
L --> S[safety_check]
S --> W[sorted walker]
W --> B[tarball builder]
T[templates] --> B
B --> O[product-spec-{v}.tar.gz]
B --> H[.sha256 sidecar]
ASCII fallback:
manifest + CLI --> loader --> safety_check --> walker --> builder --> tar.gz + .sha256
^ ^
| |
always-drop templates
Load-on-Demand References
| When | Reference |
|---|---|
--manifest, manifest authoring |
references/manifest-spec.md |
| Any CLI flag | references/flag-reference.md |
| Safety filter, always-drop list | references/safety-rules.md |
| No-flag / interactive flow | references/workflow-pack.md |
| Error message lookup | references/error-catalog.md |
| Recipient install failures | references/troubleshooting.md |
| Skill internals, extension recipes | references/maintainers-guide.md |
Load only the reference relevant to the active flag. Don't pre-load.
Resources
scripts/
├── pack/ # modularized pack builder (cli, tarball, manifest_io, templates)
├── release.py # root-CHANGELOG release lifecycle (extract/release/bump/apply/push)
├── safety_check.py # always-drop + opt-in catalog + shared-ref detection
├── manifest_loader.py # YAML load · CLI merge · validate · apply defaults
└── build_manifest.py # discover · list-questions · write manifest
assets/templates/
├── manifest.example.yaml # copyable manifest seed (annotated)
├── INSTALL.md.template # recipient docs skeleton (token-driven)
├── install.sh.template # POSIX recipient installer (version-aware)
└── install.ps1.template # Windows recipient installer (version-aware)
Operating Principles
Single source-of-truth = root CLAUDE.md "Claude Pack — LLM Operating Guide" section. The five principles (Manifest is truth · DRY · Script vs LLM split · Never silent reverse · Never overwrite recipient state) are documented there. Cross-reference, do not duplicate.
Script CLI Contract
Run via the per-skill venv created by install.sh:
.claude/skills/.venv/bin/python3 -m pack \
--root <repo-root> [flags]
⚙️ Venv bootstrap (first run): before invoking
python -m pack(or any script), check the shared interpreter exists (.claude/skills/.venv/bin/python3on POSIX,.claude\skills\.venv\Scripts\python.exeon Windows). If it is missing, do NOT silently fail or fall back to system Python — pause and ask the user via AskUserQuestion to confirm running the installer (./install.shPOSIX /install.ps1Windows, both idempotent). Run it only on approval, then retry.
The pack builder (python -m pack) emits JSON on --json. The other scripts (manifest_loader.py, safety_check.py, build_manifest.py) emit JSON to stdout unconditionally — they have no --json flag. Analytical scripts exit 0; the --strict gate is the LLM's job. Determinism is the script's job: byte-identical tar.gz for the same input + SOURCE_DATE_EPOCH.
Release Lifecycle (scripts/release.py)
Cutting a release is two artifacts moving together: the version (pack.manifest.yaml) and the changelog (root CHANGELOG.md). release.py owns that transform deterministically — it never derives content from git, so the committed CHANGELOG.md is reproducible.
Interview first (mandatory). Before any --apply, confirm with the PO via AskUserQuestion: (1) the resulting version string (explicit --release X.Y.Z or computed --bump), (2) stable vs --pre-release, (3) read back the [Unreleased] body that will be locked (refuse if thin/empty), (4) push now or hand off — the tag push is owner-owned.
# Preview a cut (writes nothing):
.claude/skills/.venv/bin/python3 .claude/skills/release/scripts/release.py --bump minor
# Apply locally, then hand the printed tag command to the owner:
.claude/skills/.venv/bin/python3 .claude/skills/release/scripts/release.py --release 2.0.0 --apply
# Inspect what CI will publish as the GitHub Release body:
.claude/skills/.venv/bin/python3 .claude/skills/release/scripts/release.py --extract 2.0.0
| Flag | Effect |
|---|---|
--extract X.Y.Z |
Print a version's CHANGELOG section body (the CI release body). Read-only. |
--release X.Y.Z |
Cut at an explicit version. |
--bump major|minor|patch |
Cut at the next version computed from the manifest. |
--pre-release LABEL |
Append a pre-release label (rc.1 → X.Y.Z-rc.1). |
--date YYYY-MM-DD |
Override the release date (default: today). |
--apply |
Write changes (default: dry-run preview). |
--push |
Owner opt-in: also create + push the product-spec-vX.Y.Z tag (requires --apply). |
A cut locks ## [Unreleased] → ## [X.Y.Z] — <date>, opens a fresh empty [Unreleased], bumps pack.manifest.yaml, and prints the exact git tag product-spec-vX.Y.Z && git push (or runs it with --push). It refuses an empty [Unreleased] or an already-locked version. Per-skill SKILL.md versions + their CHANGELOGs are bumped by hand during dev (the A4 gate enforces each skill version == its CHANGELOG top); release.py only moves the bundle version + root changelog. Pushing the tag fires .github/workflows/release.yml (build → SHA256 → GitHub Release whose body is the locked section via --extract).
What This Skill Does NOT Do
- No remote upload. Use
gh release uploadmanually. - No GPG signing v1. SHA256 sidecar only.
- No recipient
claude-unpackcompanion.tar -xzf+ bundled installer is the contract. - No merge-resolver. Recipient
install.shskips existing skills by default;FORCE_OVERWRITE=1opt-in. - No multi-project packing. One
.claude/root per bundle. - No zip / tar.zst. Tar.gz only in v1.
04 同仓库更多 Skills
cleanmatic:telemetry
x
cleanmatic:release
x
cleanmatic:product-spec
x
cleanmatic:product-spec-critique
x
cleanmatic:telemetry
Plain-Vietnamese read on how the PO's skills are actually used + whether their scripts/subagents are healthy + a thin internal-quality proxy (did validate pass). Runs read-only lenses over local telemetry (invocations, sessions, script runs, subagent outcomes, memory) and narrates them honestly — usage & health, NOT market effectiveness. Outputs ascii/markdown/mermaid/json.
cleanmatic:product-spec
Interview-driven product spec hierarchy (Vision/BRD/PRD/Epic/Story) with traceability, validation, and visualization for product owners. Use when a non-technical PO needs to capture, structure, validate, or visualize product requirements without writing code.