generate.py
// before vibecodex → after vibecodex
// 54 production principles

Your AI writes code
that breaks in prod.
vibecodex fixes that.

Architecture rules your AI follows automatically. Copy one file. Every Claude session follows 54 production principles from line one.

$ npx @aimyerdaulet/vibecodex init
FastAPINext.js 15Go 1.22+
⭐ github.com/yerdaulet-damir/vibe-coding-rules
// the problem
WITHOUT vibecodex
# routers/generate.py  (1,400 lines)
@router.post("/generate")
async def generate(req: dict, db=Depends(get_db)):
    result = await httpx.post(OPENAI_URL, json=req)
    data = result.json()
    wallet = db.query(Wallet).filter(...).one()
    wallet.balance -= data["usage"]["cost_usd"]
    db.commit()
    return data  # vendor shape leaks into response
WITH vibecodex
# routers/generate.py  (8 lines)
@router.post("/generate", response_model=GenerateResponse)
async def generate(
    req: GenerateRequest,
    user_id: str = Depends(get_current_user_id),
    svc: GenerateService = Depends(get_generate_service),
) -> GenerateResponse:
    return await svc.generate(user_id, req)

// AI assistants produce structurally correct, locally optimal code. What they don't enforce is architectural consistency: layer boundaries, single-writer invariants, bulkhead isolation, idempotency keys. vibecodex does.

// how it works
$ npx vibecodex init
? Select your stack:
❯ FastAPI (Python)
Next.js 15 (TypeScript)
Go 1.22+
✓ Copied CLAUDE.md
✓ Copied .cursor/rules/
✓ Copied .claude/skills/
01One command
# CLAUDE.md loaded
Router → Service → Repository
No business logic in routers
No sqlalchemy in services
ACL: providers return typed results
Bulkhead: one AsyncClient per provider
Idempotency keys on every side-effect
Single-writer for critical resources
0254 rules active
$ claude "add /generate endpoint"
→ Creating routers/generate.py (8 lines)
→ Creating services/generate.py
→ Creating repositories/protocols.py
✓ Layer boundaries respected
✓ No sqlalchemy in service layer
✓ Idempotency key in router
✓ lint-architecture.sh passes
03Clean code, first try
// 54 production principles
// get started
$ npx @aimyerdaulet/vibecodex init
? Select your stack:
❯ FastAPI (Python)
Next.js 15 (TypeScript)
Go 1.22+
All stacks
✓ Copied CLAUDE.md
✓ Copied .cursor/rules/architecture.mdc
✓ Copied .cursor/rules/decomposition.mdc
✓ Copied .cursor/rules/integrations.mdc
✓ Copied .claude/skills/debug-backend/SKILL.md
✓ Copied .claude/skills/new-feature/SKILL.md
✓ Copied .claude/skills/add-provider/SKILL.md
✓ Copied .claude/skills/split-monolith/SKILL.md
Done. Your AI now follows 54 production principles.
⭐ Star on GitHubRead the principles →
// questions

Frequently asked

vibecodex is a set of 54 production architecture principles for AI-assisted coding. It ships as a single CLAUDE.md file plus Cursor rules and Claude Code skills that any AI coding agent loads automatically. Stacks covered: FastAPI (Python), Next.js 15 (TypeScript), and Go 1.22+.

Yerdaulet Damir — vibecodex author
// built by

Yerdaulet Damir

Full-stack engineer building production AI products. vibecodex is the architecture rulebook I wished existed when my first vibe-coded SaaS turned into a 1,400-line router. Distilled from real refactors across FastAPI, Next.js 15, and Go services in production.

github.com/yerdaulet-damir·npm: aimyerdaulet