Universal enforcement plugin for Claude Code. Reads your existing rules, hooks, CLAUDE.md and adds deterministic checks that Claude cannot ignore.
Framework-agnostic enforcement. Works with any development process — Vibe Framework, corporate standards, or custom rules. No longer limited to basic TDD + conventional commits.
| Check | What it does | Default |
|---|---|---|
| TDD | Blocks code in src/ without tests in tests/ | ON |
| File Size | Blocks files >N lines (configurable limit) | ON (300) |
| Secrets | Blocks hardcoded tokens, API keys, passwords | ON |
| Design Tokens | Blocks hardcoded colors in UI files | OFF |
| Env in Code | Blocks passwords/secrets outside .env | ON |
| Conventional Commits | Blocks invalid commit messages | ON |
| No .env Commit | Blocks .env files in staging | ON |
| Diff Size | Warns on large diffs (>N lines) | ON (500) |
Define your own rules via vibe-runner.config.json:
{
"custom_checks": [
{
"name": "no-print-logging",
"on": "write",
"pattern": "*.py",
"grep": "\\bprint\\(",
"exclude_grep": "vr-ignore",
"severity": "block",
"message": "Use logging.getLogger() instead of print()"
}
]
}Supported custom check types:
grep— block if pattern foundmust_contain— warn if pattern NOT foundfunction_length— limit function sizefile_exists— require specific files- Commit hooks:
grep_staged,grep_message
For frameworks with development phases (like Vibe Framework):
{
"phases": {
"enabled": true,
"definitions": [
{"id": "spec", "artifact": "specs/*.md", "artifact_min_size": 500},
{"id": "build", "artifact": "src/*"}
],
"gates": [
{"from": "spec", "to": "build", "require_artifact": true}
]
}
}Blocks writing to src/ until spec artifact is complete.
-
Install the plugin:
claude plugin add ./vibe-runner
-
Works immediately with defaults (TDD + secrets + conventional commits)
-
Optional: Create
vibe-runner.config.jsonfor customization
No config file needed. Works out-of-the-box with sensible defaults.
Create vibe-runner.config.json in your project root:
{
"checks": {
"file-size": {"enabled": true, "limit": 200},
"tdd": {"enabled": true, "src": "app/", "tests": "spec/"},
"design-tokens": {"enabled": true}
},
"custom_checks": [
{
"name": "no-console-log",
"on": "write",
"pattern": "*.js|*.ts",
"grep": "console\\.log\\(",
"severity": "warn",
"message": "Use a proper logger"
}
]
}Pre-made templates:
templates/minimal.json— Default settingstemplates/corporate.json— Corporate standards (Jira commits, stricter limits)templates/vibe-framework.json— Full Vibe Framework setup with phases
- Discovery — Scans your
.claude/directory for rules, hooks, agents, skills - Enforcement — Hooks into Claude Code's file write/commit operations
- Blocking — Returns
exit 1to prevent action when rules violated - Logging — Records all violations and passes in
vibe-runner.log
Hook events:
SessionStart→ Discovery scanPostToolUse(Write|Edit)→ File checksPreToolUse(Bash: git commit)→ Commit checksStop→ Session summary
{
"checks": {
"file-size": {"limit": 200},
"conventional-commits": {"pattern": "^[A-Z]+-[0-9]+: .+"}
},
"custom_checks": [
{
"name": "require-error-handling",
"pattern": "src/api/*.py",
"must_contain": "try:|except:",
"severity": "warn"
}
]
}{
"checks": {
"design-tokens": {"enabled": true},
"tdd": {"enabled": false}
},
"custom_checks": [
{
"name": "no-inline-styles",
"pattern": "*.tsx|*.jsx",
"grep": "style=\\{\\{",
"severity": "block"
}
]
}Use templates/vibe-framework.json for full phase control with gates, subagent tracking, and framework-specific custom checks.
Add # vr-ignore to any line to exclude it from custom checks:
print("debug info") # vr-ignore- Read-only — Never modifies your files
- No secrets — Discovery excludes token values
- No network — All checks run locally
- Path validation — Prevents traversal attacks
- No code execution — Uses regex/glob patterns only
"Custom check not triggering"
- Check pattern matches your file:
*.pyvssrc/**/*.py - Verify regex syntax in
grep/must_contain - Use
vr-ignorecomment to test
"Phase blocked unexpectedly"
- Check
vibe-runner-state.jsonfor current phase - Verify artifact completeness (size + required sections)
- Set
phases: nullto disable
"Too many false positives"
- Change
severityfromblocktowarn - Add
exclude_grep: "vr-ignore"pattern - Adjust thresholds (
limit,warn)
v2.0 is backward compatible. Existing projects continue working with the same TDD + conventional commits enforcement.
New features:
- Custom checks replace meta-rule enforcement
- Phase control for structured workflows
- Granular configuration per check type
- Templates for common setups
Test suite:
bash tests/test-vibe-runner.shSecurity audit:
All paths validated, no eval/exec, stderr handling, log rotation.
MIT