How to Prevent AI Hallucinations with Step by Step Rule
How to useDecember 14th, 20256 min read

How to Prevent AI Hallucinations with Step by Step Rule

Learn how a 3-step process (Explore → Plan → Execute) prevents AI coding errors and ensures better results with Vooster AI's Step by Step rule.

Why You Shouldn't Let AI Jump Straight to Coding

Have you ever used AI coding tools? When you ask Cursor or Claude Code to "build this feature," AI immediately starts writing code. But often, when you check the results, they're completely different from what you intended.

Why does this happen? AI tends to implement without context. It doesn't properly understand your codebase conventions, and it's hard to notice when things go off track. It's like driving to a destination without a map.

In this article, we'll introduce the Step by Step Rule that forces AI to work systematically. By following just three steps—Explore → Plan → Execute—you can prevent AI "hallucinations" and achieve much better results.

The Step by Step 3-Step Process

Step by Step 3-Step Process

The core of the Step by Step Rule is forcing AI to go through a 3-step process instead of jumping straight to writing code.

Step 1: Explore and Analyze

First, ensure AI fully understands your project.

For example, if you request "create a user profile feature," AI first examines existing user-related code, database schema, API routing patterns, etc.

Step 2: Planning

Don't develop immediately—create a work plan. This is the most important step.

With a planning phase, you can check if things are going in the wrong direction. For example:

Task List Example:

  1. Add profileImage and bio fields to User model
  2. Create profile view API endpoint (GET /api/profile/:userId)
  3. Create profile update API endpoint (PUT /api/profile)
  4. Write profile page UI components
  5. Implement image upload functionality

Acceptance Criteria Example:

Step 3: Execute Implementation

Progress through the list created in the planning phase, checking items one by one.

AI implements each task item in order and verifies whether Acceptance Criteria are satisfied. During this process, if things deviate from the intended direction, you can immediately notice by referring to the planning list.

Why the Planning Phase Matters

Importance of Planning

Many developers want to skip the planning phase. "Why do I need to plan when I can just write code quickly?"

But the planning phase is the most powerful safety net in AI coding.

1. Mid-Process Validation is Possible

With a task list, it's clear which step AI is currently working on. If it suddenly tries to restructure the entire database while working on task 3, you can immediately notice: "Wait, this wasn't in the plan."

2. "Complete" Has a Clear Definition

With Acceptance Criteria, you can give a clear answer to the vague question "Is this feature done?" If all Acceptance Criteria are satisfied, it's complete. If even one is missing, it's incomplete.

3. Prevents Unintended Results Proactively

Reviewing the task list during planning lets you discover "Hey, this isn't what I wanted" before actual implementation. This is much more efficient than rebuilding after all the code is written.

4. Easy to Share in Team Collaboration

If working in a team, you can share AI's planning with teammates for feedback. All team members share the same goals and completion criteria.

Additional Tips for Writing Cursor Rules

Cursor Rule Writing Guide

When applying the Step by Step Rule to Cursor or Claude Code, here are some tips.

1. Use File References

Explicitly specifying "refer to this file" in rules makes AI follow conventions more accurately.

Example:

Before implementing, check:
- File naming: See `src/components/user/UserCard.tsx`
- API patterns: See `src/app/api/users/route.ts`
- Type definitions: See `src/types/user.ts`

2. Include Code Examples

Adding example code in rules saying "write in this style" helps AI maintain consistent coding style.

3. Write in English

Many developers write rules in their native language, but we strongly recommend writing in English. Here's why:

4. Specify Stop Points at Each Step

## Step 1: Explore
- Explore the codebase
- **STOP HERE and confirm with me before proceeding to Step 2**

## Step 2: Plan
- Create task list
- Define acceptance criteria
- **STOP HERE and get my approval before Step 3**

## Step 3: Execute
- Implement one task at a time
- Check each acceptance criteria

This makes AI stop at each step for confirmation.

Using Step by Step Rule in Vooster AI

Good news! Vooster AI provides the Step by Step Rule by default.

Rules System

Vooster AI's Rules system provides these default rules:

When creating a project and selecting a template, a Step by Step Rule optimized for that template is automatically included. Each template—EasyNext, SuperNext, FullSaaS—comes with rules tailored to its framework and architecture.

Apply Immediately via MCP Integration

Vooster AI directly integrates with Cursor and Claude Code through MCP (Model Context Protocol). Just add one line to your config file:

{
  "mcpServers": {
    "vooster-ai": {
      "command": "npx",
      "args": ["-y", "--package=@vooster/mcp@latest", "vooster-ai", "--api-key=YOUR_KEY"],
      "type": "stdio"
    }
  }
}

Now you can use Vooster AI's Step by Step Rule directly in your coding tool. AI automatically follows the Explore → Plan → Execute sequence.

Conclusion

When assigning work to AI, simply following the "Explore → Plan → Execute" sequence completely changes the results.

The Step by Step Rule is simple yet powerful. It's the most reliable way to prevent AI "hallucinations."

Vooster AI provides this Step by Step Rule by default and supports MCP integration for immediate application to your projects. If you want a systematic AI development process, apply Vooster AI's Step by Step Rule today.

Start your systematic vibe coding journey with Vooster AI today!

Start Structured Vibe Coding with Vooster

From PRD generation to technical design and task creation - AI helps you every step. Start free today.

PRD Generation

Auto-generate detailed requirements

Technical Design

Implementation plan & architecture

Task Generation

Auto-break down & manage dev tasks

No credit card required · Full access to all features

Related Posts

Discord
How to Prevent AI Hallucinations with Step by Step Rule