Skip to content

Commit 7cafaee

Browse files
committed
feat: make releaserator version-file agnostic
Auto-detect version file instead of hardcoding plugin.json. Supports plugin.json, package.json, pyproject.toml, and Cargo.toml.
1 parent 2475b6c commit 7cafaee

5 files changed

Lines changed: 94 additions & 39 deletions

File tree

docs/CONTEXT.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22
phase: 6
33
phase_name: Spec Alignment
44
updated: 2026-03-28
5-
last_commit: 66bfefe
5+
last_commit: 2475b6c
66
---
77

88
## Current Focus
99

10-
Updated macos-launchd-service skill to use modern `launchctl bootstrap/bootout` API. Templates now generate `dev.sh` with subcommands instead of the old prompt-on-exit pattern.
10+
Removed hardcoded plugin.json dependency from releaserator skill. Now auto-detects version file type (plugin.json, package.json, pyproject.toml, Cargo.toml).
1111

1212
## Active Tasks
1313

1414
- [x] Modernize launchd templates (bootstrap/bootout)
1515
- [x] Add dev.sh subcommands (start/stop/status)
1616
- [x] Update SKILL.md and usage.md references
17-
- [ ] Run releaserator to create version 1.3.0 release
17+
- [x] Make releaserator version-file agnostic
18+
- [ ] Run releaserator to create next release
1819

1920
## Blockers
2021

2122
None.
2223

2324
## Context
2425

25-
- All 3 script templates updated: dev.sh, install.sh, uninstall.sh
26-
- dev.sh template now has subcommands: bare=dev, start, stop, status
27-
- No more exit prompt in dev mode -- service stays stopped
28-
- SKILL.md and references/usage.md updated to match
29-
- Driven by fixes to temoa and apantli that revealed the skill was outdated
26+
- Releaserator SKILL.md and references/usage.md updated for multi-format version detection
27+
- Detection order: plugin.json > package.json > pyproject.toml > Cargo.toml
28+
- Step 1 detects, Step 2 parses, Step 7 updates, Step 8 stages the detected file
29+
- Error messages and success criteria now reference VERSION_FILE instead of plugin.json
3030

3131
## Next Session
3232

33-
Run releaserator to create version 1.3.0 release.
33+
Create release with releaserator.

docs/IMPLEMENTATION.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ Living document tracking progress on the Claude Code plugin for project environm
3939
- ✅ Refactor fastapi-scaffold to fastapi-sweetener (additive, not generative)
4040
- ✅ Update python-project-init to use Click for subcommands
4141
- ✅ Document new workflow in README.md
42+
- ✅ Make releaserator version-file agnostic (support plugin.json, package.json, pyproject.toml, Cargo.toml)
4243
- ⏳ Validate all skills against spec with skill-validator (deferred)
4344

44-
**Releases**: v1.2.1
45+
**Releases**: v1.2.1, v1.3.0
4546

4647
---
4748

docs/chronicles/phase-6-spec-alignment.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,24 @@ Aligning plugin with agentskills.io specification.
6262
**Decisions**: None
6363

6464
**Files**: assets/dev.sh.template, assets/install.sh.template, assets/uninstall.sh.template, SKILL.md, references/usage.md
65+
66+
---
67+
68+
## Entry 23: Releaserator version-file agnostic (2026-03-28)
69+
70+
**What**: Removed hardcoded `.claude-plugin/plugin.json` dependency from releaserator. Now auto-detects version file.
71+
72+
**Why**: Releaserator could only run in Claude Code plugin repos. Non-plugin projects (Python, Node, Rust) use different version files.
73+
74+
**How**:
75+
76+
- Step 1 now detects version file in priority order: plugin.json, package.json, pyproject.toml, Cargo.toml
77+
- Step 2 has per-type version parsing instructions
78+
- Step 7 renamed to "Update Version File" with per-type update instructions
79+
- Step 8 stages detected VERSION_FILE instead of hardcoded path
80+
- Error messages and success criteria reference VERSION_FILE
81+
- Updated references/usage.md with "Supported Version Files" section
82+
83+
**Decisions**: None
84+
85+
**Files**: skills/releaserator/SKILL.md, skills/releaserator/references/usage.md

skills/releaserator/SKILL.md

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ git status --porcelain
2323
# Check current branch
2424
git branch --show-current
2525

26-
# Check for plugin.json
27-
test -f .claude-plugin/plugin.json && echo "EXISTS" || echo "MISSING"
26+
# Detect version file (check in priority order)
27+
for f in .claude-plugin/plugin.json package.json pyproject.toml Cargo.toml; do
28+
test -f "$f" && echo "VERSION_FILE=$f" && break
29+
done
2830

2931
# Check for gh CLI
3032
command -v gh >/dev/null 2>&1 && echo "INSTALLED" || echo "NOT_FOUND"
@@ -36,11 +38,18 @@ command -v gh >/dev/null 2>&1 && echo "INSTALLED" || echo "NOT_FOUND"
3638
- If dirty: Error with message: "Working directory has uncommitted changes. Please commit or stash changes before creating a release."
3739
- Current branch SHOULD be main/master
3840
- If not: Ask user to confirm creating release from current branch
39-
- plugin.json MUST exist
40-
- If missing: Error with message: "File .claude-plugin/plugin.json not found. Are you in a plugin directory?"
41+
- A supported version file MUST exist (one of the following, checked in order):
42+
- `.claude-plugin/plugin.json` — Claude Code plugin
43+
- `package.json` — Node.js project
44+
- `pyproject.toml` — Python project (version in `[project]` or `[tool.poetry]`)
45+
- `Cargo.toml` — Rust project (version in `[package]`)
46+
- If none found: Error with message: "No supported version file found. Releaserator supports: plugin.json, package.json, pyproject.toml, Cargo.toml"
4147
- gh CLI MUST be installed
4248
- If missing: Error with message: "GitHub CLI (gh) not found. Install with: brew install gh"
4349

50+
**Store**:
51+
- `VERSION_FILE` = path to the detected version file
52+
4453
**Optional check**: Verify docs/CONTEXT.md is recent (< 24 hours old)
4554
- If stale: Warn user and suggest running `/session-wrapup` first
4655

@@ -49,8 +58,8 @@ command -v gh >/dev/null 2>&1 && echo "INSTALLED" || echo "NOT_FOUND"
4958
**Task**: Read current version and find last release tag
5059

5160
```bash
52-
# Read current version from plugin.json (use Read tool)
53-
# Parse the "version" field
61+
# Read current version from VERSION_FILE (use Read tool)
62+
# Parse the version field based on file type (see below)
5463

5564
# Find last tag (if any)
5665
git describe --tags --abbrev=0 2>/dev/null || echo "NO_TAGS"
@@ -59,14 +68,23 @@ git describe --tags --abbrev=0 2>/dev/null || echo "NO_TAGS"
5968
git tag --list --sort=-version:refname
6069
```
6170

71+
**Version parsing by file type**:
72+
73+
| Version File | How to read version |
74+
|---|---|
75+
| `.claude-plugin/plugin.json` | JSON field `"version"` |
76+
| `package.json` | JSON field `"version"` |
77+
| `pyproject.toml` | `[project] version = "X.Y.Z"` or `[tool.poetry] version = "X.Y.Z"` |
78+
| `Cargo.toml` | `[package] version = "X.Y.Z"` |
79+
6280
**Logic**:
6381

64-
- Parse version from plugin.json (e.g., "1.0.0")
82+
- Read and parse version from VERSION_FILE
6583
- If no tags exist, this is first release (baseline: use all commits)
6684
- If tags exist, use latest tag as baseline for commit collection
6785

6886
**Store**:
69-
- `CURRENT_VERSION` = version from plugin.json
87+
- `CURRENT_VERSION` = version from VERSION_FILE
7088
- `LAST_TAG` = latest git tag (or "NO_TAGS")
7189
- `IS_FIRST_RELEASE` = true if no tags exist
7290

@@ -257,24 +275,28 @@ test -f CHANGELOG.md && echo "EXISTS" || echo "MISSING"
257275

258276
**Use Write tool** to create/update CHANGELOG.md
259277

260-
### Step 7: Update plugin.json Version
278+
### Step 7: Update Version File
279+
280+
**Task**: Write new version to VERSION_FILE
261281

262-
**Task**: Write new version to .claude-plugin/plugin.json
282+
**By file type**:
263283

264-
1. Read .claude-plugin/plugin.json
265-
2. Parse JSON
266-
3. Update `"version"` field to NEW_VERSION
267-
4. Write back with proper formatting (2-space indentation, trailing newline)
284+
| Version File | How to update |
285+
|---|---|
286+
| `.claude-plugin/plugin.json` | Update JSON `"version"` field. Use 2-space indentation, trailing newline. |
287+
| `package.json` | Update JSON `"version"` field. Preserve existing indentation and trailing newline. |
288+
| `pyproject.toml` | Replace `version = "OLD"` with `version = "NEW"` in the correct section. |
289+
| `Cargo.toml` | Replace `version = "OLD"` with `version = "NEW"` in the `[package]` section. |
268290

269-
**Use Read and Write tools** (or Edit tool for simple replacement)
291+
**Use Read and Edit tools** for precise replacement.
270292

271293
### Step 8: Commit Version Bump
272294

273295
**Task**: Create commit for version and changelog changes
274296

275297
```bash
276-
# Stage files
277-
git add .claude-plugin/plugin.json CHANGELOG.md
298+
# Stage files (VERSION_FILE is the detected version file from Step 1)
299+
git add VERSION_FILE CHANGELOG.md
278300

279301
# Create commit
280302
git commit -m "chore: bump version to NEW_VERSION"
@@ -379,7 +401,7 @@ Output a summary:
379401
✅ Release vNEW_VERSION created successfully!
380402

381403
**Changes**:
382-
- Updated plugin.json (OLD_VERSION → NEW_VERSION)
404+
- Updated VERSION_FILE (OLD_VERSION → NEW_VERSION)
383405
- Created/updated CHANGELOG.md with entry for vNEW_VERSION
384406
- Committed changes (abc1234: "chore: bump version to NEW_VERSION")
385407
- Created git tag vNEW_VERSION
@@ -463,10 +485,10 @@ After installing, run: gh auth login
463485
**Message**:
464486
```
465487
❌ Version X.Y.Z already exists as git tag.
466-
Current version in plugin.json: X.Y.Z
488+
Current version in VERSION_FILE: X.Y.Z
467489
Existing tag: vX.Y.Z
468490
469-
Please update plugin.json manually to a higher version,
491+
Please update the version manually in VERSION_FILE,
470492
or delete the tag if it was created in error:
471493
git tag -d vX.Y.Z
472494
git push origin :refs/tags/vX.Y.Z
@@ -632,7 +654,7 @@ After running releaserator, verify:
632654

633655
- ✅ CHANGELOG.md created or updated with new entry
634656
- ✅ CHANGELOG.md follows Keep A Changelog format
635-
- ✅ plugin.json version field updated correctly
657+
-Version file updated correctly (plugin.json, package.json, pyproject.toml, or Cargo.toml)
636658
- ✅ Git commit created with conventional commit message
637659
- ✅ Annotated git tag created (not lightweight)
638660
- ✅ Tag pushed to remote

skills/releaserator/references/usage.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Releaserator automates the entire release process:
99
1. **Analyzes commits** since last release using Conventional Commits
1010
2. **Determines version bump** (MAJOR.MINOR.PATCH) based on commit types
1111
3. **Generates CHANGELOG.md** in Keep A Changelog format
12-
4. **Updates plugin.json** version
12+
4. **Updates version** in the project's version file (auto-detected)
1313
5. **Creates git tag** (vX.Y.Z)
1414
6. **Pushes to remote** (with confirmation)
1515
7. **Creates GitHub release** with generated notes
@@ -20,7 +20,7 @@ Use releaserator when you're ready to publish a new version:
2020

2121
- After completing a development phase
2222
- When significant features or fixes have accumulated
23-
- Before announcing the plugin to users
23+
- Before announcing the project to users
2424
- On a regular schedule (monthly, quarterly, etc.)
2525

2626
## Prerequisites
@@ -118,7 +118,7 @@ Releaserator generates Keep A Changelog formatted entries:
118118

119119
**Files modified**:
120120
- `CHANGELOG.md` - New entry prepended (or file created)
121-
- `.claude-plugin/plugin.json` - Version field updated
121+
- Version file updated (auto-detected: `plugin.json`, `package.json`, `pyproject.toml`, or `Cargo.toml`)
122122

123123
**Git operations**:
124124
- Commit: `chore: bump version to X.Y.Z`
@@ -310,7 +310,7 @@ GitLab and Gitea support coming soon!
310310
311311
**Symptom**: Error about tag vX.Y.Z already existing
312312
313-
**Cause**: Version in plugin.json might have been manually changed
313+
**Cause**: Version in the version file might have been manually changed
314314
315315
**Solution**:
316316
1. Check existing tags: `git tag -l`
@@ -319,7 +319,7 @@ GitLab and Gitea support coming soon!
319319
git tag -d vX.Y.Z
320320
git push origin :refs/tags/vX.Y.Z
321321
```
322-
3. Or manually update plugin.json to a higher version
322+
3. Or manually update the version file to a higher version
323323
324324
### Issue: Push fails
325325
@@ -353,7 +353,7 @@ GitLab and Gitea support coming soon!
353353
**Solution**:
354354
- Review commits: `git log vX.Y.Z..HEAD --oneline`
355355
- Check commit types match changes (feat vs fix vs docs)
356-
- Manually adjust plugin.json version if needed
356+
- Manually adjust the version in your project's version file if needed
357357
358358
## Platform Support
359359
@@ -369,7 +369,7 @@ Platform-specific code is isolated in `platforms/` directory for easy expansion.
369369
370370
If you need a specific version (not calculated):
371371
372-
1. Manually update `.claude-plugin/plugin.json` version
372+
1. Manually update the version in your project's version file
373373
2. Run `/releaserator`
374374
3. It will use your version instead of calculating
375375
@@ -381,12 +381,23 @@ Currently, releaserator always asks for confirmation before pushing. This is int
381381
382382
Pre-release versions (alpha, beta, rc) are not currently supported. This feature may be added in the future.
383383
384+
## Supported Version Files
385+
386+
Releaserator auto-detects the project's version file, checked in this order:
387+
388+
| File | Project Type |
389+
|---|---|
390+
| `.claude-plugin/plugin.json` | Claude Code plugin |
391+
| `package.json` | Node.js |
392+
| `pyproject.toml` | Python |
393+
| `Cargo.toml` | Rust |
394+
384395
## Files Created
385396
386397
After running releaserator, you'll have:
387398
388399
- `CHANGELOG.md` - Project changelog (created or updated)
389-
- Updated `.claude-plugin/plugin.json` version
400+
- Updated version in the project's version file
390401
- Git commit for version bump
391402
- Git tag (vX.Y.Z)
392403
- GitHub release

0 commit comments

Comments
 (0)