REprompt: Prompt Generation for Intelligent Software Development Guided by Requirements Engineering
Junjie Shi, Weisong Sun, Zhenpeng Chen, Zhujun Wu, Xiaohong Chen, Zhi Jin, Yang Liu
TL;DR
REprompt addresses the misalignment between vague user requirements and prompts for LLM-based software development by embedding requirements engineering into a four-phase prompt optimization workflow. It deploys four agents (Interviewee, Interviewer, CoTer, Critic) to elicit, analyze, specify, and validate prompts, producing both system prompts and user prompts as structured artifacts. Experiments on MetaGPT and YouWare show consistent improvements in PRD/SDD quality and end-user usability, with ablations highlighting the value of each RE phase. The approach demonstrates that grounding prompt generation in formal requirements processes yields more coherent, complete, and usable software artifacts across multiple foundation LLMs, suggesting practical benefits for AI-assisted software engineering.
Abstract
The rapid development of large language models is transforming software development. Beyond serving as code auto-completion tools in integrated development environments, large language models increasingly function as foundation models within coding agents in vibe-coding scenarios. In such settings, prompts play a central role in agent-based intelligent software development, as they not only guide the behavior of large language models but also serve as carriers of user requirements. Under the dominant conversational paradigm, prompts are typically divided into system prompts and user prompts. System prompts provide high-level instructions to steer model behavior and establish conversational context, while user prompts represent inputs and requirements provided by human users. Despite their importance, designing effective prompts remains challenging, as it requires expertise in both prompt engineering and software engineering, particularly requirements engineering. To reduce the burden of manual prompt construction, numerous automated prompt engineering methods have been proposed. However, most existing approaches neglect the methodological principles of requirements engineering, limiting their ability to generate artifacts that conform to formal requirement specifications in realistic software development scenarios. To address this gap, we propose REprompt, a multi-agent prompt optimization framework guided by requirements engineering. Experiment results demonstrate that REprompt effectively optimizes both system and user prompts by grounding prompt generation in requirements engineering principles.
