cc-devflow 2.4.2 → 2.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/bug-analyzer.md +0 -1
- package/.claude/agents/compatibility-checker.md +0 -1
- package/.claude/agents/impact-analyzer.md +0 -1
- package/.claude/commands/flow-fix.md +1 -1
- package/.claude/commands/flow-new.md +2 -3
- package/.claude/commands/git-commit.md +425 -0
- package/.claude/docs/guides/NEW_TROUBLESHOOTING.md +4 -4
- package/.claude/docs/templates/NEW_ORCHESTRATION_TEMPLATE.md +2 -3
- package/.claude/rules/devflow-conventions.md +3 -6
- package/.claude/scripts/generate-status-report.sh +7 -7
- package/.claude/scripts/recover-workflow.sh +18 -12
- package/.claude/skills/npm-release/SKILL.md +314 -0
- package/.claude/skills/writing-skills/SKILL.md +655 -0
- package/.claude/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/.claude/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/.claude/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/.claude/skills/writing-skills/persuasion-principles.md +187 -0
- package/.claude/skills/writing-skills/render-graphs.js +168 -0
- package/.claude/skills/writing-skills/testing-skills-with-subagents.md +384 -0
- package/.claude/tsc-cache/748c64fa-9e5f-4a1d-9db8-efb8415a6183/affected-repos.txt +1 -0
- package/.claude/tsc-cache/748c64fa-9e5f-4a1d-9db8-efb8415a6183/edited-files.log +1 -0
- package/.claude/tsc-cache/f903e5df-3c39-4958-b26b-724808f32956/affected-repos.txt +1 -0
- package/.claude/tsc-cache/f903e5df-3c39-4958-b26b-724808f32956/edited-files.log +2 -0
- package/CHANGELOG.md +72 -7
- package/README.md +12 -0
- package/README.zh-CN.md +12 -0
- package/bin/cc-devflow-cli.js +4 -4
- package/package.json +1 -1
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: npm-release
|
|
3
|
+
description: Use when ready to publish a new version of cc-devflow npm package to npm registry
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# NPM Release Workflow
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Standardized release process for cc-devflow npm package ensuring consistent versioning, changelog maintenance, and safe publishing.
|
|
11
|
+
|
|
12
|
+
**Core Principle**: Atomic release - all version markers (package.json, CHANGELOG.md, git tag) must stay in sync.
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
Use this skill when:
|
|
17
|
+
- ✅ Ready to release a new version of cc-devflow
|
|
18
|
+
- ✅ All changes committed and pushed
|
|
19
|
+
- ✅ On main branch with clean working directory
|
|
20
|
+
- ✅ Need to publish to npm registry
|
|
21
|
+
|
|
22
|
+
Don't use when:
|
|
23
|
+
- ❌ Working directory has uncommitted changes
|
|
24
|
+
- ❌ Not on main branch
|
|
25
|
+
- ❌ Pre-release/beta versions (needs adaptation)
|
|
26
|
+
|
|
27
|
+
## Release Types
|
|
28
|
+
|
|
29
|
+
Follow [Semantic Versioning](https://semver.org/):
|
|
30
|
+
|
|
31
|
+
| Type | Version Change | When |
|
|
32
|
+
|------|---------------|------|
|
|
33
|
+
| **Patch** | 2.4.3 → 2.4.4 | Bug fixes, minor improvements |
|
|
34
|
+
| **Minor** | 2.4.4 → 2.5.0 | New features, backward compatible |
|
|
35
|
+
| **Major** | 2.5.0 → 3.0.0 | Breaking changes |
|
|
36
|
+
|
|
37
|
+
## Complete Workflow
|
|
38
|
+
|
|
39
|
+
### Phase 1: Pre-Release Checks
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# 1. Verify git status
|
|
43
|
+
git status
|
|
44
|
+
# MUST show: "On branch main", "working tree clean"
|
|
45
|
+
|
|
46
|
+
# 2. Check current version
|
|
47
|
+
cat package.json | grep version
|
|
48
|
+
# e.g., "version": "2.4.3"
|
|
49
|
+
|
|
50
|
+
# 3. Review recent changes
|
|
51
|
+
git log --oneline -10
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**STOP if**:
|
|
55
|
+
- Not on main branch
|
|
56
|
+
- Uncommitted changes exist
|
|
57
|
+
- Unpushed commits exist
|
|
58
|
+
|
|
59
|
+
### Phase 2: Version Updates
|
|
60
|
+
|
|
61
|
+
**Step 1: Update CHANGELOG.md**
|
|
62
|
+
|
|
63
|
+
Add new version section at the top (after `---`):
|
|
64
|
+
|
|
65
|
+
```markdown
|
|
66
|
+
## [X.Y.Z] - YYYY-MM-DD
|
|
67
|
+
|
|
68
|
+
### 🎯 Release Title
|
|
69
|
+
|
|
70
|
+
Brief description of main changes.
|
|
71
|
+
|
|
72
|
+
#### Changed / Added / Fixed
|
|
73
|
+
- Bullet point 1
|
|
74
|
+
- Bullet point 2
|
|
75
|
+
|
|
76
|
+
#### Benefits
|
|
77
|
+
- ✅ Benefit 1
|
|
78
|
+
- ✅ Benefit 2
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Step 2: Update package.json**
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Manually edit or use npm version
|
|
85
|
+
npm version patch --no-git-tag-version # For patch release
|
|
86
|
+
npm version minor --no-git-tag-version # For minor release
|
|
87
|
+
npm version major --no-git-tag-version # For major release
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Or edit directly:
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"version": "X.Y.Z"
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Phase 3: Git Operations
|
|
98
|
+
|
|
99
|
+
**Step 1: Create Release Commit**
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
git add CHANGELOG.md package.json
|
|
103
|
+
|
|
104
|
+
git commit -m "$(cat <<'EOF'
|
|
105
|
+
chore(release): bump version to X.Y.Z
|
|
106
|
+
|
|
107
|
+
Release X.Y.Z - [Brief title]
|
|
108
|
+
|
|
109
|
+
主要变更:
|
|
110
|
+
- 变更点 1
|
|
111
|
+
- 变更点 2
|
|
112
|
+
|
|
113
|
+
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
114
|
+
EOF
|
|
115
|
+
)"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Step 2: Create Annotated Tag**
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
git tag -a vX.Y.Z -m "$(cat <<'EOF'
|
|
122
|
+
Release vX.Y.Z - [Brief title]
|
|
123
|
+
|
|
124
|
+
🎯 Main changes:
|
|
125
|
+
- Change 1
|
|
126
|
+
- Change 2
|
|
127
|
+
|
|
128
|
+
Benefits:
|
|
129
|
+
✅ Benefit 1
|
|
130
|
+
✅ Benefit 2
|
|
131
|
+
|
|
132
|
+
Full changelog: https://github.com/Dimon94/cc-devflow/blob/main/CHANGELOG.md
|
|
133
|
+
EOF
|
|
134
|
+
)"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Step 3: Verify**
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Check commit
|
|
141
|
+
git log --oneline -1
|
|
142
|
+
|
|
143
|
+
# Check tag
|
|
144
|
+
git tag -l "v2.4.*" | tail -3
|
|
145
|
+
|
|
146
|
+
# Verify tag annotation
|
|
147
|
+
git show vX.Y.Z
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Phase 4: Publish
|
|
151
|
+
|
|
152
|
+
**Step 1: Push to GitHub**
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# Push commits
|
|
156
|
+
git push origin main
|
|
157
|
+
|
|
158
|
+
# Push tags
|
|
159
|
+
git push origin vX.Y.Z
|
|
160
|
+
# Or push all tags: git push origin --tags
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Step 2: Create GitHub Release (Optional)**
|
|
164
|
+
|
|
165
|
+
Via GitHub CLI:
|
|
166
|
+
```bash
|
|
167
|
+
gh release create vX.Y.Z \
|
|
168
|
+
--title "vX.Y.Z - [Title]" \
|
|
169
|
+
--notes-file <(sed -n '/## \[X.Y.Z\]/,/## \[/p' CHANGELOG.md | head -n -1)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Or manually at: https://github.com/Dimon94/cc-devflow/releases/new
|
|
173
|
+
|
|
174
|
+
**Step 3: Publish to npm**
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Test publish first (dry-run)
|
|
178
|
+
npm publish --dry-run
|
|
179
|
+
|
|
180
|
+
# Actual publish
|
|
181
|
+
npm publish
|
|
182
|
+
|
|
183
|
+
# Verify publication
|
|
184
|
+
npm view cc-devflow version
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Quick Reference
|
|
188
|
+
|
|
189
|
+
| Step | Command | Purpose |
|
|
190
|
+
|------|---------|---------|
|
|
191
|
+
| Check status | `git status` | Verify clean state |
|
|
192
|
+
| Check version | `grep version package.json` | Current version |
|
|
193
|
+
| Bump version | Edit package.json | Update version number |
|
|
194
|
+
| Update changelog | Edit CHANGELOG.md | Document changes |
|
|
195
|
+
| Create commit | `git commit -m "chore(release): ..."` | Commit version bump |
|
|
196
|
+
| Create tag | `git tag -a vX.Y.Z -m "..."` | Tag release |
|
|
197
|
+
| Push commits | `git push origin main` | Push to GitHub |
|
|
198
|
+
| Push tags | `git push origin vX.Y.Z` | Push tag to GitHub |
|
|
199
|
+
| Publish npm | `npm publish` | Publish to registry |
|
|
200
|
+
|
|
201
|
+
## Common Mistakes
|
|
202
|
+
|
|
203
|
+
### ❌ Mistake 1: Forgetting to Update CHANGELOG.md
|
|
204
|
+
|
|
205
|
+
**Problem**: Version bumped but no changelog entry
|
|
206
|
+
|
|
207
|
+
**Fix**: Always update CHANGELOG.md BEFORE committing
|
|
208
|
+
|
|
209
|
+
### ❌ Mistake 2: Inconsistent Version Numbers
|
|
210
|
+
|
|
211
|
+
**Problem**: package.json shows 2.4.4 but CHANGELOG.md shows 2.4.3
|
|
212
|
+
|
|
213
|
+
**Fix**: Double-check all version numbers match before committing
|
|
214
|
+
|
|
215
|
+
### ❌ Mistake 3: Pushing Tag Before Commit
|
|
216
|
+
|
|
217
|
+
**Problem**: Tag points to wrong commit
|
|
218
|
+
|
|
219
|
+
**Fix**: Always commit first, then tag, then push both together
|
|
220
|
+
|
|
221
|
+
### ❌ Mistake 4: Not Testing npm publish
|
|
222
|
+
|
|
223
|
+
**Problem**: Published package is broken
|
|
224
|
+
|
|
225
|
+
**Fix**: Run `npm publish --dry-run` first to catch issues
|
|
226
|
+
|
|
227
|
+
### ❌ Mistake 5: Network Timeout During Push
|
|
228
|
+
|
|
229
|
+
**Problem**: `Failed to connect to github.com port 443`
|
|
230
|
+
|
|
231
|
+
**Fix**:
|
|
232
|
+
```bash
|
|
233
|
+
# Option 1: Retry after network stabilizes
|
|
234
|
+
git push origin main
|
|
235
|
+
git push origin vX.Y.Z
|
|
236
|
+
|
|
237
|
+
# Option 2: Switch to SSH (if HTTPS blocked)
|
|
238
|
+
git remote set-url origin git@github.com:Dimon94/cc-devflow.git
|
|
239
|
+
git push origin main
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Network Troubleshooting
|
|
243
|
+
|
|
244
|
+
If `git push` fails with timeout:
|
|
245
|
+
|
|
246
|
+
1. **Check network connectivity**:
|
|
247
|
+
```bash
|
|
248
|
+
curl -I https://github.com 2>&1 | head -5
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
2. **Try SSH instead of HTTPS**:
|
|
252
|
+
```bash
|
|
253
|
+
git remote -v # Check current remote URL
|
|
254
|
+
git remote set-url origin git@github.com:Dimon94/cc-devflow.git
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
3. **If SSH fails (publickey error)**:
|
|
258
|
+
- Check SSH key: `ssh -T git@github.com`
|
|
259
|
+
- Add SSH key to GitHub: https://github.com/settings/keys
|
|
260
|
+
- Or stay with HTTPS and retry later
|
|
261
|
+
|
|
262
|
+
4. **Commits and tags are safe locally**:
|
|
263
|
+
- They won't be lost
|
|
264
|
+
- Push when network is available
|
|
265
|
+
|
|
266
|
+
## Post-Release Verification
|
|
267
|
+
|
|
268
|
+
After successful release:
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
# 1. Verify GitHub tag
|
|
272
|
+
open https://github.com/Dimon94/cc-devflow/tags
|
|
273
|
+
|
|
274
|
+
# 2. Verify npm package
|
|
275
|
+
npm view cc-devflow version
|
|
276
|
+
npm view cc-devflow time
|
|
277
|
+
|
|
278
|
+
# 3. Test installation
|
|
279
|
+
npm install -g cc-devflow@latest
|
|
280
|
+
cc-devflow --version # Should show new version
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Rollback (If Needed)
|
|
284
|
+
|
|
285
|
+
If published version has critical bugs:
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
# 1. Unpublish from npm (within 72 hours)
|
|
289
|
+
npm unpublish cc-devflow@X.Y.Z
|
|
290
|
+
|
|
291
|
+
# 2. Delete git tag locally and remotely
|
|
292
|
+
git tag -d vX.Y.Z
|
|
293
|
+
git push origin :refs/tags/vX.Y.Z
|
|
294
|
+
|
|
295
|
+
# 3. Revert commit
|
|
296
|
+
git revert HEAD
|
|
297
|
+
|
|
298
|
+
# 4. Fix bug and re-release with new patch version
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**Note**: npm unpublish is only available within 72 hours of publication. After that, publish a new patch version instead.
|
|
302
|
+
|
|
303
|
+
## Real-World Impact
|
|
304
|
+
|
|
305
|
+
Following this workflow ensures:
|
|
306
|
+
- ✅ **Consistency**: All version markers stay in sync
|
|
307
|
+
- ✅ **Traceability**: Clear changelog and git history
|
|
308
|
+
- ✅ **Safety**: Dry-run catches issues before publishing
|
|
309
|
+
- ✅ **Recoverability**: Can rollback if needed
|
|
310
|
+
- ✅ **Automation-ready**: Scriptable workflow for future CI/CD
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
**[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|