Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
8c9dd5e
docs: update CLAUDE.md and delete cursor rules
wislertt Oct 20, 2025
4fb24aa
test: add integration tests for version --schema
wislertt Oct 20, 2025
f26c4dd
test: add tests for templates.rs
wislertt Oct 21, 2025
7e51bca
test: add test for directory.rs
wislertt Oct 21, 2025
6552c06
fix: fix version args conflict cases
wislertt Oct 21, 2025
2b46b3f
test: add more tests for tests/integration_tests/version/main/combina…
wislertt Oct 21, 2025
cfc80b4
fix: fix keyword curent branch to bumped branch (skip integration tests)
wislertt Oct 21, 2025
68baf1d
docs: optimize CLAUDE.md
wislertt Oct 22, 2025
2374c0c
docs: improve CLAUDE.md
wislertt Oct 22, 2025
1c74a0b
fix: fix integration tests
wislertt Oct 22, 2025
8b9d2ee
docs: add plan for logging
wislertt Oct 22, 2025
f013997
feat: add logs
wislertt Oct 22, 2025
26b6929
feat: add more logs
wislertt Oct 22, 2025
15342c4
feat: add more logs
wislertt Oct 22, 2025
f9bc582
test: add more integration test for logging
wislertt Oct 22, 2025
8af7b37
docs: update docs about logging
wislertt Oct 22, 2025
b591566
refactor: refactor integration tests for consistency
wislertt Oct 23, 2025
3747d6e
docs: improve CLAUDE.md and ./.claude/*
wislertt Oct 23, 2025
1211f4d
docs: improve claude plan and ref
wislertt Oct 23, 2025
7a4f9d0
test: add more inegration tests
wislertt Oct 23, 2025
74403f6
docs: update audit command
wislertt Oct 23, 2025
4b1e1d2
test: add more integration tests
wislertt Oct 23, 2025
40b4ab6
fix: reduce verbosity of test command
wislertt Oct 23, 2025
3ccdca0
feat: update Makefile
wislertt Oct 23, 2025
1e0edcd
test: improve test (ongoing)
wislertt Oct 23, 2025
b8949f1
test: improve test
wislertt Oct 23, 2025
788b060
test: add more integration tests
wislertt Oct 23, 2025
92df28c
test: add more integration tests
wislertt Oct 23, 2025
0c93f89
test: optimize GitRepoFixture
wislertt Oct 23, 2025
842a936
test: add more integration tests
wislertt Oct 23, 2025
bda55d9
test: add more integration tests
wislertt Oct 23, 2025
7e7752c
test: add more integration tests
wislertt Oct 23, 2025
d457ff6
chore: update deps
wislertt Oct 23, 2025
362f28a
test: add more tests
wislertt Oct 23, 2025
fea178a
docs: update docs
wislertt Oct 23, 2025
2dd70ac
test: add more integration tests
wislertt Oct 23, 2025
4f1e4f5
test: add more integration tests
wislertt Oct 23, 2025
089a563
test: add more integration tests
wislertt Oct 24, 2025
502d804
test: clean test code
wislertt Oct 25, 2025
9c4568e
docs: update docs
wislertt Oct 25, 2025
2f847be
feat: implement src/version/zerv/schema/part.rs
wislertt Oct 25, 2025
82bf0e0
feat: improve ZervError::InvalidBumpTarget
wislertt Oct 25, 2025
07a737b
feat: improve SchemaPartName usage
wislertt Oct 25, 2025
77474aa
feat: improve usage for SchemaPartName
wislertt Oct 25, 2025
5f733f2
feat: compelte TODO in override.rs
wislertt Oct 25, 2025
197f654
feat: complete some TODOs
wislertt Oct 25, 2025
62ed087
test: add more integration tests
wislertt Oct 25, 2025
43cb029
feat: simplify display trait for ZervSchemaPart
wislertt Oct 25, 2025
89e5a35
docs: update plan to implment and maintain llms.txt
wislertt Oct 26, 2025
98c9d9f
docs: add llms.md
wislertt Oct 26, 2025
dc265e3
feat: implement llms.md phase 2
wislertt Oct 26, 2025
4c49ad3
docs: update plan for llms.md phase 3
wislertt Oct 26, 2025
018decf
feat: implement /update-docs command
wislertt Oct 26, 2025
a50aa9f
docs: improve update-docs.md
wislertt Oct 26, 2025
bdb5c77
docs: add plan for zerv flow
wislertt Oct 27, 2025
50d1e59
test: fix test for ubuntu
wislertt Oct 27, 2025
8755f5d
fix: dev
wislertt Oct 27, 2025
3cf449d
fix: dev
wislertt Oct 27, 2025
601a86c
fix: dev
wislertt Oct 27, 2025
7a3fad1
fix: dev
wislertt Oct 27, 2025
c67733a
fix: dev
wislertt Oct 27, 2025
b86b1db
fix: dev
wislertt Oct 27, 2025
6084129
fix: dev
wislertt Oct 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 170 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
# CLAUDE.md

This file provides guidance to Claude Code when working with code in this repository.

## Project Overview

Zerv is a dynamic versioning CLI tool written in Rust that generates versions for any commit from git and other version control systems. It supports multiple version formats (SemVer, PEP440, CalVer) and is designed for CI/CD builds.

---

## 🎯 Critical Rules (Quick Reference)

**MANDATORY - These rules must ALWAYS be followed:**

1. ✅ **Use constants** instead of bare strings (fields, formats, sources, schemas) → Use `crate::utils::constants::*`
- **For environment variables**: Use `crate::config::EnvVars::*` (e.g., `EnvVars::PAGER`, `EnvVars::RUST_LOG`)
2. ✅ **Use `ZervError`** for custom errors and `io::Error::other()` for IO errors
3. ✅ **Use `get_git_impl()`** for environment-aware Git operations
4. ✅ **Use `should_run_docker_tests()`** for Docker-dependent tests
5. ✅ **Never reuse Git implementations** across different directories
6. ✅ **Include detailed error context** in all error messages
7. ✅ **NO useless comments** - only comment when code cannot explain itself
8. ✅ **Check existing utilities** in `src/test_utils/` before creating new ones
9. ✅ **Place `use` statements at top of file/module** - never inside functions
10. ✅ **Use `mod` blocks for test organization** - not comment dividers

**NEVER do these:**

1. ❌ Use bare string literals for field/format/source names
2. ❌ Use `unwrap()` or `expect()` in production code
3. ❌ Add comments that just repeat function names or restate code
4. ❌ Create Git fixtures without proper isolation
5. ❌ Skip Docker test gating for Docker-dependent tests
6. ❌ Write generic error messages without context
7. ❌ Duplicate code instead of using existing utilities
8. ❌ Place `use` statements inside functions (except rare naming conflict cases)
9. ❌ Use comment dividers for test grouping (use `mod` blocks instead)

**📋 Run `/audit` to check and fix violations automatically**

---

## 📚 Planning Workflow

### Check Existing Plans First

**BEFORE performing ANY coding task, check `.claude/plan/` for existing plans and context.**

Plans in `.claude/plan/` are temporary working documents with short lifecycle:

- Created when planning new features/refactors
- Used during implementation
- Deleted or archived when task is complete

### Creating New Plans

**CRITICAL: When user asks you to "write a plan" or "create a plan", you MUST:**

1. ✅ **Check existing `.claude/plan/` files** to find the highest number
2. ✅ **Create new plan** as `.claude/plan/XX-descriptive-name.md` (increment XX)
3. ✅ **Do NOT start coding** until the plan is reviewed and approved
4. ✅ **Use ExitPlanMode tool** to present the plan for approval

**Plan Document Structure:**

- **Status**: Planned/In Progress/Completed
- **Priority**: High/Medium/Low
- **Context**: Why this work is needed
- **Goals**: What we want to achieve
- **Implementation Plan**: Detailed steps
- **Testing Strategy**: How to validate
- **Success Criteria**: Definition of done
- **Documentation Updates**: What docs need updating

**Note**: Plans can reference `.claude/ref/` docs, but `.claude/ref/` should NEVER reference specific plans (one-way dependency).

---

## 📖 Essential Commands & Workflows

@.claude/ref/workflows/commands.md
@.claude/ref/workflows/coverage.md

---

## 🏗️ Architecture

### Pipeline Overview

```
Input → VCS Detection → Version Parsing → Transformation → Format Output
```

**For detailed architecture documentation:**

@.claude/ref/architecture/pipeline.md
@.claude/ref/architecture/modules.md
@.claude/ref/architecture/cli.md

---

## 🚨 Code Standards

### Quick Reference

- **Comments**: Only when code can't explain itself
- **Imports**: Always at top of file/module
- **Test organization**: Use `mod` blocks, not comment dividers
- **Line length**: Max 100 chars (rustfmt), use `format!()` for long strings

**For detailed standards:**

@.claude/ref/standards/code-style.md
@.claude/ref/standards/error-handling.md
@.claude/ref/standards/logging.md
@.claude/ref/standards/constants.md

---

## 🧪 Testing Standards

### Quick Reference

- **Environment variables**: `ZERV_TEST_NATIVE_GIT`, `ZERV_TEST_DOCKER`
- **Git operations**: Always use `get_git_impl()`
- **Docker tests**: Always use `should_run_docker_tests()` gating
- **Integration tests**: Prefer `TestCommand::run_with_stdin()` (90% of cases)

**For detailed testing patterns:**

@.claude/ref/testing/overview.md
@.claude/ref/testing/unit-tests.md
@.claude/ref/testing/integration-tests.md

---

## 🚀 CI/CD

@.claude/ref/workflows/cicd.md

---

## 🛠️ Using Claude Code Features

### When to Use What

**Slash Commands** (Simple, predefined workflows):

- `/audit` - Run code quality audit and fix violations
- Use for: Detecting and fixing code quality violations efficiently

**Agents** (Complex, multi-step exploration):

- Codebase exploration: "How does version bumping work across the codebase?"
- Large refactoring: "Migrate all tests to use environment-aware pattern"
- Research tasks: "Find all API endpoints and document them"
- Use for: Open-ended tasks requiring autonomous decision-making

**Direct Questions** (Fastest for simple tasks):

- "Review this function for bugs"
- "Explain how this works"
- "Fix the error in this code"
- Use for: Quick reviews, explanations, single-file changes

**Rule of thumb**:

1. Try direct question first (fastest)
2. Use slash command for standardized workflows
3. Use agent only for complex multi-file exploration/refactoring
Loading