← Latest papers
💻 computer science

REprompt: Prompt Generation for Intelligent Software Development Guided by Requirements Engineering

This paper introduces REprompt, a multi-agent framework that leverages requirements engineering principles to automatically generate and optimize system and user prompts, thereby enhancing the quality of artifacts produced by large language model-based coding agents in realistic software development scenarios.

Original authors: Junjie Shi, Weisong Sun, Zhenpeng Chen, Zhujun Wu, Xiaohong Chen, Zhi Jin, Yang Liu

Published 2026-01-26
📖 5 min read🧠 Deep dive

Original authors: Junjie Shi, Weisong Sun, Zhenpeng Chen, Zhujun Wu, Xiaohong Chen, Zhi Jin, Yang Liu

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you want to build a house, but instead of talking to an architect, you are shouting vague instructions to a very smart, but slightly confused, robot builder. You say, "Build me a cool house." The robot might build a castle, a spaceship, or a house with no roof, because it doesn't know exactly what "cool" means to you.

This is the problem with using Large Language Models (LLMs) to write software today. They are the robot builders, and the "prompts" (your instructions) are often too vague, leading to messy or broken code.

The paper introduces a new tool called REprompt. Think of REprompt not as a magic spell, but as a professional requirements engineer who steps in between you and the robot builder.

The Core Idea: Treating Prompts Like Blueprints

In the world of building software, there is a discipline called Requirements Engineering. It's the process where engineers sit down with clients, ask the right questions, figure out exactly what is needed, write it down in a clear blueprint, and double-check that the blueprint makes sense before any construction starts.

The authors realized that when we talk to AI, we are skipping this crucial step. We just give a quick order. REprompt fixes this by turning the AI conversation into a structured engineering process.

How REprompt Works: The Four-Step Team

Instead of one AI trying to guess what you want, REprompt uses a team of four specialized AI "agents" (characters) that act like a human engineering team. They go through four stages, just like building a real house:

  1. The Interviewer & The Interviewee (Elicitation):

    • The Analogy: Imagine a detective (Interviewer) talking to a witness (Interviewee).
    • What happens: You give a vague idea (e.g., "I want a game"). The Interviewer AI asks the Interviewee AI a series of smart questions: "What are the rules? Who are the players? What happens if you lose?" The Interviewee answers in a structured way. This turns your vague wish into a detailed list of needs.
  2. The Analyst (Analysis):

    • The Analogy: An architect looking at the detective's notes and drawing a rough sketch.
    • What happens: The Interviewer AI takes all those answers and organizes them into a draft "Software Requirements Specification." It's like turning a messy list of wishes into a formal to-do list.
  3. The Specifier (Specification):

    • The Analogy: A translator who turns the architect's sketch into a strict, step-by-step instruction manual for the construction crew.
    • What happens: This agent (called CoTer) takes the draft and turns it into a "Chain of Thought."
      • If you are asking for software (like a game), it breaks the task down into a strict list of programming steps (e.g., "First, build the board. Second, add the pieces.").
      • If you are trying to improve the AI's own personality (System Prompt), it organizes the instructions into clear sections: "Who you are," "What you know," and "How you behave."
  4. The Critic (Validation):

    • The Analogy: A building inspector who checks the blueprint before construction begins.
    • What happens: This agent looks at the final instruction manual. It asks: "Is anything missing? Is it confusing? Does it contradict itself?" If the answer is "yes," it sends it back to the Specifier to fix it.

What They Tested (The Results)

The researchers didn't just talk about this; they built it and tested it in two main ways:

1. Improving the AI's "Job Description" (System Prompts)
They used a famous multi-agent system called MetaGPT (which is like a team of AI workers building software). They took the original "job descriptions" (prompts) for the team leaders and architects and ran them through REprompt.

  • The Result: The AI team produced much better documents (like project plans and design blueprints). When humans tested the actual software built from these plans, they were happier, found it easier to use, and felt the software was higher quality. It's like giving the construction crew a better blueprint, so the house doesn't have a leaky roof.

2. Improving Your Instructions (User Prompts)
They tested REprompt on a platform called YouWare, where people type simple requests to generate web apps.

  • The Result: When users typed simple things like "I want a snake game" or "I want a calculator," REprompt first "interviewed" the request to flesh out the details, then fed the improved instructions to the AI. The resulting games and tools were significantly better, more fun to play, and worked more smoothly than when users just typed the simple request directly.

The Takeaway

The paper claims that REprompt works because it forces the AI to slow down and think like a professional engineer. Instead of rushing to code, it first asks questions, organizes the plan, and checks for errors.

  • Without REprompt: You say "Build a house," and the robot builds a pile of bricks.
  • With REprompt: The robot asks, "What size? How many rooms? What style?" It writes a plan, checks the plan, and then builds a house that actually looks like what you wanted.

The study proves that by borrowing methods from human software engineering (Requirements Engineering), we can make AI agents much better at understanding and building software for us.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →