# Prompt Engineering for AIDE

DevFeed: [Prompt Engineering for AIDE](<https://devfeed.tech/articles/prompt-engineering-for-aide-30754.md>)

Original publisher: [Read original article](<http://blog.vanillajava.blog/2025/01/prompt-engineering-for-aide.html>)

Author: Peter Lawrey (noreply@blogger.com)

Published: 2025-01-04T07:11:00Z

Content type: tutorial

Language: en

Sources: [Vanilla Java](<https://devfeed.tech/sources/vanilla-java.md>)

Topics: [Prompt Engineering](<https://devfeed.tech/topics/prompt-engineering.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Code](<https://devfeed.tech/topics/code.md>), [Development](<https://devfeed.tech/topics/development.md>), [Requirements](<https://devfeed.tech/topics/requirements.md>), [Java](<https://devfeed.tech/topics/java.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [code](<https://devfeed.tech/tags/code.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [development](<https://devfeed.tech/tags/development.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [exercise](<https://devfeed.tech/tags/exercise.md>), [info](<https://devfeed.tech/tags/info.md>), [java](<https://devfeed.tech/tags/java.md>), [opinion](<https://devfeed.tech/tags/opinion.md>), [prompt](<https://devfeed.tech/tags/prompt.md>), [prompt-engineering](<https://devfeed.tech/tags/prompt-engineering.md>), [requirements](<https://devfeed.tech/tags/requirements.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

A tutorial on writing structured AsciiDoc requirements as prompts for AI-generated Java code in AIDE. It explains how to specify context, constraints, references, concurrency requirements, performance targets, error handling, and testing needs.

## Source excerpt

This article was AI-generated using this project as context. AIDE Project. The purpose of this project is to see how much an AI could generate given enough context, and in this project, all the "source" code is generated using the requirements and unit tests as context. This follows the Next-Level Development: Harnessing AI with AIDE approach. The main parts are: Requirements Documents in .adoc format. JUnit tests in Java. AIDE itself. AI-generated code in Java. Even the articles written about AIDE are part of the context for the AI. This article is about how to write requirements as a prompt for AI to generate code, seeded with AIDE in the context. Everything after this line is AI generated. Prompt engineering can differentiate between AI-driven code that works and genuinely excels. Drawing insights from real-world Java projects--especially those striving for low latency, high throughput, and clear domain logic--this article will show you how to shape AsciiDoc prompts to engage the AI more effectively. We'll also explore how these techniques fit neatly into AIDE's (Artificial Intelligence Development Environment) documentation-driven approach, building on the examples below. 0. Well-Formed Prompt Examples Strong prompts don't just request code; they specify context, constraints, references, and testing requirements. Below are refined examples of "good prompts" structured to deliver more domain-aligned code and documentation. 0.1 Concurrency-Safe Service Prompt = Concurrency-Safe Order Processor :context: high-throughput trading system We need a Java service that: * Accepts orders via a concurrent queue (Chronicle Queue recommended). * Processes up to 100,000 orders per second. * Ensures thread safety using optimised locking (or lock-free where practical). * Logs all failures (e.g., malformed orders) with a contextual message. Constraints: * Sub-100 µs end-to-end latency per order. * Must pass the existing `OrderProcessorTest` found in xref:order-tests.ad[Order Tests]