[KongchangAI]
· 2 min read· 1,246 words

4 Ways to Stop AI from Making Up Code

4 Ways to Stop AI from Making Up Code

Four practical methods turn AI coding Agents from "spouting nonsense" into "obedient workers."

The article summarizes four practical methods to make AI coding Agents more "obedient": Skills.sh skill marketplace for productized prompt engineering; Grill me reverse questioning so AI clarifies requirements before coding; the Super power structured workflow of brainstorming, planning, testing, then coding; and the Agents.md rule file specifying tech stack, tests, and prohibitions, read by AI on every start. All point to one conclusion: AI coding failures stem more from missing context and vague requirements than from model capability.

When AI writes code, it "spouts nonsense with a straight face"—a pit almost everyone who has used an AI coding assistant has fallen into. Recently, a YouTube creator summarized four practical methods to make AI Agents "obedient," covering everything from skill marketplaces to reverse questioning to rule files, spanning the full chain from requirement clarification to code generation.

Grill me reverse questioning mechanism

Method 1: Install Plugins for Your Agent via a Skill Marketplace

The first method is Skills.sh—a "skill store" for AI Agents. The creator demonstrated a very lightweight approach: post a skill command in the comments, and the corresponding capability is directly mounted onto the Agent.

The value of this idea lies in productizing "prompt engineering." In the past, users had to repeatedly describe in conversation "please handle this type of task in a certain way"; now it becomes a skill package that you subscribe to once and stays effective long-term. This is especially meaningful for team collaboration—the same set of skills can be reused across multiple members and multiple projects, reducing the repetitive labor of training the Agent from scratch each time.

Prompt Engineering refers to the technical practice of guiding large language models to produce expected outputs through carefully designed input instructions. Early developers had to repeatedly debug prompts for each task, and this "manual tuning" model had three pain points: first, it was hard to reuse—switching to a new project meant rewriting; second, it was hard to collaborate—team members each maintained different prompt versions; third, it was hard to maintain—model upgrades or task tweaks could invalidate existing prompts. The skill marketplace encapsulates prompts into standardized, version-manageable "skill packages," essentially a productized encapsulation of prompt engineering—turning implicit tuning experience into explicit, subscribable assets, thereby reducing the cost of repetitive labor in team collaboration.

Method 2: Let AI Question You First, Then Write Code

The second method is called "Grill me" by the creator, and the material shows its install count has reached 1.6 million. The core action is to reverse the direction of the conversation: before writing code, have the AI ask the user questions until it truly understands the requirements.

This hits the most typical failure mode of AI coding—the user gives a vague requirement, and the AI immediately outputs a large chunk of code that looks complete but actually misses the target. Reverse questioning forces requirement clarification to happen up front, exposing "understanding gaps" before code is written, rather than discovering the wrong direction during the debugging phase.

Brainstorm first, then make a plan

Requirement Elicitation is a classic step in software engineering, referring to the process of clarifying users' real needs through questioning, interviews, and other means before development. In traditional development, this step is done by product managers or business analysts; in AI coding scenarios, because users often face the code generator directly, requirement elicitation is easily skipped. The reverse questioning mechanism essentially "internalizes" this step into the AI Agent's interaction flow: letting the model actively play the role of requirements analyst, exposing ambiguities, boundary conditions, and implicit assumptions through multiple rounds of follow-up questions. This forms a sharp contrast with the "one-shot generation" model—the latter seems efficient, but actually pushes the risk of requirement misunderstanding to the debugging phase, where the cost of fixing is higher.

Method 3: Brainstorm, Plan, Test—and Only Then Write Code

The third method is called "Super power," and the flow is: brainstorm first, then make a plan, then write tests, and finally generate code. The creator particularly emphasized "don't sprint right out of the gate."

The material mentions that the project already has 333,000 stars on GitHub (as of December 5). Behind this number is developers' real demand for "structured workflows": letting AI follow the sequence of design first, implementation second, and tests as a safety net, so the output quality is noticeably closer to engineering standards, rather than one-shot generating a pile of code that needs major revisions.

Rule files are often forgotten

Test-Driven Development (TDD) is an engineering practice of writing tests before implementation code, with a core loop of "red—green—refactor": first write a failing test (red), then write just enough code to make the test pass (green), and finally refactor and optimize. The "write tests before generating code" in the Super power flow borrows exactly this idea. In the AI coding context, the value of TDD is especially prominent: test cases serve as executable specifications, providing AI with clear acceptance criteria so that the correctness of generated code can be automatically verified rather than relying on manual line-by-line review. This also explains why structured workflows can significantly improve the engineering quality of AI output.

Method 4: Agents.md—Free but Most Often Overlooked

The fourth method is free, but the creator says it is "most often forgotten": write an Agents.md file. The content includes three things—a description of the tech stack, how to run tests, and explicitly prohibited operations.

The key is that "AI reads this file every time it starts working." This is equivalent to giving the project an onboarding manual that stays in effect, turning project conventions from verbal reminders into context that the Agent loads every time it starts. The creator's assessment is blunt: the effect is like the work was done by a senior engineer.

Output quality close to senior developers

AGENTS.md is a conventional project-level configuration file placed in the root directory of a code repository, used to declare project context to an AI coding Agent. Its contents usually include: tech stack and dependency versions, build and test commands, code style conventions, directories or files that must not be modified, and team-specific notes. Unlike temporary prompts in a conversation, AGENTS.md is "persistent context"—the Agent automatically reads it each time it starts a session, with no need for the user to repeat instructions. This mechanism solves the "context amnesia" problem in AI coding: in long conversations, models easily lose early conventions, while a rule file provides stable, version-controllable project memory, keeping Agent behavior consistent across sessions.

The Common Logic Behind the Four Methods

Looking at these four methods together, you'll find they solve the same category of problem: AI coding going out of control often does not come from insufficient model capability, but from missing context and vague requirements. The skill marketplace supplements capability, reverse questioning supplements requirement understanding, structured workflows supplement engineering discipline, and Agents.md supplements project constraints.

For developers who use AI Agents daily, the lowest-cost, fastest-acting entry point is actually the fourth—a rule file of a few dozen lines can noticeably change output quality. And if you're still troubled by AI "making up code," why not start by letting AI ask you a question first.

One-line Summary

Four practical methods turn AI coding Agents from "spouting nonsense" into "obedient workers."

Paragraph Summary

The article summarizes four practical methods to make AI coding Agents more "obedient": first, the Skills.sh skill marketplace, which productizes prompt engineering into subscribable skill packages for team reuse; second, Grill me reverse questioning, which lets AI ask users questions to clarify requirements before writing code, avoiding deferred misunderstandings; third, the Super power structured workflow, following the order of brainstorming, planning, writing tests, and finally generating code, emphasizing engineering discipline; fourth, the Agents.md rule file, specifying the tech stack, testing methods, and prohibited operations, which AI reads every time it starts. Together they point to one conclusion: AI coding going out of control mostly stems from missing context and vague requirements, not insufficient model capability.

#AI coding#AI Agent#prompt engineering#Skills.sh#Grill me#Super power#Agents.md#test-driven development
Share:

Related articles