This project demonstrates Spec-Driven Development (SDD) workflow leveraging Google Antigravity and Gemini although it is possible to use other AI tools such as Cursor, Windsurf or Github Co-pilot. The system automates the transition from high-level documentation to a fully functional Java-based application.
By ingesting a human-readable technical specification and a source reference (such as a medical triage PDF), the AI autonomously generates an implementation plan, builds the core codebase, and provides its own documentation with minimal human intervention. This shifts the developer's role from manual coding to high-level orchestration and system "nudging."
Crucially, the system is deterministic, meaning that once built it will always generate the same output for the same input. This is important for safety and reliability in critical environments.
Deterministic Business Rules: To ensure safety and reliability in critical environments, the system extracts logic into human-readable business rules. These rules are guaranteed to execute exactly as written by the AI Business Rules engine, effectively eliminating hallucinations.
Prompt-Based Evolution: Updates and UI enhancements—such as adding a GUI—are handled by refining the technical specification rather than direct code edits. This allows the system to refactor and expand while maintaining the integrity of the underlying logic.
Stakeholder Transparency: The platform includes a feature that allows the AI to explain what it has built in plain language. This bridges the gap between complex technical implementation and business-side understanding, allowing medical or domain experts to verify the logic.
-
Ingestion: Provide a 1-page technical spec and the source logic document (e.g., Triage rules).
-
Generation: Gemini "does its thing" to build the system, including the README and Java structure.
-
Extraction: Human-readable business rules are pulled from the PDF to ensure execution accuracy.
-
Refinement: Use natural language prompts to "nudge" the UI or functionality without manual coding.
The main branch shows the final result, after the Spec-Driven Development process is complete. If you want to see the "before" state (i.e. the 2-3 files we give the system as a starting point) , look at this branch - https://github.com/paulbrowne-irl/Auto-generate_Business_Rules/tree/Starting_spec)
IMPORTANT: Everything after this point is autogenerated as part of the SDD process.
A Java-based desktop application (Swing) that digitizes the National Emergency Medicine Programme Irish Children’s Triage System (ICTS). It parses PDF guidelines to generate executable business rules and provides a user-friendly GUI for triaging patients.
- PDF Rule Generation: Automatically extracts triage rules from the ICTS PDF (
spec/national-emergency-medicine-programme-irish-childrens-triage-system-icts.pdf). - GUI Interface: User-friendly Swing interface for:
- Generating rules.
- Simulating patient triage interactively.
- Visualizing results (Color-coded).
- Drools Rule Engine: Uses Apache KIE (Drools) to execute the generated rules logic.
- Java 21
- Maven
mvn clean packageStart the application from the command line (or double-click the jar if associated):
java -jar target/triage-system-1.0-SNAPSHOT.jarNote: This will launch a GUI window.
- Click "Generate Rules from PDF" to parse the PDF and create the rules.
- Check the status at the bottom.
- Patient Age: Enter the age.
- Symptom: Select a symptom from the dropdown. Click "Add Symptom".
- Triage Patient: Click to see the result (Priority and Color).
- Save Output: Save the current result to
triage_result.txt.
src/main/java/com/triage:TriageApplication.java: Spring Boot entry point (GUI Mode).ui/TriageGUI.java: Main Swing Window.service/: Backend logic.model/: Domain models.rules/: PDF Parser and Engine.
spec/: Source PDF.
