Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
50c7608
feat(cli): implement gitmind init command with TDD
flyingrobots Jun 12, 2025
21fc9cf
docs: update CLAUDE.md and TASKLIST.md for completed init command
flyingrobots Jun 12, 2025
97db83e
docs: synchronize TASKLIST with all feature requirements
flyingrobots Jun 12, 2025
d082638
docs: add feature associations and document storage decision
flyingrobots Jun 12, 2025
876573c
chore: gitignore .obsidian directory
flyingrobots Jun 12, 2025
b6112be
docs: update CLAUDE.md with development workflow practices
flyingrobots Jun 12, 2025
9cbe1b2
docs: add testing and code organization principles to CLAUDE.md
flyingrobots Jun 12, 2025
599530e
build: enable Docker Bake for parallel builds
flyingrobots Jun 12, 2025
00783ee
refactor(cli): create modular command structure
flyingrobots Jun 12, 2025
45652fd
refactor(cli): extract Link struct to dedicated module
flyingrobots Jun 12, 2025
b413b60
refactor(cli): update App to delegate to command modules
flyingrobots Jun 12, 2025
dafe22f
test:
flyingrobots Jun 12, 2025
10f2d85
docs: mark link command as completed
flyingrobots Jun 12, 2025
e139f46
docs: document refactoring insights in dev journal
flyingrobots Jun 12, 2025
c415b56
feat(cli): add link command CLI interface and
flyingrobots Jun 12, 2025
57da0ca
feat(F013): implement gitmind list command
flyingrobots Jun 12, 2025
738f1dc
feat(F013): implement gitmind list command (part 2)
flyingrobots Jun 12, 2025
250fc4e
feat(F016): implement gitmind unlink command
flyingrobots Jun 12, 2025
027cb33
fix: add .gitkeep to prevent .gitmind directory removal
flyingrobots Jun 12, 2025
06df5a5
docs: add F016 link hygiene feature spec
flyingrobots Jun 12, 2025
4c1270e
docs: update testing strategy and implementation progress
flyingrobots Jun 12, 2025
dff70fb
chore: update TASKLIST with link hygiene commands
flyingrobots Jun 12, 2025
53d6087
docs: add session notes on link hygiene design
flyingrobots Jun 12, 2025
a589def
refactor: eliminate stdout/stderr testing with CommandResult<T>
flyingrobots Jun 12, 2025
a7a3043
feat: complete Phase 1a MVP with gitmind check command
flyingrobots Jun 12, 2025
e33d78b
fix(cli): resolve clippy warnings and update Rust version
flyingrobots Jun 12, 2025
6545dc8
Merge remote-tracking branch 'origin/main' into fix-github-actions
flyingrobots Jun 12, 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ Thumbs.db
.claude/
# CLAUDE.md is intentionally tracked for AI assistant instructions

# Obsidian
.obsidian/

# IDE
.idea/
*.swp
Expand Down
112 changes: 110 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ This file contains important instructions for Claude and other AI assistants wor

## Critical Rules

### 1. NEVER Make Git Commits
### 1. NEVER Make Git Commits or Operations in Working Repo
- The user will explicitly ask if they want commits made
- Default to NO commits unless specifically requested
- NEVER run git operations in the working repository
- All git operations must be in Docker containers or temp directories
- This is a hard rule with no exceptions

### 2. License Headers (SPDX)
Expand Down Expand Up @@ -65,10 +67,61 @@ neuroglyph/

### 5. Development Practices

#### Development Philosophy
- **TDD (Test-Driven Development)**: Write tests first, then implementation
- **SOLID Principles**: Single responsibility, Open/closed, Liskov substitution, Interface segregation, Dependency inversion
- **KISS**: Keep It Simple, Stupid - avoid unnecessary complexity
- **YAGNI**: You Aren't Gonna Need It - don't add functionality until needed
- **Test Double-Friendly Design**: Use dependency injection and traits to enable test doubles when needed

#### Testing
- All tests run in Docker for consistency
- Use `make test` to run the full test suite
- Pre-push hooks enforce test passing
- Write tests BEFORE implementation (TDD)
- Each function should have corresponding tests
- **Always use real Git repos in tests** - our entire stack relies on Git
- **NEVER run Git operations in the actual repo** - only in Docker/temp dirs
- Create temporary Git repositories for each test
- All Git operations must be isolated from the working repository
- Use dependency injection and traits for clean architecture
- Test doubles are only for contriving edge cases, not replacing Git
- **Always test behavior, not implementation** - Tests verify what the system does, not how
- **One test file per component** - Each test file focuses on testing one component's behavior

##### Test Strategy - Three Levels
Always have these three levels of tests, all focused on behavior:
1. **Unit Tests** - Test individual components in isolation
- Located in `src/` files next to implementation (e.g., `#[cfg(test)] mod tests`)
- Test single structs/functions behavior
- Fast, focused on one thing
2. **Integration Tests** - Test components working together
- Located in `tests/` directory
- Test command behavior, file I/O, Git operations
- Use real Git repos, real file systems
3. **End-to-End Tests** - Test complete user workflows
- Also in `tests/` directory
- Test full CLI commands from user perspective
- Verify entire features work as users expect
- **Every user story in `design/features/` should have corresponding end-to-end tests**
- **Every acceptance criteria should have its own specific test**

##### Testing Principles - NEVER Test stdout/stderr
- **NEVER test stdout/stderr output** - This is brittle and couples tests to implementation
- Testing stdout is just spying by another name - it violates behavior testing
- Instead, use proper return types:
- Commands return `CommandResult<T>` with exit code and optional value
- Tests check the exit code and returned values directly
- The CLI layer handles printing - tests verify behavior, not output
- Example: Don't test "No links found" string, test that `list()` returns empty Vec

##### Definition of Done for Features
A feature is only complete when:
1. All acceptance criteria from `design/features/F*.md` have corresponding tests
2. Tests pass at all three levels (unit, integration, end-to-end)
3. User story is demonstrable through end-to-end tests
4. Documentation is updated
5. Code follows project conventions

#### Git Hooks
- Git LFS is configured for binary files
Expand All @@ -79,14 +132,20 @@ neuroglyph/
- Rust code uses standard formatting (`cargo fmt`)
- Always run clippy (`cargo clippy`)
- Follow conventional commits
- Keep functions small and focused (SOLID)
- Avoid premature optimization (YAGNI)
- **One file = one thing** - Each file contains one struct/enum/trait/type
- **Single Responsibility Principle** - Each module/struct has one reason to change

### 6. Key Technical Details

#### Storage Model
- Links stored in `.gitmind/links/` directory
- Format: `LINK_TYPE: source -> target # ts:timestamp`
- Files named by SHA of content
- No external database - Git IS the database
- **Git IS the database** - no external storage
- Every operation uses Git's content-addressable storage
- Testing must use real Git operations to be valid

#### Architecture
- CLI first approach (no server required)
Expand Down Expand Up @@ -127,6 +186,18 @@ When starting work, always check:
2. Use conventional commits when asked to commit
3. Check for Git LFS files in `.gitattributes`
4. Run tests before any push (automatic via hooks)
5. When asked for commit messages, provide them in this format:
```bash
git add <files> && git commit -m "type(scope): message"
```
6. Suggest commits after completing each task from TASKLIST.md
7. Keep TASKLIST.md up-to-date as tasks are completed

## Development Workflow Guidelines

### Tech Design and Feature Tracking
- Whenever we make a significant tech design decision, document it in `design/decisions`
- Whenever we complete a feature, update the document in `design/features` to reflect its status

## Final Reminders
- Apache 2.0, not MIT!
Expand All @@ -135,5 +206,42 @@ When starting work, always check:
- Test everything in Docker!
- Keep Gonzai chaotic! 🐵✨

## Development Workflow Example

When implementing a new feature:
1. **Start with tests** (TDD):
```rust
#[test]
fn test_init_creates_directory() {
// Create isolated temp directory for test
let temp_dir = TempDir::new()?;
// Initialize git repo in temp dir, NOT in working repo
let git_ops = GitOperations::new(temp_dir.path());
git_ops.init_repository()?;
assert!(temp_dir.path().join(".gitmind/links").exists());
}
```
2. **Design with traits and DI** for testability:
```rust
trait GitBackend {
fn init(&self) -> Result<()>;
fn add_file(&self, path: &Path) -> Result<()>;
}

struct LinkManager<G: GitBackend> {
git: G,
}
```
3. **Write minimal code** to make tests pass (KISS)
4. **Use real Git repos** in tests, test doubles only when needed
5. **Refactor** if needed while keeping tests green
6. **Don't add extra features** (YAGNI)
7. **Keep each module focused** on one responsibility (SRP)

## Important Development Practices

### Logging and Journal
- When asked, leave your impressions or thoughts to lore/CLAUDE_DEV_THOUGHTS.md by appending them to that file. That is your dev journal. Feel free to write to it freely, when you get ideas, when you have insights you want to log.

---
*Last updated: June 2025*
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# Development and testing environment for Neuroglyph CLI (gitmind)
FROM rust:1.78-slim
FROM rust:latest

# Install system dependencies
RUN apt-get update && apt-get install -y \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ clean:

# Build Docker images
docker-build:
docker compose build
COMPOSE_BAKE=true docker compose build

# Install git hooks (including Git LFS)
install-hooks:
Expand Down
Loading