Project xEMR demonstrates the successful use of advanced, automated AI systems to build a complex medical records platform that strictly adheres to all healthcare regulations. The intelligent Engineering (iE) approach fundamentally transformed the software development lifecycle by having AI agents handle 90% of the work, resulting in a 300% increase in engineer productivity.
October 2025

Background
The healthcare industry is bogged down with complex, time-consuming paperwork and tasks, and often the standard Electronic Medical Records (EMR) systems are part of the problem. That’s why we embarked on Project xEMR to build an AI-augmented EMR Extension platform. The purpose was to dramatically cut the administrative work for medical staff. Project xEMR is an AI layer that sits on top of existing EMR systems. It doesn’t replace them, only makes them smarter.
Document Intelligence for multi-format document ingestion with AI-powered summarization.
Clinical Data Extraction for the automated pulling of structured medical data.
AI-Assisted Document Generation for creating treatment plans, discharge papers, and other clinical documents.
The platform also features a Context-Aware Chat Interface, which offers a patient-specific conversational tool for healthcare providers, all while maintaining compliance with FHIR R4 and SNOMED CT for industry-standard healthcare data interoperability.
The project was initiated to achieve two core objectives:
A. Change the way we build software: Establish a new engineering approach centered on building an AI-powered EMR system where AI agents perform most of the work, significantly minimizing the reliance on traditional human-produced documents and code.
B. Create a reusable blueprint: Showcase and create a template for these AI agent-based workflows to prove they can transform the entire software development process, from initial research and planning to final implementation and deployment, by consistently applying AI assistance in every phase.
The Business Challenge
Project xEMR was designed to demonstrate how AI agents could be used powerfully across the entire project lifecycle to build a sophisticated healthcare EMR system, requiring far less human-created code and documentation. This initiative successfully showcased a modern,”AI-first” development approach, where AI-driven processes were seamlessly integrated throughout all stages: exploration, planning, architecture design, and implementation.
System Complexity
Project xEMR is a complex system due to several key technical and architectural requirements:
Healthcare Compliance: It strictly follows healthcare standards to ensure clinical accuracy and data sharing, which requires intricate data integration.
Advanced Architecture: The platform uses sophisticated design patterns like Domain-Driven Design (DDD), Command Query Responsibility Segregation (CQRS), and an Event-Driven approach. It is built as a Modular Monolith with a clear path to becoming microservices.
Modern Full-Stack: The system is built with a robust technology stack: Modern Python (3.13) with FastAPI for the backend, and Next.js 15, TypeScript, and React 19 for the frontend.
Cloud-Native Deployment: It’s designed for the cloud, deployed on AWS using Fargate ECS (serverless compute for containers). Deployment is automated using AWS CDK (Cloud Development Kit) for Infrastructure as Code (IaC).
Rigorous Testing: A comprehensive testing strategy is used to ensure quality, including pytest with testcontainers for backend integration and Vitest with Testing Library for the frontend, enforcing a Test-Driven Mindset and high test coverage.
The ‘intelligent Engineering’ Approach
The intelligent Engineering (iE) approach implements an AI-first methodology by following a structured, two-step process. This process first shapes the AI, establishing a foundational agentic workflow through six critical components that engineer comprehensive context and prompts, drive specifications-driven development, and integrate a robust tools ecosystem. It then collaborates with and leads the AI, utilizing a replicable framework that guides the agents effectively through the Explore, Plan, and Implement phases of the software development lifecycle.

Step 1: Shaping the AI
The first step was crucial for establishing the Agentic Workflow and core development standards. This involved setting up with the custom Agentic Workflow, prompt engineering at the meta and project levels, providing the necessary technical and business context, and implementing the specifications-driven and test-driven development approaches along with the relevant tools ecosystem. The six core components for “Step 1: Shaping the AI” in the intelligent Engineering (iE) approach, which establishes the foundational agentic workflow, are:
1. Agentic Workflow
A custom, four-phase development cycle tailored to the problem, covering Explore (deep research), Plan++ (feature breakdown/story creation), Implementation (code generation), and Testing (automated generation and validation).
2. Prompt Engineering
The use of a multi-layered prompting strategy, including a Meta Prompt Library (organizational standards), Project-Specific Prompts (task guidance), and Slash Commands (workflow automation).
3. Context Engineering
Providing AI agents with essential Technical Context (architecture, design patterns) and Business Context (domain-specific specs and clinical standards) for effective assistance.
4. Specifications-Driven Development
A structured process utilizing templates, such as Feature Templates and Story Templates, and Architecture Decision Documents (ADRs) to manage and formalize the development specifications.
5. Test-Driven Approach
A mandated practice for quality assurance, focused on high test coverage and clinical accuracy using tools.
6. Tools Ecosystem
The integration of specialized tools to drive efficiency, including Claude Code (primary AI assistant), MCP (context and tool management), GitHub Projects (project management), and Tach (dependency enforcement).
Step 2: Collaborate with and Lead the AI
This step executes the Agentic AI approach via a replicable framework structured around the Explore, Plan, and Implement phases. This framework empowers developers to effectively guide AI agents through the entire software development lifecycle, ensuring templates are successfully applied for coding, testing, and deployment.
Phase 1: Explore
This phase focuses on generating feature specifications by building deep domain understanding. It involves a Deep Research Agent conducting comprehensive research (e.g., healthcare standards), holding Q&A Brainstorming Sessions, and concluding with the creation of Detailed Feature Specifications. This utilizes tools like ChatGPT Deep Research, Claude, and the custom prompt: /generate-prompt:feature-exploration.
Phase 2: Plan
This phase manages feature-to-story breakdown and the project management workflow, beginning with Feature Analysis to decompose high-level features into implementable stories. This leads to Story Creation, which generates detailed, validated specifications (including acceptance criteria and a “Definition of done”). These specifications are then managed and tracked in GitHub Projects, with the process leveraging the GitHub Project manager agent and custom prompts: /generate-prompt:create-story-and-features, and /verify:story-spec-validation.
Phase 3: Implement
This phase realizes the story with strict adherence to code guidelines and continuous feedback loops. Story Implementation involves AI agents coding in adherence to established architectural patterns. This is coupled with Iterative Code Guideline Generation, automated Testing for quality assurance, and an initial AI-powered Code Review before human developer validation.
Implementation Workflow

The Key Implementation Features are designed to enhance developer workflow and maintain code integrity. The system provides Pause/Resume capabilities using the custom slash commands /implement:pause-story and /implement:resume-story, which are crucial for preserving the context of the AI agents’ work. Code Quality is automatically enforced by integrating tools such as ruff, pyright, and ESLint into the workflow. Finally, a rigorous Testing approach is maintained, where the command just check is mandated to run all tests before a commit can be made.
Technical Architecture
The system design is based on a Modular Monolith Architecture Pattern with a clear migration path to microservices. This design adheres to a set of core principles: DDD is employed for modeling the core business logic; CQRS separates read and update operations for optimized performance and scalability; an Event-Driven Architecture ensures decoupled, asynchronous processing between system components; and Hexagonal Architecture (Ports and Adapters) is utilized to create clear boundaries and isolate the core domain logic from external infrastructure dependencies.
Backend Architecture

Technology Stack
Language: Python 3.13
Framework: FastAPI
Database: PostgreSQL (via Supabase)
Authentication: Supabase Auth
Event Bus: Supabase Realtime
Testing: pytest, testcontainers
Code Quality: ruff, pyright
Frontend Architecture

Technology Stack
Framework: Next.js 15 with App Router
Language: TypeScript + React 19
UI: shadcn/ui, Tailwind CSS
State Management: Redux Toolkit, React Query
Testing: Vitest, Testing Library
Infrastructure
Cloud Provider: AWS
IaC: AWS CDK
Compute: Fargate (ECS)
Load Balancing: Application Load Balancer
Networking: VPC with public/private subnets
Event-Driven Architecture
The Event-Driven Architecture (EDA) for Project xEMR is built upon a foundation of four core concepts, which define how the system components communicate and process information:
• Events are defined as immutable facts that record what has happened within the system, such as a file being processed (e.g., DOCUMENT_UPLOADED).
• Actions are the specific tasks that need to be completed, typically in response to an event, for example, the task to (EXTRACT_DATA_FROM_DOCUMENT).
• Commands are direct instructions issued to a part of the system, such as telling a process to start (START_DOCUMENT_PROCESSING).
• Workflows are the predefined sequences of these actions and commands that can be either automated entirely by the system or initiated and guided by the user.
Communication Patterns
Within the Event-Driven Architecture, two distinct communication patterns are utilized. Synchronous communication involves direct calls that flow through the Application Layer, which are reserved for immediate responses. Conversely, Asynchronous communication is event-driven, enabling decoupled processing between system components, primarily facilitated via the Supabase Realtime service.
Lessons Learned
Project xEMR stands as a clear demonstration of the profound impact Agentic AI workflows can have, successfully handling 90% of the specifications, stories, code, tests, and implementation. This significant automation resulted in a remarkable 300% increase in productivity per engineer and yielded ancillary benefits, including better architecture and higher quality documentation. The project formalized key lessons and agreed-upon best practices that acted as crucial quality guardrails:
Structured Workflows and Context
The development process mandated Structured Workflows (Explore, Plan, Implement), anchored by the principles to Always Start with Exploration to build domain understanding and enforce Specifications Before Implementation. This established validated story specifications as the single source of truth for AI implementation prompts, supported by comprehensive Context Management and Documentation-Driven Development (using ADRs).
Quality and Accountability
To maintain code quality and clinical accuracy, a Test-Driven Mindset was mandatory, demanding high coverage and robust integration testing. This was paired with Iterative Code Guideline Development based on continuous feedback. The paramount practice, however, is Human Owns the Output, which dictates that a human must review every AI-Generated Change, ensuring human judgment and critical thinking always supersede automation.
Tooling
Success required seamless Tool Integration across the development lifecycle, coupled with the practice of Structured Commits and PRs (conventional format, AI auto-generated summaries, and “Generated with Claude Code” attribution).
Conclusion
Project xEMR confirms the future of software development: AI agents handle routine tasks and boilerplate, freeing developers to focus on architecture, business logic, and innovation. The core lesson is clear, the question is no longer ‘if AI will transform software’, but ‘how quickly’ teams can adapt. The key takeaways for leveraging this advantage are:
AI as a Force Multiplier: Amplifying developer capabilities rather than replacing them.
Context is King: Comprehensive context engineering is critical for intelligent assistance.
Structure Enables Scale: Using repeatable meta prompts, templates, and workflows makes AI assistance scalable.
Feedback Loops Matter: Continuous refinement of guidelines and prompts ensures quality and adaptation.
Robust Tools Ecosystem: Seamless integration across existing tools like Git, GitHub, and IDEs is essential for success.