Skip to content

About

git-safe-release

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

git-safe-release

English | 한국어

A repository-local skill for setting up and running guarded Git releases. It supports single-package JavaScript/React projects and independently versioned monorepo targets.

The skill updates JSON package versions, creates target-prefixed annotated SemVer tags, and atomically pushes the release branch and tags. Existing CI/CD remains responsible for the actual deployment.

When to use this

This fits pipelines where a change already passed earlier test stages before a release is finalized, for example:

Dev tests -> Main tests -> version finalized -> git-safe-release

Run it only at that last step, once the release branch already reflects a change confirmed ready to ship. The skill does not run Dev or Main tests and does not manage promotion between those branches; each target's verifyCommands is a final build check before tagging, not a substitute for that CI. If you also configure integrationBranch (for example your Dev branch), the skill compares it with the release branch on every run and asks you to confirm whether an intentional hotfix bypassed the normal Dev -> Main flow — useful when a release-branch commit has no matching Dev history to trace back to.

Requirements

  • Git with a remote that supports atomic pushes
  • Node.js 18 or newer for the skill scripts
  • Bash for rehearsal and self-tests
  • rsync, cp, or PowerShell for installation
  • A tool that reads project-local Claude or Agent skills
  • macOS, Linux, or Windows; use Git Bash or WSL for Bash-based commands on Windows

The included fixture apps require Node.js 22.13 or newer and pnpm 11.1.2.

Install in a project

Copy both hidden directories into the project root.

macOS or Linux:

rsync -a .claude .agents /path/to/project/

Windows PowerShell:

Copy-Item -Recurse -Force .claude, .agents -Destination C:\path\to\project

The canonical skill lives at .claude/skills/git-safe-release. .agents/skills/git-safe-release is a small compatibility wrapper that tells Agent-skill hosts to load the canonical skill. It is a normal directory rather than a symlink, so standard Windows ZIP, extraction, clone, and copy operations preserve it.

Set up a project

Ask the agent:

Use $git-safe-release to set up releases for this repository.

Setup inspects package manifests, branches, existing tags, and deployment workflows. It then asks for confirmation before generating:

.claude/skills/git-safe-release/project.config.json

By default, a target named storefront uses tags such as storefront_v1.0.0 while its package version remains 1.0.0.

Release

Use $git-safe-release to release the affected app with a patch bump.

The skill validates repository state, remote tags, branch relationships, target impact, and the exact release plan before modifying or pushing anything. It never force-pushes, moves tags, or silently merges branches.

Rehearse safely

Use $git-safe-release to rehearse a release for storefront.

Rehearsal creates an isolated local bare remote under /tmp. It cannot trigger GitHub Actions or reach Production.

Test fixtures

Two minimal projects exercise setup discovery and configuration validation:

  • fixtures/single-react: one Vite + React app with a root package.json
  • fixtures/pnpm-turbo: a pnpm workspace with Turborepo, two independently versioned React apps, and one shared UI package

Fixture workflows only print a message and never deploy. Run all fixture and isolated release checks with:

bash .claude/skills/git-safe-release/scripts/self-test.sh

The fixtures are repository test data. Installing the skill still copies only .claude and .agents.

Repository CI

The repository's own GitHub Actions workflow runs the skill self-test and installs and builds both fixtures for every push and pull request. It has read-only repository permission, uses no deployment secrets, and never releases or deploys a fixture.

For a manual agent-level acceptance test, copy the skill into a clean fixture repository, start a fresh agent session, ask it to run setup, compare the generated project.config.json with expected-project.config.json, and then request a rehearsal.

Supported release model

  • JSON files with a top-level plain x.y.z version
  • one or more independently versioned targets
  • configurable <app>_v<version> tag prefixes
  • branch-push, tag-push, manual, or release-only deployment policies
  • optional integration-branch hotfix detection
  • Git remotes that support atomic pushes

The skill does not create CI/CD workflows or deploy directly to a cloud provider.

License

MIT

About

git-safe-release

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages