Skip to content
/

vibecodex

vibecodex · yerdaulet-damir/vibecodex · ★ 4 · last commit 2026-05-06

54 numbered architecture rules (A1-F10) for FastAPI + Next.js + Go that AI coding agents follow automatically — enforcing layer boundaries, file-size limits, idempotency, and bulkhead isolation in vibe-coded projects.

Best whenAI assistants produce locally-optimal but architecturally-inconsistent code; the only fix is embedding named, citable architecture rules in CLAUDE.md that th…
Skip ifImporting sqlalchemy directly in a router, Inlining static data (pricing tables, model registries) in service files
vs seeds
superpowersIron Laws but constrains layer boundaries rather than workflow behaviors. Unlike all BMAD variants, vibecodex has no pla…
Primitive shape 9 total
Skills 8 MCP tools 1
00

Summary

vibecodex — Summary

vibecodex is a drop-in architecture ruleset for AI-assisted coding — 54 numbered production principles (A1-F10) packaged as CLAUDE.md + .cursor/rules/ + .claude/skills/ targeting FastAPI, Next.js 15, and Go 1.22+ stacks. The rules encode layer boundaries (hexagonal architecture), file-size limits, idempotency keys, bulkhead isolation, single-writer invariants, and graceful shutdown patterns into a format that Claude Code and Cursor follow automatically on every session. 7 Claude Code skills are provided (new-feature, debug-backend, debug-frontend, debug-go, new-feature-go, new-feature-nextjs, split-monolith, add-provider) plus an MCP server and an npm CLI (npx @aimyerdaulet/vibecodex init). 4 stars, 1 contributor, MIT license, last pushed May 2026.

differs_from_seeds: Closest to agent-os (seed, Archetype 4: markdown scaffold, zero orchestration), but vibecodex adds 7 Claude Code skills, a CLI binary, and cursor rules — making it a hybrid Archetype 4/Archetype 1 framework. Where agent-os targets the development process (CLAUDE.md establishes workflow), vibecodex targets code architecture quality (CLAUDE.md enforces layer boundaries, file-size rules, and integration patterns). Unlike superpowers (behavioral skills, workflow enforcement), vibecodex skills enforce architectural patterns — "do not touch more layers than listed" is a code-structure constraint, not a workflow constraint.

01

Overview

vibecodex — Overview

Origin

Created by yerdaulet-damir (GitHub: yerdaulet-damir/vibecodex). Published as npm package @aimyerdaulet/vibecodex. MIT license. 4 stars, 1 contributor. Last pushed May 2026.

Philosophy

The README opens with a problem statement:

"You start a project on Friday. By Sunday you have 14 endpoints, a working LLM integration, OAuth, Stripe, and a deploy pipeline. The AI is moving fast. Six weeks later, routers/generate.py is 1400 lines, services/ai_router.py ships a dict from OpenAI directly into your billing logic, the SQLAlchemy Session reaches into every layer including the JWT decoder... This isn't an AI failure. AI assistants produce structurally correct, locally optimal code. What they don't enforce is architectural consistency at scale."

The solution: 54 numbered rules that enforce architectural consistency. "Turn your AI partner from a fast junior into a disciplined senior."

Target Users

Vibe coders, solo devs, and indie hackers who ship fast with AI but want production-grade architecture maintained automatically.

The 6 Rule Parts

Rules are organized across 6 parts:

  • Part A — FastAPI Safe Decomposition (A1-A8)
  • Part B — FastAPI Integration Patterns (B1-B10)
  • Part C — Next.js TypeScript Decomposition (C1-C10)
  • Part D — Next.js Modern Patterns (D1-D6, 2024-2025)
  • Part E — Go Decomposition (E1-E8)
  • Part F — Go Integration Patterns (F1-F10)

Three Stacks

Three reference implementations provided:

  • FastAPI (reference/app/) — hexagonal Python with providers, async jobs
  • Next.js 15 (examples/nextjs/) — RSC + typed cache-tag DSL + Drizzle + Better Auth
  • Go 1.22+ (examples/go/) — cmd/+internal/ with bulkhead clients + graceful shutdown

"Pre-commit test" for Code

The CLAUDE.md has one active enforcement mechanism: the new-feature skill requires answering 4 questions before writing code — API contract, layers touched, test scenario, dependency protocol.

02

Architecture

vibecodex — Architecture

Distribution

  • Type: npm-package + skill-pack + command-pack
  • Install: npx @aimyerdaulet/vibecodex init or git clone + cp
  • Runtime: Node.js (CLI install only; rules are static files)
  • License: MIT

Directory Structure

vibecodex/
├── CLAUDE.md                    # 18 principles encoded as actionable rules
├── .claude/
│   ├── rules/                   # Claude Code rules (same as CLAUDE.md, structured)
│   └── skills/
│       ├── new-feature/SKILL.md       # Pre-flight checklist for new features
│       ├── debug-backend/SKILL.md     # FastAPI debugging skill
│       ├── debug-frontend/SKILL.md    # Next.js debugging skill
│       ├── debug-go/SKILL.md          # Go debugging skill
│       ├── new-feature-go/SKILL.md    # Go new feature checklist
│       ├── new-feature-nextjs/SKILL.md # Next.js new feature checklist
│       ├── split-monolith/SKILL.md    # Refactor monolith → layered skill
│       └── add-provider/SKILL.md      # Add external API provider skill
├── .cursor/
│   └── rules/                   # Cursor IDE rules (same 54 principles)
├── cli/
│   ├── package.json             # @aimyerdaulet/vibecodex (binary: vibecodex)
│   ├── bin/vibecodex.js         # CLI entry point
│   └── src/                    # CLI source
├── mcp/
│   ├── src/index.ts             # MCP server source
│   └── package.json
├── reference/
│   └── app/                    # FastAPI reference implementation
├── examples/
│   ├── nextjs/                 # Next.js 15 example
│   └── go/                     # Go example
├── docs/
│   └── principles/             # Detailed principle explanations
└── templates/                  # Project templates

CLI Binary

vibecodex (from cli/bin/vibecodex.js):

  • npx @aimyerdaulet/vibecodex init — adds CLAUDE.md, .cursor/rules/, .claude/skills/ to project
  • npx @aimyerdaulet/vibecodex init --stack fastapi — stack-specific init
  • npx @aimyerdaulet/vibecodex init --stack nextjs
  • npx @aimyerdaulet/vibecodex init --stack go
  • npx @aimyerdaulet/vibecodex init --dry-run — preview without writing

MCP Server

An MCP server is present in mcp/src/index.ts — purpose and tools TBD (single TypeScript entry point, not fully documented in README).

Target AI Tools

  • Claude Code (CLAUDE.md + .claude/skills/)
  • Cursor (.cursor/rules/)
03

Components

vibecodex — Components

Skills (8 — in .claude/skills/)

Skill Purpose
new-feature Pre-flight checklist before writing any code (define API contract, identify layers, write test scenario, check dependencies)
debug-backend FastAPI debugging workflow with layer-aware root cause analysis
debug-frontend Next.js debugging workflow
debug-go Go debugging workflow
new-feature-go Go new feature pre-flight checklist
new-feature-nextjs Next.js new feature pre-flight checklist
split-monolith Step-by-step guide for decomposing a large module into layered architecture
add-provider Procedure for adding a new external API provider following the ACL pattern

CLAUDE.md Rules (18 — for FastAPI, used as template)

Sampled key rules:

  • A1: "Folder, not file, when a domain splits by type."
  • A2: "Static data lives in app/data/ (or a registry.py next to its domain)."
  • A3: "One file, one domain. If the file is adding a second disjoint domain, split it."
  • B1: "Dependency Inversion via typing.Protocol — services never depend on a concrete repository."
  • B5: "Idempotency keys: charge + debit endpoints MUST accept and store an idempotency_key."
  • B6: "Bulkhead clients: each external provider gets its own httpx.AsyncClient with its own timeout and retry budget."

Cursor Rules

.cursor/rules/ — same 54 principles formatted for Cursor IDE.

CLI Binary

vibecodex (npm package @aimyerdaulet/vibecodex):

  • Subcommands: init, init --stack <fastapi|nextjs|go>, init --dry-run

MCP Server

mcp/src/index.ts — an MCP server (purpose: architecture rule enforcement tooling; details not fully documented).

Templates + Examples

  • reference/app/ — full FastAPI reference (hexagonal architecture, providers, async jobs, credits)
  • examples/nextjs/ — Next.js 15 reference
  • examples/go/ — Go 1.22+ reference
05

Prompts

vibecodex — Prompts

Excerpt 1 — CLAUDE.md Layer Boundary Enforcement

From CLAUDE.md:

## Architecture (MANDATORY)

The codebase has exactly four layers. Imports flow **only downward**:

Router → Service → Repository (via Protocol) → ORM/HTTP/S3 ↘ Provider (via ACL) → external API


| Layer | Lives in | What it does | What it CANNOT import |
|---|---|---|---|
| **Router** | `app/routers/` | HTTP only: parse request, call service, format reply | `sqlalchemy`, `httpx`, business logic |
| **Service** | `app/services/` | Business rules, domain orchestration | `sqlalchemy`, `httpx`, `boto3`, FastAPI `Request` |
| **Repository** | `app/repositories/` | Data access (SQL, S3, Redis) | other services, FastAPI |
| **Provider** | `app/providers/<vendor>/` | External API adapter, returns ACL types | services, repositories, FastAPI |

If a quick fix would violate a rule, you say so and propose the right shape. You never silently take the shortcut.

Prompting technique: Explicit import prohibition table — each layer has a "What it CANNOT import" column that gives the model specific, verifiable constraints. The last sentence is an anti-sycophancy instruction: the model must refuse a user's "quick fix" that violates the architecture.

Excerpt 2 — new-feature SKILL.md Pre-Flight Checklist

From .claude/skills/new-feature/SKILL.md:

# new-feature

Do not open any file for editing until all 5 steps below are completed.

## Step 1 — Define the API contract

Write the contract in plain text before any code. Answer these 4 questions:

Endpoint: POST /generate/image Request: { prompt: str, model_id: str, width: int, height: int } Response: { task_id: str, status: "queued" } Side effect: creates a task, holds credits


If you cannot answer all 4 in 2 sentences, the feature scope is unclear. Stop and clarify with the user.

## Step 2 — Identify layers touched

Use this decision matrix to know which files you will create or modify:

| What the feature needs | Layers touched | Files |
|---|---|---|
| New HTTP endpoint only | Router | `routers/<domain>.py` |
| Logic + credits charge | All of the above + Credits | + `services/credits/user.py` (read-only — single writer!) |

**Write the list:** "This feature touches: Router, Service, Repo."
Do not touch more layers than listed. If you discover you need more, stop and re-plan.

Prompting technique: Hard gate — "Do not open any file for editing until all 5 steps below are completed." This is a pre-implementation barrier that forces explicit upfront planning. Combined with the decision matrix (lookup table, not reasoning), it prevents scope creep.

Excerpt 3 — Single-Writer Invariant

From CLAUDE.md:

**Rule B7 — Credits are a single-writer domain.**
Only `services/credits/user.py` may deduct, refund, or hold credits.
Any router, provider, or background task that needs to touch credits MUST call the credits service via the service layer, never directly.

Prompting technique: Domain invariant as a named rule with a declarative prohibition. "Only X may do Y" is a stronger constraint than "prefer doing Y via X." The rule name (B7) makes it citable in code review ("this violates B7").

09

Uniqueness

vibecodex — Uniqueness & Positioning

differs_from_seeds

Architecture-rule-pack rather than workflow methodology — a niche not occupied by any seed framework. Closest to agent-os (Archetype 4: markdown scaffold) for its CLAUDE.md-centric approach, but agent-os focuses on development workflow (how to manage a coding session), while vibecodex focuses on code architecture quality (import direction, file-size limits, idempotency, bulkhead isolation). The new-feature skill's pre-flight checklist pattern resembles superpowers's skills (Iron Laws enforced at invocation), but the constraint is architectural ("do not touch more layers than listed") rather than behavioral ("write a failing test first"). Unlike all BMAD variants in this batch, vibecodex has no planning phases, no persona agents, and no sprint workflow — it's strictly a per-feature code architecture enforcer.

Key Positioning

  • Only framework in the corpus that encodes architecture rules as numbered, citable principles (A1-F10) — enabling code review to reference specific rules by name.
  • Dual-IDE (Claude Code + Cursor) out of the box — rare in this corpus.
  • Stack-specific: FastAPI + Next.js 15 + Go 1.22+ is a specific "indie SaaS" stack that's increasingly common for vibe coders.
  • The split-monolith skill is a unique refactoring-specific skill not present in BMAD, superpowers, or spec-kit.

Observable Failure Modes

  1. Stack-specific: Works only for FastAPI + Next.js + Go. Projects on Django, Rails, Spring Boot, or Rust need a different ruleset.
  2. Solo contributor: 4 stars, 1 contributor — high abandonment risk.
  3. MCP server undocumented: The mcp/ directory ships a TypeScript MCP server with no README explanation of what tools it provides — unusable without reverse-engineering.
  4. No enforcement below the surface: The rules are enforced by prompting the model — a sufficiently assertive user ("just add it real quick") can override all 54 rules. The CLAUDE.md says "you say so and propose the right shape" but the model cannot technically block the action.
  5. Reference apps may drift from rules: The FastAPI reference/app/ is a static example that may not track future rule updates.
04

Workflow

vibecodex — Workflow

New Feature Workflow (via new-feature skill)

The skill enforces 5 mandatory steps before any code is written:

Step 1 — Define the API contract

Endpoint:   POST /generate/image
Request:    { prompt: str, model_id: str, width: int, height: int }
Response:   { task_id: str, status: "queued" }
Side effect: creates a task, holds credits

If you cannot answer all 4 questions in 2 sentences, STOP and clarify with user.

Step 2 — Identify layers touched Decision matrix:

Feature needs Layers touched
New HTTP endpoint only Router
Endpoint + business logic Router + Service
Logic + database Router + Service + Repo
Logic + external API Router + Service + Provider
Logic + credits All + Credits (single writer!)

Write the list. Do not touch more layers than listed.

Step 3 — Define test scenarios (2 minimum)

  • Scenario 1: happy path
  • Scenario 2: edge case (0 credits, invalid input, etc.)

Step 4 — Check Single-Writer Invariant No service except services/credits/user.py may write credit deductions.

Step 5 — Write code Only after Steps 1-4 are complete.

Artifacts

Artifact Generator
CLAUDE.md (project-level rules) vibecodex CLI init
.cursor/rules/ (Cursor rules) vibecodex CLI init
.claude/skills/ (skill files) vibecodex CLI init
API contract (plaintext) new-feature skill Step 1
Test scenarios new-feature skill Step 3

Approval Gates

  1. new-feature skill Step 1: contract must be answerable before proceeding.
  2. new-feature skill Step 2: layer list must not grow during implementation.
  3. Test scenarios written before any implementation code.

No Phase Workflow

Unlike BMAD or spec-kit, vibecodex has no multi-phase project lifecycle (no PRD, no architecture doc, no sprint planning). It's a per-feature enforcement framework, not a project lifecycle framework.

06

Memory Context

vibecodex — Memory & Context

CLAUDE.md as Persistent Architecture Memory

The primary memory artifact is CLAUDE.md — the 18 rules (for FastAPI) are loaded by Claude Code at every session start, providing an architecture memory that persists without any database. The rules encode decisions that were made once (hexagonal architecture, provider isolation, credits as single-writer) and never need to be re-stated.

No State System

No session state files, no YAML store, no SQLite. vibecodex doesn't track feature progress, story completion, or workflow state. It's a per-feature architectural enforcer, not a project lifecycle manager.

Reference Implementations as Memory

The three reference implementations (reference/app/, examples/nextjs/, examples/go/) serve as "concrete memory" — the model can read them to understand how a rule is applied in practice, rather than reasoning from the abstract rule.

Cross-Session Handoff

Partial — the CLAUDE.md and .claude/skills/ files persist across sessions, providing architectural continuity. But there's no mechanism to resume a partially-completed feature (no docs/stories/, no workflow-status.yaml).

Context Window Efficiency

The 54 rules are compact — the CLAUDE.md for FastAPI is approximately 600 lines, significantly smaller than BMAD's full agent persona files. The decision matrix in new-feature skill is a compression of architectural reasoning into a lookup table, reducing the context window overhead of rule application.

07

Orchestration

vibecodex — Orchestration

Multi-Agent Pattern

No — vibecodex is a single-agent framework. No subagents, no orchestrator, no persona switching.

Orchestration Pattern

None — the skills are a library of checklists invoked on demand, not a sequential or hierarchical workflow.

Isolation

None — in-place editing. No worktree, no container.

Multi-Model

No — single model.

Execution Mode

interactive-loop — developer invokes a skill (e.g., "new-feature") when starting work on a feature; Claude Code runs the pre-flight checklist interactively. No background daemon.

Prompt Chaining

Partial — within a single new-feature session, Steps 1-5 chain (each step's output constrains the next). But there's no cross-feature chaining.

MCP Server

The mcp/src/index.ts MCP server is present but sparsely documented. It may provide architecture validation tools (checking imports, detecting layer violations), but this is not confirmed by the available README content. Single TypeScript source file.

Key Design Choice

vibecodex deliberately avoids orchestration complexity. The README positions it against BMAD and spec-kit by targeting a simpler use case: a solo developer who just wants the architecture rules to be followed, without managing a multi-phase agile lifecycle.

08

Ui Cli Surface

vibecodex — UI / CLI Surface

CLI Binary

  • Exists: Yes — vibecodex (npm package @aimyerdaulet/vibecodex)
  • Entry point: cli/bin/vibecodex.js
  • Is thin wrapper: No — custom installer/init logic
  • Subcommands:
    • vibecodex init — install CLAUDE.md + .cursor/rules/ + .claude/skills/ to project
    • vibecodex init --stack fastapi
    • vibecodex init --stack nextjs
    • vibecodex init --stack go
    • vibecodex init --dry-run — preview without writing files

Local UI

None — terminal only.

Cursor Rules

.cursor/rules/ — the same 54 principles deployed as Cursor IDE rules, making vibecodex dual-IDE (Claude Code + Cursor).

MCP Server

mcp/src/index.ts — an MCP server is present. Purpose is not fully documented in README; likely provides architecture validation tools. TypeScript.

Documentation Website

vibecodex.dev (https://vibecodex-omega.vercel.app) — a Vercel-hosted website with principle explanations and examples.

Cross-Tool Portability

Medium — CLAUDE.md works with Claude Code; .cursor/rules/ works with Cursor. No support for Gemini CLI, Codex, or other AI tools beyond these two.

Smithery / npm

Available as npm package on npmjs.com/@aimyerdaulet/vibecodex for discoverability.

Related frameworks

same archetype · same primary tool · same memory type

BMAD-METHOD ★ 48k

Provides a full agile delivery lifecycle with named expert-persona AI collaborators that elicit the human's best thinking rather…

Agent OS ★ 4.6k

Extracts implicit codebase conventions into token-efficient markdown standards files and injects them selectively into AI agent…

Claude Conductor ★ 367

Gives Claude Code a persistent, cross-linked, auto-analyzed documentation system so it retains codebase context across sessions.

Spec-Driver (Greenfield Spec-Driven Development) ★ 25

Prevents spec rot in AI-assisted development by making implementation changes flow back into evergreen, authoritative specs via…

Anthropic Knowledge Work Plugins ★ 16k

Role-specialized plugin bundles with live MCP connectors that turn Claude into a domain expert for enterprise knowledge workers.

Codex Integration for Claude Code (skill-codex) ★ 1.3k

Single Claude Code skill that handles Codex CLI invocation correctly (stdin blocking, thinking token suppression, session resume)…