一键导入
smaqit-release-prepare-files
Validate git state and prepare all files (CHANGELOG.md, version files) for release
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Validate git state and prepare all files (CHANGELOG.md, version files) for release
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Creates a new agent for this project. Use when the user asks to create, define, or build a new custom agent.
Use when the user wants to create, define, build, or package a new skill — including when they ask to turn a workflow into a reusable command, wrap domain knowledge into a slash-command, or describe a repeatable procedure they want Copilot to follow. Gathers name and purpose, infers a complete specification, writes a definition file, and invokes smaqit.L2 to compile a SKILL.md file.
Use when deploying a feature to an existing project's production environment through its already-proven CI/CD pipeline. Reads specs to identify the stack, target, and provisioning mode before any infrastructure work. Handles all three provisioning_mode branches (provision, existing-owned, existing-shared) with infrastructure readiness, CI/CD-triggered deploy, verification, amendment gate, and optional release tagging. No dev-VM sweep, no deploy-rsync skills — the Nth deploy on infrastructure already proven. Also use when the user says "deploy this", "push to production", "ship this feature", or asks to deploy to a project that already has CI/CD workflows from its initial greenfield run.
Use before any local deployment or credential operation that requires secrets from a local HashiCorp Vault instance. Verifies Vault is running, unsealed, and authenticated on 127.0.0.1:8200. Also runs an interactive credential loader script that prompts for all project secrets and writes them to Vault. Use for first-time setup, adding a new project's credentials, or when a Vault path is missing. Also use when setting up Vault for the first time on a new machine, or when a caller cannot reach Vault and needs troubleshooting guidance.
Use when provisioning cloud infrastructure for a project's target application on Cyso Cloud (OpenStack) using Terraform. Covers application credential sourcing, Object Storage backend initialization, SSH keypair variable configuration, `terraform init/plan/apply`, and fixed IP retrieval. Produces a running Cyso VM accessible via SSH, with Cinder data volume attached and security group configured on ports 22/80/443. Also use when re-running Terraform after infrastructure changes or when an operator invokes `/provision.cyso`.
Use when configuring a GitHub repository with the secrets and variables required for CI/CD workflows. Covers Actions secrets (VM_SSH_KEY, Terraform backend credentials, cloud provider credentials, GH_TERRAFORM_TOKEN) and Actions variables (VM_HOST, DEMO_MODE). Uses the `gh` CLI. Prevents GITHUB_TOKEN reserved-name collisions and SSH key trailing-newline drift. Also use when setting up a new deployment repository, rotating CI/CD credentials, or verifying that all required repository secrets and variables are present.
| name | smaqit.release-prepare-files |
| description | Validate git state and prepare all files (CHANGELOG.md, version files) for release |
| metadata | {"version":"0.5.0"} |
Validate the repository state and prepare all necessary files for a release, including CHANGELOG.md and optional version files.
Use this skill after obtaining version approval and before executing git operations to:
A. Verify current branch:
git branch --show-current
main or user-specified release branchB. Check version doesn't exist in CHANGELOG.md:
grep "## \\[X.Y.Z\\]" CHANGELOG.md
grep "## \\[0.3.0\\]" CHANGELOG.md)Note: Uncommitted changes are acceptable - they will be handled during git operations step.
A. Collect all changes since last release (reconciliation source):
The release workflow always creates a commit named exactly "Prepare release vX.Y.Z". Use this commit as the authoritative boundary — it is more reliable than git tags (absent in shallow clones) and more precise than PR merge timestamps (which can be incorrectly ordered).
Step 2A-1 — Deepen the clone so the boundary commit is reachable:
git fetch --unshallow 2>/dev/null || git fetch --depth=2147483647 2>/dev/null || true
Step 2A-2 — Find the boundary SHA:
# List all "Prepare release" commits, most recent first
git log --format="%H %s" | grep -iE "^[0-9a-f]+ Prepare release v[0-9]"
Store as <boundary-sha>. Confirm:
git log -1 --oneline "<boundary-sha>"
Step 2A-3 — Collect commits after the boundary:
# PR merge commits (high-level summaries):
git log "<boundary-sha>..HEAD" --merges --pretty=format:"%h %s"
# Individual commits (feature details):
git log "<boundary-sha>..HEAD" --no-merges --pretty=format:"%h %s"
Filter out noise commits from both lists before analysing:
Initial plan — release workflow setup commitsPrepare release v — release boundary markers themselvesMerge pull request .*/copilot/release- — release PR mergesThe remaining commits are the real changelog delta.
Fallback (no "Prepare release" commits found): use git tags:
git fetch --tags --quiet 2>/dev/null || true
git tag --sort=-v:refname | head -1
# Then: git log <last-tag>..HEAD --merges/--no-merges
B. Reconcile [Unreleased] section with collected changes:
Build the authoritative list of changes using the commit delta from Step 2A and the smaqit.release-analysis changes list. The [Unreleased] section is a starting point only — treat it as incomplete.
For each non-noise commit found in the git log range:
[Unreleased]Added, Changed, Fixed, Removed, Deprecated, Security)Minimum completeness check before moving on:
The result should document every meaningful change — not just the version number bump.
C. Move reconciled [Unreleased] content to new version section:
Find the ## [Unreleased] section and move its content to a new version section with current date (YYYY-MM-DD):
## [Unreleased]
(empty or minimal content)
## [X.Y.Z] - YYYY-MM-DD
### Added
- Feature X
### Fixed
- Bug Y
D. Update comparison links at bottom of CHANGELOG.md:
Update the link structure:
[Unreleased]: https://github.com/owner/repo/compare/vX.Y.Z...HEAD
[X.Y.Z]: https://github.com/owner/repo/releases/tag/vX.Y.Z
[Previous]: https://github.com/owner/repo/releases/tag/vPrevious
E. If creating CHANGELOG.md from scratch:
Use Keep a Changelog format:
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [X.Y.Z] - YYYY-MM-DD
### Added
- Initial release
[Unreleased]: https://github.com/owner/repo/compare/vX.Y.Z...HEAD
[X.Y.Z]: https://github.com/owner/repo/releases/tag/vX.Y.Z
A. Ask user for version files:
Common version files by ecosystem:
package.jsonpyproject.toml, setup.py, __init__.pyCargo.tomlB. If repository has obvious version file:
C. If user confirms version files:
X.Y.Z, not vX.Y.Z)Example updates:
package.json:
{
"version": "0.3.0"
}
pyproject.toml:
[project]
version = "0.3.0"
D. If user declines or no version files exist:
Before completing:
Provide a summary of files prepared:
files_modified:
- CHANGELOG.md
- package.json
validation_passed: true
version_synced: true
Output fields:
files_modified: List of files changed during preparationvalidation_passed: Boolean indicating all validations passedversion_synced: Boolean indicating if version files were updated| Error | Suggested Action |
|---|---|
| Version already exists in CHANGELOG.md | Stop and report: "Version X.Y.Z already exists" |
| Not on main branch (local release) | Warn and request confirmation before proceeding |
| Version file has different format | Ask user how to update it (may need custom logic) |
| CHANGELOG.md doesn't exist | Create from scratch using Keep a Changelog template |
git checkout## [0.3.0]), but git tags use 'v' prefix (e.g., v0.3.0)git log[Unreleased] against the commit delta before promoting; the [Unreleased] section is often incomplete or emptyrelease-git-local handles commit grouping