Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 85 additions & 40 deletions .claude/skills/bump-coana.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,122 @@
---
description: Bump @coana-tech/cli to a new version, update changelog, and create a PR
name: bump-coana
description: Bump @coana-tech/cli to a new version, update changelog, and create a PR. Use when user wants to upgrade Coana CLI, bump Coana version, or says "bump coana" with a version number.
allowed-tools: Read, Edit, Write, Bash, Glob
user-invocable: true
---

# Bump Coana CLI Version

Automates the process of upgrading the @coana-tech/cli dependency to a new version.
Automates the process of upgrading the @coana-tech/cli dependency to a new version, including package.json updates, changelog entry, and PR creation.

## Usage
## Input

```
/bump-coana <version>
```
- **Version**: The Coana version to upgrade to (e.g., `14.12.173`)
- Passed via `$ARGUMENTS` (e.g., `/bump-coana 14.12.173`)

If no version is provided, ask the user for the Coana version to upgrade to.

Where `<version>` is the Coana version number (e.g., `14.12.173`).
## Workflow

## Instructions
### Step 1: Parse and Validate Input

When this command is invoked with a version argument ($ARGUMENTS), perform the following steps:
Extract the version number from `$ARGUMENTS`:

```bash
COANA_VERSION="$ARGUMENTS"

# Validate version format (should be semver-like: X.Y.Z)
if [[ ! "$COANA_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "ERROR: Invalid version format. Expected X.Y.Z (e.g., 14.12.173)"
exit 1
fi
```

### 1. Validate Input
- Extract the version from $ARGUMENTS (e.g., "14.12.173").
- If no version is provided, ask the user for the Coana version to upgrade to.
### Step 2: Update package.json

### 2. Update package.json
- Read `package.json` in the repository root.
- Find the current `@coana-tech/cli` version in devDependencies and note it for the PR body.
- Update the `@coana-tech/cli` version to the provided version.
- Bump the patch version of the package (e.g., `1.1.59` becomes `1.1.60`).
- Write the updated package.json.
1. Read `package.json` in the repository root.
2. Find the current `@coana-tech/cli` version in `devDependencies` and note it as `CURRENT_VERSION`.
3. Update `@coana-tech/cli` to the new version.
4. Bump the patch version of the package (e.g., `1.1.59` → `1.1.60`).
5. Write the updated `package.json`.

### 3. Update CHANGELOG.md
- Read `CHANGELOG.md` in the repository root.
- Add a new version entry at the top (after the header section that ends with "The format is based on..."), using today's date in YYYY-MM-DD format.
- The new version should match the bumped package.json version.
- Use this exact format for the new entry:
**Values to extract**:
- `CURRENT_VERSION`: The old @coana-tech/cli version (for PR body)
- `NEW_PKG_VERSION`: The bumped package.json version (for changelog)

### Step 3: Update CHANGELOG.md

1. Read `CHANGELOG.md` in the repository root.
2. Add a new version entry after the header section (which ends with "The format is based on...").
3. Use today's date in `YYYY-MM-DD` format.

**Entry format**:
```markdown
## [NEW_VERSION](https://github.com/SocketDev/socket-cli/releases/tag/vNEW_VERSION) - YYYY-MM-DD
## [NEW_PKG_VERSION](https://github.com/SocketDev/socket-cli/releases/tag/vNEW_PKG_VERSION) - YYYY-MM-DD

### Changed
- Updated the Coana CLI to v `COANA_VERSION`.

```

Note: Include the blank line after the changelog entry.
**Note**: Include a blank line after the entry.

### Step 4: Update Lock File

```bash
pnpm install
```

### 4. Update Lock File
- Run `pnpm install` to update pnpm-lock.yaml with the new dependency version.
This updates `pnpm-lock.yaml` with the new dependency version.

### 5. Create Branch and Commit
- Create a new branch named `coana-COANA_VERSION` (e.g., `coana-14.12.173`) from the current branch.
- Stage the changes: package.json, CHANGELOG.md, and pnpm-lock.yaml.
- Create a commit with the message: `upgrading coana to version COANA_VERSION`.
- Use the `-n` flag to skip pre-commit hooks.
### Step 5: Create Branch and Commit

### 6. Push and Create PR
- Push the branch to origin with `-u` flag.
- Create a PR using `gh pr create` targeting the `v1.x` branch with:
- Title: `upgrading coana to version COANA_VERSION`
- Body using the format below.
```bash
# Create branch
git checkout -b "coana-$COANA_VERSION"

Use this PR body format (use a HEREDOC for proper formatting):
# Stage changes
git add package.json CHANGELOG.md pnpm-lock.yaml

# Commit (skip pre-commit hooks with -n)
git commit -n -m "upgrading coana to version $COANA_VERSION"
```

### Step 6: Push and Create PR

```bash
# Push branch
git push -u origin "coana-$COANA_VERSION"

# Create PR targeting v1.x branch
gh pr create --base v1.x --title "upgrading coana to version $COANA_VERSION" --body "$(cat <<'EOF'
## Summary
- Upgrades @coana-tech/cli from CURRENT_VERSION to COANA_VERSION

## Coana Changelog
For details on what's included in this Coana release, see the [Coana Changelogs](https://docs.coana.tech/changelogs).
EOF
)"
```

Replace CURRENT_VERSION with the old version found in step 2, and COANA_VERSION with the new version.
Replace `CURRENT_VERSION` and `COANA_VERSION` with actual values.

## Output

- Branch: `coana-<VERSION>` pushed to origin
- PR: Created targeting `v1.x` branch
- Files modified: `package.json`, `CHANGELOG.md`, `pnpm-lock.yaml`

Report the PR URL to the user when complete.

## Error Handling

- **No version provided**: Ask user for the version number
- **Invalid version format**: Report error with expected format
- **pnpm install fails**: Check network connectivity and npm registry access
- **PR creation fails**: Verify `gh` CLI is authenticated

## Important Notes

### Important Notes
- Do NOT add any AI/Claude co-authorship or attribution to the commit message or PR.
- Do NOT include "Generated with Claude Code" or similar text anywhere.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ 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/).

## [1.1.61](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.61) - 2026-01-29

### Changed
- Updated the Coana CLI to v `14.12.174`.

## [1.1.60](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.60) - 2026-01-28

### Changed
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "socket",
"version": "1.1.60",
"version": "1.1.61",
"description": "CLI for Socket.dev",
"homepage": "https://github.com/SocketDev/socket-cli",
"license": "MIT AND OFL-1.1",
Expand Down Expand Up @@ -94,7 +94,7 @@
"@babel/preset-typescript": "7.27.1",
"@babel/runtime": "7.28.4",
"@biomejs/biome": "2.2.4",
"@coana-tech/cli": "14.12.173",
"@coana-tech/cli": "14.12.174",
"@cyclonedx/cdxgen": "11.11.0",
"@dotenvx/dotenvx": "1.49.0",
"@eslint/compat": "1.3.2",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.