haechandev
AI & work

Seven rules I try to follow when working with AI

Personal development rules for turning fast AI output into maintainable work, from code size and research to databases, UI, and task management.

July 28, 2026

AI makes building much faster. The problem is how easily that speed also shortens the time spent thinking. Files grow, screens become elaborate too early, and explanations pile up beyond the answer I need.

I use more practices than these seven, but these have helped most when work grows complicated or stalls. They are less a perfect rulebook than reference points for regaining focus.

1. Aim to finish a file within 200 lines

The number is not the goal. Once a file becomes too long, state, presentation, communication, and error handling often collect in one place, even when I ask AI for clean architecture.

Exceeding 200 lines does not automatically make code wrong. It does make me pause:

Does this file really have one responsibility?

When a screen component grows, I first check whether it mixes state hooks, API requests, and reusable presentation components. The line limit is an alarm for mixed responsibilities.

I tell AI in advance to propose responsibility boundaries if a file is likely to substantially exceed 200 lines. Getting the structure right early is less painful than dismantling a large file later.

2. Look for experience before implementation

Writing code well and understanding where it fails in practice are different abilities.

Before authentication or file uploads, I ask AI to look at official documentation and trustworthy technical sources for:

  • Common security, performance, and operating pitfalls.
  • The framework’s recommended approach.
  • Constraints revealed by past failures.

Only then do I ask for three options that fit our structure, grounded in that evidence. Other developers’ experience becomes material for design rather than a search result to follow blindly.

For changing libraries and platforms, current official documentation comes before the model’s memory. Checking where an answer starts usually saves time later.

3. Review indexes whenever the database changes

AI can produce a working table or query and overlook indexes. Small development datasets make this easy to miss.

I attach this question to database changes:

How do this screen and API filter, sort, and join data? Do the indexes match those access patterns?

If a list filters by user_id and sorts by created_at, separate indexes may not be enough; a composite (user_id, created_at) index may fit the query better. I also record different flows such as lists, administrator searches, and batch jobs.

This belongs in the project’s database rules, not just a prompt: review index impact and execution plans for schema and query changes.

4. Do not try to finish the visual design first

Ask AI for a polished, elaborate screen and it will deliver. But decoration can arrive before information hierarchy. Cards, gradients, and animation make revision harder when the structure is still unclear.

I start simply:

  • What does the screen show?
  • Where should the user act?
  • What changes when the state changes?

Once those are clear, I add spacing, typography, color, and motion. The information order needs to be visible first. A sound structure makes visual refinement more precise.

5. Ask for the essential answer

Context and alternatives can help, but they can also blur a decision that needs to be made now. I define the scope of the answer first.

Do not implement yet. Give me the tradeoffs and one recommendation.

Narrow the possible causes to three and tell me what to check first.

A short answer does not require shallow reasoning. Make the immediate decision, then ask for depth when needed. Tools such as Caveman, which reduce wording and context, fit this principle. Choosing the essential point remains my responsibility.

6. Resolve one ambiguity at a time and carry it into task.md

Trying to settle several ambiguous design questions at once is risky. The conversation grows while the reasons for each decision stay thin.

If permissions, data structure, screen flow, and operating policy are all unclear, I begin with one:

Let us first decide who can use this feature. Data structure and screens come next.

Each agreed answer becomes the premise for the next question. I also ask whether there are facts we still need before deciding. Ambiguity then decreases rather than accumulating.

I record agreed work in task.md.

## Current tasks

- [ ] Confirm cancellation permissions
- [ ] Document cancellation state transitions
- [ ] Review refund queries and indexes
- [ ] Implement the smallest administrator workflow
- [ ] Verify on a real device

The aim is to show what is blocked, what to check next, and what counts as done. AI can work on the first unfinished item and leave the result and next question afterward.

task.md carries decisions into code work and preserves focus across conversation, documentation, and implementation.

7. Understand what exists before writing new code

When asked to build immediately, AI may create new functions and components even when similar logic exists. User lookup, error handling, and permission checks gradually diverge. Later, it becomes harder to know which implementation to use.

I first get a basic understanding of the structure, then ask AI to find existing implementations. For a user profile feature, I might say:

Before implementing, find the APIs, hooks, types, and components related to user, profile, and userId. Briefly describe where they are used and propose a plan around reusable pieces. Add new logic only when needed, with a reason.

AI then checks for an existing useUser hook, lookup function, or UserSummary component before extending the flow. If a new boundary is needed, it explains why.

The point is to understand why the current structure exists and consciously choose whether to reuse or change it. That lets me follow the implementation and keeps AI-written code consistent with the project.

The rules help me keep doing my part

These rules keep me from accepting a fast answer while skipping decisions I need to make.

Small files reveal responsibilities. Research checks the starting assumptions. Index reviews anticipate bottlenecks. Simple UI exposes information structure. Resolving questions one at a time and reading existing code preserve focus.

AI can move work forward very quickly. I use these rules to keep that speed from turning into complexity.