Release Tool
Release a tool by creating and pushing a version tag.
Usage
code
/release <tool-name> /release <tool-name> --version <version>
Instructions
When the user invokes this skill with a tool name:
If --version is provided:
Skip change analysis and use the specified version directly:
- •Verify the tool exists in the
bin/directory - •Update the version in the tool's source code to the specified version
- •Commit the version change with message:
<tool-name>: bump version to <version> - •Create the tag in the format
<tool-name>-v<version> - •Check if tag exists - if the tag already exists, inform the user and stop
- •Push the commit and tag to origin
If --version is NOT provided:
- •Verify the tool exists in the
bin/directory - •Get the current version by running
bin/<tool-name> --versionand parsing the version number- •If
--versionis not supported, follow the "Missing Version Support" section below
- •If
- •Find the last tag for this tool by searching for tags matching
<tool-name>-v* - •Analyze changes since last tag:
- •Run
git diff <last-tag>..HEAD -- bin/<tool-name>to see what changed - •If no previous tag exists, this is the initial release
- •Run
- •Suggest version bump based on changes:
- •Patch (x.y.Z): Internal changes only - refactoring, bug fixes, documentation, code cleanup
- •Minor (x.Y.0): New features added - new flags, new functionality, new options
- •Major (X.0.0): Breaking changes - removed features, changed default behavior, renamed flags, modified output format
- •Show analysis to user:
- •Display the current version
- •Summarize the changes since last tag
- •Show your recommended bump type with reasoning
- •Let the user confirm or choose a different version
- •Update the version in the tool's source code to the chosen version
- •Commit the version change with message:
<tool-name>: bump version to <version> - •Create the tag in the format
<tool-name>-v<version>(e.g.,ascii-banner-v1.0.0) - •Check if tag exists - if the tag already exists, inform the user and stop
- •Push the commit and tag to origin
Example
code
/release ascii-banner
This will:
- •Run
bin/ascii-banner --versionto get "ascii-banner 1.0.0" - •Find the last tag
ascii-banner-v1.0.0 - •Run
git diff ascii-banner-v1.0.0..HEAD -- bin/ascii-bannerto see changes - •Analyze the diff and suggest a version bump:
- •"I see you added a new
--colorflag. This is a new feature, so I recommend a minor bump to 1.1.0" - •Or: "I see you fixed a bug in the output formatting. This is an internal fix, so I recommend a patch bump to 1.0.1"
- •Or: "I see you changed the default output format. This breaks backward compatibility, so I recommend a major bump to 2.0.0"
- •"I see you added a new
- •Let the user confirm or choose a different version
- •Update the VERSION in the tool to the chosen version
- •Commit the version change
- •Create tag
ascii-banner-v<new-version> - •Push the commit and tag to origin
With explicit version
code
/release ascii-banner --version 2.0.0
This will:
- •Update the VERSION in the tool to 2.0.0
- •Commit the version change
- •Create tag
ascii-banner-v2.0.0 - •Push the commit and tag to origin
No change analysis is performed when --version is specified.
Change Analysis Guidelines
When analyzing the diff, look for these patterns:
Patch (bug fixes, internal changes)
- •Fixed typos or documentation
- •Refactored code without changing behavior
- •Fixed bugs that made the tool not work as documented
- •Performance improvements
- •Code cleanup
Minor (new features, backward compatible)
- •New command-line flags or options
- •New output formats (when existing formats still work)
- •New functionality that doesn't affect existing behavior
- •Added help text or examples
Major (breaking changes)
- •Removed flags or options
- •Changed default behavior
- •Renamed flags (e.g.,
--verbose→--debug) - •Changed output format in a way that breaks scripts
- •Changed exit codes
- •Removed features
Error Handling
- •If the tool doesn't exist, report an error
- •If the tag already exists, inform the user (this version has already been released)
Missing Version Support
If the tool doesn't respond to --version:
- •Ask the user if they want to add version support to the tool
- •If yes, suggest starting at
1.0.0for initial release (or0.1.0if the tool is experimental) - •Add a VERSION constant and
--versionflag to the tool - •Proceed with the release (no change analysis needed for initial release)
No Previous Tag
If this is the first release (no previous tag exists for this tool):
- •Inform the user this is the initial release
- •Skip change analysis (nothing to compare against)
- •Use the current version in the tool as the release version
- •Proceed with tag creation and push