Autonomous Multi-Phase Software Architecture Execution with LLM Agents

cara · Healthcare · 2026 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Healthcare platform architecture execution

Cara needed to execute a large healthcare-platform architecture epic with many interdependent tickets while preserving clinical safety, compliance gates, code quality, and architectural intent.

Constraints:

Architecture

Cara used Claude Code with Opus 4.6 inside a RePPITS execution harness. The human architect designed a five-layer composable healthcare platform, planned 66 Linear tickets with dependencies and acceptance criteria, refined instruction/memory files, and gave the agent MCP-accessible research documents. Each ticket followed Research, Propose, Plan, Implement, Test, Secure. Agents ran in 19 parallel subagent batches for independent tickets, but every phase required tests, type-check, push, CI, Kubernetes verification, compliance checks, and combined-diff review before progress continued.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  human-domain-architect[Human domain architect] --> linear-ticket-epic[Linear ticket epic]
  human-domain-architect --> research-documents[Research documents]
  linear-ticket-epic --> claude-code-agent[Claude Code agent]
  claude-code-agent --> reppits-process[RePPITS process]
  file-based-memory[File-based memory] --> claude-code-agent
  claude-md-process-rules[CLAUDE.md process rules] --> claude-code-agent
  agents-md-technical-context[AGENTS.md technical context] --> claude-code-agent
  mcp-research-tools[MCP research tools] --> claude-code-agent
  research-documents --> mcp-research-tools
  claude-code-agent --> parallel-subagents[Parallel subagents]
  parallel-subagents --> combined-diff-review[Combined diff review]
  reppits-process --> compliance-and-security-gates[Compliance and security gates]
  combined-diff-review --> compliance-and-security-gates
  compliance-and-security-gates --> ci-and-kubernetes-verification[CI and Kubernetes verification]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Human domain architect Designs the architecture, plans tickets, and directs the agent using healthtech and software expertise. Linear ticket epic, Claude Code agent, Research documents
Linear ticket epic Contains 66 issues with blocking dependencies, interface definitions, and acceptance criteria. Human domain architect, Claude Code agent
Claude Code agent Executes the tickets through RePPITS, reads memory/context, spawns subagents, and updates code. Linear ticket epic, RePPITS process, File-based memory, CLAUDE.md process rules, AGENTS.md technical context, MCP research tools, Parallel subagents, Compliance and security gates, CI and Kubernetes verification
RePPITS process Mandatory ticket workflow: research, propose, plan, implement, test, secure. Claude Code agent, Compliance and security gates
File-based memory Stores durable correction rules that the agent reads at session start. Claude Code agent
CLAUDE.md process rules Defines the enforced implementation and verification sequence. Claude Code agent
AGENTS.md technical context Provides tech stack, project map, scaffold manifests, commands, and code style. Claude Code agent
MCP research tools Let the agent access research documents, S3 whitepapers, architecture docs, and EHR documentation. Claude Code agent, Research documents
Research documents Hold scaffold audits, maturity deep-dives, vendor strategy analyses, and whitepapers. Human domain architect, MCP research tools
Parallel subagents Execute independent tickets in batches of 2-5 agents. Claude Code agent, Combined diff review
Combined diff review Reviews integrated output from parallel agents to catch cross-agent security and integration issues. Parallel subagents, Compliance and security gates
Compliance and security gates Run healthcare compliance checks, security audits, tests, lint, type-checks, and phase verification. RePPITS process, Combined diff review, CI and Kubernetes verification
CI and Kubernetes verification Verifies CI and Kubernetes pods after each phase. Compliance and security gates

Data flow

The human domain expert first structured the codebase, refined instruction files, planned the epic, and created research documents. During execution, the agent reads memory rules, CLAUDE.md process rules, AGENTS.md technical context, Linear tickets, research docs, and MCP-accessible external sources. For each ticket it follows RePPITS, implements and tests, runs compliance/security gates, commits and verifies CI/Kubernetes, then updates trackers. Parallel subagent batches work independent features, after which the combined diff is reviewed before phase gates pass.

3 supporting quotes
“Every ticket followed RePPITS: Research the codebase and external sources, Propose two approaches, Plan concrete tasks, Implement, Test, then run healthcare compliance checks”article, stated
“CLAUDE.md defines process rules: the implementation sequence (implement → test → lint → review → secure → commit → push → verify CI → update tracker).”article, stated
“For independent tickets, the agent spawns 2–5 parallel subagents with precise prompts. The critical rule: after parallel work, review the COMBINED diff.”article, stated

Why this architecture

The setup treated the LLM as an execution engine inside a strict harness, not as the architect. Healthcare domain expertise produced the architecture, tickets, and safety decisions; RePPITS enforced process; memory preserved corrections across sessions; and combined-diff review caught issues that parallel subagents could not see individually. Deterministic clinical safety kept LLM proposals from making final routing decisions.

3 supporting quotes
“The AI executed the plan; the human designed it. * Research documents in Linear: scaffold audits, maturity deep-dives, vendor strategy analyses linked to the epic.”article, stated
“The agent cannot skip phases or commit without passing all gates. The Research phase extends beyond the codebase: fetching whitepapers from S3, analyzing cross-repo AWS architecture, reading EHR API documentation.”article, stated
“And the AI agent safety architecture was missing: LLMs were making clinical routing decisions that should have been deterministic.”article, stated

Models used: Claude Code · Opus 4.6 · GPT-5.4 · Gemini 3.1 Ultra

Scale

Alternatives considered (roads not taken)

Single-pass AI app generation

Rejected because: Enterprise healthcare apps need multi-phase discovery, architecture planning, gates, integrations, and compliance.

“Today, Cara generates apps in a single pass: describe what you want, the AI builds it, you iterate.”article, stated
“enterprise-grade production applications (20+ pages, multi-role auth, complex clinical workflows, EHR integrations, real compliance requirements) need the same multi-phase approach”article, stated

LLM decides clinical routing directly

Rejected because: Clinical routing decisions needed deterministic safety logic; LLMs can propose but code decides.

“And the AI agent safety architecture was missing: LLMs were making clinical routing decisions that should have been deterministic.”article, stated
“And a deterministic clinical safety engine where the LLM proposes but code decides, based on a published paper on failsafe medical triage agents.”article, stated

Parallel subagent self-review only

Rejected because: A prior SSRF vulnerability was invisible to one agent but caught only when the combined diff was reviewed.

“after parallel work, review the COMBINED diff”article, stated
“The vulnerability was introduced by one parallel agent and invisible to that agent’s review, but caught when the combined diff was reviewed holistically.”article, stated

Reactive coding without complete architecture first

Rejected because: The architecture, tickets, dependencies, and acceptance criteria were complete before implementation, avoiding mid-execution redesign.

“The architecture was complete before a single line was written. Three external model analyses synthesized with a published whitepaper on clinical safety.”article, stated
“Every ticket knew its place. No mid-execution redesigns. For independent tickets, the agent spawns 2–5 parallel subagents with precise prompts.”article, stated

Patterns

durable-execution (agentic)

File-based memory carries corrections across sessions and makes later sessions inherit prior lessons.

“The agent maintains a file-based memory system across sessions. Every correction becomes a durable rule.”article, stated
“Session n + 1 has every lesson from sessions 1 through n.”article, stated

multi-agent-orchestration (agentic)

Independent tickets are executed by 2-5 parallel subagents, then integrated through combined review.

“For independent tickets, the agent spawns 2–5 parallel subagents with precise prompts.”article, stated

guardrails-io-filtering (safety)

RePPITS gates enforce healthcare compliance, security review, and stop-fix-reverify behavior.

“The agent cannot skip phases or commit without passing all gates.”article, stated
“After each of 7 phases: full test suite, type-check, push, verify CI, verify Kubernetes pods.”article, stated

tool-use-orchestration (agentic)

The agent uses MCP tools, Linear tickets, S3 whitepapers, AWS architecture docs, EHR API docs, CI, and Kubernetes verification.

“The agent accessed these via MCP tools during execution.”article, stated
“fetching whitepapers from S3, analyzing cross-repo AWS architecture, reading EHR API documentation.”article, stated

human-in-the-loop-gate (governance)

Human domain expertise designed the architecture and remained responsible for clinical and architectural decisions.

“no translation layer between clinical compliance requirements and architectural decisions.”article, stated
“The AI executed the plan. It did not design the plan.”article, stated

Tradeoffs

Use LLMs for execution, not architecture ownership

Chose human-designed architecture with agent execution over agent-led architecture discovery during implementation.

Rationale: Healthcare and compliance decisions required domain expertise close to the problem.

“The architecture was complete before a single line was written.”article, stated
“The AI executed the plan. It did not design the plan.”article, stated

Run parallel subagents only with combined review

Chose 2-5 subagents plus holistic diff review over serial execution only or independent subagent self-review.

Rationale: Parallelism accelerates independent tickets, but integrated review catches vulnerabilities that local subagent reviews miss.

“For independent tickets, the agent spawns 2–5 parallel subagents with precise prompts.”article, stated
“after parallel work, review the COMBINED diff”article, stated

Separate workflow rules from technical context

Chose CLAUDE.md for process rules and AGENTS.md for technical context over one mutable instruction file for both process and project details.

Rationale: Updating scaffold technical context should not accidentally alter process enforcement.

“The separation matters: a new scaffold updates AGENTS.md without touching the workflow rules in CLAUDE.md”article, stated
“reducing the risk of accidentally modifying process enforcement during documentation updates.”article, stated

Gotchas (what bit them)

LLMs should not make final clinical routing decisions.

Root cause: Clinical safety requires deterministic boundaries and failsafe urgency logic.

Resolution: Cara implemented a deterministic clinical safety engine where the LLM proposes but code decides.

“LLMs were making clinical routing decisions that should have been deterministic.”article, stated
“a deterministic clinical safety engine where the LLM proposes but code decides”article, stated

Parallel agents can introduce integration-level vulnerabilities.

Root cause: A vulnerability introduced by one agent can be invisible from that agent's local review.

Resolution: The harness requires combined-diff review after parallel work.

“This rule exists because a real SSRF (Server-Side Request Forgery”article, stated
“caught when the combined diff was reviewed holistically.”article, stated

Tests can miss safety-critical boundary math.

Root cause: A max-risk boundary defaulted to the lowest urgency despite all tests passing.

Resolution: Structured review caught the math issue and fixed it immediately.

“maxRisk === 1.0 (highest danger score) defaulted to SELF_CARE_INFO_ONLY (lowest urgency). This passed all 536 tests.”article, stated
“The structured review caught it by reading the math.”article, stated

Autonomous execution was preparation-bound.

Root cause: The agent could execute quickly only after weeks of codebase structuring, instruction refinement, epic planning, and research preparation.

Resolution: The human prepared consistent boundaries, instructions, tickets, and research documents before the run.

“The autonomous execution was not spontaneous. Here is what it actually took:”article, stated
“Roughly 20–25 hours of preparation enabling the autonomous execution.”article, stated

Evaluation

The run was evaluated through test counts, phase gates, CI/Kubernetes verification, security audits, bug counts, deferred-item count, production incidents, and preparation metrics.

Metrics: 66 tickets across 2 repositories · 536 tests · under 4 hours autonomous execution · 2 full security audits · 2 safety-critical bugs and 8 other issues fixed immediately · zero deferred items · 0 CI failures · 1 production incident fixed in under 5 minutes

3 supporting quotes
“Two full security audits found 2 safety-critical bugs and 8 other issues, all fixed immediately, zero deferred.”article, stated
“66 tickets. 7 phases. 536 tests.∼20,000 lines. 19 parallel subagent batches.”article, stated
“\text{CI failures} & 0”article, stated

Outcomes

The source reports 66 tickets, 7 phases, 19 subagent batches, under 4 hours of execution, and about 20-25 hours of preparation.

3 supporting quotes
“shipped a composable** **5-layer architecture for a healthcare app platform”article, stated
“Everything described in this paper (the persistent memory, the structured workflow, the parallel agents, the phase gates, the security audits) can be offered directly to Cara users.”article, stated
“Cara would use the exact same methodology to build apps for doctors that was used to build Cara itself.”article, stated