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:
- AGENTS.md — Universal lean core context (loaded by all AI tools)
- Scoped Rules — Auto-loaded per tool when you edit matching files
- Agent Skills — Reusable workflow skills (new feature, fix bug, refactor, and more)
- PRDs — Feature requirements for complex features (optional)
- 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 Tool | Plan Mode Command | How AGENTS.md Is Loaded |
|---|---|---|
| Claude Code | Press Shift+Tab | Via CLAUDE.md symlink to AGENTS.md |
| Cursor | /plan or Composer mode | Reads AGENTS.md natively |
| Windsurf | Cascade planning | Reads AGENTS.md natively |
| Gemini CLI | /plan command | Via 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:
| Tool | Generated To | Format Transform |
|---|---|---|
| Claude Code | Tool-specific rules folder | YAML frontmatter with globs: array |
| Cursor | Tool-specific rules folder | Frontmatter with globs: + alwaysApply |
| Windsurf | Tool-specific rules folder | Frontmatter with trigger: + globs:, trimmed to <6K |
14 scoped rules covering:
api-routes— API route and server action patternsdatabase— Prisma queries and repository patternui-components— Design system (colors, typography, layouts)state-management— React Query, forms, optimistic updatestesting— TDD approach and test patternsauthentication— Clerk auth, RBAC, permissionssecurity— Input validation and vulnerability preventionoperations— Logging, monitoring, background jobsarchitecture— System design, modular monolithinfrastructure— Terraform, CI/CD, Dockerai-features— Vercel AI SDK, provider configdevelopment— Git conventions, TypeScript standards (always loaded)mcp-tools— Context7, Chrome DevTools integrationnfr— 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:
| Skill | Phase | Description |
|---|---|---|
specify | Orchestration | Define WHAT: PRD for features, bugs, or changes |
plan | Orchestration | Define HOW: task breakdown for any complex change |
new-feature | Implementation | Full feature development with three-gate system |
new-api-route | Implementation | API route with auth, validation, tests |
fix-bug | Implementation | Bug investigation and fix workflow |
refactor | Implementation | Safe refactoring with test preservation |
add-test | Implementation | Add tests following TDD patterns |
stack-swap | Implementation | Swap a technology in the stack |
code-review | Review | Architecture, performance, patterns audit |
design-review | Review | Accessibility, design system, UX audit |
qa | Review | Test quality, coverage, regression analysis |
security-reviewer | Review | Security audit with OWASP checklist |
readme-updater | Documentation | Update 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:
specifyskill — Define WHAT: PRD for features, complex bugs, or significant changesplanskill — Define HOW: decompose into tasks (works with PRD or standalone)- Implementation skill —
new-feature,new-api-route,fix-bug, orrefactor - Review skills —
code-review,design-review,qa,security-reviewer readme-updaterskill — 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-committriggers 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
- Use
specifyskill for complex changes (creates PRD for features, bugs, refactoring) - Use
planskill to decompose into tasks (works with PRD or standalone) - Scoped rules auto-load based on files you will edit
- AI analyzes existing patterns via READMEs
- Use an implementation skill for each task (
new-feature,fix-bug,refactor, etc.) - AI implements with TDD
- Use review skills (
code-review,design-review,qa,security-reviewer) - You commit
- Git hooks auto-generate docs
- Use
readme-updaterskill to fill docs with business logic - 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
Related Documentation
- Build Your First Feature — Hands-on quick start
- Prompt Library and Skills — Effective prompts and recovery strategies
- PRD Workflow — PRD-driven development for complex features
- Keeping Docs Synced — Auto-documentation system
- Stack Customization — Swap any technology in the stack
- Troubleshooting — Fix framework issues
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