跪拜 Guibai
← All articles
Artificial Intelligence

Stop Telling AI to Code; Start Handing It a Blueprint

By dzhd ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

The workflow directly attacks the two biggest complaints about AI coding assistants: fabricated API calls and unmaintainable output. By shifting the developer's role from instruction-giver to architect and integrator, it produces code that can survive beyond a single session.

Summary

Directing an AI to "build a todo app" produces hallucinations and spaghetti. A structured workflow flips the dynamic: first force the AI to output a technical plan defining the tech stack, feature boundaries, and data contracts before writing a single line of code. This upfront constraint eliminates the ambiguity that causes most AI-generated bugs.

The coding phase itself follows a "glue programming" principle. Instead of asking the AI to implement complex logic like drag-and-drop from scratch, the developer selects a mature library and writes only the thin integration layer that connects it to the application's state. This approach keeps business logic clean and makes library swaps trivial.

A final meta-layer introduces a supervisor prompt that reviews, scores, and suggests improvements for the code the AI just generated. This self-critique loop turns the AI into a 24/7 code reviewer, progressively lifting output quality without the developer needing to master every best practice upfront.

Takeaways
Spending 20% of the timeline on a written technical plan—tech stack, feature boundaries, explicit exclusions, and data structures—prevents most AI hallucinations.
Explicitly listing what the feature will NOT include stops the AI from over-engineering and adding unrequested complexity.
Mandating a fixed data contract (e.g., `{id, text, completed}`) before coding eliminates field-name drift across multiple AI interactions.
Glue programming means selecting a mature, battle-tested library and writing only the minimal integration code that connects it to the app's state.
Hand-written drag-and-drop logic is a bug magnet; wrapping a library like `react-beautiful-dnd` keeps the business logic untouched and the drag complexity encapsulated.
A supervisor prompt (Ω prompt) that reviews, scores, and suggests optimizations for generated code creates a self-improving feedback loop.
The developer's core skill shifts from writing syntax to making technical decisions: library selection, boundary definition, and data structure design.
Conclusions

The methodology treats AI not as a junior developer but as a skilled executor with no business context, which is a more accurate mental model than the common "pair programmer" analogy.

An explicit "not-to-do list" is a surprisingly high-leverage tool for AI coding; it cuts off the most common failure mode—unprompted feature creep—before it starts.

The self-review prompt pattern exploits the model's own training on high-quality code to critique its output, effectively turning the model's knowledge base into an automated linter and mentor.

Glue programming aligns with a broader industry shift where the value of a developer is measured by integration and architectural decisions, not lines of original code written.

Concepts & terms
Vibe Coding
A term from the developer community describing the practice of using natural language to drive AI code generation, often without detailed specifications, relying on the 'vibe' or general feel of the request.
Glue Programming
An approach where a developer writes minimal integration code to connect mature, existing libraries and services, rather than implementing complex logic from scratch.
Alpha (α) and Omega (Ω) Prompts
A two-role prompt pattern: the α prompt is the instruction to generate code, and the Ω prompt is a follow-up instruction that asks the AI to review, score, and suggest improvements for the code it just produced.
Data Contract
A predefined, explicit data structure (like a TypeScript interface) that serves as a fixed agreement between different parts of an application, preventing the AI from inventing or changing field names across interactions.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗