Skip to content

paulbrowne-irl/Auto-generate_Business_Rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Overview: AI-Automated Spec-Driven System

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.

Key Capabilities

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.

How It Works

  • 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.

Starting Spec

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)

Video Walk through of this project

100% accurate AI using Business Rules (Spec Driven Development)

IMPORTANT: Everything after this point is autogenerated as part of the SDD process.

Irish Children's Triage System (ICTS) - GUI Edition

Overview

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.

Features

  • 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.

Prerequisites

  • Java 21
  • Maven

Getting Started

1. Build the Application

mvn clean package

2. Run the Application

Start the application from the command line (or double-click the jar if associated):

java -jar target/triage-system-1.0-SNAPSHOT.jar

Note: This will launch a GUI window.

3. Usage

Setup Tab

  • Click "Generate Rules from PDF" to parse the PDF and create the rules.
  • Check the status at the bottom.

Triage Simulation Tab

  1. Patient Age: Enter the age.
  2. Symptom: Select a symptom from the dropdown. Click "Add Symptom".
  3. Triage Patient: Click to see the result (Priority and Color).
  4. Save Output: Save the current result to triage_result.txt.

Project Structure

  • 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.

About

Example Automating the extraction and generation of executable business rules from natural language documents using AI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors