Skip to content

Commit 2d1fd02

Browse files
authored
docs: update README.md (#129)
1 parent 9c68e0e commit 2d1fd02

File tree

22 files changed

+1569
-1120
lines changed

22 files changed

+1569
-1120
lines changed

.claude/CLAUDE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,30 @@ Input → VCS Detection → Version Parsing → Transformation → Format Output
119119

120120
---
121121

122+
## 📝 Documentation Standards
123+
124+
### Test-Driven Documentation
125+
126+
**MANDATORY - All code examples in documentation must have corresponding tests**
127+
128+
1.**Every code example** in README.md and other docs must be backed by tests
129+
2.**Add reference comments**: `<!-- Corresponding test: path/to/test.rs:test_function -->`
130+
3.**Exact matching**: Documentation examples must exactly match test output
131+
4.**Realistic values**: Use actual commit hashes, not `{hex}` placeholders
132+
5.**Coordinated updates**: Update tests first, then documentation to match
133+
134+
### Reference Comment Format
135+
136+
```html
137+
<!-- Corresponding test: tests/integration_tests/flow/docs/quick_start.rs:test_quick_start_documentation_examples -->
138+
```
139+
140+
**For detailed documentation maintenance guidelines:**
141+
142+
@.claude/ref/documentation-maintenance.md
143+
144+
---
145+
122146
## 🧪 Testing Standards
123147

124148
### Quick Reference

.claude/plan/48-docs-restructure.md

Lines changed: 77 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Documentation Restructure Plan
22

3-
**Status**: Planned
3+
**Status**: In Progress
44
**Priority**: High
55
**Context**: Ready for first publish, need docs restructuring for human vs LLM audiences
66

@@ -21,46 +21,50 @@
2121

2222
#### README.md Table of Contents
2323

24-
1. **Hero Section** - Above the fold content
24+
1. **Hero Section** - Above the fold content
2525
- **Content**: Clear one-liner, key benefit statement
2626
- **Purpose**: Immediate value proposition
2727

28-
2. **Quick Start** - Install and run in 60 seconds
28+
2. **Quick Start** - Install and run in 60 seconds
2929
- **Content**:
3030

3131
```bash
3232
# Install
3333
cargo install zerv
3434

35-
# Try automated version (current branch determines output)
35+
# Try automated versioning (current branch determines output)
3636
zerv flow
37-
# → 1.2.3-alpha.5 (on feature branch)
38-
# → 1.3.0-beta.1 (on develop branch)
39-
# → 1.2.3 (on main branch)
37+
# → 1.0.0 (on main branch with tag v1.0.0)
38+
# → 1.0.1-rc.1.post.3 (on release branch with pre-release tag)
39+
# → 1.0.1-beta.1.post.3+develop.3.gf297dd0 (on develop branch)
40+
# → 1.0.1-alpha.59394.post.1+feature.new.auth.1.g4e9af24 (on feature branch)
41+
# → 1.0.1-alpha.17015.post.1.dev.1764382150+feature.dirty.work.1.g54c499a (on dirty feature branch)
4042
```
4143

4244
- **Purpose**: Get users running code immediately to see value
4345

44-
3. **Key Features** - 6 bullet points maximum
46+
3. **Key Features** ✅ - 5 concise bullet points (reduced from 6 to avoid redundancy)
4547
- **Content**:
4648
- **zerv version**: Flexible, configurable version generation with full control
4749
- **zerv flow**: Opinionated, automated pre-release management based on Git branches
48-
- Smart Schema System: Auto-detects clean releases, pre-releases, and build context
49-
- Multiple Formats: SemVer, PEP440 (Python), CalVer, custom schemas
50-
- CI/CD Ready: Override capabilities and pipeline-friendly output formats
51-
- Zero Config: Works out of the box with sensible defaults
50+
- **Smart Schema System**: Auto-detects clean releases, pre-releases, and build context
51+
- **Multiple Formats**: SemVer, PEP440 (Python), CalVer, custom schemas
52+
- **CI/CD Integration**: Complements semantic release with branch-based pre-releases and full override control
5253
- **Purpose**: Clear distinction between flexible (version) vs automated (flow) approaches
5354

54-
4. **Usage Examples** - Copy-paste examples by command
55+
4. **Usage Examples** 🚧 - Copy-paste examples by command
5556
- **Content**:
56-
- **zerv flow**: Automated branch-based versions with 5 main capability areas:
57+
- **zerv flow**: Automated branch-based versions with comprehensive documentation:
58+
- ✅ **Core Principles**: 4 fundamental design principles
59+
- ✅ **Version Format Explained**: Structure, components, and variations with examples
60+
- ✅ **Pre-release Resolution Strategy**: Branch patterns, post-release logic, distance modes
5761
- **Workflow Examples** (3 real-world scenarios with diagrams):
58-
- Trunk-Based Development: Parallel features, nested branches, sync scenarios
59-
- GitFlow: develop/feature/hotfix/release branches with proper pre-release mapping
60-
- Complex Release Management: Branch abandonment, cascading releases
62+
- Trunk-Based Development: Parallel features, nested branches, sync scenarios
63+
- GitFlow: develop/feature/hotfix/release branches with proper pre-release mapping
64+
- Complex Release Management: Branch abandonment, cascading releases
6165
- **DIAGRAMS**: Copy mermaid diagrams from `.claude/plan/32-zerv-flow-implementation-plan.md`
62-
- **Schema Variants**: 10+ standard schema presets only (no CalVer support)
63-
- **Branch Rules**: Configurable pattern matching (default GitFlow) for pre-release automation
66+
- **Schema Variants**: 10+ standard schema presets only (no CalVer support)
67+
- **Branch Rules**: Configurable pattern matching (default GitFlow) for pre-release automation
6468
- **Pre-release Control**: Labels (alpha/beta/rc), numbers, hash-based identification
6569
- **Post Mode Options**: Tag distance vs commit distance calculation modes
6670
- **zerv version**: Manual control with 4 main capability areas:
@@ -76,11 +80,11 @@
7680
- Pipeline chaining examples (e.g., `zerv version --output-format zerv | zerv version --source stdin --schema calver`)
7781
- **Purpose**: Practical examples organized by command for easy reference
7882

79-
5. **Installation** - Simple, cargo-focused
83+
5. **Installation** - Simple, cargo-focused
8084
- **Content**: Cargo install command, manual download link
8185
- **Purpose**: Quick installation path
8286

83-
6. **Links** - Point to comprehensive docs
87+
6. **Links** - Point to comprehensive docs
8488
- **Content**: Link to docs/llms.md, CLI help command
8589
- **Purpose**: Path to detailed information
8690

@@ -127,8 +131,60 @@
127131
- No information loss from existing documentation
128132
- Both files serve their distinct audiences effectively
129133

134+
## Implementation Notes
135+
136+
### 📝 Documentation Maintenance Process Established
137+
138+
**Corresponding Test Guidelines**:
139+
Every code example in documentation must have a corresponding test with reference comment:
140+
141+
```html
142+
<!-- Corresponding test: tests/integration_tests/flow/docs/quick_start.rs:test_quick_start_documentation_examples -->
143+
```
144+
145+
**Working Process**:
146+
147+
1. **Test First**: Write comprehensive test for documentation example
148+
2. **Document Second**: Add example to documentation with exact output
149+
3. **Add Reference**: Include corresponding test comment for maintainability
150+
4. **Validate**: Ensure examples exactly match test outputs
151+
5. **Coordinated Updates**: Update tests first, then documentation to match
152+
153+
**Infrastructure in Place**:
154+
155+
- ✅ **TestScenario**: Chainable test framework with CLI command execution
156+
- ✅ **Pattern Assertion System**: `{hex:7}`, `{timestamp:now}`, `{regex:pattern}` support
157+
- ✅ **Documentation Standards**: Comprehensive guidelines in `.claude/ref/documentation-maintenance.md`
158+
- ✅ **Maintenance Comments**: Professional "Corresponding test:" format
159+
160+
**File Structure**:
161+
162+
```
163+
tests/integration_tests/flow/docs/
164+
├── mod.rs
165+
├── test_utils.rs # TestScenario implementation
166+
├── quick_start.rs # Quick Start documentation tests
167+
└── tmp.rs # assert_commands functionality (temporary)
168+
```
169+
170+
## Next Steps
171+
172+
### Remaining Implementation Tasks:
173+
174+
1. **Usage Examples** - Organize by command with practical examples and workflow diagrams
175+
2. **Installation Section** - Simple cargo-focused installation instructions
176+
3. **Links Section** - Point to comprehensive docs and CLI help
177+
4. **docs/llms.md** - Create symlink to README.md for comprehensive reference
178+
179+
### Diagram Integration:
180+
181+
- **Copy mermaid diagrams** from `.claude/plan/32-zerv-flow-implementation-plan.md`
182+
- **Include 3 workflow diagrams**: Trunk-Based, GitFlow, Complex Release Management
183+
- **Essential for**: Showing real Git scenarios and zerv flow capabilities
184+
130185
## Notes
131186
132187
- This is a consolidation effort - we're reducing doc surface area while improving coverage
133188
- AUTO.md remains as auto-generated CLI reference
189+
- Test-driven documentation ensures examples always stay accurate
134190
- Future: Consider more scalable documentation approach if needed

0 commit comments

Comments
 (0)