vibe-loop
v0.2.0
Published
OpenCode plugin for deterministic vibe coding: auto-verify, auto-commit, and persistent task management
Maintainers
Readme
VibeLoop
Deterministic vibe coding for OpenCode. Auto-verify. Auto-commit. Never lose context.
VibeLoop is an OpenCode-native plugin that closes the feedback loop on AI coding:
- Verification Loop — Runs tests/build automatically after every file change. Failure is injected back to the AI for self-correction.
- Git Checkpoint — Commits when verification passes. One command, no manual
git add/commit. - Task State Manager — Task queue that survives session resets, compaction, and disconnects.
- Parallel Agent Coordinator — File-based claim system for coordinating multiple simultaneous OpenCode instances.
Install
Add to your OpenCode config (~/.config/opencode/opencode.json):
{
"plugin": ["oh-my-opencode@latest", "vibe-loop@latest"]
}That's it. No API keys, no config files, no project setup needed.
How It Works
1. Verification Loop (automatic)
After every write, edit, or bash call that modifies files, VibeLoop runs your project's verification command and injects the result into Claude's observation stream.
Auto-detected commands (zero configuration):
| Project | Verification Command |
|---------|---------------------|
| SvelteKit (check script) | npm run check |
| Node.js (typecheck script) | npm run typecheck |
| Node.js (typecheck + test) | npm run typecheck && npm test |
| Node.js (tsconfig, no scripts) | npx tsc --noEmit |
| Node.js (yarn/pnpm/bun) | equivalent with detected package manager |
| Rust | cargo test |
| Go | go test ./... |
| Python (pytest) | python -m pytest |
| Ruby | bundle exec rspec |
Detection priority (Node.js): typecheck → type-check → check → npx tsc --noEmit
If verification passes: ✅ [VibeLoop] Verification passed
If verification fails: The error output is appended to the tool result — Claude reads it and self-corrects automatically.
After 3 consecutive failures, auto-verification pauses. Call vl_verify to reset and retry.
2. Custom Verification Command (vl_config_set)
When auto-detection picks the wrong command (e.g. a Svelte project without a check script, or a monorepo with a custom setup), override it:
vl_config_set(verification_command: "npm run check")
vl_config_set(verification_command: "pnpm typecheck && pnpm test")
# Reset to auto-detect:
vl_config_set(verification_command: "")
# See current config:
vl_config_get()The override is saved to .vibe-loop.json and persists across sessions.
3. Manual Verification (vl_verify)
Run verification at any time — useful for debugging or resetting the failure counter:
vl_verify() # use configured/auto-detected command
vl_verify(command: "npm run lint") # one-off custom commandWhen auto-verification has paused after 3 failures, vl_verify is the way to reset the counter and resume.
4. Git Checkpoint (vl_git_checkpoint)
vl_git_checkpoint(message: "feat: add user auth")- Runs verification (unless
skip_verification: true) - Stages all changes (
git add -A) - Commits with the given message
- Saves checkpoint metadata to
.vibe-loop.json
5. Task Management
Tasks persist in .vibe-loop.json — they survive session disconnects, context compaction, and restarts.
vl_task_add(title: "Add login endpoint", priority: "high")
vl_task_update(task_id: "abc123", status: "in_progress")
vl_task_update(task_id: "abc123", title: "New title", priority: "low") # update any fields
vl_task_list()
vl_task_next() # returns highest-priority unblocked task
vl_task_remove(task_id: "abc123")Dependency tracking:
vl_task_add(title: "Write tests", depends_on: ["abc123"])This task won't surface in vl_task_next until abc123 is completed.
6. Parallel Agent Coordination (vl_agent_*)
Run multiple OpenCode instances on the same project directory without stepping on each other:
# In instance A:
vl_agent_claim(task_id: "abc123", agent_id: "agent-A")
# In instance B — will see it's already claimed:
vl_agent_claim(task_id: "abc123", agent_id: "agent-B")
# → ⚠️ Task already claimed by agent-A
# When done:
vl_agent_report(task_id: "abc123", agent_id: "agent-A", status: "done")
# Check all agents:
vl_agent_status()Claims are stored in .vibe-loop-agents/claims.json.
Session Compaction
When OpenCode compacts your session context, VibeLoop automatically injects:
- Current task list (in_progress + pending)
- Last verification result
- Last git checkpoint
So Claude never loses track of where it was.
System Prompt
VibeLoop injects vibe coding rules into every session's system prompt:
- Use
vl_task_*tools instead oftodowrite(tasks persist across sessions) - Always close the loop (fix before moving on)
- One task
in_progressat a time - Commit only on user request
- Fix root causes, not symptoms
Files Created in Your Project
.vibe-loop.json # Task state + verification command + checkpoint history
.vibe-loop-agents/ # Parallel agent coordination
└── claims.jsonAdd to .gitignore or commit them — both work. Committing .vibe-loop.json lets you share task state across machines.
Tool Reference
| Tool | Description |
|------|-------------|
| vl_git_checkpoint | Verify + stage + commit |
| vl_task_add | Add a task to the queue |
| vl_task_update | Update task status, title, priority, or description |
| vl_task_list | List all tasks |
| vl_task_next | Get next recommended task |
| vl_task_remove | Delete a task |
| vl_verify | Manually run verification + reset failure counter |
| vl_config_set | Override the verification command |
| vl_config_get | Show current VibeLoop config |
| vl_agent_claim | Claim a task for this agent |
| vl_agent_report | Report task outcome |
| vl_agent_status | See all active agent claims |
Philosophy
Peter Steinberger's "Close the Loop" principle: the AI should never move forward if the last action broke something. VibeLoop makes this deterministic — not a prompt suggestion, but a structural enforcement.
"The loop that's closed is the loop that ships." — VibeLoop
License
MIT
