AI Dev OS: Enforce Next.js Conventions with Claude Code
Install AI Dev OS and add your project‑specific guidelines to enforce conventions.
Run npx ai-dev-os init --rules typescript --plugin claude-code and verify with npx ai-dev-os doctor.
Summary
The article walks through installing AI Dev OS into an existing Next.js project using Claude Code, showing how the 4‑layer model loads project philosophy, Next.js conventions, TypeScript rules, and security patterns. The CLI init command npx ai-dev-os init --rules typescript --plugin claude-code generates a CLAUDE.md index, a docs/ai-dev-os rule submodule, a .claude/plugins/ai-dev-os skill set, and pre‑commit hooks for automated rule verification. The article explains that guidelines live in .claude/guidelines/nextjs.md, .claude/guidelines/typescript.md, and .claude/guidelines/security.md, and are loaded only when relevant to avoid diluting Claude’s attention. The author demonstrates how to add project‑specific guidelines in the CLAUDE.md Project‑Specific Guidelines section, such as business rules, external API contracts, and compliance constraints. The article includes a verification step using npx ai-dev-os doctor to confirm all guideline files are detected and no configuration conflicts exist. The author also describes how the framework uses a conditional ActionResult type to handle server actions that return data or just success. The article concludes by encouraging developers to test the same task before and after applying guidelines to see the difference in generated code. The Loom demo and step‑by‑step instructions provide a hands‑on walkthrough that takes under 30 minutes.
Key changes
- AI Dev OS uses a 4‑layer model: CLAUDE.md, .claude/guidelines, .claude/commands, and plugins
- CLI init command npx ai-dev-os init --rules typescript --plugin claude-code generates CLAUDE.md, rule submodule, plugin skills, and pre‑commit hooks
- Guidelines live in .claude/guidelines/nextjs.md, .claude/guidelines/typescript.md, and .claude/guidelines/security.md
- Project‑specific guidelines are added in the CLAUDE.md Project‑Specific Guidelines section
- npx ai-dev-os doctor verifies guideline files and configuration
- Framework uses a conditional ActionResult type for server actions
- Article demonstrates before/after code generation to show guideline enforcement
- Setup takes under 30 minutes with CLI or manual steps