Skip to content

Commit 202fe0d

Browse files
authored
Merge pull request #13 from nullhack/hotfix/calver-versioning-v1.2.20260312r2
fix: template hotfix v1.2.20260312r2
2 parents 99a68b9 + d101f69 commit 202fe0d

File tree

4 files changed

+45
-30
lines changed

4 files changed

+45
-30
lines changed

.opencode/skills/template-release/SKILL.md

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ Use this when ready to release a new version of the cookiecutter template after
1515

1616
## Template Versioning Strategy
1717

18-
### Semantic Versioning for Template
19-
Use standard semantic versioning: `v{major}.{minor}.{patch}`
18+
### Hybrid Calver Versioning for Template
19+
Use hybrid versioning: `v{major}.{minor}.{YYYYMMDD}r{revision}`
2020

2121
**Version Bump Guidelines:**
22-
- **Major (v2.0.0)**: Breaking changes to cookiecutter variables, major workflow changes, removed features
23-
- **Minor (v1.1.0)**: New agents, new skills, workflow enhancements, new features
24-
- **Patch (v1.0.1)**: Bug fixes, documentation updates, minor improvements
22+
- **Major (v2.x.xxxxr1)**: Breaking changes to cookiecutter variables, major workflow changes, removed features
23+
- **Minor (v1.x.xxxxr1)**: New agents, new skills, workflow enhancements, new features
24+
- **Revision (v1.2.xxxxr2)**: Bug fixes, documentation updates, minor improvements on same day
2525

2626
**Examples:**
2727
```
28-
v1.0.0 # Initial release
29-
v1.1.0 # Added repo-manager agent and git-release skill
30-
v1.1.1 # Fixed bug in template generation
31-
v1.2.0 # Added template-manager meta agent
32-
v2.0.0 # Changed cookiecutter.json structure (breaking)
28+
v1.0.20260302r1 # Initial release on March 2, 2026
29+
v1.1.20260315r1 # Added repo-manager agent and git-release skill on March 15
30+
v1.1.20260315r2 # Fixed bug in template generation same day
31+
v1.2.20260320r1 # Added template-manager meta agent on March 20
32+
v2.0.20260401r1 # Changed cookiecutter.json structure (breaking) on April 1
3333
```
3434

3535
## Release Process Workflow
@@ -56,7 +56,7 @@ fi
5656
### Phase 2: Version Calculation and Update
5757
```bash
5858
# Get current version from git tags
59-
current_version=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
59+
current_version=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.00000000r0")
6060
echo "Current version: $current_version"
6161

6262
# Determine next version based on changes
@@ -65,7 +65,7 @@ git log ${current_version}..HEAD --oneline
6565

6666
# Version bump logic (manual decision)
6767
echo "Select version bump type:"
68-
echo "1. Patch (bug fixes, docs)"
68+
echo "1. Revision (bug fixes, docs - same day)"
6969
echo "2. Minor (new features, agents, skills)"
7070
echo "3. Major (breaking changes)"
7171

@@ -74,24 +74,37 @@ breaking_changes=$(git log ${current_version}..HEAD --grep="BREAKING CHANGE" --o
7474
new_features=$(git log ${current_version}..HEAD --grep="feat:" --oneline | wc -l)
7575
bug_fixes=$(git log ${current_version}..HEAD --grep="fix:" --oneline | wc -l)
7676

77+
# Get current date for calver
78+
current_date=$(date +%Y%m%d)
79+
7780
if [ "$breaking_changes" -gt 0 ]; then
7881
bump_type="major"
7982
elif [ "$new_features" -gt 0 ]; then
8083
bump_type="minor"
8184
else
82-
bump_type="patch"
85+
bump_type="revision"
8386
fi
8487

88+
# Extract current version components
89+
current_major=$(echo $current_version | sed 's/v\([0-9]\+\)\..*/\1/')
90+
current_minor=$(echo $current_version | sed 's/v[0-9]\+\.\([0-9]\+\).*/\1/')
91+
current_date_in_tag=$(echo $current_version | sed 's/v[0-9]\+\.[0-9]\+\.\([0-9]\{8\}\).*/\1/')
92+
current_revision=$(echo $current_version | sed 's/.*r\([0-9]\+\)/\1/')
93+
8594
# Calculate new version
8695
case $bump_type in
8796
"major")
88-
new_version=$(echo $current_version | sed 's/v\([0-9]\+\).*/v\1/' | sed 's/v//' | awk '{print "v" ($1+1) ".0.0"}')
97+
new_version=$(echo "v$((current_major + 1)).0.${current_date}r1")
8998
;;
9099
"minor")
91-
new_version=$(echo $current_version | sed 's/v\([0-9]\+\)\.\([0-9]\+\).*/v\1.\2/' | sed 's/v//' | awk -F. '{print "v" $1 "." ($2+1) ".0"}')
100+
new_version=$(echo "v${current_major}.$((current_minor + 1)).${current_date}r1")
92101
;;
93-
"patch")
94-
new_version=$(echo $current_version | sed 's/v//' | awk -F. '{print "v" $1 "." $2 "." ($3+1)}')
102+
"revision")
103+
if [ "$current_date_in_tag" = "$current_date" ]; then
104+
new_version=$(echo "v${current_major}.${current_minor}.${current_date}r$((current_revision + 1))")
105+
else
106+
new_version=$(echo "v${current_major}.${current_minor}.${current_date}r1")
107+
fi
95108
;;
96109
esac
97110

@@ -317,7 +330,7 @@ EOF
317330
git add .
318331
git commit -m "feat(agents): add template-manager meta agent"
319332
@template-manager /skill template-release
320-
# Output: "Created release v1.2.0 with new meta agent functionality"
333+
# Output: "Created release v1.2.20260320r1 with new meta agent functionality"
321334
```
322335

323336
### Patch Release
@@ -326,7 +339,7 @@ git commit -m "feat(agents): add template-manager meta agent"
326339
git add .
327340
git commit -m "fix(docs): correct cookiecutter variable examples"
328341
@template-manager /skill template-release
329-
# Output: "Created release v1.1.1 with documentation fixes"
342+
# Output: "Created release v1.2.20260320r2 with documentation fixes"
330343
```
331344

332345
### Major Release
@@ -337,5 +350,5 @@ git commit -m "feat!: restructure cookiecutter variables for better usability
337350
338351
BREAKING CHANGE: cookiecutter.json format changed"
339352
@template-manager /skill template-release
340-
# Output: "Created release v2.0.0 with breaking changes - migration guide included"
353+
# Output: "Created release v2.0.20260401r1 with breaking changes - migration guide included"
341354
```

AGENTS.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ When developers use this template, they get:
8989
cookiecutter gh:your-username/python-project-template
9090

9191
# Or use a specific version
92-
cookiecutter gh:your-username/python-project-template --checkout v1.2.0
92+
cookiecutter gh:your-username/python-project-template --checkout v1.2.20260312r1
9393
```
9494

9595
### Template Development Workflow
@@ -108,15 +108,15 @@ cookiecutter gh:your-username/python-project-template --checkout v1.2.0
108108

109109
## Template Versioning
110110

111-
### Semantic Versioning for Template
112-
- **Major (v2.0.0)**: Breaking changes to cookiecutter variables
113-
- **Minor (v1.1.0)**: New agents, skills, workflow features
114-
- **Patch (v1.0.1)**: Bug fixes, documentation updates
111+
### Hybrid Calver Versioning for Template
112+
- **Major (v2.x.xxxxr1)**: Breaking changes to cookiecutter variables
113+
- **Minor (v1.x.xxxxr1)**: New agents, skills, workflow features
114+
- **Revision (v1.2.xxxxr2)**: Bug fixes, documentation updates
115115

116116
### Recent Releases
117-
- **v1.0.0**: Initial release with development workflow
118-
- **v1.1.0**: Added repository management agent
119-
- **v1.2.0**: Added meta template management system
117+
- **v1.0.20260312r1**: Initial release with development workflow
118+
- **v1.1.20260312r1**: Added repository management agent
119+
- **v1.2.20260312r1**: Added meta template management system
120120

121121
## Generated Project Features
122122

cookiecutter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"project_short_description": "Python template with some awesome tools to quickstart any Python project",
1010
"minimum_coverage": 100,
1111
"include_examples": "true",
12-
"version": "0.1.0",
12+
"version": "0.1.20260312r1",
1313
"license": ["MIT", "BSD_3_Clause", "Apache_2.0", "GPL_3.0", "Proprietary"]
1414
}

{{cookiecutter.project_slug}}/.opencode/skills/pr-management/SKILL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ fi
491491
```
492492

493493
### With CI/CD Pipeline
494+
{% raw %}
494495
```yaml
495496
# Auto-deployment for specific labels
496497
name: Auto Deploy
@@ -507,4 +508,5 @@ jobs:
507508
run: |
508509
echo "Deploying PR #${{ github.event.pull_request.number }} to staging"
509510
# Deployment commands...
510-
```
511+
```
512+
{% endraw %}

0 commit comments

Comments
 (0)