10 min read

AI Development Framework

VibeReady includes a full AI development framework that auto-loads project patterns and generates documentation as you code. This page explains the architecture, core components, and daily workflow.


Five-Minute Overview

What is this? An AI framework that auto-loads project patterns and generates docs, so every AI tool you use already understands your codebase conventions.

Key components:

  1. AGENTS.md — Universal lean core context (loaded by all AI tools)
  2. Scoped Rules — Auto-loaded per tool when you edit matching files
  3. Agent Skills — Reusable workflow skills (new feature, fix bug, refactor, and more)
  4. PRDs — Feature requirements for complex features (optional)
  5. Git hooks — Auto-generate docs on commit

Basic workflow:

[specify skill] -> [plan skill] -> Describe feature -> Scoped rules auto-load -> AI follows patterns -> Commit -> Docs auto-generate

Start here: Build Your First Feature for hands-on learning.


Framework Architecture

Core Components

AGENTS.md (Lean Core - ~70 lines, always loaded)
    |
    |--- Scoped Rules (auto-loaded per file you edit)
    |    Master source maintained in a dedicated rules directory,
    |    then generated per tool by the setup command.
    |
    |--- Agent Skills (invoked on demand)
    |    specify/       plan/              (SDLC orchestration)
    |    new-feature/   fix-bug/   refactor/  (implementation)
    |    new-api-route/ add-test/  stack-swap/
    |    code-review/   design-review/  qa/   (review)
    |    security-reviewer/
    |    readme-updater/                      (documentation)
    |
    |--- PRDs (Feature requirements)
    |    PRD-{feature}.md
    |
    |--- Routes and API directories
         {route}/README.md (auto-generated)

Git Hooks and Auto-Documentation

Commit code -> post-commit hook -> doc generation script -> Updates route READMEs -> Updates API docs -> Ready for next session

How It Works

1. AGENTS.md (Universal Core Context)

Purpose: A lean core file (~70 lines) with non-negotiable rules, loaded by every AI tool automatically.

Contains:

  • Multi-tenancy rule (scope ALL queries by organizationId)
  • TDD requirement (tests first)
  • DRY principle (reuse existing patterns)
  • README-first pattern (read READMEs before code search)
  • Three-Gate quality system overview
  • Pointers to skills and scoped rules

How tools load it:

AI ToolPlan Mode CommandHow AGENTS.md Is Loaded
Claude CodePress Shift+TabVia CLAUDE.md symlink to AGENTS.md
Cursor/plan or Composer modeReads AGENTS.md natively
WindsurfCascade planningReads AGENTS.md natively
Gemini CLI/plan commandVia GEMINI.md symlink to AGENTS.md

The setup command creates symlinks and copies scoped rules for your chosen tool.

Gemini CLI / GitHub Copilot note: These tools read AGENTS.md (core rules) but do not support scoped rules. You still get TDD, multi-tenancy, DRY, and security enforcement — just without file-specific patterns auto-loading. For detailed patterns, check the skill reference files.

2. Scoped Rules (Auto-loaded per File)

Purpose: Relevant patterns load automatically when you edit matching files. No manual routing needed.

How it works:

  • The setup command generates rules from a master source directory into each tool’s expected location
  • Edit an API route and API patterns load automatically
  • Edit a test file and testing patterns load automatically
  • Edit a component and UI patterns load automatically

Generated to each tool’s rule directory:

ToolGenerated ToFormat Transform
Claude CodeTool-specific rules folderYAML frontmatter with globs: array
CursorTool-specific rules folderFrontmatter with globs: + alwaysApply
WindsurfTool-specific rules folderFrontmatter with trigger: + globs:, trimmed to <6K

14 scoped rules covering:

  • api-routes — API route and server action patterns
  • database — Prisma queries and repository pattern
  • ui-components — Design system (colors, typography, layouts)
  • state-management — React Query, forms, optimistic updates
  • testing — TDD approach and test patterns
  • authentication — Clerk auth, RBAC, permissions
  • security — Input validation and vulnerability prevention
  • operations — Logging, monitoring, background jobs
  • architecture — System design, modular monolith
  • infrastructure — Terraform, CI/CD, Docker
  • ai-features — Vercel AI SDK, provider config
  • development — Git conventions, TypeScript standards (always loaded)
  • mcp-tools — Context7, Chrome DevTools integration
  • nfr — Performance, accessibility, error handling (always loaded)

Stack decomposition: Technology-specific patterns live in reference directories within skills. A stack manifest maps each technology to all files containing its patterns. When swapping a technology (e.g., Clerk to NextAuth), the manifest lists every file to update. See Stack Customization for details.

3. Agent Skills

Purpose: Reusable multi-step workflows that AI tools invoke on demand.

Follows the Agent Skills open standard — supported by 27+ tools including Claude Code, Cursor, VS Code, Codex, Gemini CLI, Windsurf, GitHub Copilot, and more.

Available skills:

SkillPhaseDescription
specifyOrchestrationDefine WHAT: PRD for features, bugs, or changes
planOrchestrationDefine HOW: task breakdown for any complex change
new-featureImplementationFull feature development with three-gate system
new-api-routeImplementationAPI route with auth, validation, tests
fix-bugImplementationBug investigation and fix workflow
refactorImplementationSafe refactoring with test preservation
add-testImplementationAdd tests following TDD patterns
stack-swapImplementationSwap a technology in the stack
code-reviewReviewArchitecture, performance, patterns audit
design-reviewReviewAccessibility, design system, UX audit
qaReviewTest quality, coverage, regression analysis
security-reviewerReviewSecurity audit with OWASP checklist
readme-updaterDocumentationUpdate module READMEs (delegated task)

How to invoke: Just describe your task — tools auto-discover matching skills. Or reference directly: “Use the new-feature skill to build X.”

4. PRD Workflow

Purpose: Feature requirements and implementation tracking for complex changes.

Skill-driven workflow:

  1. specify skill — Define WHAT: PRD for features, complex bugs, or significant changes
  2. plan skill — Define HOW: decompose into tasks (works with PRD or standalone)
  3. Implementation skill — new-feature, new-api-route, fix-bug, or refactor
  4. Review skills — code-review, design-review, qa, security-reviewer
  5. readme-updater skill — Update documentation

See PRD Workflow for the full guide.

5. Route-Based Architecture

Each route directory follows a consistent structure with co-located tests and auto-generated documentation:

src/app/
  dashboard/
    page.tsx           # Route implementation
    __tests__/         # Co-located tests
    README.md          # Auto-generated docs
  api/
    items/
      route.ts         # API endpoint
      __tests__/       # API tests
      README.md        # Auto-generated docs

Route READMEs contain: Component structure, API endpoints, database usage, business logic, testing patterns, and AI context.

Auto-generated on commit via git hooks.

6. Git Hooks and Auto-Documentation

Purpose: Keep documentation synchronized with code changes.

How it works:

  • The setup command configures Husky hooks
  • post-commit triggers a documentation generation script
  • The script analyzes changed files and updates route READMEs and API docs

Why this matters: Documentation never drifts, AI always has current context, and there is zero manual effort. See Keeping Docs Synced for details.

7. MCP Tools Integration

Purpose: External tools for AI development.

Configured tools:

  • Context7 — Latest library documentation
  • Chrome DevTools — Browser debugging

Usage examples:

CONTEXT7: /radix-ui/primitives for latest shadcn/ui patterns
CONTEXT7: /tanstack/query for React Query

See MCP Setup for configuration.


The Development Cycle

  1. Use specify skill for complex changes (creates PRD for features, bugs, refactoring)
  2. Use plan skill to decompose into tasks (works with PRD or standalone)
  3. Scoped rules auto-load based on files you will edit
  4. AI analyzes existing patterns via READMEs
  5. Use an implementation skill for each task (new-feature, fix-bug, refactor, etc.)
  6. AI implements with TDD
  7. Use review skills (code-review, design-review, qa, security-reviewer)
  8. You commit
  9. Git hooks auto-generate docs
  10. Use readme-updater skill to fill docs with business logic
  11. Next session: AI has updated context

Commands Reference

# Framework Setup
make ai-setup         # Configure AI tool and verify rules
npm install           # Install Husky hooks automatically

# Validation
make validate-ai      # Check AI context completeness
make generate-docs    # Force regenerate documentation

# PRD Management -- use the specify skill
# "Use the specify skill to create a PRD for [feature]."

Quick Tips

  • Always enter plan mode first — Loads full context before making changes
  • Reference existing routes — AI learns from patterns already in your codebase
  • Commit frequently — Triggers auto-documentation
  • Let AI write tests first — TDD approach produces better outcomes
  • Use skills for complex tasks — “Use the new-feature skill” ensures the full workflow runs

Avoid these common pitfalls:

  • Do not skip plan mode — AI will not load project context
  • Do not skip tests — Quality depends on test coverage

Ready to build with VibeReady?

Get the full AI-native SaaS foundation with production infrastructure, AI development framework, and all integrations.

Get VibeReady — From $149