Skip to content

Commit 696c872

Browse files
authored
[CI] Improve claude code release command (#4413)
1 parent 80e5cf1 commit 696c872

File tree

1 file changed

+11
-40
lines changed

1 file changed

+11
-40
lines changed

.claude/commands/create-frontend-release.md

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Examples:
1515
- `minor --skip-changelog` - Skip automated changelog generation
1616
- `minor --dry-run` - Simulate release without executing
1717

18-
If no arguments provided, the command will analyze recent changes and recommend the appropriate version type.
18+
If no arguments provided, the command will always perform prerelease if the current version is prerelease, or patch in other cases. This command will never perform minor or major releases without explicit direction.
1919
</task>
2020

2121
## Prerequisites
@@ -35,7 +35,7 @@ Before starting, ensure:
3535
CURRENT_VERSION=$(node -p "require('./package.json').version")
3636
if [[ "$CURRENT_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+- ]]; then
3737
echo "⚠️ Current version $CURRENT_VERSION is a pre-release"
38-
echo "Consider promoting to stable (e.g., 1.24.0-1 → 1.24.0) first"
38+
echo "Consider releasing stable (e.g., 1.24.0-1 → 1.24.0) first"
3939
fi
4040
```
4141

@@ -111,29 +111,7 @@ echo "Last stable release: $LAST_STABLE"
111111
```
112112
7. **HUMAN ANALYSIS**: Review change summary and verify scope
113113

114-
### Step 3: Semantic Version Determination
115-
116-
Based on analysis, determine version type:
117-
118-
**Pre-release Handling:**
119-
- If current version is pre-release (e.g., 1.24.0-1):
120-
- Consider promoting to stable (1.24.0) instead of new version
121-
- Or create new minor/major if significant changes added
122-
123-
**Automatic Detection:**
124-
- **MAJOR**: Breaking changes detected (`BREAKING CHANGE`, `!` in commits)
125-
- **MINOR**: New features without breaking changes (`feat:` commits)
126-
- **PATCH**: Only bug fixes, docs, or dependency updates
127-
128-
**Version Workflow Limitations:**
129-
- ⚠️ Cannot use "stable" as version_type - not in allowed values
130-
- Allowed values: patch, minor, major, prepatch, preminor, premajor, prerelease
131-
- For pre-release → stable promotion, must manually update version
132-
133-
**Manual Override Options:**
134-
- If arguments provided, validate against detected changes
135-
- **CONFIRMATION REQUIRED**: Version type correct for these changes?
136-
- **WARNING**: If manual override conflicts with detected breaking changes
114+
### Step 3: Version Preview
137115

138116
**Version Preview:**
139117
- Current: `${CURRENT_VERSION}`
@@ -179,7 +157,6 @@ Based on analysis, determine version type:
179157

180158
### Step 6: Breaking Change Analysis
181159

182-
For minor/major releases:
183160
1. Analyze API changes in:
184161
- Public TypeScript interfaces
185162
- Extension APIs
@@ -256,7 +233,7 @@ gh workflow run version-bump.yaml -f version_type=${VERSION_TYPE}
256233
echo "Workflow triggered. Waiting for PR creation..."
257234
```
258235

259-
**For pre-release → stable promotion:**
236+
**For releasing a stable version:**
260237
1. Must manually create branch and update version:
261238
```bash
262239
git checkout -b version-bump-${NEW_VERSION}
@@ -603,32 +580,21 @@ The command implements multiple quality gates:
603580
```
604581
- Creates alpha/beta/rc versions
605582
- Draft release status
583+
- Python package specs require that prereleases use alpha/beta/rc as the preid
606584

607585
## Common Issues and Solutions
608586

609587
### Issue: Pre-release Version Confusion
610588
**Problem**: Not sure whether to promote pre-release or create new version
611589
**Solution**:
612-
- If no new commits since pre-release: promote to stable
613-
- If new commits exist: consider new minor version
590+
- Follow semver standards: a prerelease version is followed by a normal release. It should have the same major, minor, and patch versions as the prerelease.
614591

615592
### Issue: Wrong Commit Count
616593
**Problem**: Changelog includes commits from other branches
617594
**Solution**: Always use `--first-parent` flag with git log
618595

619-
### Issue: Release Workflow Doesn't Trigger
620-
**Problem**: update-locales adds [skip ci] to PR
621-
**Solution**:
622-
1. Create patch release to trigger workflow
623-
2. Alternative: Revert version and re-run version bump workflow
624-
3. Fix update-locales to skip [skip ci] for Release PRs
625-
626596
**Update**: Sometimes update-locales doesn't add [skip ci] - always verify!
627597

628-
### Issue: Version Workflow Limitations
629-
**Problem**: Cannot use "stable" as version_type
630-
**Solution**: Manually create PR for pre-release → stable promotion
631-
632598
### Issue: Missing PRs in Changelog
633599
**Problem**: PR was merged to different branch
634600
**Solution**: Verify PR merge target with:
@@ -638,6 +604,11 @@ gh pr view ${PR_NUMBER} --json baseRefName
638604

639605
### Issue: Release Failed Due to [skip ci]
640606
**Problem**: Release workflow didn't trigger after merge
607+
**Prevention**: Always avoid this scenario
608+
- Ensure that `[skip ci]` or similar flags are NOT in the `HEAD` commit message of the PR
609+
- Push a new, empty commit to the PR
610+
- Always double-check this immediately before merging
611+
641612
**Recovery Strategy**:
642613
1. Revert version in a new PR (e.g., 1.24.0 → 1.24.0-1)
643614
2. Merge the revert PR

0 commit comments

Comments
 (0)