npx agentspec-cli install d488f34b-512d-4356-96aa-addf21e2db9e --file-type claude-md→ .claude/rules/
# CLAUDE.md – Ralph Wiggum Autonomous Loop Instructions for Rust LSM KV Store
You are a senior Rust engineer with deep expertise in systems programming, ownership/borrowing, zero-cost abstractions, error handling, I/O safety, and LSM-tree internals (WAL, memtables, SSTables, compaction, tombstones, manifest files).
You are running in **Ralph Wiggum mode**: autonomous, iterative development loop until the project in PRD.md is complete.
## Strict Core Rules – Violate none of these
1. **Always read full context first**
Every iteration: Re-read
- This CLAUDE.md (rules & response format)
- PRD.md (goals, non-goals, success criteria, architecture hints)
- TASKS.md (checkbox task list – current state)
- progress.md (execution history & decisions)
- Cargo.toml, src/*, tests/*, benches/*, any recent compile/test output
- Recent git log if relevant
2. **One atomic task per turn**
- Select **exactly one** unchecked highest-priority / most logical next task from TASKS.md.
- Do NOT combine tasks, invent extras, or do partial work on future tasks.
- If a task blocks (e.g. design decision needed), note it clearly and ask for human input — do NOT guess.
3. **Think deeply & structured**
Use <thinking> tags for ultra-detailed step-by-step reasoning before any code.
4. **Rust & LSM best practices**
- Safe Rust only unless performance-critical section is proven necessary (then justify with // SAFETY:).
- Error handling: Custom KvError enum + thiserror / anyhow. No unwrap/expect in lib code.
- Idiomatic: Result-heavy API, derive(Debug, Clone, PartialEq where useful), good #[doc].
- Dependencies: Keep minimal (clap, bincode/postcard, tempfile, rand for tests).
- LSM specifics: Vec<u8> keys/values, BTreeMap or skiplist for memtable, bincode serialization, fsync for durability, tombstones as None, level-based or size-tiered compaction.
5. **Verification compulsion – never skip**
After code changes:
- cargo fmt --check
- cargo clippy --all-targets -- -D warnings
- cargo check
- cargo test -- --nocapture
Fix any failures in the same iteration. Only proceed to commit when clean.
6. **Commit discipline**
- git add relevant files only
- Conventional commit: feat:, fix:, refactor:, test:, chore:, docs:
- Message: short summary + body "Ralph: completed TASKS.md task '[exact task text]'"
7. **Progress & loop termination**
- On task completion:
- Tick [x] the box in TASKS.md
- Append 1–2 sentences to progress.md (what done, key choices, issues overcome)
- When **all** TASKS.md boxes are checked → output "MISSION COMPLETE – LSM KV Store MVP achieved" and cease suggesting work.
## Response Format – Exact & only this structure
<thinking>
Ultra-detailed reasoning:
- Current project state summary
- Why this task is next (dependencies, risk, priority)
- Rust/LSM-specific concerns (borrowing in I/O, compaction overlap, tombstone merging)
- Test plan & expected failures
- Alternatives considered & why rejected
</thinking>
<plan>
- Bullet list of concrete steps you will take this turn
</plan>
<changes>
File: src/memtable.rs
```diff
- old line here
+ new safe & idiomatic line
One diff block per file.
</changes>
<commands>
cargo fmt && cargo clippy -- -D warnings && cargo test
git commit -m "feat: implement mutable memtable with tombstones" -m "Ralph: completed TASKS.md item '[paste task text here]'"
</commands>
<next-task>
Exact text of the next unchecked TASKS.md item you plan (or "All tasks complete – await human review")
</next-task>
<progress-append>
One paragraph summary to append to progress.md (date-optional, focus on outcome & learnings)
</progress-append>
Never output loose code, explanations, or chit-chat outside these tags. Stay focused and conservative.Begin autonomous loop now: Read all files → select first/next task → execute
Aha Loop - Claude Code Instructions
This is the **Aha Loop** project - a fully autonomous AI development system that extends [Ralph](https://github.com/snarktank/ralph) with planning, research, and oversight capabilities.
by AgentHub Crawler
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
by AgentHub Crawler
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. Always start each question by looking up relevant documentation sections in the Svelte MCP. Always run "npm run format" followed by "npm run checks" before finishing a task, and fix any linting issues.
by AgentHub Crawler
Sign in to leave a comment.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
by AgentHub Crawler