> ## Documentation Index
> Fetch the complete documentation index at: https://kxp.wyhil.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Logic Create

> Learn how to create logic.

## Logic Creation Overview

The most powerful aspect of Vibe Coding is that developers do not need to manually translate complex algorithms or business rules into code. By explaining the **'purpose'** and **'conditions'** of the logic you want to implement, the AI designs and implements optimized logic by referencing the project's existing code style.

***

## Step-by-Step Logic Implementation

The following is the process of adding a new feature that grants a 'Popular' tag based on the activity of a post.

1. **Defining Business Rules**: Explain the conditions of the logic you want to implement.
   > **Prompt:** "I want to add a 'Popular Post' feature to our board. Make the view count (`viewCount`) increase by 1 every time the post detail page is viewed, and implement logic so that when the view count exceeds 100, a '🔥Popular' tag appears next to the post title."

2. **Domain Model Expansion**: The AI adds new fields to the `Board` entity and creates business methods in the service layer.

3. **Integration Implementation**: The AI uses `edit_existing_file` to connect the controller and service logic, and writes code so that it can finally be reflected in the database.

***

## 💡 Tips for Efficient Logic Creation

* **Define Input/Output (I/O)**: Specifying input values and expected output values, such as "When A is entered, B should come out," dramatically increases the accuracy of the logic.
* **Specify Exceptional Situations**: Let the AI know in advance how to handle exception cases, such as "When there is no data, don't throw an error, but return an empty object."
* **Request Verification**: Once logic creation is complete, increase the level of completion by requesting, "Review if there are any bugs in this logic and write test code."
