/version Command
Unified version management with intelligent create/edit routing
Version
Unified version management that intelligently creates new versions or edits existing ones based on context and natural language input.
Usage
/doh:version <natural language description>
Examples
/doh:version 2.0.0/doh:version for gitlab integration/doh:version 1.5.0 add user management features/doh:version 2.0.0 change status to active/doh:version major release with breaking changes/doh:version patch for authentication fixes
Instructions
1. Parse Input and Route Intelligently
From $ARGUMENTS, extract:
- Explicit version: "2.0.0", "1.5.0", "3.0.0"
- Version hints: "major", "minor", "patch", "next"
- Action context: "for", "add", "change status", "update"
- Feature context: Feature names, descriptions, scope indicators
2. Determine Operation Mode
Check version existence if explicit version provided:
[ -f ".doh/versions/${VERSION}.md" ]
Route decision:
- Version exists + context ā EDIT MODE
- Version missing ā CREATE MODE
- No version specified ā DISCOVERY MODE (infer version)
3. CREATE MODE - New Version
When version doesn't exist or needs to be inferred:
3a. Context Gathering (Silently)
- Read
VERSIONfile for current version - Check
.doh/versions/for existing versions - Check
.doh/prds/for features that might target this version - Look at
.doh/epics/for work in progress
3b. Discovery Phase (if needed)
If version number unclear or context missing:
š Version Planning: "$ARGUMENTS"
To create the right version, I need to understand:
1. **What's driving this version?**
- Major new features or capabilities?
- Bug fixes and stability improvements?
- Breaking changes or architecture updates?
2. **Version preference:**
- Specific version number in mind?
- Or should I suggest based on changes?
3. **Scope and timeline:**
- Which features will be included?
- Any breaking changes expected?
Current version: ${CURRENT_VERSION}
Available versions: ${EXISTING_VERSIONS}
Please provide context.
3c. Version Number Determination
Smart inference:
- "major" or breaking changes ā X+1.0.0
- "minor" or new features ā X.Y+1.0
- "patch" or bug fixes ā X.Y.Z+1
- Context analysis: "gitlab integration" ā likely major, "auth fixes" ā patch
3d. Present Plan and Create
š Version Planning Summary
===========================
**Proposed Version:** ${VERSION}
**Type:** ${MAJOR/MINOR/PATCH} (${REASONING})
**Theme:** ${RELEASE_THEME}
**Version Progression:** ${CURRENT_VERSION} ā ${VERSION}
**Scope Understanding:** ${DESCRIPTION_FROM_INPUT}
Should I create version ${VERSION}?
1. ā
Yes, create version ${VERSION}
2. āļø Adjust the version details
3. š Let me provide more context
4. ā Cancel
If confirmed, use helper:
./.claude/scripts/doh/helper.sh version new "${VERSION}" "${DESCRIPTION}"
Post-creation enhancement:
- Read the created version file
- Update with context from discovery conversation
- Preserve all frontmatter from helper
4. EDIT MODE - Existing Version
When version file exists:
4a. Load Current State
š Current Version: ${VERSION}
========================
**Status:** ${CURRENT_STATUS}
**Description:** ${CURRENT_DESCRIPTION}
**Current Content:**
- Goals: ${GOALS_SUMMARY}
- Features: ${FEATURES_SUMMARY}
- Breaking Changes: ${BREAKING_CHANGES}
**Related Work:**
- PRDs targeting this version: ${COUNT}
- Active epics: ${COUNT}
4b. Parse Edit Intent
From natural language, determine:
- Status changes: "active", "completed", "released", "deprecated"
- Content updates: "add features", "update notes", "change description"
- Scope changes: "include", "add to scope", "remove from scope"
4c. Present Changes
š Proposed Changes to Version ${VERSION}
=========================================
**Changes Based On:** "${USER_INPUT}"
**What will be updated:** ${CHANGES_DESCRIPTION}
Apply these changes?
1. ā
Yes, apply changes
2. āļø Edit some changes
3. š Preview result
4. ā Cancel
4d. Apply Updates Using Helper
Use helper_version_update to touch existing versions:
Simple touch (updates timestamp only):
# Just touch the version file - automatically updates 'updated' field
./.claude/scripts/doh/helper.sh version update "${VERSION}"
With specific field updates (optional):
# Update specific fields only if needed
./.claude/scripts/doh/helper.sh version update "${VERSION}" status:"${NEW_STATUS}"
# Or multiple fields
./.claude/scripts/doh/helper.sh version update "${VERSION}" status:"active" description:"Updated description"
Helper automatically:
- Updates
updatedfield with current timestamp - Validates version existence
- Preserves all existing structure and content
- Handles atomic file operations
For content sections beyond frontmatter:
- Read version file after helper touch
- Enhance content sections based on user input
- All frontmatter is already handled by helper
5. DISCOVERY MODE - No Version Specified
When input like "for gitlab integration" without version:
5a. Context Analysis
- Analyze feature scope from description
- Check current version and existing plans
- Determine appropriate version increment
5b. Version Suggestion
š Version Analysis for "${ARGUMENTS}"
====================================
**Feature Analysis:**
- Scope: ${FEATURE_SCOPE_ANALYSIS}
- Impact: ${BREAKING_CHANGES_ASSESSMENT}
- Suggested increment: ${VERSION_TYPE}
**Recommended Version:** ${SUGGESTED_VERSION}
**Reasoning:** ${VERSION_REASONING}
Should I create version ${SUGGESTED_VERSION}?
1. ā
Yes, create ${SUGGESTED_VERSION}
2. š Suggest different version
3. āļø Let me specify version manually
If confirmed, proceed to CREATE MODE with inferred version
6. Post-Operation Summary
ā
Version Operation Complete
=============================
**Version:** ${VERSION}
**Operation:** ${CREATED/UPDATED}
**Changes:** ${SUMMARY_OF_CHANGES}
**Files Affected:**
- .doh/versions/${VERSION}.md
**Next Steps:**
⢠View version: /doh:version-show ${VERSION}
⢠Plan features: /doh:prd-new <feature> for version ${VERSION}
⢠Check all versions: /doh:version-status
Important Rules
- SMART ROUTING - Auto-detect create vs edit based on version existence
- HELPER DELEGATION - Always use helpers:
version newfor creation,version updatefor edits - CONTEXT AWARENESS - Use information from PRD creation and discovery
- NATURAL LANGUAGE - Parse human descriptions intelligently
- NO MANUAL TEMPLATES - Let helpers handle all version file operations
- DISCOVERY WHEN UNCLEAR - Conduct discovery when context missing
- ATOMIC OPERATIONS - Helpers ensure proper file handling and validation
Error Handling
- Invalid version format: Show semantic versioning examples
- Version conflicts: Offer edit existing or choose different number
- Ambiguous input: Conduct discovery session
- Helper errors: Show exact error and suggest fixes