LightSpeedWP projects follow Semantic Versioning (SemVer) principles.
- The root-level
VERSIONfile is the single source of truth for the current project version. - The
VERSIONfile must contain only the version string inX.Y.Zor semver.org compatible format (e.g.,1.2.3,2.0.0-beta.1).
- All files that include a
versionfield in their YAML frontmatter must set it to exactly match the contents of the rootVERSIONfile. - This applies to agent specs, prompt files, instructions, documentation, and any config files using the
versionfield. - When the project version changes (the
VERSIONfile is updated), update all relevantversionfields in tracked files to match.
Example:
---
version: "1.2.3" # Must match contents of root VERSION file
---Validation:
Use scripts or CI to ensure all frontmatter version fields remain synchronized with the root VERSION file.
Version numbers follow the format: MAJOR.MINOR.PATCH
- MAJOR: Incremented for incompatible API changes
- MINOR: Incremented for backwards-compatible functionality additions
- PATCH: Incremented for backwards-compatible bug fixes
Pre-release Versions: May include identifiers:
1.0.0-alpha.11.0.0-beta.11.0.0-rc.1
- Plugins/themes should also specify minimum supported WordPress and PHP versions, and note browser compatibility as needed.
- Create annotated tags for releases:
git tag -a v1.0.0 -m "Release version 1.0.0" - Use the
vprefix for all version tags - Push tags to remote:
git push origin --tags
main/master: Production-ready codedevelop: Integration branch for featuresfeature/*: Feature development brancheshotfix/*: Emergency fixes for productionrelease/*: Preparation for new releases
- Feature Development: Work in
feature/*branches - Integration: Merge features into
develop - Release Preparation: Create
release/*branch fromdevelop - Testing: Test the release branch
- Release: Merge to
mainand tag the version - Hotfixes: Apply fixes via
hotfix/*branches
- Maintain a
CHANGELOG.mdusing Keep a Changelog format. - Update changelog for each release, including sections for Added, Changed, Deprecated, Removed, Fixed, Security.
Update version numbers in:
- Plugin header comment (
Version:) - Theme
style.cssheader (Version:) readme.txt(Stable tag:)package.json(version)composer.json(version)
Consider tools for version management:
- npm version: For Node.js projects
- Composer: For PHP projects
- GitHub Actions: For automated releases and version checks
- WP-CLI: For WordPress-specific versioning
1.2.3
# Update version in files
npm version patch # Updates package.json
# Update plugin header, readme.txt, and frontmatter versions manually
# Commit and tag
git add .
git commit -m "Bump version to 1.2.3"
git tag -a v1.2.3 -m "Release version 1.2.3"
git push origin main --tags- Always test before releasing
- Document breaking changes clearly
- Maintain backwards compatibility where possible
- Use pre-release versions for testing
- Follow WordPress and SemVer guidelines
- Automate version updates and verification whenever possible
- Communicate changes to users via changelog and release notes
Note: This is an alternative versioning approach for documentation and configuration files. The unified versioning strategy above remains the recommended default.
For documentation-heavy repositories (like .github), individual files may evolve independently. This strategy allows per-file semantic versioning whilst maintaining coordination with the repository version.
- Repository version (
/VERSION): UsesX.Y.0format for coordinated releases - File version (
version:in frontmatter): IndependentX.Y.Zversioning per file - Guardrail: A file's minor version (
X.Y) must not exceed the repository's minor version
- Content edits, typo fixes, clarifications
- No schema or structural changes
- Safe for all consumers
- Schema-related key changes in that file
- New required fields or breaking changes for agents
- Must not exceed repository minor version
Scenario 1: Edit instruction prose
- Current:
version: 0.1.3 - Action: Fix typos, clarify instructions
- Result:
version: 0.1.4(patch bump)
Scenario 2: Add required frontmatter field
- Current:
version: 0.2.5, Repo:0.2.0 - Action: Add new required
applyTofield - Result: Cannot bump to
0.3.0(would exceed repo0.2.0) - Must wait for repo bump to
0.3.0first
Scenario 3: Coordinated release
- Repo bumps:
0.2.0→0.3.0 - Files with breaking changes: bump to
0.3.0 - Files with only content edits: remain at
0.2.xor bump patch
A file must not have a minor version exceeding the repository minor version:
- ✓ File
0.2.8with Repo0.2.0(valid) - ✓ File
0.2.0with Repo0.3.0(valid) - ✗ File
0.3.0with Repo0.2.0(invalid - exceeds repo minor)
Use scripts/versioning/bump-file-version.js for single or bulk version bumps:
# Bump patch version of a single file
node scripts/versioning/bump-file-version.js .github/instructions/coding-standards.instructions.md patch
# Bump minor version (with guardrail check)
node scripts/versioning/bump-file-version.js .github/prompts/review.prompt.md minor
# Bulk bump patch versions
node scripts/versioning/bump-file-version.js --bulk ".github/instructions/**/*.md" patchThe script will:
- Automatically update the
versionfield - Update
last_updatedto current date - Enforce the guardrail (file minor ≤ repo minor)
- Exit with error if guardrail would be violated
Add a CI check to ensure file versions don't exceed repository version:
- name: Validate file versions
run: |
REPO_VERSION=$(cat VERSION)
node scripts/versioning/validate-versions.js --repo-version $REPO_VERSIONUse per-file versioning when:
- Documentation/instructions evolve independently
- Fine-grained change tracking is valuable
- Multiple maintainers update different files
Use unified versioning when:
- Coordinated releases are preferred
- Simplicity is more important than granularity
- All files change together
Bump individual or bulk file versions with guardrails:
# Single file
node scripts/versioning/bump-file-version.cjs <file> [patch|minor]
# Bulk update
node scripts/versioning/bump-file-version.cjs --bulk "<pattern>" [patch|minor]
# Help
node scripts/versioning/bump-file-version.cjs --helpValidate and fix broken reference links in frontmatter:
# Scan and fix all references
node scripts/maintenance/fix-references.cjs
# Show current fix map
node scripts/maintenance/fix-references.cjs --fix-map
# Help
node scripts/maintenance/fix-references.cjs --helpConsider adding these scripts to GitHub Actions workflows for:
- Pre-commit hooks (validate versions before commit)
- Pull request checks (ensure references are valid)
- Release automation (bulk bump versions on release)
Maintained with ❤️ by the 🚀 LightSpeedWP Automation Team Org Profile