LogoNEXTDEVKIT Tutorials

Integrating AI Agents

This tutorial will help you quickly get started with NEXTDEVKIT and AI IDE usage, including AI Rules and MCP installation and usage.

In today's world, templates with AI support can greatly improve development speed.

For current large language models, whether GPT or Claude, building a complete, easy to expand, and stable SaaS project from zero is quite hard. This is because AI is not good at code organization and structure, and lacks understanding of project design.

So most projects that start completely from zero using AI for Vibe Coding will face weak code structure and hard to maintain code problems at some point. Many bugs, very broken code, making it hard to continue using AI for Vibe Coding.

This is one of the main reasons I created NextDevKit. If AI works with a project that has good organization, clear code structure, clear instructions on how to write code, and complete documentation support, then using AI for Vibe Coding is much more effective. I built NextDevKit for this reason myself, to help me do better Vibe Coding.

NextDevKit can work with most modern AI development tools through the Ruler project, including AI IDEs like Cursor and Copilot, and also supports AI CLI tools like Claude Code and Gemini.

NextDevKit has complete documentation and already includes Context7 AI agents by default. You can access the latest documentation directly through MCP. It also has built-in AI Rules instructions that make it easy to quickly add development features.

Choosing an AI IDE

There are many AI IDEs available, such as Cursor, Copilot, Gemini, AugmentCode, Claude Code, etc.

NextDevKit uses the Ruler project to manage AI IDE settings to work with different AI IDEs.

For the Ruler project, please check the Ruler Official Documentation.

So currently, using AI Agents supported by the Ruler project will give you a better experience. If your current AI IDE is not in the Ruler project's supported list, you can manually add the Rules and MCP settings to your project.

You can choose your AI IDE based on your situation and price. My personal suggestion is to use Cursor + Claude Code together, with Claude 4 Sonnet Think model. This gives the best overall experience.

AI Rules Instructions

NextDevKit includes built-in AI Rules instructions to help you develop faster and use AI tools better for quick development feature integration.

.ruler/
├── engineering
   ├── common-commands.md
   ├── core-files-and-functions.md
   └── development-guidelines.md
├── instructions.md
├── mcp.json
├── project
   └── project-architecture.md
└── ruler.toml

Installation

To add these rules to your AI IDE, you first need to install Ruler globally:

npm install -g @intellectronica/ruler

Quick Start

Apply the built-in rules to your AI agents:

# Apply to all configured agents, based on your ./ruler/ruler.toml config file
ruler apply

# Apply to specific agents only, for example Cursor
ruler apply --agents cursor

Pre-configured Rules

NextDevKit includes 4 core instruction files:

  • 🏗️ Project Structure - Complete project structure and tech stack
  • 🛠️ Development Standards - Programming standards and best practices
  • 🔧 Core Functions - Key file locations and function references
  • Common Commands - Development commands and deployment process

Suggestions

More AI rules is not always better. Too many rules might cause more AI confusion, which does not help actual development. Try to add only rules related to your needs to your prompt.

NextDevKit currently includes four default rules files, all written based on NextDevKit project structure and features. You can use them as reference for your own rule instructions.

If you don't want to use the default rules files, you can manually add the Rules and MCP settings to your project.

I strongly suggest that if you want to use AI rules this way, you should carefully read the instruction content and adjust it based on your needs.

Don't use instruction rules you are not familiar with, or AI might not work the way you want.

For example, the core functions instruction file is shown below. You can use it as reference for your own rule instructions.

The above file is a reference. In different templates, for example cloudflare workers templates, there will be some specific changes and improvements.

Good instruction rule sets plus clear prompts can definitely greatly improve development efficiency.

AI + Docs

Besides AI rule instruction sets, NextDevKit also provides complete and comprehensive documentation. AI agents can access these documents through Context7 MCP integration. This ensures AI always has the latest project information.

NextDevKit documentation also provides llms.txt file support, which can be better accessed by AI agents and crawlers.

Benefits:

  • Always access latest documentation
  • Context-aware responses for NextDevKit
  • No need to manually search for relevant documentation

If you need more documentation index support, you can also use Context7's MCP to retrieve more documentation.

For example, Better Auth, Drizzle ORM, Shadcn UI documentation, etc.

About how to use it, you just need to simply tell AI the following instruction:

Help me query NEXTDEVKIT documentation through Context7, then xxxx

AI + MCP

NextDevKit currently only includes Context7 as the default MCP server.

You can configure more MCP servers in the .ruler/mcp.json file. Then run ruler apply --with-mcp to apply these configurations.

My personal experience is that a lot of MCP integrations don't have much effective impact on development efficiency. I suggest only integrating the MCP servers you need.

Configuring Context7

NextDevKit is pre-configured with Context7:

# Apply MCP configuration
ruler apply --with-mcp

# Apply to specific agents only
ruler apply --agents cursor --with-mcp

Manual Enable Required

⚠️ Important: After running ruler, you must check or manually enable MCP functionality in your AI IDE settings. Otherwise it might just be installed but not enabled.

Usage

After configuration, ask AI questions like:

  • "Query NextDevKit authentication configuration in Context7?"

AI will automatically query NextDevKit documentation through Context7.

Summary

Great! You have now completed AI Agents integration and can start using AI for Vibe Coding.

Next you will understand NextDevKit code structure and organization, and start your local service!