open source CLI tool

Scan your codebase.
Generate AI guardrails.

viberails reads your existing project — framework, structure, naming, tests — and generates rules that AI tools, hooks, and CI actually follow.

AI edits pre-commit PR checks
~/workspace
$ npx viberails
viberails
Scan complete
Project readiness ──────────────╮
   Test runner     vitest       
   Hook manager    Lefthook     
   Linter          Biome        
   Typecheck       tsc --noEmit 
├─────────────────────────────────╯
Configure viberails
Max file size (300 lines)
File naming (kebab-case, detected)
Missing tests (enforced)
Coverage (80%)
- AI context (none set)
Per-package overrides (3 packages)
- Boundaries (not enabled)
Reset all to defaults
Review scan details
Done — write config

how it works

01

Reads the room before it sets rules

Framework, tooling, structure, naming, tests. It pulls defaults from the codebase you already trust instead of inventing a policy on top of it.

02

Checks your setup before you configure

Validates test runner, hook manager, linter, and typecheck before you spend time configuring. Missing tools can be installed inline or skipped.

03

Generates rules AI tools actually follow

Scan results become .viberails/context.md — natural-language directives wired into Claude Code hooks, pre-commit checks, and CI. Not a template. Derived from your code.

04

Enforces on every surface

Pre-commit hooks, Claude Code integration, and GitHub Actions. Violations are caught during AI edits, on commit, and in pull requests.

Monorepo-native. Workspace detection, per-package scanning, and boundary inference included.

where it shows up

During AI edits

Claude Code PostToolUse hook validates files as they're written. Catches violations mid-session, not after.

On commit

Pre-commit hook runs check --staged. Optional typecheck and lint hooks included.

In pull requests

GitHub Actions workflow runs check --enforce to block merges with violations.

claude code
⏺ Refactoring display module into smaller files:
Update(src/display.ts)
  ⎿  Removed 14 lines
  ⎿  PostToolUse hook returned error
  ⎿  src/display.ts: 312 lines (max 300).
     Split into focused modules.
⏺ The file is still over the 300-line limit.
  Let me extract more code to fix this.
Update(src/display.ts)
  ⎿  Removed 28 lines, added 2 lines
pre-commit / ci
$ viberails check --staged
Checking file rules... done
Checking missing tests... done
Checking boundaries... done
✓ 127 files checked · no violations

get started

npm
$ npx viberails
pnpm
$ pnpm dlx viberails
what it generates
viberails.config.json

enforced rules from scan

.viberails/context.md

AI-readable directives

.viberails/scan-result.json

raw detection data

integrations
Pre-commit hook Claude Code hook GitHub Actions CLAUDE.md ref Typecheck Lint
supported stacks

Next.js, React, Vue, Angular, Svelte, Astro, Remix, and 15+ more frameworks. ESLint, Biome, Prettier. Vitest, Jest, Playwright, Cypress. npm, pnpm, yarn, bun.