Skip to content

Commit 5f24466

Browse files
committed
add bump-coana Claude command
1 parent 50b9eff commit 5f24466

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

.claude/commands/bump-coana.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
description: Bump @coana-tech/cli to a new version, update changelog, and create a PR
3+
allowed-tools: Read, Edit, Write, Bash, Glob
4+
---
5+
6+
# Bump Coana CLI Version
7+
8+
Automates the process of upgrading the @coana-tech/cli dependency to a new version.
9+
10+
## Usage
11+
12+
```
13+
/bump-coana <version>
14+
```
15+
16+
Where `<version>` is the Coana version number (e.g., `14.12.173`).
17+
18+
## Instructions
19+
20+
When this command is invoked with a version argument ($ARGUMENTS), perform the following steps:
21+
22+
### 1. Validate Input
23+
- Extract the version from $ARGUMENTS (e.g., "14.12.173").
24+
- If no version is provided, ask the user for the Coana version to upgrade to.
25+
26+
### 2. Update package.json
27+
- Read `package.json` in the repository root.
28+
- Find the current `@coana-tech/cli` version in devDependencies and note it for the PR body.
29+
- Update the `@coana-tech/cli` version to the provided version.
30+
- Bump the patch version of the package (e.g., `1.1.59` becomes `1.1.60`).
31+
- Write the updated package.json.
32+
33+
### 3. Update CHANGELOG.md
34+
- Read `CHANGELOG.md` in the repository root.
35+
- 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.
36+
- The new version should match the bumped package.json version.
37+
- Use this exact format for the new entry:
38+
39+
```markdown
40+
## [NEW_VERSION](https://github.com/SocketDev/socket-cli/releases/tag/vNEW_VERSION) - YYYY-MM-DD
41+
42+
### Changed
43+
- Updated the Coana CLI to v `COANA_VERSION`.
44+
45+
```
46+
47+
Note: Include the blank line after the changelog entry.
48+
49+
### 4. Update Lock File
50+
- Run `pnpm install` to update pnpm-lock.yaml with the new dependency version.
51+
52+
### 5. Create Branch and Commit
53+
- Create a new branch named `coana-COANA_VERSION` (e.g., `coana-14.12.173`) from the current branch.
54+
- Stage the changes: package.json, CHANGELOG.md, and pnpm-lock.yaml.
55+
- Create a commit with the message: `upgrading coana to version COANA_VERSION`.
56+
- Use the `-n` flag to skip pre-commit hooks.
57+
58+
### 6. Push and Create PR
59+
- Push the branch to origin with `-u` flag.
60+
- Create a PR using `gh pr create` targeting the `main` branch with:
61+
- Title: `upgrading coana to version COANA_VERSION`
62+
- Body using the format below.
63+
64+
Use this PR body format (use a HEREDOC for proper formatting):
65+
```
66+
## Summary
67+
- Upgrades @coana-tech/cli from CURRENT_VERSION to COANA_VERSION
68+
69+
## Coana Changelog
70+
For details on what's included in this Coana release, see the [Coana Changelogs](https://docs.coana.tech/changelogs).
71+
```
72+
73+
Replace CURRENT_VERSION with the old version found in step 2, and COANA_VERSION with the new version.
74+
75+
### Important Notes
76+
- Do NOT add any AI/Claude co-authorship or attribution to the commit message or PR.
77+
- Do NOT include "Generated with Claude Code" or similar text anywhere.

0 commit comments

Comments
 (0)