<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Karthi Mahadevan</title>
    <description>The latest articles on DEV Community by Karthi Mahadevan (@mkarthiatgithub).</description>
    <link>https://dev.to/mkarthiatgithub</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F921222%2F8bc36a20-9112-4260-8c0f-22c5f8b2c131.jpeg</url>
      <title>DEV Community: Karthi Mahadevan</title>
      <link>https://dev.to/mkarthiatgithub</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mkarthiatgithub"/>
    <language>en</language>
    <item>
      <title>Specification: Agentic Docs-as-Code Architecture Pipeline</title>
      <dc:creator>Karthi Mahadevan</dc:creator>
      <pubDate>Sun, 04 Oct 2026 21:24:31 +0000</pubDate>
      <link>https://dev.to/mkarthiatgithub/specification-agentic-docs-as-code-architecture-pipeline-558a</link>
      <guid>https://dev.to/mkarthiatgithub/specification-agentic-docs-as-code-architecture-pipeline-558a</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;This specification establishes an automated, agent-driven software architecture documentation ecosystem. The framework integrates strict structural standards, controlled natural language rules, and autonomous AI maintenance patterns into a unified, version-controlled pipeline.&lt;/p&gt;




&lt;h2&gt;
  
  
  Core Pillars
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Structural Standard (arc42 &amp;amp; C4 Model)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;System Decomposition:&lt;/strong&gt; All documentation follows the hierarchical arc42 architecture template, ensuring complete coverage from business goals down to deployment views and quality requirements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visualizations:&lt;/strong&gt; The C4 model (Context, Containers, Component, Code) is embedded directly into source files using Mermaid.js or Structurizr DSL to maintain living visual artifacts alongside text.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Linguistic Standard (ASD-STE100)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Controlled Vocabulary:&lt;/strong&gt; All documentation must adhere to ASD-STE100 (Simplified Technical English) principles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clarity Constraints:&lt;/strong&gt; Sentences remain concise, active voice is strictly enforced, and synonyms are eliminated to ensure absolute zero ambiguity for both human readers and machine interpreters.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Agentic Maintenance Pattern (Karpathy-Style Workflow)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Living Codebase Model:&lt;/strong&gt; Documentation is treated as a compiled artifact maintained primarily by AI coding agents rather than manual wiki updates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repository Governance:&lt;/strong&gt; A root-level configuration file (&lt;code&gt;AGENTS.md&lt;/code&gt; or &lt;code&gt;CLAUDE.md&lt;/code&gt;) acts as the compiler rulebook, dictating formatting, terminology, and structural constraints to any interacting AI agent.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Operational Workflow
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Storage:&lt;/strong&gt; Plain-text documentation sources (AsciiDoc or Markdown) reside in a version-controlled repository structured according to arc42 layouts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Execution:&lt;/strong&gt; Architectural changes trigger targeted agentic instructions. Agents read repository guardrails, update affected multi-file documentation blocks, log corresponding Architecture Decision Records (ADRs), and refresh C4 diagrams in a single pass.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Publishing:&lt;/strong&gt; CI/CD automation compiles the source files into a static architecture portal on every commit.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>agents</category>
      <category>architecture</category>
      <category>automation</category>
      <category>documentation</category>
    </item>
    <item>
      <title>final quality gate</title>
      <dc:creator>Karthi Mahadevan</dc:creator>
      <pubDate>Sun, 04 Oct 2026 12:53:10 +0000</pubDate>
      <link>https://dev.to/mkarthiatgithub/final-quality-gate-519f</link>
      <guid>https://dev.to/mkarthiatgithub/final-quality-gate-519f</guid>
      <description>&lt;p&gt;Yes. Step 5 is the &lt;strong&gt;final quality gate&lt;/strong&gt; before we allow the system to generate the project-level architecture document.&lt;/p&gt;

&lt;p&gt;There is one important difference from Step 2:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 2:&lt;/strong&gt; Is one repository's extracted architecture trustworthy?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 5:&lt;/strong&gt; Is the &lt;strong&gt;combined project architecture&lt;/strong&gt; trustworthy?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the complete pipeline is now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;100 Repositories
      ↓
1. Extraction
      ↓
100 Architecture Evidence Models
      ↓
2. Repository Validation
      ↓
100 Validated Models
      ↓
3. Repository Documentation
      ↓
100 Repository Architecture Documents
      ↓
4. Project Aggregation
      ↓
Project Architecture Model
      ↓
5. PROJECT VALIDATION
      ↓
Validated Project Architecture Model
      ↓
Project Documentation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save this as &lt;strong&gt;&lt;code&gt;05-project-validation.md&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 5 — Project Architecture Validation
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Purpose
&lt;/h2&gt;

&lt;p&gt;Validate the Project Architecture Model produced by Step 4.&lt;/p&gt;

&lt;p&gt;This is the final architecture quality gate before project-level architecture documentation is generated.&lt;/p&gt;

&lt;p&gt;The objective is to determine whether the aggregated project architecture is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;accurate&lt;/li&gt;
&lt;li&gt;internally consistent&lt;/li&gt;
&lt;li&gt;traceable to repository evidence&lt;/li&gt;
&lt;li&gt;sufficiently complete&lt;/li&gt;
&lt;li&gt;correctly scoped&lt;/li&gt;
&lt;li&gt;free from unsupported architectural conclusions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not generate the final project architecture documentation.&lt;/p&gt;

&lt;p&gt;Do not silently correct the Project Architecture Model.&lt;/p&gt;

&lt;p&gt;Identify problems and provide explicit correction requirements.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. Validation Principle
&lt;/h1&gt;

&lt;p&gt;The project architecture must be derived from validated repository evidence.&lt;/p&gt;

&lt;p&gt;The Project Architecture Model must not become more certain than its source evidence.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="g8a0yh"&lt;br&gt;
Repository A:&lt;br&gt;
Payment Service produces event X.&lt;/p&gt;

&lt;p&gt;Repository B:&lt;br&gt;
Inventory Service consumes event X.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


supports:



```text id="v7kwba"
Payment Service → event X → Inventory Service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;It does not automatically support:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="7o0n3j"&lt;br&gt;
The project implements a formal Saga.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


Additional evidence is required for that conclusion.

---

# 2. Final Validation Status

Return one status:



```text id="26l0xi"
PASS
PASS_WITH_WARNINGS
FAIL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  PASS
&lt;/h3&gt;

&lt;p&gt;The Project Architecture Model is sufficiently reliable for project documentation.&lt;/p&gt;
&lt;h3&gt;
  
  
  PASS_WITH_WARNINGS
&lt;/h3&gt;

&lt;p&gt;The model is usable, but known limitations or unresolved areas must be carried into the final documentation.&lt;/p&gt;
&lt;h3&gt;
  
  
  FAIL
&lt;/h3&gt;

&lt;p&gt;The model contains significant contradictions, unsupported relationships, identity problems, or architecture claims that could make the project documentation misleading.&lt;/p&gt;


&lt;h1&gt;
  
  
  3. Repository Coverage Validation
&lt;/h1&gt;

&lt;p&gt;Confirm that the aggregation includes all intended repositories.&lt;/p&gt;

&lt;p&gt;Compare:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;expected repository inventory&lt;/li&gt;
&lt;li&gt;supplied repository models&lt;/li&gt;
&lt;li&gt;aggregated repositories&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;missing repositories&lt;/li&gt;
&lt;li&gt;duplicate repositories&lt;/li&gt;
&lt;li&gt;repositories with failed validation&lt;/li&gt;
&lt;li&gt;repositories with incomplete extraction&lt;/li&gt;
&lt;li&gt;repositories whose purpose is unresolved&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For every missing repository record:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Repository:
Expected:
Present:
Reason:
Impact:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not assume a missing repository is irrelevant.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Source Traceability Validation
&lt;/h1&gt;

&lt;p&gt;Every significant project-level fact must be traceable to repository-level evidence.&lt;/p&gt;

&lt;p&gt;For each important relationship identify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Project Fact
    ↓
Repository Evidence
    ↓
Source Location
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Project relationship:
Order Service produces order.created.

Supporting repository:
order-service

Source evidence:
src/events/OrderCreatedPublisher.java

Classification:
Verified
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Flag project-level facts that have no identifiable source evidence.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. Entity Identity Validation
&lt;/h1&gt;

&lt;p&gt;Validate the canonical entity model.&lt;/p&gt;

&lt;p&gt;Check for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;duplicate services&lt;/li&gt;
&lt;li&gt;duplicate APIs&lt;/li&gt;
&lt;li&gt;duplicate topics&lt;/li&gt;
&lt;li&gt;duplicate databases&lt;/li&gt;
&lt;li&gt;duplicate external systems&lt;/li&gt;
&lt;li&gt;incorrect entity merges&lt;/li&gt;
&lt;li&gt;entities incorrectly split into multiple identities&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="7suw6e"&lt;br&gt;
PaymentService&lt;br&gt;
payment-service&lt;br&gt;
Payment Service&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


Determine whether these represent:

* the same service
* different services
* unresolved identity

Do not merge entities only because their names are similar.

---

# 6. Repository Boundary Validation

Confirm that every service, component and dependency retains its originating repository.

Check:



```text id="h8k3vv"
Repository
    ↓
Service
    ↓
Component
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Flag entities whose ownership cannot be established.&lt;/p&gt;

&lt;p&gt;This is important because repository ownership is required for future maintenance and architecture analysis.&lt;/p&gt;


&lt;h1&gt;
  
  
  7. Service Dependency Validation
&lt;/h1&gt;

&lt;p&gt;Validate every service-to-service relationship.&lt;/p&gt;

&lt;p&gt;For each:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="b0r7me"&lt;br&gt;
Source Service&lt;br&gt;
    ↓&lt;br&gt;
Interaction&lt;br&gt;
    ↓&lt;br&gt;
Target Service&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


verify:

* source exists
* target exists
* interaction is supported
* technology is correct
* direction is correct
* evidence exists
* relationship is not duplicated incorrectly

Classify relationships:

* `Verified`
* `Inferred`
* `Unknown`

---

# 8. API Relationship Validation

Validate project-wide API relationships.

For each API:



```text id="q6v8ta"
Provider
    ↓
API
    ↓
Consumer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;provider exists&lt;/li&gt;
&lt;li&gt;API exists&lt;/li&gt;
&lt;li&gt;consumer exists&lt;/li&gt;
&lt;li&gt;endpoint matches&lt;/li&gt;
&lt;li&gt;protocol matches&lt;/li&gt;
&lt;li&gt;direction matches&lt;/li&gt;
&lt;li&gt;evidence exists&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Where only one side is known, do not invent the other side.&lt;/p&gt;

&lt;p&gt;Use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Provider confirmed; consumer unknown&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;or:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Consumer confirmed; provider unknown&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;where appropriate.&lt;/p&gt;


&lt;h1&gt;
  
  
  9. Messaging Architecture Validation
&lt;/h1&gt;

&lt;p&gt;Perform a detailed validation of:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="f9ntpw"&lt;br&gt;
Producer&lt;br&gt;
    ↓&lt;br&gt;
Event&lt;br&gt;
    ↓&lt;br&gt;
Topic / Queue&lt;br&gt;
    ↓&lt;br&gt;
Consumer&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


For each relationship verify:

* producer
* event/message
* topic/queue
* consumer
* technology
* schema where available
* evidence

Check for:

### Orphaned producers

Producer exists but no consumer is identified.

### Orphaned consumers

Consumer exists but no producer is identified.

### Topic conflicts

Different repositories define the same topic differently.

### Event conflicts

The same event name appears with incompatible structures.

### Ownership conflicts

Different repositories appear to own the same event/topic.

### External boundaries

The missing producer/consumer may be an external system.

Do not automatically classify an orphan as an error.

---

# 10. Contract Consistency Validation

Compare contracts across repositories.

Check:

* API paths
* HTTP methods
* request structures
* response structures
* event names
* event schemas
* topic names
* queue names
* message fields
* versioning

Look for mismatches.

Example:



```text id="z9of6g"
Producer:
customerId

Consumer:
customer_id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Record:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Contract inconsistency
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not decide that the consumer is wrong without evidence.&lt;/p&gt;




&lt;h1&gt;
  
  
  11. Data Architecture Validation
&lt;/h1&gt;

&lt;p&gt;Validate project-wide data relationships.&lt;/p&gt;

&lt;p&gt;For every important datastore:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="1y8e5a"&lt;br&gt;
Service&lt;br&gt;
    ↓&lt;br&gt;
Read / Write&lt;br&gt;
    ↓&lt;br&gt;
Database&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


Check:

* datastore identity
* technology
* owning repository
* services accessing it
* read/write behaviour
* evidence

Identify shared databases.

Do not automatically classify shared database access as a defect.

Record it as an architecture characteristic.

---

# 12. External System Validation

Validate external-system relationships.

Check whether systems classified as external are actually:

* external systems
* internal project services
* shared platform services
* third-party services
* unresolved

Check:

* interaction direction
* protocol
* service relationship
* authentication
* evidence

Do not infer external ownership from names alone.

---

# 13. End-to-End Flow Validation

Validate each reconstructed cross-service flow.

For every flow check:



```text id="mt8d47"
Trigger
   ↓
Service
   ↓
Interaction
   ↓
Service
   ↓
Persistence / Messaging
   ↓
Output
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Verify every transition.&lt;/p&gt;

&lt;p&gt;Identify whether each interaction is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;synchronous&lt;/li&gt;
&lt;li&gt;asynchronous&lt;/li&gt;
&lt;li&gt;scheduled&lt;/li&gt;
&lt;li&gt;mixed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Flag flows where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a transition has no evidence&lt;/li&gt;
&lt;li&gt;service order is incorrect&lt;/li&gt;
&lt;li&gt;messaging direction is incorrect&lt;/li&gt;
&lt;li&gt;a synchronous interaction is shown as asynchronous&lt;/li&gt;
&lt;li&gt;an asynchronous interaction is shown as synchronous&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;
  
  
  14. Architecture Pattern Validation
&lt;/h1&gt;

&lt;p&gt;This is a major quality gate.&lt;/p&gt;

&lt;p&gt;Do not accept project-level architecture patterns simply because several repositories use related technologies.&lt;/p&gt;

&lt;p&gt;Evaluate each pattern independently.&lt;/p&gt;
&lt;h2&gt;
  
  
  Event-Driven Architecture
&lt;/h2&gt;

&lt;p&gt;Require evidence of meaningful event-driven integration across the project.&lt;/p&gt;

&lt;p&gt;Kafka alone is insufficient.&lt;/p&gt;
&lt;h2&gt;
  
  
  Saga
&lt;/h2&gt;

&lt;p&gt;Require evidence of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;distributed business transaction&lt;/li&gt;
&lt;li&gt;multiple participating services&lt;/li&gt;
&lt;li&gt;state progression&lt;/li&gt;
&lt;li&gt;orchestration or choreography&lt;/li&gt;
&lt;li&gt;compensation/recovery where required&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Multiple Kafka consumers are insufficient.&lt;/p&gt;
&lt;h2&gt;
  
  
  Saga Choreography
&lt;/h2&gt;

&lt;p&gt;Require evidence that services react to events and independently determine subsequent actions.&lt;/p&gt;
&lt;h2&gt;
  
  
  Saga Orchestration
&lt;/h2&gt;

&lt;p&gt;Require evidence of a central coordinator controlling the distributed transaction.&lt;/p&gt;
&lt;h2&gt;
  
  
  Outbox
&lt;/h2&gt;

&lt;p&gt;Require evidence of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;business state persistence&lt;/li&gt;
&lt;li&gt;event persistence&lt;/li&gt;
&lt;li&gt;transactional coupling&lt;/li&gt;
&lt;li&gt;relay/publisher&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  CQRS
&lt;/h2&gt;

&lt;p&gt;Require meaningful separation of command and query responsibilities.&lt;/p&gt;
&lt;h2&gt;
  
  
  API Gateway
&lt;/h2&gt;

&lt;p&gt;Require evidence of a gateway serving as a controlled entry point to multiple services.&lt;/p&gt;
&lt;h2&gt;
  
  
  Circuit Breaker
&lt;/h2&gt;

&lt;p&gt;Require actual implementation or configuration.&lt;/p&gt;
&lt;h2&gt;
  
  
  Idempotent Consumer
&lt;/h2&gt;

&lt;p&gt;Require evidence of duplicate detection or idempotent processing.&lt;/p&gt;

&lt;p&gt;For each project-level pattern produce:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Evidence&lt;/th&gt;
&lt;th&gt;Supporting Repositories&lt;/th&gt;
&lt;th&gt;Scope&lt;/th&gt;
&lt;th&gt;Confidence&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Possible results:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Confirmed&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Possible&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Not established&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;
  
  
  15. Project Architecture Scope Validation
&lt;/h1&gt;

&lt;p&gt;Do not allow local architecture characteristics to become project-wide claims without sufficient evidence.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Repository A:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="3f3p5b"&lt;br&gt;
Uses Hexagonal Architecture.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


Valid project conclusion:



```text id="4ch0ms"
Payment Service uses a Hexagonal Architecture approach.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Invalid project conclusion:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="4zyw2k"&lt;br&gt;
The entire project uses Hexagonal Architecture.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


unless other evidence supports project-wide adoption.

Record the correct scope:

* repository
* service
* subsystem
* project-wide

---

# 16. Business Capability Validation

Validate business capability groupings.

Check whether each service-to-capability mapping is supported by:

* repository documentation
* source naming
* domain concepts
* APIs
* events
* business documentation

Do not infer a business capability solely from a service name when the meaning is uncertain.

Use:

`Business capability not established`

where necessary.

---

# 17. Project Architecture Pattern Consistency

Check whether different repositories claim incompatible architectural patterns.

Examples:



```text id="q21p1k"
Repository A:
event-driven

Repository B:
synchronous REST

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This is not automatically a contradiction.&lt;/p&gt;

&lt;p&gt;The project may intentionally use both.&lt;/p&gt;

&lt;p&gt;Instead determine whether the project architecture is:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="l1b8fi"&lt;br&gt;
Predominantly synchronous&lt;br&gt;
Predominantly asynchronous&lt;br&gt;
Mixed synchronous/asynchronous&lt;br&gt;
Unknown&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


Similarly, different services may legitimately use different internal architecture patterns.

Do not force uniformity where the evidence shows architectural diversity.

---

# 18. Dependency Graph Integrity

Validate the complete project dependency graph.

Check:

* every source exists
* every target exists
* every relationship has evidence
* no impossible cycles are introduced
* duplicate relationships are consolidated
* external nodes are clearly identified
* unresolved nodes remain visible

Do not assume a cycle is an error.

A cycle may be a legitimate architecture characteristic.

Record it for architectural analysis.

---

# 19. High-Centrality Service Validation

Identify services that have many dependencies.

Examples:



```text id="k9q1l3"
Service A
    ↓
12 downstream dependencies
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;These services may be architecturally significant.&lt;/p&gt;

&lt;p&gt;Do not automatically classify them as problems.&lt;/p&gt;

&lt;p&gt;Record:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Observation:
Service A has a high number of incoming/outgoing relationships.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final documentation may use this information to explain architectural concentration or coupling.&lt;/p&gt;




&lt;h1&gt;
  
  
  20. Shared Resource Validation
&lt;/h1&gt;

&lt;p&gt;Identify shared resources such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;databases&lt;/li&gt;
&lt;li&gt;queues&lt;/li&gt;
&lt;li&gt;topics&lt;/li&gt;
&lt;li&gt;APIs&lt;/li&gt;
&lt;li&gt;shared libraries&lt;/li&gt;
&lt;li&gt;configuration&lt;/li&gt;
&lt;li&gt;infrastructure services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For each record:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="6k7grw"&lt;br&gt;
Resource&lt;br&gt;
Consumers&lt;br&gt;
Producers&lt;br&gt;
Repositories&lt;br&gt;
Evidence&lt;br&gt;
Confidence&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


Look for:

* shared database access
* shared topic ownership
* shared infrastructure dependencies
* shared configuration dependencies

Do not label sharing as good or bad without further architectural analysis.

---

# 21. Contradiction Resolution

Review every contradiction discovered during Step 4.

For each:



```text id="m0v0t4"
Contradiction:
...

Evidence A:
...

Evidence B:
...

Resolution:
Resolved / Unresolved

Reason:
...

Impact:
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Possible resolution outcomes:&lt;/p&gt;
&lt;h3&gt;
  
  
  Resolved
&lt;/h3&gt;

&lt;p&gt;Evidence clearly supports one interpretation.&lt;/p&gt;
&lt;h3&gt;
  
  
  Unresolved
&lt;/h3&gt;

&lt;p&gt;Evidence does not allow a reliable conclusion.&lt;/p&gt;
&lt;h3&gt;
  
  
  External Information Required
&lt;/h3&gt;

&lt;p&gt;Repository evidence is insufficient.&lt;/p&gt;

&lt;p&gt;Never resolve a contradiction merely because one interpretation appears more likely.&lt;/p&gt;


&lt;h1&gt;
  
  
  22. Missing Information Validation
&lt;/h1&gt;

&lt;p&gt;Review all project unknowns.&lt;/p&gt;

&lt;p&gt;Classify them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Acceptable Unknown&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Documentation Gap&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Architecture Gap&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;External Information Required&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Critical Unknown&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="0c3sg4"&lt;br&gt;
Business ownership unknown.&lt;/p&gt;

&lt;p&gt;Runtime production topology unknown.&lt;/p&gt;

&lt;p&gt;External system contract unavailable.&lt;/p&gt;

&lt;p&gt;Topic ownership unresolved.&lt;/p&gt;

&lt;p&gt;Disaster recovery architecture not present in repositories.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


Do not remove unknowns merely to make the project architecture appear complete.

---

# 23. Architecture Completeness Check

Determine whether the Project Architecture Model contains sufficient information to explain:

### System

* what the project contains
* major services
* external systems

### Application

* service interactions
* APIs
* events
* databases
* major flows

### Platform

* deployment
* infrastructure
* networking where known
* security
* observability

### Operational

* resilience
* failure handling
* deployment mechanisms

### Cross-cutting

* major architecture patterns
* dependencies
* shared resources

If an area is not represented, classify it as:

* not present
* not established
* missing

---

# 24. Evidence Coverage Score

Calculate an evidence coverage assessment.

Classify significant project architecture facts as:

* directly verified
* inferred
* unknown

Report:



```text id="nyy7s9"
Verified:
...

Inferred:
...

Unknown:
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Do not create a misleading numerical score unless the evidence model supports reliable calculation.&lt;/p&gt;

&lt;p&gt;The purpose is to communicate confidence, not create false precision.&lt;/p&gt;


&lt;h1&gt;
  
  
  25. Final Hallucination Check
&lt;/h1&gt;

&lt;p&gt;Ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Could any project-level conclusion have been produced from generic architecture knowledge rather than repository evidence?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Review especially:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;business architecture&lt;/li&gt;
&lt;li&gt;architecture patterns&lt;/li&gt;
&lt;li&gt;scalability&lt;/li&gt;
&lt;li&gt;availability&lt;/li&gt;
&lt;li&gt;resilience&lt;/li&gt;
&lt;li&gt;security&lt;/li&gt;
&lt;li&gt;data ownership&lt;/li&gt;
&lt;li&gt;system ownership&lt;/li&gt;
&lt;li&gt;production topology&lt;/li&gt;
&lt;li&gt;disaster recovery&lt;/li&gt;
&lt;li&gt;compliance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remove or downgrade unsupported conclusions.&lt;/p&gt;


&lt;h1&gt;
  
  
  26. Project Documentation Readiness
&lt;/h1&gt;

&lt;p&gt;The Project Architecture Model is ready for final documentation only when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;all intended repositories are accounted for&lt;/li&gt;
&lt;li&gt;repository identities are stable&lt;/li&gt;
&lt;li&gt;major services are identified&lt;/li&gt;
&lt;li&gt;significant relationships have evidence&lt;/li&gt;
&lt;li&gt;API relationships are validated&lt;/li&gt;
&lt;li&gt;messaging relationships are validated&lt;/li&gt;
&lt;li&gt;database relationships are validated&lt;/li&gt;
&lt;li&gt;cross-service flows are validated&lt;/li&gt;
&lt;li&gt;contradictions are resolved or explicitly recorded&lt;/li&gt;
&lt;li&gt;project-level patterns are evidence-based&lt;/li&gt;
&lt;li&gt;business capability claims are appropriately scoped&lt;/li&gt;
&lt;li&gt;unknowns are preserved&lt;/li&gt;
&lt;li&gt;project-wide claims are not derived from local evidence without justification&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;
  
  
  27. Final Findings
&lt;/h1&gt;

&lt;p&gt;Produce a findings table.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Severity&lt;/th&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Finding&lt;/th&gt;
&lt;th&gt;Evidence&lt;/th&gt;
&lt;th&gt;Required Action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Severity:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Critical&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;High&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Medium&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Low&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Informational&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;
  
  
  28. Final Decision
&lt;/h1&gt;

&lt;p&gt;Return:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="5p9m1h"&lt;br&gt;
PROJECT VALIDATION STATUS:&lt;br&gt;
PASS&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


or:



```text id="8o5l2b"
PROJECT VALIDATION STATUS:
PASS_WITH_WARNINGS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="0tvjbb"&lt;br&gt;
PROJECT VALIDATION STATUS:&lt;br&gt;
FAIL&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


### PASS

The Project Architecture Model is ready for project-level documentation.

### PASS_WITH_WARNINGS

The model can be documented, but the documented limitations must remain visible.

### FAIL

The model must return to Step 4 for correction.

---

# 29. Output on PASS

When validation passes, produce:

1. Validated Project Architecture Model
2. Confirmed project dependency graph
3. Confirmed cross-service flows
4. Confirmed architecture patterns
5. Known contradictions
6. Known unknowns
7. Validation findings
8. Documentation readiness status

Do not generate the final project architecture document.

The next stage will consume this validated Project Architecture Model and generate the project-level architecture documentation.

## Now the five stages are complete

You have effectively designed a **documentation engineering pipeline**:



```text
┌─────────────────────────────────────────────┐
│              SOURCE REPOSITORIES            │
│                                             │
│ Repo 1 ... Repo 2 ... Repo 3 ... Repo 100 │
└──────────────────────┬──────────────────────┘
                       │
                       ▼
             ┌───────────────────┐
             │ 1. EXTRACTION     │
             │                   │
             │ What exists?      │
             └─────────┬─────────┘
                       │
                       ▼
              Architecture
              Evidence Models
                       │
                       ▼
             ┌───────────────────┐
             │ 2. VALIDATION     │
             │                   │
             │ Can we trust it?  │
             └─────────┬─────────┘
                       │
                       ▼
             Validated Repo Models
                       │
                       ▼
             ┌───────────────────┐
             │ 3. DOCUMENTATION  │
             │                   │
             │ Explain it        │
             └─────────┬─────────┘
                       │
                       ▼
              100 Repository Docs
                       │
                       ▼
             ┌───────────────────┐
             │ 4. AGGREGATION    │
             │                   │
             │ How do they       │
             │ fit together?     │
             └─────────┬─────────┘
                       │
                       ▼
             Project Architecture
                    Model
                       │
                       ▼
             ┌───────────────────┐
             │ 5. VALIDATION     │
             │                   │
             │ Can we trust the  │
             │ whole picture?    │
             └─────────┬─────────┘
                       │
                       ▼
            VALIDATED PROJECT MODEL
                       │
                       ▼
             PROJECT DOCUMENTATION
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  One thing I would change from our original thinking
&lt;/h3&gt;

&lt;p&gt;We now have &lt;strong&gt;five core prompts&lt;/strong&gt;, but I would &lt;strong&gt;not call these five agents&lt;/strong&gt; yet.&lt;/p&gt;

&lt;p&gt;Think of them as five &lt;strong&gt;specialised stages&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Later, if you automate this, you could have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Extraction Agent
       ↓
Validation Agent
       ↓
Documentation Agent
       ↓
Aggregation Agent
       ↓
Project Validation Agent
       ↓
Project Documentation Agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that there is actually a &lt;strong&gt;sixth prompt&lt;/strong&gt; hiding at the end:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project Documentation Generation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We have deliberately not written that yet.&lt;/p&gt;

&lt;p&gt;That should be the final prompt because now we know exactly what its input will be:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Validated Project Architecture Model&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;rather than 100 repositories or 100 Markdown documents.&lt;/p&gt;

&lt;p&gt;That is the cleanest endpoint for this design.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>softwareengineering</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Step 4 — Project Architecture Aggregation</title>
      <dc:creator>Karthi Mahadevan</dc:creator>
      <pubDate>Sun, 04 Oct 2026 12:48:54 +0000</pubDate>
      <link>https://dev.to/mkarthiatgithub/step-4-project-architecture-aggregation-9gk</link>
      <guid>https://dev.to/mkarthiatgithub/step-4-project-architecture-aggregation-9gk</guid>
      <description>&lt;p&gt;Yes. Now we move to &lt;strong&gt;Step 4 — Aggregation&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is the step that turns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Repository A → validated architecture
Repository B → validated architecture
Repository C → validated architecture
...
Repository 100 → validated architecture
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;into:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;              100 validated repository models
                         ↓
                 STEP 4 — AGGREGATION
                         ↓
              Project Architecture Model
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key point:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4 does not yet write the final project documentation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It builds the &lt;strong&gt;combined project-level model&lt;/strong&gt; first.&lt;/p&gt;

&lt;p&gt;That model becomes the input to Step 5.&lt;/p&gt;

&lt;p&gt;Save this as &lt;strong&gt;&lt;code&gt;04-project-aggregation.md&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 4 — Project Architecture Aggregation
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Purpose
&lt;/h2&gt;

&lt;p&gt;Combine validated Architecture Evidence Models from multiple repositories into a single Project Architecture Model.&lt;/p&gt;

&lt;p&gt;This is an aggregation and cross-repository analysis task.&lt;/p&gt;

&lt;p&gt;Do not generate the final project architecture documentation.&lt;/p&gt;

&lt;p&gt;Do not simply concatenate repository documents.&lt;/p&gt;

&lt;p&gt;Do not assume that similarly named components are the same system component.&lt;/p&gt;

&lt;p&gt;The objective is to discover and represent the architecture of the entire project from validated repository-level evidence.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. Inputs
&lt;/h1&gt;

&lt;p&gt;The primary inputs are validated Architecture Evidence Models from multiple repositories.&lt;/p&gt;

&lt;p&gt;Each repository model should contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;repository identity&lt;/li&gt;
&lt;li&gt;application/service identity&lt;/li&gt;
&lt;li&gt;components&lt;/li&gt;
&lt;li&gt;APIs&lt;/li&gt;
&lt;li&gt;processing flows&lt;/li&gt;
&lt;li&gt;events&lt;/li&gt;
&lt;li&gt;topics&lt;/li&gt;
&lt;li&gt;queues&lt;/li&gt;
&lt;li&gt;databases&lt;/li&gt;
&lt;li&gt;external systems&lt;/li&gt;
&lt;li&gt;dependencies&lt;/li&gt;
&lt;li&gt;deployment information&lt;/li&gt;
&lt;li&gt;security&lt;/li&gt;
&lt;li&gt;observability&lt;/li&gt;
&lt;li&gt;resilience&lt;/li&gt;
&lt;li&gt;architecture pattern evidence&lt;/li&gt;
&lt;li&gt;unknowns&lt;/li&gt;
&lt;li&gt;source evidence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Repository documentation may be used as a supporting input.&lt;/p&gt;

&lt;p&gt;The validated Architecture Evidence Models remain the authoritative source.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Core Rules
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Rule 1 — Do not assume relationships
&lt;/h2&gt;

&lt;p&gt;A relationship between two repositories must be supported by evidence.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Repository A:
produces order.created

Repository B:
consumes order.created
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This provides evidence for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A → order.created → B
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not create the relationship merely because both repositories belong to the same project.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rule 2 — Do not merge entities automatically
&lt;/h2&gt;

&lt;p&gt;These may or may not be the same:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PaymentService
payment-service
Payment Service
payments-api
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Determine identity using evidence.&lt;/p&gt;

&lt;p&gt;If identity cannot be established:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Identity unresolved&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Do not silently merge them.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rule 3 — Preserve repository boundaries
&lt;/h2&gt;

&lt;p&gt;Maintain the relationship between:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Project
 ├── Repository
 │     └── Service
 │           └── Component
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not lose repository ownership when creating the project model.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rule 4 — Distinguish local and project-level facts
&lt;/h2&gt;

&lt;p&gt;A repository may establish:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Payment Service consumes order.created.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The project aggregation may establish:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Order Service produces order.created.
Payment Service consumes order.created.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second statement is a project-level relationship created by combining evidence.&lt;/p&gt;

&lt;p&gt;Make that distinction explicit.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Repository Inventory
&lt;/h1&gt;

&lt;p&gt;Create a project inventory.&lt;/p&gt;

&lt;p&gt;For each repository record:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Repository&lt;/th&gt;
&lt;th&gt;Application&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;th&gt;Deployment&lt;/th&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Also identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;repositories with multiple services&lt;/li&gt;
&lt;li&gt;repositories containing shared libraries&lt;/li&gt;
&lt;li&gt;infrastructure-only repositories&lt;/li&gt;
&lt;li&gt;configuration repositories&lt;/li&gt;
&lt;li&gt;deployment repositories&lt;/li&gt;
&lt;li&gt;repositories whose role is unclear&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  4. Canonical Entity Model
&lt;/h1&gt;

&lt;p&gt;Create canonical identities for project-level entities.&lt;/p&gt;

&lt;p&gt;At minimum:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Repository
Service
Component
API
Event
Topic
Queue
Database
ExternalSystem
DeploymentUnit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For each entity record:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Canonical ID
Display Name
Entity Type
Source Repository
Evidence
Identity Confidence
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;canonical_id: service.payment
display_name: Payment Service
type: Service
source_repository: payment-service
identity_confidence: High
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not merge entities without sufficient evidence.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. Repository-to-Service Mapping
&lt;/h1&gt;

&lt;p&gt;Build the relationship:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Repository → Application/Service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one repository / one service&lt;/li&gt;
&lt;li&gt;one repository / multiple services&lt;/li&gt;
&lt;li&gt;shared libraries&lt;/li&gt;
&lt;li&gt;infrastructure repositories&lt;/li&gt;
&lt;li&gt;unknown repository purpose&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Flag ambiguous cases.&lt;/p&gt;




&lt;h1&gt;
  
  
  6. Project Dependency Graph
&lt;/h1&gt;

&lt;p&gt;Construct the project-wide dependency graph.&lt;/p&gt;

&lt;p&gt;Represent relationships as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Source
    ↓
Relationship
    ↓
Target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Order Service
    ↓ produces
order.created
    ↓ consumed by
Payment Service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Payment Service
    ↓ calls
Customer API
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Order Service
    ↓ writes
Order Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For every relationship record:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;th&gt;Relationship&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;th&gt;Evidence&lt;/th&gt;
&lt;th&gt;Confidence&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  7. Cross-Repository API Relationships
&lt;/h1&gt;

&lt;p&gt;Identify APIs where one repository provides an API and another repository consumes it.&lt;/p&gt;

&lt;p&gt;Construct:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Provider
    ↓
API
    ↓
Consumer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Validate using evidence from both sides where possible.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer Service
    ↓
GET /customers/{id}
    ↓
Payment Service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Classify the relationship:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Verified — both sides&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Verified — provider only&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Verified — consumer only&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Inferred&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Unknown&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not assume an API consumer merely because a URL resembles the provider's endpoint.&lt;/p&gt;




&lt;h1&gt;
  
  
  8. Cross-Repository Messaging Relationships
&lt;/h1&gt;

&lt;p&gt;This is one of the most important aggregation tasks.&lt;/p&gt;

&lt;p&gt;Construct:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Producer
    ↓
Event
    ↓
Topic / Queue
    ↓
Consumer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For every event/topic/queue identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;producer&lt;/li&gt;
&lt;li&gt;consumer&lt;/li&gt;
&lt;li&gt;repository&lt;/li&gt;
&lt;li&gt;service&lt;/li&gt;
&lt;li&gt;technology&lt;/li&gt;
&lt;li&gt;topic/queue&lt;/li&gt;
&lt;li&gt;event/message&lt;/li&gt;
&lt;li&gt;direction&lt;/li&gt;
&lt;li&gt;evidence&lt;/li&gt;
&lt;li&gt;confidence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Order Service
    ↓
order.created
    ↓
Kafka topic: orders
    ↓
Payment Service
    ↓
Inventory Service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Flag:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;producer with no consumer&lt;/li&gt;
&lt;li&gt;consumer with no identified producer&lt;/li&gt;
&lt;li&gt;topic with conflicting definitions&lt;/li&gt;
&lt;li&gt;different schemas for the same event&lt;/li&gt;
&lt;li&gt;same topic name used with incompatible semantics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not automatically treat an orphan as an error.&lt;/p&gt;

&lt;p&gt;It may represent an external producer or consumer.&lt;/p&gt;




&lt;h1&gt;
  
  
  9. Database and Data Ownership
&lt;/h1&gt;

&lt;p&gt;Identify project-wide data stores.&lt;/p&gt;

&lt;p&gt;For each database:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;consuming services&lt;/li&gt;
&lt;li&gt;producing/writing services&lt;/li&gt;
&lt;li&gt;reading services&lt;/li&gt;
&lt;li&gt;repository&lt;/li&gt;
&lt;li&gt;technology&lt;/li&gt;
&lt;li&gt;entities/tables where available&lt;/li&gt;
&lt;li&gt;evidence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Look for shared database access.&lt;/p&gt;

&lt;p&gt;Identify relationships such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Service A → writes → Database X
Service B → reads → Database X
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not automatically conclude that this is a design problem.&lt;/p&gt;

&lt;p&gt;Record it as an architecture observation for later analysis.&lt;/p&gt;




&lt;h1&gt;
  
  
  10. External System Map
&lt;/h1&gt;

&lt;p&gt;Create a project-wide map of external systems.&lt;/p&gt;

&lt;p&gt;For each external system identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;interacting services&lt;/li&gt;
&lt;li&gt;interaction type&lt;/li&gt;
&lt;li&gt;protocol&lt;/li&gt;
&lt;li&gt;direction&lt;/li&gt;
&lt;li&gt;authentication&lt;/li&gt;
&lt;li&gt;purpose&lt;/li&gt;
&lt;li&gt;evidence&lt;/li&gt;
&lt;li&gt;confidence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;External Customer System
       ↑
       │ REST
       │
Customer Service
       │
       │ REST
       ↓
Payment Service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Determine whether an external system is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;genuinely external&lt;/li&gt;
&lt;li&gt;another project service&lt;/li&gt;
&lt;li&gt;an internal shared platform&lt;/li&gt;
&lt;li&gt;unresolved&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not assume based on naming alone.&lt;/p&gt;




&lt;h1&gt;
  
  
  11. Event and Message Catalogue
&lt;/h1&gt;

&lt;p&gt;Create a project-wide catalogue.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Event/Message&lt;/th&gt;
&lt;th&gt;Topic/Queue&lt;/th&gt;
&lt;th&gt;Producer&lt;/th&gt;
&lt;th&gt;Consumers&lt;/th&gt;
&lt;th&gt;Schema&lt;/th&gt;
&lt;th&gt;Evidence&lt;/th&gt;
&lt;th&gt;Confidence&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;duplicate event names&lt;/li&gt;
&lt;li&gt;duplicate topic names&lt;/li&gt;
&lt;li&gt;conflicting schemas&lt;/li&gt;
&lt;li&gt;multiple producers&lt;/li&gt;
&lt;li&gt;multiple consumers&lt;/li&gt;
&lt;li&gt;unused topics&lt;/li&gt;
&lt;li&gt;externally owned events&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not assume two similarly named events are identical.&lt;/p&gt;




&lt;h1&gt;
  
  
  12. API Catalogue
&lt;/h1&gt;

&lt;p&gt;Create a project-wide API catalogue.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;API&lt;/th&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Consumers&lt;/th&gt;
&lt;th&gt;Protocol&lt;/th&gt;
&lt;th&gt;Contract&lt;/th&gt;
&lt;th&gt;Evidence&lt;/th&gt;
&lt;th&gt;Confidence&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;provider&lt;/li&gt;
&lt;li&gt;consumers&lt;/li&gt;
&lt;li&gt;internal APIs&lt;/li&gt;
&lt;li&gt;external APIs&lt;/li&gt;
&lt;li&gt;duplicate endpoints&lt;/li&gt;
&lt;li&gt;versioning&lt;/li&gt;
&lt;li&gt;unresolved consumers/providers&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  13. Architecture Pattern Aggregation
&lt;/h1&gt;

&lt;p&gt;Do not simply combine repository-level pattern claims.&lt;/p&gt;

&lt;p&gt;Evaluate patterns at project level.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;A repository may show:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Kafka producer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Kafka consumer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Together this provides stronger evidence for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Event-driven integration
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But still distinguish:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Event-driven integration
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Entire project follows Event-Driven Architecture.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For project-level patterns evaluate evidence across multiple services.&lt;/p&gt;

&lt;p&gt;Potential patterns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Event-Driven Architecture&lt;/li&gt;
&lt;li&gt;Saga&lt;/li&gt;
&lt;li&gt;Saga choreography&lt;/li&gt;
&lt;li&gt;Saga orchestration&lt;/li&gt;
&lt;li&gt;Outbox&lt;/li&gt;
&lt;li&gt;CQRS&lt;/li&gt;
&lt;li&gt;API Gateway&lt;/li&gt;
&lt;li&gt;Hexagonal Architecture&lt;/li&gt;
&lt;li&gt;Layered Architecture&lt;/li&gt;
&lt;li&gt;Shared Database&lt;/li&gt;
&lt;li&gt;Service-to-Service REST&lt;/li&gt;
&lt;li&gt;Asynchronous integration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For each pattern:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Project Evidence&lt;/th&gt;
&lt;th&gt;Supporting Repositories&lt;/th&gt;
&lt;th&gt;Confidence&lt;/th&gt;
&lt;th&gt;Conclusion&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Do not claim a project-wide pattern unless the evidence supports project-wide scope.&lt;/p&gt;




&lt;h1&gt;
  
  
  14. Business Capability Aggregation
&lt;/h1&gt;

&lt;p&gt;Where repository evidence supports it, group services into business capabilities.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer Management
    ├── Customer Service
    ├── Customer Profile Service
    └── Customer Notification Service

Order Management
    ├── Order Service
    ├── Order Validation Service
    └── Order Fulfilment Service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not invent business capabilities.&lt;/p&gt;

&lt;p&gt;If the business purpose cannot be established:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Business capability grouping not established from repository evidence.&lt;/code&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  15. End-to-End Flow Reconstruction
&lt;/h1&gt;

&lt;p&gt;Identify flows that cross repository boundaries.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer
   ↓
Order API
   ↓
Order Service
   ↓
Kafka
   ↓
Payment Service
   ↓
Payment Provider
   ↓
Kafka
   ↓
Order Service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For each cross-service flow identify:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Trigger&lt;/li&gt;
&lt;li&gt;Service&lt;/li&gt;
&lt;li&gt;Interaction&lt;/li&gt;
&lt;li&gt;Message/API&lt;/li&gt;
&lt;li&gt;Next service&lt;/li&gt;
&lt;li&gt;Persistence&lt;/li&gt;
&lt;li&gt;Output&lt;/li&gt;
&lt;li&gt;Failure handling&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Distinguish:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;synchronous flow&lt;/li&gt;
&lt;li&gt;asynchronous flow&lt;/li&gt;
&lt;li&gt;mixed flow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not create an end-to-end business flow when only isolated technical relationships are known.&lt;/p&gt;




&lt;h1&gt;
  
  
  16. Cross-Repository Architecture Observations
&lt;/h1&gt;

&lt;p&gt;Identify significant project-level observations.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;central services&lt;/li&gt;
&lt;li&gt;highly connected services&lt;/li&gt;
&lt;li&gt;shared databases&lt;/li&gt;
&lt;li&gt;synchronous dependency chains&lt;/li&gt;
&lt;li&gt;event-driven boundaries&lt;/li&gt;
&lt;li&gt;integration hubs&lt;/li&gt;
&lt;li&gt;duplicated functionality&lt;/li&gt;
&lt;li&gt;shared infrastructure&lt;/li&gt;
&lt;li&gt;tightly coupled services&lt;/li&gt;
&lt;li&gt;isolated services&lt;/li&gt;
&lt;li&gt;common platform dependencies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are observations.&lt;/p&gt;

&lt;p&gt;Do not automatically classify them as problems.&lt;/p&gt;




&lt;h1&gt;
  
  
  17. Contradiction Detection
&lt;/h1&gt;

&lt;p&gt;Actively search for conflicts between repositories.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;h3&gt;
  
  
  API conflict
&lt;/h3&gt;

&lt;p&gt;Repository A:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /customer/{id}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Repository B expects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /customers/{id}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Event conflict
&lt;/h3&gt;

&lt;p&gt;Producer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;order.created
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Consumer expects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;order-created
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Schema conflict
&lt;/h3&gt;

&lt;p&gt;Producer sends:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;customerId
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Consumer expects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;customer_id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Technology conflict
&lt;/h3&gt;

&lt;p&gt;One repository identifies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Kafka
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another identifies the same integration as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SQS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not resolve contradictions by guessing.&lt;/p&gt;

&lt;p&gt;Record them.&lt;/p&gt;




&lt;h1&gt;
  
  
  18. Missing Relationship Detection
&lt;/h1&gt;

&lt;p&gt;Look for relationships that may be incomplete.&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Consumer exists
but producer is unknown.

API consumer exists
but provider is unknown.

Topic exists
but ownership is unknown.

Service depends on database
but database repository is not identified.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Classify each:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;confirmed external dependency&lt;/li&gt;
&lt;li&gt;missing repository&lt;/li&gt;
&lt;li&gt;missing evidence&lt;/li&gt;
&lt;li&gt;unresolved&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  19. Project Architecture Model
&lt;/h1&gt;

&lt;p&gt;Produce a structured Project Architecture Model containing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Project
Repositories
Services
Components
APIs
Events
Topics
Queues
Databases
ExternalSystems
Dependencies
CrossServiceFlows
ArchitecturePatterns
BusinessCapabilities
DeploymentArchitecture
SecurityArchitecture
ObservabilityArchitecture
ResilienceArchitecture
Contradictions
Unknowns
Evidence
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model must preserve the originating repository for every significant entity and relationship.&lt;/p&gt;




&lt;h1&gt;
  
  
  20. Project Dependency Matrix
&lt;/h1&gt;

&lt;p&gt;Produce a service dependency matrix where useful.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Order&lt;/th&gt;
&lt;th&gt;Payment&lt;/th&gt;
&lt;th&gt;Customer&lt;/th&gt;
&lt;th&gt;Inventory&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Order&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;Event&lt;/td&gt;
&lt;td&gt;API&lt;/td&gt;
&lt;td&gt;Event&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Payment&lt;/td&gt;
&lt;td&gt;Event&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;API&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Customer&lt;/td&gt;
&lt;td&gt;API&lt;/td&gt;
&lt;td&gt;API&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inventory&lt;/td&gt;
&lt;td&gt;Event&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Do not create empty relationships simply to populate the matrix.&lt;/p&gt;




&lt;h1&gt;
  
  
  21. Project-Level Confidence
&lt;/h1&gt;

&lt;p&gt;Assign confidence to project-level conclusions.&lt;/p&gt;

&lt;p&gt;Use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;High&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Medium&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Low&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Unknown&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Confidence must reflect evidence quality, not how plausible the architecture appears.&lt;/p&gt;




&lt;h1&gt;
  
  
  22. Aggregation Quality Gate
&lt;/h1&gt;

&lt;p&gt;Before completing Step 4, check:&lt;/p&gt;

&lt;h3&gt;
  
  
  Identity
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;repositories are uniquely identified&lt;/li&gt;
&lt;li&gt;services are consistently identified&lt;/li&gt;
&lt;li&gt;duplicate entities are investigated&lt;/li&gt;
&lt;li&gt;ambiguous entities remain unresolved&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Relationships
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;cross-service relationships have evidence&lt;/li&gt;
&lt;li&gt;API relationships are supported&lt;/li&gt;
&lt;li&gt;messaging relationships are supported&lt;/li&gt;
&lt;li&gt;database relationships are supported&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Consistency
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;conflicting names are identified&lt;/li&gt;
&lt;li&gt;conflicting contracts are identified&lt;/li&gt;
&lt;li&gt;conflicting technologies are identified&lt;/li&gt;
&lt;li&gt;contradictory relationships are identified&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Architecture
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;project-level patterns are evidence-based&lt;/li&gt;
&lt;li&gt;local patterns are not automatically treated as project-wide&lt;/li&gt;
&lt;li&gt;end-to-end flows are evidence-based&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Traceability
&lt;/h3&gt;

&lt;p&gt;Every significant project-level relationship can be traced back to one or more repositories.&lt;/p&gt;

&lt;h3&gt;
  
  
  Uncertainty
&lt;/h3&gt;

&lt;p&gt;Unknowns and unresolved relationships are explicitly recorded.&lt;/p&gt;




&lt;h1&gt;
  
  
  23. Final Output
&lt;/h1&gt;

&lt;p&gt;Return:&lt;/p&gt;

&lt;h2&gt;
  
  
  A. Project Architecture Model
&lt;/h2&gt;

&lt;p&gt;The structured project-wide model.&lt;/p&gt;

&lt;h2&gt;
  
  
  B. Project Dependency Graph
&lt;/h2&gt;

&lt;p&gt;All confirmed cross-repository relationships.&lt;/p&gt;

&lt;h2&gt;
  
  
  C. Cross-Service Flows
&lt;/h2&gt;

&lt;p&gt;Important end-to-end flows.&lt;/p&gt;

&lt;h2&gt;
  
  
  D. Architecture Patterns
&lt;/h2&gt;

&lt;p&gt;Patterns supported by project-level evidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  E. Contradictions
&lt;/h2&gt;

&lt;p&gt;Conflicting evidence that requires resolution.&lt;/p&gt;

&lt;h2&gt;
  
  
  F. Unknowns
&lt;/h2&gt;

&lt;p&gt;Important information that cannot be established.&lt;/p&gt;

&lt;h2&gt;
  
  
  G. Aggregation Status
&lt;/h2&gt;

&lt;p&gt;Return:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PASS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PASS_WITH_WARNINGS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FAIL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not generate the final project architecture document.&lt;/p&gt;

&lt;p&gt;Step 5 — Project Validation will validate this Project Architecture Model before project documentation is generated.&lt;/p&gt;

&lt;h3&gt;
  
  
  The key change from Step 3
&lt;/h3&gt;

&lt;p&gt;Step 3 was:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Explain this repository."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Step 4 is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"What happens when all these repositories are viewed as one system?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That distinction is crucial.&lt;/p&gt;

&lt;p&gt;For example, three individual documents might say:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Order Service
  produces order.created

Payment Service
  consumes order.created

Inventory Service
  consumes order.created
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 4 discovers the project-level relationship:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    order.created
                         │
                ┌────────┴────────┐
                ↓                 ↓
        Payment Service    Inventory Service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That relationship may &lt;strong&gt;not exist explicitly in any single repository&lt;/strong&gt;. It emerges from aggregation.&lt;/p&gt;

&lt;p&gt;And Step 4 is also where we start finding the really valuable architecture information:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;service coupling&lt;/li&gt;
&lt;li&gt;central services&lt;/li&gt;
&lt;li&gt;shared databases&lt;/li&gt;
&lt;li&gt;event hubs&lt;/li&gt;
&lt;li&gt;synchronous chains&lt;/li&gt;
&lt;li&gt;cross-service flows&lt;/li&gt;
&lt;li&gt;duplicated integrations&lt;/li&gt;
&lt;li&gt;inconsistent contracts&lt;/li&gt;
&lt;li&gt;project-wide architecture patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But we still &lt;strong&gt;don't trust the result yet&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That's Step 5.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5 will be the final Project Validation gate&lt;/strong&gt; — essentially asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Given the entire 100-service architecture model, can we trust the project-level architecture we are about to publish?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After that, we'll have the complete five-stage pipeline.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>softwareengineering</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Step 3 — Documentation Generation</title>
      <dc:creator>Karthi Mahadevan</dc:creator>
      <pubDate>Sun, 04 Oct 2026 12:19:23 +0000</pubDate>
      <link>https://dev.to/mkarthiatgithub/step-3-documentation-generation-370f</link>
      <guid>https://dev.to/mkarthiatgithub/step-3-documentation-generation-370f</guid>
      <description>&lt;p&gt;Exactly. Step 3 is where we finally produce the &lt;strong&gt;human-readable architecture document&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The important rule is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Step 3 must not rediscover the architecture. It must explain the validated Architecture Evidence Model.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That prevents the documentation stage from introducing new assumptions.&lt;/p&gt;

&lt;p&gt;The pipeline is now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Source Code
    ↓
1. Extraction
    ↓
Architecture Evidence Model
    ↓
2. Validation
    ↓
Validated Architecture Evidence Model
    ↓
3. Documentation
    ↓
Repository Architecture Document
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save this as &lt;strong&gt;&lt;code&gt;03-documentation-generation.md&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 3 — Documentation Generation
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Purpose
&lt;/h2&gt;

&lt;p&gt;Generate the repository-level architecture documentation from the validated Architecture Evidence Model produced by Step 2.&lt;/p&gt;

&lt;p&gt;This is a documentation task.&lt;/p&gt;

&lt;p&gt;The architecture has already been extracted and validated.&lt;/p&gt;

&lt;p&gt;Do not independently rediscover the architecture.&lt;/p&gt;

&lt;p&gt;Do not introduce new architectural claims.&lt;/p&gt;

&lt;p&gt;Do not invent missing business context.&lt;/p&gt;

&lt;p&gt;The validated Architecture Evidence Model is the primary source for this document.&lt;/p&gt;

&lt;p&gt;The objective is to produce a clear, technically accurate, reusable architecture document that can later be combined with equivalent documents from other repositories to create project-level architecture documentation.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. Core Rules
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Rule 1 — Evidence is authoritative
&lt;/h2&gt;

&lt;p&gt;Use the validated Architecture Evidence Model as the source of truth.&lt;/p&gt;

&lt;p&gt;If information is marked:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Verified&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;present it as established fact.&lt;/p&gt;

&lt;p&gt;If information is marked:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Inferred&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;make the inference explicit.&lt;/p&gt;

&lt;p&gt;If information is marked:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Unknown&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;do not fill the gap.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rule 2 — Do not invent
&lt;/h2&gt;

&lt;p&gt;Do not invent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;business requirements&lt;/li&gt;
&lt;li&gt;business processes&lt;/li&gt;
&lt;li&gt;architecture patterns&lt;/li&gt;
&lt;li&gt;system dependencies&lt;/li&gt;
&lt;li&gt;technology usage&lt;/li&gt;
&lt;li&gt;security controls&lt;/li&gt;
&lt;li&gt;deployment characteristics&lt;/li&gt;
&lt;li&gt;scalability&lt;/li&gt;
&lt;li&gt;availability&lt;/li&gt;
&lt;li&gt;disaster recovery&lt;/li&gt;
&lt;li&gt;data ownership&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;unless supported by the validated evidence.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rule 3 — Explain the application, not generic technology
&lt;/h2&gt;

&lt;p&gt;Do not explain generic technologies such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what Kafka is&lt;/li&gt;
&lt;li&gt;what Kubernetes is&lt;/li&gt;
&lt;li&gt;what AWS is&lt;/li&gt;
&lt;li&gt;what REST is&lt;/li&gt;
&lt;li&gt;what PostgreSQL is&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;unless required to explain how this application uses the technology.&lt;/p&gt;

&lt;p&gt;The focus is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How does this application use the technology?&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Rule 4 — Preserve technical depth
&lt;/h2&gt;

&lt;p&gt;Do not oversimplify the architecture.&lt;/p&gt;

&lt;p&gt;The document must be understandable to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;software developers&lt;/li&gt;
&lt;li&gt;application architects&lt;/li&gt;
&lt;li&gt;platform engineers&lt;/li&gt;
&lt;li&gt;DevOps engineers&lt;/li&gt;
&lt;li&gt;security engineers&lt;/li&gt;
&lt;li&gt;technical leads&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use clear language without removing important technical detail.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rule 5 — Progressive disclosure
&lt;/h2&gt;

&lt;p&gt;Present information in layers.&lt;/p&gt;

&lt;p&gt;A reader should be able to understand the system at three levels:&lt;/p&gt;

&lt;h3&gt;
  
  
  Level 1 — System understanding
&lt;/h3&gt;

&lt;p&gt;What is this application?&lt;/p&gt;

&lt;p&gt;Why does it exist?&lt;/p&gt;

&lt;p&gt;What systems does it interact with?&lt;/p&gt;

&lt;p&gt;What is the main flow?&lt;/p&gt;

&lt;h3&gt;
  
  
  Level 2 — Application architecture
&lt;/h3&gt;

&lt;p&gt;How are the components implemented?&lt;/p&gt;

&lt;p&gt;How do they interact?&lt;/p&gt;

&lt;p&gt;What are the APIs, events, databases and processing flows?&lt;/p&gt;

&lt;h3&gt;
  
  
  Level 3 — Platform and operational architecture
&lt;/h3&gt;

&lt;p&gt;How is the application deployed?&lt;/p&gt;

&lt;p&gt;What infrastructure does it use?&lt;/p&gt;

&lt;p&gt;How are security, configuration, observability and resilience implemented?&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Required Document Structure
&lt;/h1&gt;

&lt;p&gt;Use the following exact section order.&lt;/p&gt;

&lt;p&gt;Do not rename sections.&lt;/p&gt;

&lt;p&gt;Do not omit a mandatory section.&lt;/p&gt;

&lt;p&gt;If information is unavailable, state &lt;code&gt;Unknown&lt;/code&gt; or &lt;code&gt;Not established from repository evidence&lt;/code&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. Executive Summary
&lt;/h1&gt;

&lt;p&gt;Provide a concise overview of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;application/service&lt;/li&gt;
&lt;li&gt;primary responsibility&lt;/li&gt;
&lt;li&gt;major architectural characteristics&lt;/li&gt;
&lt;li&gt;major integrations&lt;/li&gt;
&lt;li&gt;primary runtime/platform&lt;/li&gt;
&lt;li&gt;important architectural observations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep this section short.&lt;/p&gt;

&lt;p&gt;It should allow a technical reader to understand the application before reading the details.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Business Context
&lt;/h1&gt;

&lt;p&gt;Explain the business purpose of the application only where supported by evidence.&lt;/p&gt;

&lt;p&gt;Include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;business capability&lt;/li&gt;
&lt;li&gt;problem addressed&lt;/li&gt;
&lt;li&gt;major business interactions&lt;/li&gt;
&lt;li&gt;business outcome&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If business context cannot be established from the repository:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Business context is not established from repository evidence.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Do not manufacture business explanations from class names.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. System Context
&lt;/h1&gt;

&lt;p&gt;Describe the application's position in the wider system.&lt;/p&gt;

&lt;p&gt;Show:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;users or actors where identifiable&lt;/li&gt;
&lt;li&gt;upstream systems&lt;/li&gt;
&lt;li&gt;this application&lt;/li&gt;
&lt;li&gt;downstream systems&lt;/li&gt;
&lt;li&gt;external systems&lt;/li&gt;
&lt;li&gt;major data/event flows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Include a System Context diagram.&lt;/p&gt;

&lt;p&gt;Use only relationships supported by the validated evidence.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Architecture Overview
&lt;/h1&gt;

&lt;p&gt;Provide the main technical architecture.&lt;/p&gt;

&lt;p&gt;Describe:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;major components&lt;/li&gt;
&lt;li&gt;major communication mechanisms&lt;/li&gt;
&lt;li&gt;data stores&lt;/li&gt;
&lt;li&gt;messaging&lt;/li&gt;
&lt;li&gt;external integrations&lt;/li&gt;
&lt;li&gt;deployment boundary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Include an architecture diagram.&lt;/p&gt;

&lt;p&gt;The diagram must match the validated dependency model.&lt;/p&gt;

&lt;p&gt;Do not show relationships that are not supported by evidence.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. End-to-End Processing Flow
&lt;/h1&gt;

&lt;p&gt;Describe the major application flows.&lt;/p&gt;

&lt;p&gt;For each important flow explain:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Trigger&lt;/li&gt;
&lt;li&gt;Entry point&lt;/li&gt;
&lt;li&gt;Processing&lt;/li&gt;
&lt;li&gt;Internal component interactions&lt;/li&gt;
&lt;li&gt;External calls&lt;/li&gt;
&lt;li&gt;Messaging&lt;/li&gt;
&lt;li&gt;Persistence&lt;/li&gt;
&lt;li&gt;Output&lt;/li&gt;
&lt;li&gt;Error handling&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Clearly distinguish:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;synchronous&lt;/li&gt;
&lt;li&gt;asynchronous&lt;/li&gt;
&lt;li&gt;scheduled&lt;/li&gt;
&lt;li&gt;event-driven&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use sequence diagrams where they provide useful detail.&lt;/p&gt;

&lt;p&gt;Do not create a diagram merely for presentation.&lt;/p&gt;




&lt;h1&gt;
  
  
  6. Component and Class Design
&lt;/h1&gt;

&lt;p&gt;Describe the significant application components.&lt;/p&gt;

&lt;p&gt;For each important component include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;name&lt;/li&gt;
&lt;li&gt;responsibility&lt;/li&gt;
&lt;li&gt;source location&lt;/li&gt;
&lt;li&gt;important interfaces&lt;/li&gt;
&lt;li&gt;dependencies&lt;/li&gt;
&lt;li&gt;relationships to other components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Where useful, include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;component diagram&lt;/li&gt;
&lt;li&gt;class diagram&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not create a class diagram containing every class.&lt;/p&gt;

&lt;p&gt;Focus on classes and components that explain the architecture.&lt;/p&gt;




&lt;h1&gt;
  
  
  7. Input and Output Contracts
&lt;/h1&gt;

&lt;p&gt;Document important interfaces.&lt;/p&gt;

&lt;p&gt;Include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;REST APIs&lt;/li&gt;
&lt;li&gt;requests&lt;/li&gt;
&lt;li&gt;responses&lt;/li&gt;
&lt;li&gt;events&lt;/li&gt;
&lt;li&gt;messages&lt;/li&gt;
&lt;li&gt;commands&lt;/li&gt;
&lt;li&gt;scheduled inputs&lt;/li&gt;
&lt;li&gt;outputs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Where available, document:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;field names&lt;/li&gt;
&lt;li&gt;important data structures&lt;/li&gt;
&lt;li&gt;schemas&lt;/li&gt;
&lt;li&gt;validation&lt;/li&gt;
&lt;li&gt;error responses&lt;/li&gt;
&lt;li&gt;versioning&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not invent contract details.&lt;/p&gt;

&lt;p&gt;If the full contract is not available:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Contract details are not established from repository evidence.&lt;/code&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  8. Integration and Messaging Architecture
&lt;/h1&gt;

&lt;p&gt;Document all significant integrations.&lt;/p&gt;

&lt;p&gt;Use a table such as:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Interaction&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;th&gt;Contract&lt;/th&gt;
&lt;th&gt;Direction&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;th&gt;Failure Handling&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;APIs&lt;/li&gt;
&lt;li&gt;Kafka&lt;/li&gt;
&lt;li&gt;queues&lt;/li&gt;
&lt;li&gt;events&lt;/li&gt;
&lt;li&gt;external systems&lt;/li&gt;
&lt;li&gt;databases where relevant&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For messaging include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;producer&lt;/li&gt;
&lt;li&gt;topic/queue&lt;/li&gt;
&lt;li&gt;consumer&lt;/li&gt;
&lt;li&gt;message/event&lt;/li&gt;
&lt;li&gt;asynchronous behaviour&lt;/li&gt;
&lt;li&gt;retry&lt;/li&gt;
&lt;li&gt;acknowledgement&lt;/li&gt;
&lt;li&gt;dead-letter handling&lt;/li&gt;
&lt;li&gt;ordering where established&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  9. Architecture Patterns
&lt;/h1&gt;

&lt;p&gt;Document only patterns supported by evidence.&lt;/p&gt;

&lt;p&gt;For each confirmed pattern:&lt;/p&gt;

&lt;h3&gt;
  
  
  Pattern
&lt;/h3&gt;

&lt;p&gt;Name of pattern.&lt;/p&gt;

&lt;h3&gt;
  
  
  Evidence
&lt;/h3&gt;

&lt;p&gt;Explain the implementation evidence.&lt;/p&gt;

&lt;h3&gt;
  
  
  Application of Pattern
&lt;/h3&gt;

&lt;p&gt;Explain how the application uses it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Benefit
&lt;/h3&gt;

&lt;p&gt;Explain the technical or business benefit only where it can reasonably be established.&lt;/p&gt;

&lt;p&gt;Possible patterns include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Event-Driven Architecture&lt;/li&gt;
&lt;li&gt;Saga&lt;/li&gt;
&lt;li&gt;Saga choreography&lt;/li&gt;
&lt;li&gt;Saga orchestration&lt;/li&gt;
&lt;li&gt;Outbox&lt;/li&gt;
&lt;li&gt;CQRS&lt;/li&gt;
&lt;li&gt;API Gateway&lt;/li&gt;
&lt;li&gt;Hexagonal Architecture&lt;/li&gt;
&lt;li&gt;Ports and Adapters&lt;/li&gt;
&lt;li&gt;Layered Architecture&lt;/li&gt;
&lt;li&gt;Retry&lt;/li&gt;
&lt;li&gt;Circuit Breaker&lt;/li&gt;
&lt;li&gt;Idempotent Consumer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not claim a pattern simply because the repository uses a technology commonly associated with it.&lt;/p&gt;

&lt;p&gt;For patterns classified as &lt;code&gt;Possible&lt;/code&gt;, clearly label them as such.&lt;/p&gt;




&lt;h1&gt;
  
  
  10. Platform and Deployment Architecture
&lt;/h1&gt;

&lt;p&gt;Describe how the application is deployed.&lt;/p&gt;

&lt;p&gt;Include only supported information.&lt;/p&gt;

&lt;p&gt;Where applicable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;containerisation&lt;/li&gt;
&lt;li&gt;Kubernetes&lt;/li&gt;
&lt;li&gt;Helm&lt;/li&gt;
&lt;li&gt;AWS&lt;/li&gt;
&lt;li&gt;networking&lt;/li&gt;
&lt;li&gt;storage&lt;/li&gt;
&lt;li&gt;configuration&lt;/li&gt;
&lt;li&gt;secrets&lt;/li&gt;
&lt;li&gt;IAM&lt;/li&gt;
&lt;li&gt;CI/CD&lt;/li&gt;
&lt;li&gt;deployment strategy&lt;/li&gt;
&lt;li&gt;health checks&lt;/li&gt;
&lt;li&gt;scaling&lt;/li&gt;
&lt;li&gt;infrastructure dependencies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Explain how the application interacts with the platform.&lt;/p&gt;

&lt;p&gt;Do not provide generic Kubernetes or AWS tutorials.&lt;/p&gt;

&lt;p&gt;Include a deployment diagram when useful.&lt;/p&gt;




&lt;h1&gt;
  
  
  11. Failure Handling and Resilience
&lt;/h1&gt;

&lt;p&gt;Describe actual implementation of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;retries&lt;/li&gt;
&lt;li&gt;timeouts&lt;/li&gt;
&lt;li&gt;circuit breakers&lt;/li&gt;
&lt;li&gt;dead-letter handling&lt;/li&gt;
&lt;li&gt;duplicate handling&lt;/li&gt;
&lt;li&gt;idempotency&lt;/li&gt;
&lt;li&gt;fallback&lt;/li&gt;
&lt;li&gt;compensation&lt;/li&gt;
&lt;li&gt;recovery&lt;/li&gt;
&lt;li&gt;graceful degradation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Separate:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Implemented&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;from:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Not established&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Do not claim resilience characteristics that are not evidenced.&lt;/p&gt;




&lt;h1&gt;
  
  
  12. Security and Observability
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Security
&lt;/h2&gt;

&lt;p&gt;Document:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;authentication&lt;/li&gt;
&lt;li&gt;authorisation&lt;/li&gt;
&lt;li&gt;mTLS&lt;/li&gt;
&lt;li&gt;OAuth/OIDC&lt;/li&gt;
&lt;li&gt;JWT&lt;/li&gt;
&lt;li&gt;certificates&lt;/li&gt;
&lt;li&gt;IAM&lt;/li&gt;
&lt;li&gt;secrets&lt;/li&gt;
&lt;li&gt;Vault&lt;/li&gt;
&lt;li&gt;Secrets Manager&lt;/li&gt;
&lt;li&gt;security configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Only document mechanisms supported by evidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Observability
&lt;/h2&gt;

&lt;p&gt;Document:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;logging&lt;/li&gt;
&lt;li&gt;metrics&lt;/li&gt;
&lt;li&gt;tracing&lt;/li&gt;
&lt;li&gt;health checks&lt;/li&gt;
&lt;li&gt;correlation IDs&lt;/li&gt;
&lt;li&gt;audit logging&lt;/li&gt;
&lt;li&gt;monitoring integrations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Explain how these mechanisms are implemented by the application.&lt;/p&gt;




&lt;h1&gt;
  
  
  13. Source Code Navigation
&lt;/h1&gt;

&lt;p&gt;Provide a practical map from architecture concepts to source code.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Architecture Element&lt;/th&gt;
&lt;th&gt;Source Location&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;REST API&lt;/td&gt;
&lt;td&gt;&lt;code&gt;src/...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;API entry point&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Order processor&lt;/td&gt;
&lt;td&gt;&lt;code&gt;src/...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Main processing logic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kafka producer&lt;/td&gt;
&lt;td&gt;&lt;code&gt;src/...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Publishes event&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database repository&lt;/td&gt;
&lt;td&gt;&lt;code&gt;src/...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Persistence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Configuration&lt;/td&gt;
&lt;td&gt;&lt;code&gt;config/...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Runtime configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This section must help a developer move from the architecture document to the implementation.&lt;/p&gt;




&lt;h1&gt;
  
  
  14. Architecture Observations
&lt;/h1&gt;

&lt;p&gt;Record important observations from the validated evidence.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;strong separation of responsibilities&lt;/li&gt;
&lt;li&gt;tightly coupled components&lt;/li&gt;
&lt;li&gt;synchronous dependency chain&lt;/li&gt;
&lt;li&gt;asynchronous integration&lt;/li&gt;
&lt;li&gt;central dependency&lt;/li&gt;
&lt;li&gt;resilience mechanism&lt;/li&gt;
&lt;li&gt;deployment constraint&lt;/li&gt;
&lt;li&gt;security dependency&lt;/li&gt;
&lt;li&gt;operational concern&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Separate observations from facts.&lt;/p&gt;

&lt;p&gt;Do not present architectural opinion as source-code fact.&lt;/p&gt;

&lt;p&gt;Where an observation is an interpretation, label it:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Observation&lt;/code&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  15. Evidence and Open Questions
&lt;/h1&gt;

&lt;p&gt;Document important evidence and unresolved questions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Evidence
&lt;/h2&gt;

&lt;p&gt;For important architecture claims include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;source location&lt;/li&gt;
&lt;li&gt;implementation/configuration&lt;/li&gt;
&lt;li&gt;evidence classification&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Open Questions
&lt;/h2&gt;

&lt;p&gt;Record information that cannot be established from the repository.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;business ownership&lt;/li&gt;
&lt;li&gt;runtime configuration supplied outside the repository&lt;/li&gt;
&lt;li&gt;production topology&lt;/li&gt;
&lt;li&gt;external system contract&lt;/li&gt;
&lt;li&gt;operational ownership&lt;/li&gt;
&lt;li&gt;undocumented business rules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not hide uncertainty.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Diagrams
&lt;/h1&gt;

&lt;p&gt;Generate diagrams only when they improve understanding.&lt;/p&gt;

&lt;p&gt;Preferred diagram types:&lt;/p&gt;

&lt;h2&gt;
  
  
  System Context
&lt;/h2&gt;

&lt;p&gt;Shows the application and external systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Container / Architecture
&lt;/h2&gt;

&lt;p&gt;Shows major technical components and dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Component
&lt;/h2&gt;

&lt;p&gt;Shows significant application components.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sequence
&lt;/h2&gt;

&lt;p&gt;Shows important runtime interactions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment
&lt;/h2&gt;

&lt;p&gt;Shows runtime/platform architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Class
&lt;/h2&gt;

&lt;p&gt;Shows important structural relationships where useful.&lt;/p&gt;

&lt;p&gt;Every diagram must be derived from the validated Architecture Evidence Model.&lt;/p&gt;

&lt;p&gt;Do not add speculative components or relationships.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Diagram Rules
&lt;/h1&gt;

&lt;p&gt;Use consistent notation.&lt;/p&gt;

&lt;p&gt;For every relationship make clear:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;source&lt;/li&gt;
&lt;li&gt;target&lt;/li&gt;
&lt;li&gt;interaction&lt;/li&gt;
&lt;li&gt;direction&lt;/li&gt;
&lt;li&gt;synchronous/asynchronous where relevant&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For messaging:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="c4f8r4"&lt;br&gt;
Producer&lt;br&gt;
   |&lt;br&gt;
   | Event&lt;br&gt;
   v&lt;br&gt;
Topic / Queue&lt;br&gt;
   |&lt;br&gt;
   v&lt;br&gt;
Consumer&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


For synchronous calls:



```text id="5t9iq2"
Caller
   |
   | HTTP/API
   v
Target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Do not use an arrow without a meaningful relationship.&lt;/p&gt;


&lt;h1&gt;
  
  
  5. Evidence Marking
&lt;/h1&gt;

&lt;p&gt;Do not clutter normal prose with evidence labels.&lt;/p&gt;

&lt;p&gt;Use evidence labels where uncertainty matters.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="w1b8id"&lt;br&gt;
&lt;strong&gt;Evidence status:&lt;/strong&gt; Verified&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


or:



```text id="5k90bx"
**Evidence status:** Inferred
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```text id="78a9t2"&lt;br&gt;
&lt;strong&gt;Evidence status:&lt;/strong&gt; Unknown&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


For important architecture claims, include the relevant source location.

---

# 6. Cross-Repository Compatibility

This document will later be combined with documentation from many repositories.

Therefore:

* preserve stable component names
* preserve topic names
* preserve API names
* preserve external system names
* preserve technology names
* use consistent terminology
* do not create arbitrary synonyms
* do not hide repository identity

The document must remain independently understandable while also being suitable for project-level aggregation.

---

# 7. Architecture Metadata

Include a metadata section containing:



```text id="h0d2f8"
Repository:
Application:
Document Type:
Source Commit:
Analysis Status:
Validation Status:
Architecture Confidence:
Known Limitations:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Do not invent values.&lt;/p&gt;

&lt;p&gt;If unavailable, use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Unknown&lt;/code&gt;&lt;/p&gt;


&lt;h1&gt;
  
  
  8. Writing Style
&lt;/h1&gt;

&lt;p&gt;Use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;short sentences&lt;/li&gt;
&lt;li&gt;active voice&lt;/li&gt;
&lt;li&gt;precise technical terms&lt;/li&gt;
&lt;li&gt;clear headings&lt;/li&gt;
&lt;li&gt;tables where they improve comparison&lt;/li&gt;
&lt;li&gt;diagrams where they improve understanding&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Avoid:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;marketing language&lt;/li&gt;
&lt;li&gt;unnecessary introductions&lt;/li&gt;
&lt;li&gt;generic technology tutorials&lt;/li&gt;
&lt;li&gt;repetition&lt;/li&gt;
&lt;li&gt;vague architectural claims&lt;/li&gt;
&lt;li&gt;unsupported business explanations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Follow approximately 80% ASD-STE100 principles while retaining normal professional architecture-documentation vocabulary.&lt;/p&gt;

&lt;p&gt;Use technical terminology where it is necessary.&lt;/p&gt;

&lt;p&gt;Do not simplify terminology merely to make the document shorter.&lt;/p&gt;


&lt;h1&gt;
  
  
  9. Final Documentation Quality Check
&lt;/h1&gt;

&lt;p&gt;Before producing the final document, validate the document against the Architecture Evidence Model.&lt;/p&gt;

&lt;p&gt;Check:&lt;/p&gt;
&lt;h3&gt;
  
  
  Accuracy
&lt;/h3&gt;

&lt;p&gt;Every significant architectural claim is supported by validated evidence.&lt;/p&gt;
&lt;h3&gt;
  
  
  Completeness
&lt;/h3&gt;

&lt;p&gt;All required sections exist.&lt;/p&gt;
&lt;h3&gt;
  
  
  Consistency
&lt;/h3&gt;

&lt;p&gt;Names and relationships are consistent across:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;prose&lt;/li&gt;
&lt;li&gt;tables&lt;/li&gt;
&lt;li&gt;diagrams&lt;/li&gt;
&lt;li&gt;source navigation&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Diagram consistency
&lt;/h3&gt;

&lt;p&gt;Every significant relationship shown in diagrams exists in the validated dependency model.&lt;/p&gt;
&lt;h3&gt;
  
  
  No invention
&lt;/h3&gt;

&lt;p&gt;No new architecture facts have been introduced.&lt;/p&gt;
&lt;h3&gt;
  
  
  Uncertainty
&lt;/h3&gt;

&lt;p&gt;Unknown and inferred information remains clearly identified.&lt;/p&gt;
&lt;h3&gt;
  
  
  Audience
&lt;/h3&gt;

&lt;p&gt;The document provides useful information for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;developers&lt;/li&gt;
&lt;li&gt;architects&lt;/li&gt;
&lt;li&gt;platform engineers&lt;/li&gt;
&lt;li&gt;DevOps engineers&lt;/li&gt;
&lt;li&gt;security engineers&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Cross-repository compatibility
&lt;/h3&gt;

&lt;p&gt;The structure and terminology remain compatible with equivalent documents generated for other repositories.&lt;/p&gt;


&lt;h1&gt;
  
  
  10. Final Output
&lt;/h1&gt;

&lt;p&gt;Return the complete repository architecture document.&lt;/p&gt;

&lt;p&gt;Do not return the Architecture Evidence Model unless specifically requested.&lt;/p&gt;

&lt;p&gt;Do not describe the documentation-generation process.&lt;/p&gt;

&lt;p&gt;Do not provide a summary of what you were instructed to do.&lt;/p&gt;

&lt;p&gt;The final output must be the architecture document itself.&lt;/p&gt;
&lt;h3&gt;
  
  
  Where Step 3 sits
&lt;/h3&gt;

&lt;p&gt;We now have a clean separation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                  REPOSITORY
                      │
                      ▼
            ┌─────────────────┐
            │ 1. EXTRACTION   │
            │                 │
            │ "What exists?"  │
            └────────┬────────┘
                     │
                     ▼
            Architecture
            Evidence Model
                     │
                     ▼
            ┌─────────────────┐
            │ 2. VALIDATION   │
            │                 │
            │ "Can we trust   │
            │  this?"         │
            └────────┬────────┘
                     │
                     ▼
             Validated Model
                     │
                     ▼
            ┌─────────────────┐
            │ 3. DOCUMENTATION│
            │                 │
            │ "How do we      │
            │ explain it?"    │
            └────────┬────────┘
                     │
                     ▼
             Repository
          Architecture Doc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is an important boundary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1 discovers.&lt;br&gt;
Step 2 challenges.&lt;br&gt;
Step 3 communicates.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That means when you eventually process 100 repositories, you are not asking the LLM to repeatedly "understand everything and write a README." You are creating &lt;strong&gt;100 validated, structurally identical architecture records&lt;/strong&gt;, which can then be aggregated in Step 4.&lt;/p&gt;

&lt;p&gt;And that is where the architecture gets interesting: &lt;strong&gt;Step 4 will not simply concatenate 100 documents.&lt;/strong&gt; It will build a &lt;strong&gt;project-wide architecture model&lt;/strong&gt; from the individual validated models and resolve cross-repository relationships.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>documentation</category>
      <category>softwaredevelopment</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Step 2 — Architecture Evidence Validation</title>
      <dc:creator>Karthi Mahadevan</dc:creator>
      <pubDate>Sun, 04 Oct 2026 12:16:49 +0000</pubDate>
      <link>https://dev.to/mkarthiatgithub/step-2-architecture-evidence-validation-5fi2</link>
      <guid>https://dev.to/mkarthiatgithub/step-2-architecture-evidence-validation-5fi2</guid>
      <description>&lt;h2&gt;
  
  
  Purpose
&lt;/h2&gt;

&lt;p&gt;Validate the Architecture Evidence Model produced by Step 1.&lt;/p&gt;

&lt;p&gt;This is a validation task.&lt;/p&gt;

&lt;p&gt;Do not generate the final architecture documentation.&lt;/p&gt;

&lt;p&gt;Do not improve the architecture.&lt;/p&gt;

&lt;p&gt;Do not silently correct unsupported claims.&lt;/p&gt;

&lt;p&gt;Determine whether the extracted architecture evidence is sufficiently accurate, complete, consistent, and traceable to the source repository.&lt;/p&gt;

&lt;p&gt;The output will be used to decide whether the repository can proceed to Step 3 — Documentation.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. Validation Principles
&lt;/h1&gt;

&lt;p&gt;Apply these principles throughout validation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Principle 1 — Source evidence is authoritative
&lt;/h3&gt;

&lt;p&gt;The source repository is the primary authority.&lt;/p&gt;

&lt;p&gt;The Architecture Evidence Model must not contain claims that cannot be supported by repository evidence.&lt;/p&gt;

&lt;h3&gt;
  
  
  Principle 2 — Do not validate by plausibility
&lt;/h3&gt;

&lt;p&gt;A statement being technically plausible is not sufficient.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Kafka is present.
Therefore the system is event-driven.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is not valid evidence.&lt;/p&gt;

&lt;p&gt;The validator must identify the actual producer, event/topic, consumer and processing behaviour.&lt;/p&gt;

&lt;h3&gt;
  
  
  Principle 3 — Distinguish fact from inference
&lt;/h3&gt;

&lt;p&gt;Every significant architectural claim must be classified as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Verified&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Inferred&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Unknown&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check that the classification matches the evidence.&lt;/p&gt;

&lt;h3&gt;
  
  
  Principle 4 — Do not silently repair
&lt;/h3&gt;

&lt;p&gt;If the extraction contains an error:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;identify the error&lt;/li&gt;
&lt;li&gt;provide the evidence&lt;/li&gt;
&lt;li&gt;state the required correction&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not silently modify the Architecture Evidence Model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Principle 5 — Prefer missing information over invented information
&lt;/h3&gt;

&lt;p&gt;If the repository does not provide enough evidence:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Unknown&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;is preferable to an unsupported conclusion.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Validation Result
&lt;/h1&gt;

&lt;p&gt;Return one overall status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PASS
PASS_WITH_WARNINGS
FAIL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  PASS
&lt;/h3&gt;

&lt;p&gt;The evidence model is sufficiently accurate and complete for documentation generation.&lt;/p&gt;

&lt;h3&gt;
  
  
  PASS_WITH_WARNINGS
&lt;/h3&gt;

&lt;p&gt;The model can proceed, but there are known limitations that must appear in the documentation.&lt;/p&gt;

&lt;h3&gt;
  
  
  FAIL
&lt;/h3&gt;

&lt;p&gt;The model contains significant errors, unsupported claims, contradictions, or missing evidence that could make the architecture documentation misleading.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Repository Coverage Check
&lt;/h1&gt;

&lt;p&gt;Confirm that Step 1 examined the relevant repository artefacts.&lt;/p&gt;

&lt;p&gt;Check for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;application source code&lt;/li&gt;
&lt;li&gt;configuration&lt;/li&gt;
&lt;li&gt;build files&lt;/li&gt;
&lt;li&gt;dependency definitions&lt;/li&gt;
&lt;li&gt;tests&lt;/li&gt;
&lt;li&gt;deployment manifests&lt;/li&gt;
&lt;li&gt;Dockerfiles&lt;/li&gt;
&lt;li&gt;Helm charts&lt;/li&gt;
&lt;li&gt;infrastructure definitions&lt;/li&gt;
&lt;li&gt;CI/CD configuration&lt;/li&gt;
&lt;li&gt;repository documentation&lt;/li&gt;
&lt;li&gt;scripts&lt;/li&gt;
&lt;li&gt;messaging configuration&lt;/li&gt;
&lt;li&gt;API definitions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For each category report:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Area&lt;/th&gt;
&lt;th&gt;Found&lt;/th&gt;
&lt;th&gt;Analysed&lt;/th&gt;
&lt;th&gt;Evidence&lt;/th&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If a category does not exist, record:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Not present&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Do not treat absence as a validation failure.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Evidence Traceability Check
&lt;/h1&gt;

&lt;p&gt;For every significant architectural claim, verify that evidence exists.&lt;/p&gt;

&lt;p&gt;Check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;source file path&lt;/li&gt;
&lt;li&gt;class/function/configuration&lt;/li&gt;
&lt;li&gt;relevant implementation&lt;/li&gt;
&lt;li&gt;configuration&lt;/li&gt;
&lt;li&gt;relationship evidence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Claim:
Payment Service consumes order.created.

Evidence:
src/messaging/OrderCreatedConsumer.java
Kafka consumer configuration
Topic configuration: order.created

Classification:
Verified
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Flag any claim that has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;no evidence&lt;/li&gt;
&lt;li&gt;vague evidence&lt;/li&gt;
&lt;li&gt;incorrect source location&lt;/li&gt;
&lt;li&gt;evidence that does not support the claim&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  5. Classification Check
&lt;/h1&gt;

&lt;p&gt;Check whether each significant item has the correct classification.&lt;/p&gt;

&lt;h3&gt;
  
  
  Verified
&lt;/h3&gt;

&lt;p&gt;Directly supported by repository evidence.&lt;/p&gt;

&lt;h3&gt;
  
  
  Inferred
&lt;/h3&gt;

&lt;p&gt;Reasonably derived from multiple pieces of evidence but not explicitly established.&lt;/p&gt;

&lt;h3&gt;
  
  
  Unknown
&lt;/h3&gt;

&lt;p&gt;Cannot be established from the repository.&lt;/p&gt;

&lt;p&gt;Flag cases where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Verified&lt;/code&gt; is actually only an inference&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Inferred&lt;/code&gt; should be &lt;code&gt;Unknown&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Unknown&lt;/code&gt; is incorrectly presented as fact&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  6. Component Validation
&lt;/h1&gt;

&lt;p&gt;Validate the extracted application components.&lt;/p&gt;

&lt;p&gt;For each significant component:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does it exist?&lt;/li&gt;
&lt;li&gt;Does the source location exist?&lt;/li&gt;
&lt;li&gt;Does its described responsibility match the implementation?&lt;/li&gt;
&lt;li&gt;Are relationships supported?&lt;/li&gt;
&lt;li&gt;Is the component actually architecturally significant?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Flag:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;invented components&lt;/li&gt;
&lt;li&gt;duplicated components&lt;/li&gt;
&lt;li&gt;incorrect names&lt;/li&gt;
&lt;li&gt;incorrect responsibilities&lt;/li&gt;
&lt;li&gt;components described at the wrong abstraction level&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not require every source-code class to appear as an architecture component.&lt;/p&gt;




&lt;h1&gt;
  
  
  7. Processing Flow Validation
&lt;/h1&gt;

&lt;p&gt;Validate every extracted major processing flow.&lt;/p&gt;

&lt;p&gt;For each flow check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Trigger
   ↓
Entry Point
   ↓
Processing
   ↓
External Interaction
   ↓
Persistence / Messaging
   ↓
Output
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Confirm that each significant step has source evidence.&lt;/p&gt;

&lt;p&gt;Check that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sequence is plausible from actual code&lt;/li&gt;
&lt;li&gt;synchronous interactions are not labelled asynchronous&lt;/li&gt;
&lt;li&gt;asynchronous interactions are not labelled synchronous&lt;/li&gt;
&lt;li&gt;error paths are supported&lt;/li&gt;
&lt;li&gt;persistence is supported&lt;/li&gt;
&lt;li&gt;external calls are supported&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Flag flows where the extraction jumps from:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;A → D&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;without evidence for:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;A → B → C → D&lt;/code&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  8. API Validation
&lt;/h1&gt;

&lt;p&gt;For every extracted API validate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;endpoint/path&lt;/li&gt;
&lt;li&gt;HTTP method where applicable&lt;/li&gt;
&lt;li&gt;implementation&lt;/li&gt;
&lt;li&gt;request/input&lt;/li&gt;
&lt;li&gt;response/output&lt;/li&gt;
&lt;li&gt;authentication&lt;/li&gt;
&lt;li&gt;downstream calls&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Confirm that API claims match actual source definitions.&lt;/p&gt;

&lt;p&gt;Flag:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;endpoints that do not exist&lt;/li&gt;
&lt;li&gt;incorrect HTTP methods&lt;/li&gt;
&lt;li&gt;incorrect request/response descriptions&lt;/li&gt;
&lt;li&gt;unsupported security claims&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  9. Messaging Validation
&lt;/h1&gt;

&lt;p&gt;This is a high-priority validation area.&lt;/p&gt;

&lt;p&gt;For every messaging relationship validate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Producer
    ↓
Topic / Queue
    ↓
Consumer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;technology&lt;/li&gt;
&lt;li&gt;topic/queue name&lt;/li&gt;
&lt;li&gt;producer&lt;/li&gt;
&lt;li&gt;consumer&lt;/li&gt;
&lt;li&gt;message/event&lt;/li&gt;
&lt;li&gt;configuration&lt;/li&gt;
&lt;li&gt;serialization/schema if available&lt;/li&gt;
&lt;li&gt;retry behaviour&lt;/li&gt;
&lt;li&gt;acknowledgement behaviour&lt;/li&gt;
&lt;li&gt;dead-letter handling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not accept:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Kafka dependency exists
→ Kafka integration exists
→ Event-driven architecture
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;without evidence of actual messaging behaviour.&lt;/p&gt;

&lt;p&gt;Flag orphaned relationships such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Topic exists
but no producer or consumer evidence was found.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unless the repository genuinely only contains one side of the integration.&lt;/p&gt;




&lt;h1&gt;
  
  
  10. Persistence Validation
&lt;/h1&gt;

&lt;p&gt;For every database or datastore:&lt;/p&gt;

&lt;p&gt;Check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;connection/configuration evidence&lt;/li&gt;
&lt;li&gt;actual usage&lt;/li&gt;
&lt;li&gt;read/write behaviour&lt;/li&gt;
&lt;li&gt;relevant repositories or adapters&lt;/li&gt;
&lt;li&gt;transaction evidence where claimed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not claim:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;transactional boundary&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;unless source evidence supports it.&lt;/p&gt;

&lt;p&gt;Do not claim:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;database is the system of record&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;unless the repository provides evidence sufficient to support that statement.&lt;/p&gt;




&lt;h1&gt;
  
  
  11. External Dependency Validation
&lt;/h1&gt;

&lt;p&gt;For every external system check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;source/configuration evidence&lt;/li&gt;
&lt;li&gt;protocol&lt;/li&gt;
&lt;li&gt;endpoint&lt;/li&gt;
&lt;li&gt;interaction direction&lt;/li&gt;
&lt;li&gt;authentication&lt;/li&gt;
&lt;li&gt;actual usage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Distinguish:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Configured dependency
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Actively used dependency
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A URL in configuration does not by itself prove that the application actively calls the system.&lt;/p&gt;




&lt;h1&gt;
  
  
  12. Deployment Validation
&lt;/h1&gt;

&lt;p&gt;Validate deployment claims against actual repository artefacts.&lt;/p&gt;

&lt;p&gt;Check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dockerfile&lt;/li&gt;
&lt;li&gt;Kubernetes manifests&lt;/li&gt;
&lt;li&gt;Helm charts&lt;/li&gt;
&lt;li&gt;Terraform&lt;/li&gt;
&lt;li&gt;CloudFormation&lt;/li&gt;
&lt;li&gt;AWS SAM&lt;/li&gt;
&lt;li&gt;CI/CD pipelines&lt;/li&gt;
&lt;li&gt;deployment scripts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Validate claims about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;runtime platform&lt;/li&gt;
&lt;li&gt;Kubernetes resources&lt;/li&gt;
&lt;li&gt;AWS resources&lt;/li&gt;
&lt;li&gt;storage&lt;/li&gt;
&lt;li&gt;networking&lt;/li&gt;
&lt;li&gt;secrets&lt;/li&gt;
&lt;li&gt;configuration&lt;/li&gt;
&lt;li&gt;health checks&lt;/li&gt;
&lt;li&gt;scaling&lt;/li&gt;
&lt;li&gt;deployment strategy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not infer runtime infrastructure that is not represented in the repository.&lt;/p&gt;




&lt;h1&gt;
  
  
  13. Security Validation
&lt;/h1&gt;

&lt;p&gt;Validate security claims against implementation or configuration.&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mTLS
OAuth
OIDC
JWT
IAM
Vault
Secrets Manager
certificate authentication
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check whether the evidence demonstrates actual use.&lt;/p&gt;

&lt;p&gt;Do not treat a library dependency as proof that the security mechanism is active.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Spring Security dependency exists
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;does not automatically prove:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OAuth authentication is enforced.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  14. Architecture Pattern Validation
&lt;/h1&gt;

&lt;p&gt;This is a critical quality gate.&lt;/p&gt;

&lt;p&gt;For every claimed architecture pattern, verify the required evidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Event-Driven Architecture
&lt;/h2&gt;

&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;event producers&lt;/li&gt;
&lt;li&gt;event definitions&lt;/li&gt;
&lt;li&gt;messaging transport&lt;/li&gt;
&lt;li&gt;asynchronous consumers&lt;/li&gt;
&lt;li&gt;event-driven processing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Kafka alone is insufficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  Saga
&lt;/h2&gt;

&lt;p&gt;Require evidence of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;distributed business transaction&lt;/li&gt;
&lt;li&gt;multiple participating services&lt;/li&gt;
&lt;li&gt;state progression&lt;/li&gt;
&lt;li&gt;orchestration or choreography&lt;/li&gt;
&lt;li&gt;compensation/recovery behaviour where applicable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Multiple services and Kafka alone are insufficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outbox
&lt;/h2&gt;

&lt;p&gt;Require evidence of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;business data persistence&lt;/li&gt;
&lt;li&gt;event persistence&lt;/li&gt;
&lt;li&gt;atomic or transactionally coupled write&lt;/li&gt;
&lt;li&gt;relay/publisher mechanism&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Database + Kafka is insufficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  CQRS
&lt;/h2&gt;

&lt;p&gt;Require evidence of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;distinct command and query responsibilities&lt;/li&gt;
&lt;li&gt;separate models or processing paths&lt;/li&gt;
&lt;li&gt;meaningful separation of write and read behaviour&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Separate controller classes are insufficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  API Gateway
&lt;/h2&gt;

&lt;p&gt;Require evidence that a gateway is acting as an entry point for multiple downstream services or equivalent gateway behaviour.&lt;/p&gt;

&lt;h2&gt;
  
  
  Circuit Breaker
&lt;/h2&gt;

&lt;p&gt;Require actual circuit-breaker configuration or implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Idempotent Consumer
&lt;/h2&gt;

&lt;p&gt;Require evidence of duplicate detection, idempotency keys, deduplication state, or equivalent behaviour.&lt;/p&gt;

&lt;p&gt;For each pattern return:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Evidence Found&lt;/th&gt;
&lt;th&gt;Required Evidence&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Event-Driven&lt;/td&gt;
&lt;td&gt;...&lt;/td&gt;
&lt;td&gt;...&lt;/td&gt;
&lt;td&gt;Confirmed/Possible/Not established&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Saga&lt;/td&gt;
&lt;td&gt;...&lt;/td&gt;
&lt;td&gt;...&lt;/td&gt;
&lt;td&gt;Confirmed/Possible/Not established&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Outbox&lt;/td&gt;
&lt;td&gt;...&lt;/td&gt;
&lt;td&gt;...&lt;/td&gt;
&lt;td&gt;Confirmed/Possible/Not established&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  15. Dependency Graph Validation
&lt;/h1&gt;

&lt;p&gt;Validate every dependency relationship.&lt;/p&gt;

&lt;p&gt;For each relationship:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Source
    ↓
Relationship
    ↓
Target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Confirm that both endpoints exist or are explicitly classified as external.&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Order Service
    → produces
order.created
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Payment Service
    → consumes
order.created
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Payment Service
    → calls
Customer API
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;missing endpoints&lt;/li&gt;
&lt;li&gt;impossible relationships&lt;/li&gt;
&lt;li&gt;duplicate relationships&lt;/li&gt;
&lt;li&gt;contradictory relationships&lt;/li&gt;
&lt;li&gt;incorrect direction&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  16. Cross-Section Consistency
&lt;/h1&gt;

&lt;p&gt;Compare information across the entire Architecture Evidence Model.&lt;/p&gt;

&lt;p&gt;Check for contradictions such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Section A:
Payment Service consumes order.created.

Section B:
Payment Service produces order.created.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dependency Model:
SQS

Messaging Model:
Kafka
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Deployment:
Kubernetes

Infrastructure:
EC2 standalone deployment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not assume one is correct.&lt;/p&gt;

&lt;p&gt;Report the contradiction and identify the evidence required to resolve it.&lt;/p&gt;




&lt;h1&gt;
  
  
  17. Naming Consistency
&lt;/h1&gt;

&lt;p&gt;Check that the same entity is not represented using inconsistent names.&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PaymentService
payment-service
Payment Service
Payments Service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Determine whether these are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the same entity&lt;/li&gt;
&lt;li&gt;different entities&lt;/li&gt;
&lt;li&gt;unresolved&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not automatically merge entities unless evidence supports the relationship.&lt;/p&gt;




&lt;h1&gt;
  
  
  18. Completeness Check
&lt;/h1&gt;

&lt;p&gt;Check whether the extraction contains enough information for the next stage.&lt;/p&gt;

&lt;p&gt;Required areas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;application identity&lt;/li&gt;
&lt;li&gt;significant components&lt;/li&gt;
&lt;li&gt;major processing flows&lt;/li&gt;
&lt;li&gt;APIs&lt;/li&gt;
&lt;li&gt;messaging&lt;/li&gt;
&lt;li&gt;persistence&lt;/li&gt;
&lt;li&gt;external dependencies&lt;/li&gt;
&lt;li&gt;deployment&lt;/li&gt;
&lt;li&gt;security where identifiable&lt;/li&gt;
&lt;li&gt;observability where identifiable&lt;/li&gt;
&lt;li&gt;resilience where identifiable&lt;/li&gt;
&lt;li&gt;architecture pattern evidence&lt;/li&gt;
&lt;li&gt;dependency relationships&lt;/li&gt;
&lt;li&gt;unknowns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A missing area is not automatically a failure.&lt;/p&gt;

&lt;p&gt;Determine whether it is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Not present&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;or:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Not analysed&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;or:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Missing evidence&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;These have different meanings.&lt;/p&gt;




&lt;h1&gt;
  
  
  19. Hallucination Check
&lt;/h1&gt;

&lt;p&gt;Actively search for unsupported claims.&lt;/p&gt;

&lt;p&gt;Ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Could this statement have been produced from general software knowledge rather than repository evidence?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If yes, inspect the evidence.&lt;/p&gt;

&lt;p&gt;Flag claims such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;assumed business purpose&lt;/li&gt;
&lt;li&gt;assumed architecture pattern&lt;/li&gt;
&lt;li&gt;assumed runtime behaviour&lt;/li&gt;
&lt;li&gt;assumed scalability&lt;/li&gt;
&lt;li&gt;assumed high availability&lt;/li&gt;
&lt;li&gt;assumed disaster recovery&lt;/li&gt;
&lt;li&gt;assumed security controls&lt;/li&gt;
&lt;li&gt;assumed data ownership&lt;/li&gt;
&lt;li&gt;assumed transaction boundaries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unless supported by evidence.&lt;/p&gt;




&lt;h1&gt;
  
  
  20. Unknowns Check
&lt;/h1&gt;

&lt;p&gt;Ensure uncertainty has not been hidden.&lt;/p&gt;

&lt;p&gt;The validation must identify important unanswered questions.&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Business purpose unknown.

Runtime deployment environment not established.

Kafka topic ownership not established.

External system contract not available.

Production scaling configuration not present.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These must remain explicit.&lt;/p&gt;




&lt;h1&gt;
  
  
  21. Validation Findings
&lt;/h1&gt;

&lt;p&gt;Produce a findings table.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Severity&lt;/th&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Finding&lt;/th&gt;
&lt;th&gt;Evidence&lt;/th&gt;
&lt;th&gt;Required Action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Severity:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Critical&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;High&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Medium&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Low&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Informational&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;V001 | High | Evidence | Saga claimed without compensation/orchestration evidence | ... | Remove claim or provide evidence

V002 | Medium | Completeness | Deployment strategy not established | ... | Mark Unknown

V003 | Low | Naming | PaymentService and payment-service may refer to same component | ... | Confirm canonical identity
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  22. Correction Instructions
&lt;/h1&gt;

&lt;p&gt;If validation fails, produce explicit correction instructions for Step 1.&lt;/p&gt;

&lt;p&gt;Format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CORRECTION REQUEST

Finding:
...

Problem:
...

Required re-analysis:
...

Source locations to inspect:
...

Expected correction:
...

Do not modify unrelated areas.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The correction request must be actionable.&lt;/p&gt;




&lt;h1&gt;
  
  
  23. Final Quality Gate
&lt;/h1&gt;

&lt;p&gt;The Architecture Evidence Model may proceed to Step 3 only when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;no Critical findings remain&lt;/li&gt;
&lt;li&gt;no High unsupported architectural claims remain&lt;/li&gt;
&lt;li&gt;significant claims have evidence&lt;/li&gt;
&lt;li&gt;classifications are reasonable&lt;/li&gt;
&lt;li&gt;major relationships are traceable&lt;/li&gt;
&lt;li&gt;contradictions are resolved or explicitly documented&lt;/li&gt;
&lt;li&gt;unknowns are clearly identified&lt;/li&gt;
&lt;li&gt;architecture patterns are evidence-based&lt;/li&gt;
&lt;li&gt;naming is sufficiently consistent&lt;/li&gt;
&lt;li&gt;the dependency model is usable for later aggregation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Return:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VALIDATION STATUS:
PASS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VALIDATION STATUS:
PASS_WITH_WARNINGS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VALIDATION STATUS:
FAIL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not generate the final architecture documentation.&lt;/p&gt;

&lt;p&gt;Step 3 will consume the validated Architecture Evidence Model.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>softwaredevelopment</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>small agentic documentation pipeline</title>
      <dc:creator>Karthi Mahadevan</dc:creator>
      <pubDate>Sun, 04 Oct 2026 12:13:00 +0000</pubDate>
      <link>https://dev.to/mkarthiatgithub/small-agentic-documentation-pipeline-57hg</link>
      <guid>https://dev.to/mkarthiatgithub/small-agentic-documentation-pipeline-57hg</guid>
      <description>&lt;ol&gt;
&lt;li&gt;EXTRACTION
  ↓&lt;/li&gt;
&lt;li&gt;VALIDATION
  ↓&lt;/li&gt;
&lt;li&gt;DOCUMENTATION
  ↓&lt;/li&gt;
&lt;li&gt;AGGREGATION
  ↓&lt;/li&gt;
&lt;li&gt;PROJECT VALIDATION&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Yes. We should treat this as a &lt;strong&gt;small agentic documentation pipeline&lt;/strong&gt;, but we do not need to make it complicated.&lt;/p&gt;

&lt;p&gt;I would split it into &lt;strong&gt;5 main stages&lt;/strong&gt;, matching exactly what you chose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. EXTRACTION
      ↓
2. VALIDATION
      ↓
3. DOCUMENTATION
      ↓
4. AGGREGATION
      ↓
5. PROJECT VALIDATION
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside those stages, we will eventually have several prompts. But &lt;strong&gt;do not create all of them now&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We will build them one at a time and keep the output contract stable.&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 1 — EXTRACTION
&lt;/h1&gt;

&lt;p&gt;The purpose of Step 1 is very important:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Do not write architecture documentation yet.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Extract what can be established from the source code and repository.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Think of this as building the &lt;strong&gt;Architecture Evidence Model&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SOURCE REPOSITORY
       ↓
   STEP 1 PROMPT
       ↓
ARCHITECTURE EVIDENCE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output is &lt;strong&gt;structured facts&lt;/strong&gt;, not a polished README.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1 prompt
&lt;/h2&gt;

&lt;p&gt;I recommend making this a separate prompt from your existing documentation prompt.&lt;/p&gt;

&lt;p&gt;Save the following as:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;01-source-extraction.md&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 1 — Source-to-Architecture Extraction
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Purpose
&lt;/h2&gt;

&lt;p&gt;Analyse the supplied source repository and extract the architecture evidence that can be established from the repository.&lt;/p&gt;

&lt;p&gt;This is an extraction task.&lt;/p&gt;

&lt;p&gt;Do not write the final architecture documentation.&lt;/p&gt;

&lt;p&gt;Do not improve, simplify, or redesign the architecture.&lt;/p&gt;

&lt;p&gt;Do not assume that a technology implies an architecture pattern.&lt;/p&gt;

&lt;p&gt;Extract evidence from the source code, configuration, deployment files, infrastructure definitions, tests, documentation, and other repository artefacts.&lt;/p&gt;

&lt;p&gt;The output will be consumed by later stages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Validation&lt;/li&gt;
&lt;li&gt;Documentation generation&lt;/li&gt;
&lt;li&gt;Cross-repository aggregation&lt;/li&gt;
&lt;li&gt;Project-level architecture analysis&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Accuracy is more important than completeness.&lt;/p&gt;

&lt;p&gt;If information cannot be established from the repository, mark it as &lt;code&gt;Unknown&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If information is reasonably inferred from evidence but is not explicitly established, mark it as &lt;code&gt;Inferred&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;Verified&lt;/code&gt; only when the repository provides direct evidence.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. Analysis Rules
&lt;/h1&gt;

&lt;p&gt;Follow these rules throughout the analysis.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 1 — Evidence first
&lt;/h3&gt;

&lt;p&gt;Every significant architectural fact must have supporting repository evidence.&lt;/p&gt;

&lt;p&gt;Record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;source file path&lt;/li&gt;
&lt;li&gt;relevant class/function/configuration where useful&lt;/li&gt;
&lt;li&gt;evidence description&lt;/li&gt;
&lt;li&gt;confidence classification&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Verified&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Inferred&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Unknown&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not present inference as fact.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 2 — Do not invent business meaning
&lt;/h3&gt;

&lt;p&gt;The repository may reveal technical behaviour without revealing the business purpose.&lt;/p&gt;

&lt;p&gt;Do not invent business context.&lt;/p&gt;

&lt;p&gt;If the business purpose cannot be established:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Unknown — business purpose not established from repository evidence.&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 3 — Technology does not prove architecture
&lt;/h3&gt;

&lt;p&gt;Do not infer an architecture pattern merely because a technology is present.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kafka does not automatically prove Event-Driven Architecture.&lt;/li&gt;
&lt;li&gt;Multiple microservices do not automatically prove Saga.&lt;/li&gt;
&lt;li&gt;A database and messaging system do not automatically prove Outbox.&lt;/li&gt;
&lt;li&gt;Separate read/write classes do not automatically prove CQRS.&lt;/li&gt;
&lt;li&gt;Kubernetes does not automatically prove cloud-native architecture.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Record the technical evidence first.&lt;/p&gt;

&lt;p&gt;Only record an architecture pattern when the required behavioural evidence exists.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 4 — Distinguish source behaviour from infrastructure
&lt;/h3&gt;

&lt;p&gt;Separate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;application behaviour&lt;/li&gt;
&lt;li&gt;configuration&lt;/li&gt;
&lt;li&gt;infrastructure/deployment&lt;/li&gt;
&lt;li&gt;runtime assumptions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not assume that infrastructure configuration proves application behaviour.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 5 — Preserve names
&lt;/h3&gt;

&lt;p&gt;Use the names found in the repository for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;services&lt;/li&gt;
&lt;li&gt;applications&lt;/li&gt;
&lt;li&gt;classes&lt;/li&gt;
&lt;li&gt;interfaces&lt;/li&gt;
&lt;li&gt;APIs&lt;/li&gt;
&lt;li&gt;events&lt;/li&gt;
&lt;li&gt;topics&lt;/li&gt;
&lt;li&gt;queues&lt;/li&gt;
&lt;li&gt;databases&lt;/li&gt;
&lt;li&gt;external systems&lt;/li&gt;
&lt;li&gt;configuration properties&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not rename them for convenience.&lt;/p&gt;

&lt;p&gt;A later stage may create canonical names.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule 6 — Do not fill gaps
&lt;/h3&gt;

&lt;p&gt;When evidence is missing:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Unknown&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Do not guess.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Repository Identity
&lt;/h1&gt;

&lt;p&gt;Extract:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;repository name&lt;/li&gt;
&lt;li&gt;application/service name&lt;/li&gt;
&lt;li&gt;repository purpose if explicitly stated&lt;/li&gt;
&lt;li&gt;programming languages&lt;/li&gt;
&lt;li&gt;major frameworks&lt;/li&gt;
&lt;li&gt;build system&lt;/li&gt;
&lt;li&gt;repository structure&lt;/li&gt;
&lt;li&gt;deployment model if identifiable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For each item provide evidence.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Application Components
&lt;/h1&gt;

&lt;p&gt;Identify the significant application components.&lt;/p&gt;

&lt;p&gt;For each component record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;component name&lt;/li&gt;
&lt;li&gt;type&lt;/li&gt;
&lt;li&gt;responsibility&lt;/li&gt;
&lt;li&gt;source location&lt;/li&gt;
&lt;li&gt;relationships to other components&lt;/li&gt;
&lt;li&gt;evidence&lt;/li&gt;
&lt;li&gt;classification&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Component types may include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;service&lt;/li&gt;
&lt;li&gt;controller&lt;/li&gt;
&lt;li&gt;API&lt;/li&gt;
&lt;li&gt;consumer&lt;/li&gt;
&lt;li&gt;producer&lt;/li&gt;
&lt;li&gt;processor&lt;/li&gt;
&lt;li&gt;handler&lt;/li&gt;
&lt;li&gt;scheduler&lt;/li&gt;
&lt;li&gt;repository&lt;/li&gt;
&lt;li&gt;database adapter&lt;/li&gt;
&lt;li&gt;external-system adapter&lt;/li&gt;
&lt;li&gt;domain component&lt;/li&gt;
&lt;li&gt;configuration component&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not list every class.&lt;/p&gt;

&lt;p&gt;Focus on components that contribute to the architecture.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Main Processing Flows
&lt;/h1&gt;

&lt;p&gt;Identify the major application flows that can be established from the source.&lt;/p&gt;

&lt;p&gt;For each flow record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;trigger&lt;/li&gt;
&lt;li&gt;entry point&lt;/li&gt;
&lt;li&gt;processing steps&lt;/li&gt;
&lt;li&gt;important components&lt;/li&gt;
&lt;li&gt;external calls&lt;/li&gt;
&lt;li&gt;messaging&lt;/li&gt;
&lt;li&gt;persistence&lt;/li&gt;
&lt;li&gt;output&lt;/li&gt;
&lt;li&gt;error handling&lt;/li&gt;
&lt;li&gt;evidence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Distinguish:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;synchronous flow&lt;/li&gt;
&lt;li&gt;asynchronous flow&lt;/li&gt;
&lt;li&gt;scheduled flow&lt;/li&gt;
&lt;li&gt;event-driven flow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not create a business flow that cannot be supported by evidence.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. Interfaces and APIs
&lt;/h1&gt;

&lt;p&gt;Identify application interfaces.&lt;/p&gt;

&lt;p&gt;Include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;REST APIs&lt;/li&gt;
&lt;li&gt;GraphQL APIs&lt;/li&gt;
&lt;li&gt;messaging interfaces&lt;/li&gt;
&lt;li&gt;event interfaces&lt;/li&gt;
&lt;li&gt;command interfaces&lt;/li&gt;
&lt;li&gt;scheduled interfaces&lt;/li&gt;
&lt;li&gt;other externally triggered interfaces&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For each interface record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;name/path&lt;/li&gt;
&lt;li&gt;method or interaction type&lt;/li&gt;
&lt;li&gt;producer&lt;/li&gt;
&lt;li&gt;consumer&lt;/li&gt;
&lt;li&gt;input&lt;/li&gt;
&lt;li&gt;output&lt;/li&gt;
&lt;li&gt;authentication/security evidence&lt;/li&gt;
&lt;li&gt;source location&lt;/li&gt;
&lt;li&gt;evidence classification&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  6. Messaging
&lt;/h1&gt;

&lt;p&gt;Identify all messaging technologies and messaging relationships.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kafka&lt;/li&gt;
&lt;li&gt;SQS&lt;/li&gt;
&lt;li&gt;SNS&lt;/li&gt;
&lt;li&gt;RabbitMQ&lt;/li&gt;
&lt;li&gt;other brokers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For each messaging relationship record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;technology&lt;/li&gt;
&lt;li&gt;topic/queue/channel&lt;/li&gt;
&lt;li&gt;producer&lt;/li&gt;
&lt;li&gt;consumer&lt;/li&gt;
&lt;li&gt;message/event name&lt;/li&gt;
&lt;li&gt;direction&lt;/li&gt;
&lt;li&gt;message structure if identifiable&lt;/li&gt;
&lt;li&gt;configuration&lt;/li&gt;
&lt;li&gt;retry behaviour&lt;/li&gt;
&lt;li&gt;dead-letter handling&lt;/li&gt;
&lt;li&gt;ordering evidence&lt;/li&gt;
&lt;li&gt;acknowledgement behaviour&lt;/li&gt;
&lt;li&gt;source evidence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not infer semantics that are not supported by source evidence.&lt;/p&gt;




&lt;h1&gt;
  
  
  7. Data and Persistence
&lt;/h1&gt;

&lt;p&gt;Identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;databases&lt;/li&gt;
&lt;li&gt;tables where architecturally relevant&lt;/li&gt;
&lt;li&gt;repositories&lt;/li&gt;
&lt;li&gt;persistence frameworks&lt;/li&gt;
&lt;li&gt;caches&lt;/li&gt;
&lt;li&gt;object stores&lt;/li&gt;
&lt;li&gt;external data stores&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For each dependency record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;technology&lt;/li&gt;
&lt;li&gt;purpose&lt;/li&gt;
&lt;li&gt;read/write behaviour&lt;/li&gt;
&lt;li&gt;relevant entities&lt;/li&gt;
&lt;li&gt;transaction boundaries if identifiable&lt;/li&gt;
&lt;li&gt;source evidence&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  8. External Systems
&lt;/h1&gt;

&lt;p&gt;Identify systems outside the repository.&lt;/p&gt;

&lt;p&gt;For each external dependency record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;system name&lt;/li&gt;
&lt;li&gt;interaction type&lt;/li&gt;
&lt;li&gt;direction&lt;/li&gt;
&lt;li&gt;protocol/technology&lt;/li&gt;
&lt;li&gt;purpose if established&lt;/li&gt;
&lt;li&gt;configuration&lt;/li&gt;
&lt;li&gt;authentication mechanism if identifiable&lt;/li&gt;
&lt;li&gt;failure handling&lt;/li&gt;
&lt;li&gt;source evidence&lt;/li&gt;
&lt;li&gt;classification&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  9. Security
&lt;/h1&gt;

&lt;p&gt;Extract security mechanisms that are actually present.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;authentication&lt;/li&gt;
&lt;li&gt;authorisation&lt;/li&gt;
&lt;li&gt;mTLS&lt;/li&gt;
&lt;li&gt;OAuth/OIDC&lt;/li&gt;
&lt;li&gt;JWT&lt;/li&gt;
&lt;li&gt;certificates&lt;/li&gt;
&lt;li&gt;secrets&lt;/li&gt;
&lt;li&gt;Vault&lt;/li&gt;
&lt;li&gt;AWS Secrets Manager&lt;/li&gt;
&lt;li&gt;IAM&lt;/li&gt;
&lt;li&gt;API security&lt;/li&gt;
&lt;li&gt;network security configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not infer security controls that are not evidenced.&lt;/p&gt;




&lt;h1&gt;
  
  
  10. Configuration
&lt;/h1&gt;

&lt;p&gt;Identify important configuration.&lt;/p&gt;

&lt;p&gt;Include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;environment variables&lt;/li&gt;
&lt;li&gt;configuration files&lt;/li&gt;
&lt;li&gt;secrets references&lt;/li&gt;
&lt;li&gt;endpoints&lt;/li&gt;
&lt;li&gt;topic names&lt;/li&gt;
&lt;li&gt;queue names&lt;/li&gt;
&lt;li&gt;database configuration&lt;/li&gt;
&lt;li&gt;feature flags&lt;/li&gt;
&lt;li&gt;timeout values&lt;/li&gt;
&lt;li&gt;retry configuration&lt;/li&gt;
&lt;li&gt;external service configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Distinguish:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;hard-coded values&lt;/li&gt;
&lt;li&gt;environment configuration&lt;/li&gt;
&lt;li&gt;secret references&lt;/li&gt;
&lt;li&gt;infrastructure-provided configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not expose secret values.&lt;/p&gt;




&lt;h1&gt;
  
  
  11. Deployment and Infrastructure
&lt;/h1&gt;

&lt;p&gt;Extract deployment evidence.&lt;/p&gt;

&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dockerfiles&lt;/li&gt;
&lt;li&gt;Kubernetes manifests&lt;/li&gt;
&lt;li&gt;Helm charts&lt;/li&gt;
&lt;li&gt;Terraform&lt;/li&gt;
&lt;li&gt;CloudFormation&lt;/li&gt;
&lt;li&gt;AWS SAM&lt;/li&gt;
&lt;li&gt;Jenkins&lt;/li&gt;
&lt;li&gt;GitLab CI&lt;/li&gt;
&lt;li&gt;GitHub Actions&lt;/li&gt;
&lt;li&gt;Flux&lt;/li&gt;
&lt;li&gt;Argo CD&lt;/li&gt;
&lt;li&gt;other deployment mechanisms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;deployment unit&lt;/li&gt;
&lt;li&gt;runtime platform&lt;/li&gt;
&lt;li&gt;Kubernetes resources&lt;/li&gt;
&lt;li&gt;AWS resources&lt;/li&gt;
&lt;li&gt;networking dependencies&lt;/li&gt;
&lt;li&gt;storage&lt;/li&gt;
&lt;li&gt;configuration injection&lt;/li&gt;
&lt;li&gt;secrets injection&lt;/li&gt;
&lt;li&gt;scaling configuration&lt;/li&gt;
&lt;li&gt;health checks&lt;/li&gt;
&lt;li&gt;deployment strategy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Only record infrastructure that can be established from repository evidence.&lt;/p&gt;




&lt;h1&gt;
  
  
  12. Observability
&lt;/h1&gt;

&lt;p&gt;Identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;logging&lt;/li&gt;
&lt;li&gt;metrics&lt;/li&gt;
&lt;li&gt;tracing&lt;/li&gt;
&lt;li&gt;health endpoints&lt;/li&gt;
&lt;li&gt;monitoring integrations&lt;/li&gt;
&lt;li&gt;alerts&lt;/li&gt;
&lt;li&gt;correlation IDs&lt;/li&gt;
&lt;li&gt;audit logging&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Record the implementation evidence.&lt;/p&gt;




&lt;h1&gt;
  
  
  13. Resilience and Failure Handling
&lt;/h1&gt;

&lt;p&gt;Identify actual implementation of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;retries&lt;/li&gt;
&lt;li&gt;timeout handling&lt;/li&gt;
&lt;li&gt;circuit breakers&lt;/li&gt;
&lt;li&gt;dead-letter queues&lt;/li&gt;
&lt;li&gt;fallback&lt;/li&gt;
&lt;li&gt;idempotency&lt;/li&gt;
&lt;li&gt;duplicate handling&lt;/li&gt;
&lt;li&gt;transaction handling&lt;/li&gt;
&lt;li&gt;compensation&lt;/li&gt;
&lt;li&gt;recovery&lt;/li&gt;
&lt;li&gt;graceful degradation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not label these as architecture patterns unless the evidence supports the pattern.&lt;/p&gt;




&lt;h1&gt;
  
  
  14. Architecture Pattern Evidence
&lt;/h1&gt;

&lt;p&gt;Evaluate the repository for evidence of known architecture patterns.&lt;/p&gt;

&lt;p&gt;Possible patterns include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Event-Driven Architecture&lt;/li&gt;
&lt;li&gt;Saga&lt;/li&gt;
&lt;li&gt;Saga choreography&lt;/li&gt;
&lt;li&gt;Saga orchestration&lt;/li&gt;
&lt;li&gt;Outbox&lt;/li&gt;
&lt;li&gt;CQRS&lt;/li&gt;
&lt;li&gt;API Gateway&lt;/li&gt;
&lt;li&gt;Hexagonal Architecture&lt;/li&gt;
&lt;li&gt;Ports and Adapters&lt;/li&gt;
&lt;li&gt;Layered Architecture&lt;/li&gt;
&lt;li&gt;Retry&lt;/li&gt;
&lt;li&gt;Circuit Breaker&lt;/li&gt;
&lt;li&gt;Idempotent Consumer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For each candidate pattern provide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;pattern&lt;/li&gt;
&lt;li&gt;evidence required&lt;/li&gt;
&lt;li&gt;evidence found&lt;/li&gt;
&lt;li&gt;classification&lt;/li&gt;
&lt;li&gt;conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Confirmed&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Possible&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Not established&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Do not confirm a pattern from technology names alone.&lt;/p&gt;




&lt;h1&gt;
  
  
  15. Dependency Model
&lt;/h1&gt;

&lt;p&gt;Create a structured list of dependencies.&lt;/p&gt;

&lt;p&gt;For every significant relationship record:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;th&gt;Relationship&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;th&gt;Direction&lt;/th&gt;
&lt;th&gt;Evidence&lt;/th&gt;
&lt;th&gt;Classification&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Order Service | produces event | order.created | Kafka | outbound | source evidence | Verified

Payment Service | consumes event | order.created | Kafka | inbound | source evidence | Verified

Payment Service | calls | Customer API | REST | outbound | source evidence | Verified
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This dependency model is particularly important.&lt;/p&gt;

&lt;p&gt;It will later be aggregated across many repositories.&lt;/p&gt;




&lt;h1&gt;
  
  
  16. Architecture Evidence Model
&lt;/h1&gt;

&lt;p&gt;Produce a structured representation containing at least:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Repository
Application
Components
ProcessingFlows
APIs
Messages
Topics
Queues
Databases
ExternalSystems
Security
Configuration
Deployment
Observability
Resilience
ArchitecturePatterns
Dependencies
Unknowns
Evidence
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use stable names and relationships.&lt;/p&gt;

&lt;p&gt;The model must be suitable for machine processing and later aggregation.&lt;/p&gt;




&lt;h1&gt;
  
  
  17. Unknowns and Gaps
&lt;/h1&gt;

&lt;p&gt;Create an explicit list of information that cannot be established.&lt;/p&gt;

&lt;p&gt;For each unknown record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;missing information&lt;/li&gt;
&lt;li&gt;why it cannot be established&lt;/li&gt;
&lt;li&gt;what source or human information would be required&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Unknown:
Business purpose of PaymentProcessor.

Reason:
Technical behaviour is visible, but no business documentation exists.

Required confirmation:
Product/business owner.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  18. Final Extraction Check
&lt;/h1&gt;

&lt;p&gt;Before producing the final output, perform this check.&lt;/p&gt;

&lt;h3&gt;
  
  
  Coverage
&lt;/h3&gt;

&lt;p&gt;Confirm that you examined:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;source code&lt;/li&gt;
&lt;li&gt;configuration&lt;/li&gt;
&lt;li&gt;build files&lt;/li&gt;
&lt;li&gt;deployment files&lt;/li&gt;
&lt;li&gt;infrastructure files&lt;/li&gt;
&lt;li&gt;CI/CD configuration&lt;/li&gt;
&lt;li&gt;tests&lt;/li&gt;
&lt;li&gt;repository documentation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a category does not exist, record that it was checked and not found.&lt;/p&gt;

&lt;h3&gt;
  
  
  Evidence
&lt;/h3&gt;

&lt;p&gt;Confirm:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;significant claims have evidence&lt;/li&gt;
&lt;li&gt;inferred facts are labelled&lt;/li&gt;
&lt;li&gt;unknown facts are labelled&lt;/li&gt;
&lt;li&gt;no unsupported architecture pattern is claimed&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Relationships
&lt;/h3&gt;

&lt;p&gt;Confirm:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;producers and consumers are identified where possible&lt;/li&gt;
&lt;li&gt;upstream and downstream relationships are recorded&lt;/li&gt;
&lt;li&gt;APIs are connected to their implementations&lt;/li&gt;
&lt;li&gt;messaging relationships are connected to source evidence&lt;/li&gt;
&lt;li&gt;persistence relationships are recorded&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Consistency
&lt;/h3&gt;

&lt;p&gt;Confirm:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;component names are consistent&lt;/li&gt;
&lt;li&gt;topic names are consistent&lt;/li&gt;
&lt;li&gt;API names are consistent&lt;/li&gt;
&lt;li&gt;external system names are consistent&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Final rule
&lt;/h3&gt;

&lt;p&gt;Do not generate polished architecture documentation.&lt;/p&gt;

&lt;p&gt;Return the &lt;strong&gt;Architecture Evidence Model&lt;/strong&gt; and the associated evidence.&lt;/p&gt;

&lt;p&gt;This output will be passed to Step 2 — Validation.&lt;/p&gt;

&lt;h3&gt;
  
  
  What this gives us
&lt;/h3&gt;

&lt;p&gt;The important distinction is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1 does not try to make the documentation beautiful.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It tries to answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"What does the repository actually tell us?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That gives Step 2 something concrete to validate.&lt;/p&gt;

&lt;p&gt;Our pipeline now looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────────────────┐
│    SOURCE REPO      │
└──────────┬──────────┘
           ↓
┌─────────────────────┐
│  1. EXTRACTION      │
│                     │
│ Architecture       │
│ Evidence Model      │
└──────────┬──────────┘
           ↓
┌─────────────────────┐
│  2. VALIDATION      │  ← next
└──────────┬──────────┘
           ↓
┌─────────────────────┐
│  3. DOCUMENTATION   │
└──────────┬──────────┘
           ↓
┌─────────────────────┐
│  4. AGGREGATION     │
└──────────┬──────────┘
           ↓
┌─────────────────────┐
│ 5. PROJECT          │
│    VALIDATION       │
└─────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And yes, &lt;strong&gt;this is agentic in the useful sense&lt;/strong&gt;: each stage has a defined job, a defined input, and a defined output. But we are not yet adding autonomous agents or complex orchestration. We are first designing the &lt;strong&gt;contracts between the stages&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next, Step 2 should be the Validation Prompt.&lt;/strong&gt; That is where we make the system catch omissions, unsupported claims, contradictions and hallucinated architecture before documentation is generated.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>automation</category>
      <category>documentation</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Source-to-Architecture Documentation Framework</title>
      <dc:creator>Karthi Mahadevan</dc:creator>
      <pubDate>Sun, 04 Oct 2026 11:48:35 +0000</pubDate>
      <link>https://dev.to/mkarthiatgithub/source-to-architecture-documentation-framework-46lp</link>
      <guid>https://dev.to/mkarthiatgithub/source-to-architecture-documentation-framework-46lp</guid>
      <description>&lt;h1&gt;
  
  
  A reusable methodology for generating high-quality technical documentation from source code using LLMs
&lt;/h1&gt;

&lt;h1&gt;
  
  
  1. Introduction
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1.1 The objective
&lt;/h2&gt;

&lt;p&gt;The objective is to generate accurate, useful and maintainable architecture documentation from an existing software repository.&lt;/p&gt;

&lt;p&gt;The documentation must explain the system as a whole.&lt;/p&gt;

&lt;p&gt;It must not simply describe source files, classes, methods or dependencies.&lt;/p&gt;

&lt;p&gt;It must help different technical audiences understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why the system exists.&lt;/li&gt;
&lt;li&gt;What business problem it solves.&lt;/li&gt;
&lt;li&gt;What the system does.&lt;/li&gt;
&lt;li&gt;How the system processes information.&lt;/li&gt;
&lt;li&gt;How its components interact.&lt;/li&gt;
&lt;li&gt;What data enters and leaves the system.&lt;/li&gt;
&lt;li&gt;Which systems are upstream and downstream.&lt;/li&gt;
&lt;li&gt;Which architectural patterns the system implements.&lt;/li&gt;
&lt;li&gt;How messaging and integration technologies support the application.&lt;/li&gt;
&lt;li&gt;How the application uses its underlying platform.&lt;/li&gt;
&lt;li&gt;How failures, retries and errors affect the flow.&lt;/li&gt;
&lt;li&gt;Where the important implementation details exist in the source code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The final document must connect business behaviour, application implementation and platform architecture.&lt;/p&gt;

&lt;p&gt;The goal is not to explain every technology.&lt;/p&gt;

&lt;p&gt;The goal is to explain how this particular system uses those technologies to deliver its business capability.&lt;/p&gt;

&lt;h2&gt;
  
  
  1.2 What this documentation is not
&lt;/h2&gt;

&lt;p&gt;This documentation is not:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A programming tutorial.&lt;/li&gt;
&lt;li&gt;A Kubernetes or Kafka introduction.&lt;/li&gt;
&lt;li&gt;A generic technology reference.&lt;/li&gt;
&lt;li&gt;A list of source-code files.&lt;/li&gt;
&lt;li&gt;An automatically generated class inventory.&lt;/li&gt;
&lt;li&gt;A marketing document.&lt;/li&gt;
&lt;li&gt;A description of an ideal architecture that does not match the implementation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, if an application uses Kafka, the documentation should explain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which component publishes messages.&lt;/li&gt;
&lt;li&gt;Which topic receives them.&lt;/li&gt;
&lt;li&gt;What message it publishes.&lt;/li&gt;
&lt;li&gt;Which component consumes them.&lt;/li&gt;
&lt;li&gt;What happens after consumption.&lt;/li&gt;
&lt;li&gt;What business activity the message supports.&lt;/li&gt;
&lt;li&gt;How the messaging flow affects the application architecture.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It does not need to explain what Kafka is.&lt;/p&gt;

&lt;p&gt;The reader is expected to understand the technologies already.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. The Documentation Philosophy
&lt;/h1&gt;

&lt;p&gt;The methodology combines nine complementary techniques.&lt;/p&gt;

&lt;p&gt;Each technique has a specific responsibility.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Technique&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Pyramid Principle / BLUF&lt;/td&gt;
&lt;td&gt;Structure information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ASD-STE100&lt;/td&gt;
&lt;td&gt;Control language complexity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Diátaxis&lt;/td&gt;
&lt;td&gt;Distinguish documentation types&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C4 Model&lt;/td&gt;
&lt;td&gt;Visualise architecture&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;arc42&lt;/td&gt;
&lt;td&gt;Organise architecture information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Feynman Technique&lt;/td&gt;
&lt;td&gt;Improve explanation quality&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cognitive Load Theory&lt;/td&gt;
&lt;td&gt;Control information complexity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Progressive Disclosure&lt;/td&gt;
&lt;td&gt;Organise information into layers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Evidence-Based Analysis&lt;/td&gt;
&lt;td&gt;Maintain technical accuracy&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These techniques must work together.&lt;/p&gt;

&lt;p&gt;They must not become competing instructions.&lt;/p&gt;

&lt;h2&gt;
  
  
  2.1 Pyramid Principle and BLUF — Structure
&lt;/h2&gt;

&lt;p&gt;Present the main information first.&lt;/p&gt;

&lt;p&gt;Start with the conclusion or main purpose.&lt;/p&gt;

&lt;p&gt;Then explain the supporting information.&lt;/p&gt;

&lt;p&gt;Use this order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Main purpose.&lt;/li&gt;
&lt;li&gt;Main architectural characteristics.&lt;/li&gt;
&lt;li&gt;Supporting components.&lt;/li&gt;
&lt;li&gt;Detailed implementation.&lt;/li&gt;
&lt;li&gt;Evidence and references.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Weak explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The application contains an OrderController. It calls OrderService. The service validates the order and publishes an event. The event is consumed by another service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Better explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The application processes customer orders and publishes order events for downstream services.&lt;/p&gt;

&lt;p&gt;The OrderController accepts incoming requests. OrderService validates and processes them. The event publisher sends the resulting event to Kafka.&lt;/p&gt;

&lt;p&gt;The second explanation gives the reader the system purpose before introducing implementation details.&lt;/p&gt;

&lt;h2&gt;
  
  
  2.2 ASD-STE100 — Control language
&lt;/h2&gt;

&lt;p&gt;Use approximately 80% of ASD-STE100 principles.&lt;/p&gt;

&lt;p&gt;The objective is clear technical English, not artificial simplification.&lt;/p&gt;

&lt;p&gt;Rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use short sentences.&lt;/li&gt;
&lt;li&gt;Prefer familiar words.&lt;/li&gt;
&lt;li&gt;Use active voice.&lt;/li&gt;
&lt;li&gt;Keep one main idea in each sentence.&lt;/li&gt;
&lt;li&gt;Avoid unnecessary adjectives.&lt;/li&gt;
&lt;li&gt;Avoid long introductory paragraphs.&lt;/li&gt;
&lt;li&gt;Use consistent terminology.&lt;/li&gt;
&lt;li&gt;Retain essential technical terms.&lt;/li&gt;
&lt;li&gt;Avoid repeating information.&lt;/li&gt;
&lt;li&gt;Do not remove technical depth to make the document shorter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Avoid:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The service facilitates the asynchronous propagation of order-related domain events to downstream consumers through the underlying messaging infrastructure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prefer:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The service publishes order events to Kafka.&lt;/p&gt;

&lt;p&gt;Downstream consumers receive these events and process them.&lt;/p&gt;

&lt;p&gt;The second version is easier to read and retains the technical meaning.&lt;/p&gt;

&lt;h2&gt;
  
  
  2.3 Diátaxis — Control documentation type
&lt;/h2&gt;

&lt;p&gt;Diátaxis defines four types of technical documentation.&lt;/p&gt;

&lt;p&gt;They are:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Tutorial&lt;/td&gt;
&lt;td&gt;Learn through a practical sequence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;How-to guide&lt;/td&gt;
&lt;td&gt;Complete a specific task&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Explanation&lt;/td&gt;
&lt;td&gt;Understand how and why something works&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reference&lt;/td&gt;
&lt;td&gt;Find precise technical information&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Architecture documentation is mainly an &lt;strong&gt;Explanation&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It must explain the system's structure, behaviour and design.&lt;/p&gt;

&lt;p&gt;It can include reference information where useful.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Architecture overview: Explanation.&lt;/li&gt;
&lt;li&gt;Component responsibilities: Explanation.&lt;/li&gt;
&lt;li&gt;API schemas: Reference.&lt;/li&gt;
&lt;li&gt;Kafka topic configuration: Reference.&lt;/li&gt;
&lt;li&gt;Local development setup: How-to.&lt;/li&gt;
&lt;li&gt;Getting started with the repository: Tutorial.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not turn an architecture README into a tutorial.&lt;/p&gt;

&lt;h2&gt;
  
  
  2.4 C4 Model — Control architecture visualisation
&lt;/h2&gt;

&lt;p&gt;Use architecture diagrams to explain the system at different levels.&lt;/p&gt;

&lt;p&gt;Recommended views:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;System Context&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Shows the system, users and external systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Container&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Shows applications, services, databases and major runtime components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Component&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Shows the important internal components within an application or service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dynamic or Sequence View&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Shows how components interact during a particular business flow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deployment View&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Shows where the application runs and which infrastructure components support it.&lt;/p&gt;

&lt;p&gt;Do not create every diagram automatically.&lt;/p&gt;

&lt;p&gt;Select diagrams based on the complexity of the system and the needs of the readers.&lt;/p&gt;

&lt;p&gt;A class diagram is a separate implementation-level view. Use it when class relationships provide useful information.&lt;/p&gt;

&lt;h2&gt;
  
  
  2.5 arc42 — Control documentation structure
&lt;/h2&gt;

&lt;p&gt;Use arc42 as a reference for architecture documentation.&lt;/p&gt;

&lt;p&gt;Its useful concepts include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Introduction and goals.&lt;/li&gt;
&lt;li&gt;Constraints.&lt;/li&gt;
&lt;li&gt;Context and scope.&lt;/li&gt;
&lt;li&gt;Solution strategy.&lt;/li&gt;
&lt;li&gt;Building blocks.&lt;/li&gt;
&lt;li&gt;Runtime behaviour.&lt;/li&gt;
&lt;li&gt;Deployment.&lt;/li&gt;
&lt;li&gt;Cross-cutting concepts.&lt;/li&gt;
&lt;li&gt;Architecture decisions.&lt;/li&gt;
&lt;li&gt;Quality requirements.&lt;/li&gt;
&lt;li&gt;Risks and technical debt.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not force every arc42 section into every README.&lt;/p&gt;

&lt;p&gt;Use the sections that provide value for the specific application.&lt;/p&gt;

&lt;h2&gt;
  
  
  2.6 Feynman Technique — Control explanation quality
&lt;/h2&gt;

&lt;p&gt;Explain complex interactions in simple language.&lt;/p&gt;

&lt;p&gt;This does not mean removing technical detail.&lt;/p&gt;

&lt;p&gt;It means making the relationships understandable.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Technical statement:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The OrderService publishes an OrderCreated event, which is consumed asynchronously by the PaymentService.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Better explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After the order is created, OrderService publishes an OrderCreated event.&lt;/p&gt;

&lt;p&gt;PaymentService receives the event and starts payment processing.&lt;/p&gt;

&lt;p&gt;The two services do not need to call each other directly during this flow.&lt;/p&gt;

&lt;p&gt;This explanation describes the actual interaction and its architectural consequence.&lt;/p&gt;

&lt;p&gt;Use practical examples to explain complex behaviour.&lt;/p&gt;

&lt;p&gt;Do not introduce unrelated analogies.&lt;/p&gt;

&lt;h2&gt;
  
  
  2.7 Cognitive Load Theory — Control complexity
&lt;/h2&gt;

&lt;p&gt;Do not expose every implementation detail at once.&lt;/p&gt;

&lt;p&gt;Separate the system into meaningful concepts.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First explain the business transaction.&lt;/li&gt;
&lt;li&gt;Then explain the application flow.&lt;/li&gt;
&lt;li&gt;Then explain the messaging interaction.&lt;/li&gt;
&lt;li&gt;Then explain the relevant classes.&lt;/li&gt;
&lt;li&gt;Finally explain the infrastructure dependencies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Avoid introducing Kafka partitions, Kubernetes probes, IAM policies and database indexes in the same paragraph unless they directly affect the flow being explained.&lt;/p&gt;

&lt;h2&gt;
  
  
  2.8 Progressive Disclosure — Control reading depth
&lt;/h2&gt;

&lt;p&gt;Organise the document into layers.&lt;/p&gt;

&lt;p&gt;A reader must be able to understand the system at a high level without reading every implementation detail.&lt;/p&gt;

&lt;p&gt;Recommended layers:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer 1 — Business and architecture overview&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What the system does and why it exists.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer 2 — End-to-end behaviour&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How information moves through the system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer 3 — Application implementation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Which components and classes implement the flow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer 4 — Integration and platform&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How infrastructure enables the flow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer 5 — Operational and technical detail&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Configuration, resilience, deployment and failure handling.&lt;/p&gt;

&lt;h2&gt;
  
  
  2.9 Evidence-Based Analysis — Control accuracy
&lt;/h2&gt;

&lt;p&gt;This is a mandatory principle.&lt;/p&gt;

&lt;p&gt;The LLM must distinguish between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verified facts.&lt;/li&gt;
&lt;li&gt;Reasonable inferences.&lt;/li&gt;
&lt;li&gt;Unknown information.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Never present an assumption as an implementation fact.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verified:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;OrderService publishes an event using KafkaTemplate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inferred:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The application appears to use event-driven communication.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unknown:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Whether the business process requires a seven-year event retention period.&lt;/p&gt;

&lt;p&gt;Source code can explain implementation.&lt;/p&gt;

&lt;p&gt;It may not explain the business decision behind that implementation.&lt;/p&gt;

&lt;p&gt;Flag missing information for human confirmation.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Target Audience and Reading Experience
&lt;/h1&gt;

&lt;p&gt;The documentation must support three primary audiences.&lt;/p&gt;

&lt;p&gt;Do not produce three independent documents unless there is a clear reason.&lt;/p&gt;

&lt;p&gt;Create one architecture document with different reading levels.&lt;/p&gt;

&lt;h2&gt;
  
  
  3.1 Developers
&lt;/h2&gt;

&lt;p&gt;Developers need to understand how to navigate and change the application.&lt;/p&gt;

&lt;p&gt;They need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Entry points.&lt;/li&gt;
&lt;li&gt;Class responsibilities.&lt;/li&gt;
&lt;li&gt;Component relationships.&lt;/li&gt;
&lt;li&gt;Processing sequence.&lt;/li&gt;
&lt;li&gt;Input and output contracts.&lt;/li&gt;
&lt;li&gt;Data transformations.&lt;/li&gt;
&lt;li&gt;Database interactions.&lt;/li&gt;
&lt;li&gt;Messaging behaviour.&lt;/li&gt;
&lt;li&gt;Exception handling.&lt;/li&gt;
&lt;li&gt;Configuration.&lt;/li&gt;
&lt;li&gt;Source-code references.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Their main question is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where is the behaviour implemented, and what happens when the code executes?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3.2 Architects
&lt;/h2&gt;

&lt;p&gt;Architects need to understand the system's structure and design.&lt;/p&gt;

&lt;p&gt;They need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Business purpose.&lt;/li&gt;
&lt;li&gt;System boundaries.&lt;/li&gt;
&lt;li&gt;External dependencies.&lt;/li&gt;
&lt;li&gt;Upstream and downstream relationships.&lt;/li&gt;
&lt;li&gt;Architecture diagrams.&lt;/li&gt;
&lt;li&gt;Architectural patterns.&lt;/li&gt;
&lt;li&gt;Integration strategy.&lt;/li&gt;
&lt;li&gt;Data ownership.&lt;/li&gt;
&lt;li&gt;Synchronisation and consistency.&lt;/li&gt;
&lt;li&gt;Failure boundaries.&lt;/li&gt;
&lt;li&gt;Design constraints.&lt;/li&gt;
&lt;li&gt;Important architecture decisions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Their main question is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why is the system designed this way, and how does it interact with the wider architecture?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3.3 Platform Engineers and SREs
&lt;/h2&gt;

&lt;p&gt;Platform engineers need to understand how the application uses infrastructure.&lt;/p&gt;

&lt;p&gt;They need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Runtime components.&lt;/li&gt;
&lt;li&gt;Deployment architecture.&lt;/li&gt;
&lt;li&gt;Kubernetes resources.&lt;/li&gt;
&lt;li&gt;AWS services.&lt;/li&gt;
&lt;li&gt;Kafka topics and consumer groups.&lt;/li&gt;
&lt;li&gt;SQS queues and subscriptions.&lt;/li&gt;
&lt;li&gt;IAM permissions.&lt;/li&gt;
&lt;li&gt;Configuration and secrets.&lt;/li&gt;
&lt;li&gt;Network dependencies.&lt;/li&gt;
&lt;li&gt;Storage dependencies.&lt;/li&gt;
&lt;li&gt;Scaling behaviour.&lt;/li&gt;
&lt;li&gt;Health checks.&lt;/li&gt;
&lt;li&gt;Monitoring and logging.&lt;/li&gt;
&lt;li&gt;Operational failure points.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Their main question is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What infrastructure does the application depend on, and how does the application use it?&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Recommended Architecture README Structure
&lt;/h1&gt;

&lt;p&gt;Use the following structure as the default.&lt;/p&gt;

&lt;p&gt;Adapt it to the actual application.&lt;/p&gt;

&lt;p&gt;Do not generate empty sections.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.1 Executive Summary
&lt;/h2&gt;

&lt;p&gt;Explain the application in a few paragraphs.&lt;/p&gt;

&lt;p&gt;Include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application purpose.&lt;/li&gt;
&lt;li&gt;Business capability.&lt;/li&gt;
&lt;li&gt;Main processing responsibility.&lt;/li&gt;
&lt;li&gt;Important integrations.&lt;/li&gt;
&lt;li&gt;Architectural characteristics.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A reader should understand the system without reading the entire document.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.2 Business Context
&lt;/h2&gt;

&lt;p&gt;Explain why the application exists.&lt;/p&gt;

&lt;p&gt;Include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Business problem.&lt;/li&gt;
&lt;li&gt;Business process.&lt;/li&gt;
&lt;li&gt;Capability delivered.&lt;/li&gt;
&lt;li&gt;Main stakeholders.&lt;/li&gt;
&lt;li&gt;Business benefits.&lt;/li&gt;
&lt;li&gt;Position within the wider business process.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use domain terminology from the source and available business documentation.&lt;/p&gt;

&lt;p&gt;Do not invent business benefits.&lt;/p&gt;

&lt;p&gt;If the source does not establish the business purpose, identify the missing information.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.3 System Context
&lt;/h2&gt;

&lt;p&gt;Describe the application boundary.&lt;/p&gt;

&lt;p&gt;Identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;External systems.&lt;/li&gt;
&lt;li&gt;Upstream systems.&lt;/li&gt;
&lt;li&gt;Downstream systems.&lt;/li&gt;
&lt;li&gt;Users or initiating actors.&lt;/li&gt;
&lt;li&gt;Data providers.&lt;/li&gt;
&lt;li&gt;Data consumers.&lt;/li&gt;
&lt;li&gt;External interfaces.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use a System Context diagram.&lt;/p&gt;

&lt;p&gt;Include an integration table:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System&lt;/th&gt;
&lt;th&gt;Relationship&lt;/th&gt;
&lt;th&gt;Interaction&lt;/th&gt;
&lt;th&gt;Information exchanged&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;System A&lt;/td&gt;
&lt;td&gt;Upstream&lt;/td&gt;
&lt;td&gt;REST API&lt;/td&gt;
&lt;td&gt;Customer request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;System B&lt;/td&gt;
&lt;td&gt;Downstream&lt;/td&gt;
&lt;td&gt;Kafka&lt;/td&gt;
&lt;td&gt;Order event&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;System C&lt;/td&gt;
&lt;td&gt;External dependency&lt;/td&gt;
&lt;td&gt;SQS&lt;/td&gt;
&lt;td&gt;Notification request&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Only include verified relationships.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.4 Architecture Overview
&lt;/h2&gt;

&lt;p&gt;Describe:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Overall architecture.&lt;/li&gt;
&lt;li&gt;Main applications and services.&lt;/li&gt;
&lt;li&gt;Communication mechanisms.&lt;/li&gt;
&lt;li&gt;Data stores.&lt;/li&gt;
&lt;li&gt;Architectural patterns.&lt;/li&gt;
&lt;li&gt;Major infrastructure dependencies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Include a high-level architecture diagram.&lt;/p&gt;

&lt;p&gt;Keep the diagram readable.&lt;/p&gt;

&lt;p&gt;Do not show every class or infrastructure resource at this level.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.5 End-to-End Processing Flow
&lt;/h2&gt;

&lt;p&gt;This is one of the most important sections.&lt;/p&gt;

&lt;p&gt;Explain the complete business transaction or processing journey.&lt;/p&gt;

&lt;p&gt;For each flow, identify:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Trigger.&lt;/li&gt;
&lt;li&gt;Entry point.&lt;/li&gt;
&lt;li&gt;Validation.&lt;/li&gt;
&lt;li&gt;Processing.&lt;/li&gt;
&lt;li&gt;Data transformation.&lt;/li&gt;
&lt;li&gt;Persistence.&lt;/li&gt;
&lt;li&gt;Event publication or API interaction.&lt;/li&gt;
&lt;li&gt;Downstream processing.&lt;/li&gt;
&lt;li&gt;Final output.&lt;/li&gt;
&lt;li&gt;Error or compensation behaviour.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use a sequence diagram when the flow involves several interacting components.&lt;/p&gt;

&lt;p&gt;Include synchronous and asynchronous boundaries.&lt;/p&gt;

&lt;p&gt;Make it clear where the original request ends and where asynchronous processing continues.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.6 Component and Class Design
&lt;/h2&gt;

&lt;p&gt;Explain the important components.&lt;/p&gt;

&lt;p&gt;Do not list every class.&lt;/p&gt;

&lt;p&gt;Group classes by responsibility.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;th&gt;Important interactions&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;OrderController&lt;/td&gt;
&lt;td&gt;Accepts external requests&lt;/td&gt;
&lt;td&gt;OrderService&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OrderService&lt;/td&gt;
&lt;td&gt;Validates and processes orders&lt;/td&gt;
&lt;td&gt;OrderRepository, EventPublisher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OrderRepository&lt;/td&gt;
&lt;td&gt;Persists order data&lt;/td&gt;
&lt;td&gt;Database&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EventPublisher&lt;/td&gt;
&lt;td&gt;Publishes order events&lt;/td&gt;
&lt;td&gt;Kafka&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PaymentConsumer&lt;/td&gt;
&lt;td&gt;Processes payment events&lt;/td&gt;
&lt;td&gt;PaymentService&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Include a class diagram where it adds value.&lt;/p&gt;

&lt;p&gt;Show:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Important classes.&lt;/li&gt;
&lt;li&gt;Interfaces.&lt;/li&gt;
&lt;li&gt;Inheritance where relevant.&lt;/li&gt;
&lt;li&gt;Composition and dependencies.&lt;/li&gt;
&lt;li&gt;Important method relationships where useful.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not use a class diagram as a substitute for a sequence diagram.&lt;/p&gt;

&lt;p&gt;A class diagram shows structure.&lt;/p&gt;

&lt;p&gt;A sequence diagram shows behaviour over time.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.7 Input and Output Contracts
&lt;/h2&gt;

&lt;p&gt;Document the data entering and leaving the system.&lt;/p&gt;

&lt;p&gt;For each important interface, identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Interface name.&lt;/li&gt;
&lt;li&gt;Producer.&lt;/li&gt;
&lt;li&gt;Consumer.&lt;/li&gt;
&lt;li&gt;Input schema.&lt;/li&gt;
&lt;li&gt;Output schema.&lt;/li&gt;
&lt;li&gt;Mandatory fields.&lt;/li&gt;
&lt;li&gt;Optional fields.&lt;/li&gt;
&lt;li&gt;Validation.&lt;/li&gt;
&lt;li&gt;Transformation.&lt;/li&gt;
&lt;li&gt;Error response.&lt;/li&gt;
&lt;li&gt;Versioning behaviour.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Interface&lt;/td&gt;
&lt;td&gt;OrderCreated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Producer&lt;/td&gt;
&lt;td&gt;OrderService&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Consumer&lt;/td&gt;
&lt;td&gt;PaymentService&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Transport&lt;/td&gt;
&lt;td&gt;Kafka&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Input&lt;/td&gt;
&lt;td&gt;Order details&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output&lt;/td&gt;
&lt;td&gt;Payment processing request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Contract&lt;/td&gt;
&lt;td&gt;Actual schema or DTO reference&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Use actual DTOs, schemas, API specifications and message definitions.&lt;/p&gt;

&lt;p&gt;Do not invent fields.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.8 Integration and Messaging Architecture
&lt;/h2&gt;

&lt;p&gt;Explain how the application uses messaging and integration technologies.&lt;/p&gt;

&lt;p&gt;For Kafka, consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Producer component.&lt;/li&gt;
&lt;li&gt;Topic.&lt;/li&gt;
&lt;li&gt;Message schema.&lt;/li&gt;
&lt;li&gt;Partition key, if established.&lt;/li&gt;
&lt;li&gt;Consumer component.&lt;/li&gt;
&lt;li&gt;Consumer group, if configured or discoverable.&lt;/li&gt;
&lt;li&gt;Offset behaviour, if relevant.&lt;/li&gt;
&lt;li&gt;Retry behaviour.&lt;/li&gt;
&lt;li&gt;Dead-letter handling.&lt;/li&gt;
&lt;li&gt;Ordering requirements.&lt;/li&gt;
&lt;li&gt;Delivery semantics.&lt;/li&gt;
&lt;li&gt;Authentication and authorisation dependencies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For SQS, consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Queue.&lt;/li&gt;
&lt;li&gt;Producer.&lt;/li&gt;
&lt;li&gt;Consumer.&lt;/li&gt;
&lt;li&gt;Message structure.&lt;/li&gt;
&lt;li&gt;Visibility timeout.&lt;/li&gt;
&lt;li&gt;Retry behaviour.&lt;/li&gt;
&lt;li&gt;Dead-letter queue.&lt;/li&gt;
&lt;li&gt;FIFO or standard queue.&lt;/li&gt;
&lt;li&gt;Message group or deduplication settings, where relevant.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For REST APIs, consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Calling service.&lt;/li&gt;
&lt;li&gt;Receiving service.&lt;/li&gt;
&lt;li&gt;Endpoint.&lt;/li&gt;
&lt;li&gt;Request and response.&lt;/li&gt;
&lt;li&gt;Authentication.&lt;/li&gt;
&lt;li&gt;Timeout.&lt;/li&gt;
&lt;li&gt;Retry.&lt;/li&gt;
&lt;li&gt;Error handling.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Focus on how these technologies support the application flow.&lt;/p&gt;

&lt;p&gt;Do not provide generic technology explanations.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.9 Architecture Patterns
&lt;/h2&gt;

&lt;p&gt;Identify patterns supported by source-code evidence.&lt;/p&gt;

&lt;p&gt;Possible patterns include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Event-Driven Architecture.&lt;/li&gt;
&lt;li&gt;Saga.&lt;/li&gt;
&lt;li&gt;Choreography.&lt;/li&gt;
&lt;li&gt;Orchestration.&lt;/li&gt;
&lt;li&gt;CQRS.&lt;/li&gt;
&lt;li&gt;Transactional Outbox.&lt;/li&gt;
&lt;li&gt;Repository.&lt;/li&gt;
&lt;li&gt;Adapter.&lt;/li&gt;
&lt;li&gt;Strategy.&lt;/li&gt;
&lt;li&gt;Dependency Injection.&lt;/li&gt;
&lt;li&gt;Hexagonal Architecture.&lt;/li&gt;
&lt;li&gt;Layered Architecture.&lt;/li&gt;
&lt;li&gt;Circuit Breaker.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For each identified pattern, explain:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What pattern is present.&lt;/li&gt;
&lt;li&gt;Where it appears.&lt;/li&gt;
&lt;li&gt;Which components participate.&lt;/li&gt;
&lt;li&gt;How the pattern works.&lt;/li&gt;
&lt;li&gt;Why it matters to the system.&lt;/li&gt;
&lt;li&gt;What evidence supports the identification.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do not infer a pattern from a technology name.&lt;/p&gt;

&lt;p&gt;Kafka alone does not prove Event-Driven Architecture.&lt;/p&gt;

&lt;p&gt;Multiple services alone do not prove Saga.&lt;/p&gt;

&lt;p&gt;If the evidence is incomplete, label the pattern as a possible or partial implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.10 Platform and Deployment Architecture
&lt;/h2&gt;

&lt;p&gt;Explain the infrastructure used by the application.&lt;/p&gt;

&lt;p&gt;Cover only relevant dependencies.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kubernetes Deployments.&lt;/li&gt;
&lt;li&gt;Services.&lt;/li&gt;
&lt;li&gt;Ingress or Gateway.&lt;/li&gt;
&lt;li&gt;ConfigMaps.&lt;/li&gt;
&lt;li&gt;Secrets.&lt;/li&gt;
&lt;li&gt;Persistent Volumes.&lt;/li&gt;
&lt;li&gt;AWS Lambda.&lt;/li&gt;
&lt;li&gt;SQS.&lt;/li&gt;
&lt;li&gt;SNS.&lt;/li&gt;
&lt;li&gt;Kafka.&lt;/li&gt;
&lt;li&gt;RDS.&lt;/li&gt;
&lt;li&gt;S3.&lt;/li&gt;
&lt;li&gt;IAM roles.&lt;/li&gt;
&lt;li&gt;VPC and network dependencies.&lt;/li&gt;
&lt;li&gt;External services.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Explain the relationship between the application and each platform component.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Platform component&lt;/th&gt;
&lt;th&gt;Application usage&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Kubernetes Deployment&lt;/td&gt;
&lt;td&gt;Runs OrderService&lt;/td&gt;
&lt;td&gt;Application runtime&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kafka&lt;/td&gt;
&lt;td&gt;Receives OrderCreated events&lt;/td&gt;
&lt;td&gt;Asynchronous integration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RDS&lt;/td&gt;
&lt;td&gt;Stores order data&lt;/td&gt;
&lt;td&gt;Persistence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Secrets Manager&lt;/td&gt;
&lt;td&gt;Provides credentials&lt;/td&gt;
&lt;td&gt;Secure configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Do not document infrastructure that is not relevant to the application architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.11 Failure Handling and Resilience
&lt;/h2&gt;

&lt;p&gt;Explain what happens when something fails.&lt;/p&gt;

&lt;p&gt;Consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Validation failures.&lt;/li&gt;
&lt;li&gt;Database errors.&lt;/li&gt;
&lt;li&gt;Network failures.&lt;/li&gt;
&lt;li&gt;API timeouts.&lt;/li&gt;
&lt;li&gt;Kafka publication failures.&lt;/li&gt;
&lt;li&gt;Consumer failures.&lt;/li&gt;
&lt;li&gt;Message retries.&lt;/li&gt;
&lt;li&gt;Duplicate messages.&lt;/li&gt;
&lt;li&gt;Dead-letter handling.&lt;/li&gt;
&lt;li&gt;Compensation.&lt;/li&gt;
&lt;li&gt;Partial transaction completion.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Distinguish between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Failure handling visible in source code.&lt;/li&gt;
&lt;li&gt;Behaviour provided by infrastructure configuration.&lt;/li&gt;
&lt;li&gt;Behaviour that requires runtime verification.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not assume that retries, idempotency or compensation exist because they are desirable.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.12 Security and Observability
&lt;/h2&gt;

&lt;p&gt;Document the application's relevant security and monitoring behaviour.&lt;/p&gt;

&lt;p&gt;Security:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Authentication.&lt;/li&gt;
&lt;li&gt;Authorisation.&lt;/li&gt;
&lt;li&gt;Service identities.&lt;/li&gt;
&lt;li&gt;IAM permissions.&lt;/li&gt;
&lt;li&gt;Certificate usage.&lt;/li&gt;
&lt;li&gt;Secret management.&lt;/li&gt;
&lt;li&gt;Encryption configuration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Observability:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Logging.&lt;/li&gt;
&lt;li&gt;Metrics.&lt;/li&gt;
&lt;li&gt;Tracing.&lt;/li&gt;
&lt;li&gt;Correlation identifiers.&lt;/li&gt;
&lt;li&gt;Health endpoints.&lt;/li&gt;
&lt;li&gt;Monitoring integrations.&lt;/li&gt;
&lt;li&gt;Alerting configuration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Explain the implementation, not the general theory.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.13 Source Code Navigation
&lt;/h2&gt;

&lt;p&gt;Provide a practical map of the repository.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Location&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;src/controller&lt;/td&gt;
&lt;td&gt;API entry points&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;src/service&lt;/td&gt;
&lt;td&gt;Business processing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;src/repository&lt;/td&gt;
&lt;td&gt;Data persistence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;src/messaging&lt;/td&gt;
&lt;td&gt;Event publishing and consumption&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;src/model&lt;/td&gt;
&lt;td&gt;Domain objects and DTOs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;src/config&lt;/td&gt;
&lt;td&gt;Application configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tests&lt;/td&gt;
&lt;td&gt;Automated tests&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Use actual repository paths.&lt;/p&gt;

&lt;p&gt;Highlight the important classes for the main business flow.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.14 Architecture Observations
&lt;/h2&gt;

&lt;p&gt;Record useful observations.&lt;/p&gt;

&lt;p&gt;Separate them into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Confirmed design characteristics.&lt;/li&gt;
&lt;li&gt;Potential limitations.&lt;/li&gt;
&lt;li&gt;Technical debt.&lt;/li&gt;
&lt;li&gt;Unverified assumptions.&lt;/li&gt;
&lt;li&gt;Questions for architects or business owners.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Avoid subjective criticism.&lt;/p&gt;

&lt;p&gt;Explain why an observation matters.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. The Three Essential Architecture Views
&lt;/h1&gt;

&lt;p&gt;A strong architecture document must connect three views.&lt;/p&gt;

&lt;h2&gt;
  
  
  5.1 Business View
&lt;/h2&gt;

&lt;p&gt;Explains why the system exists.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Customer submits an order.&lt;/p&gt;

&lt;p&gt;The business process validates the order and initiates payment.&lt;/p&gt;

&lt;p&gt;The customer receives a confirmation after the required processing completes.&lt;/p&gt;

&lt;h2&gt;
  
  
  5.2 Application View
&lt;/h2&gt;

&lt;p&gt;Explains which software components implement the business process.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;OrderController accepts the request.&lt;/p&gt;

&lt;p&gt;OrderService validates the order.&lt;/p&gt;

&lt;p&gt;OrderRepository persists the order.&lt;/p&gt;

&lt;p&gt;EventPublisher publishes the resulting event.&lt;/p&gt;

&lt;h2&gt;
  
  
  5.3 Platform View
&lt;/h2&gt;

&lt;p&gt;Explains which infrastructure components enable the application flow.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Kubernetes runs the application.&lt;/p&gt;

&lt;p&gt;RDS stores order information.&lt;/p&gt;

&lt;p&gt;Kafka transports events to downstream services.&lt;/p&gt;

&lt;p&gt;The downstream consumer runs as a separate application workload.&lt;/p&gt;

&lt;h2&gt;
  
  
  5.4 Connect the three views
&lt;/h2&gt;

&lt;p&gt;Use a mapping table.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Business activity&lt;/th&gt;
&lt;th&gt;Application component&lt;/th&gt;
&lt;th&gt;Platform dependency&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Submit order&lt;/td&gt;
&lt;td&gt;OrderController&lt;/td&gt;
&lt;td&gt;Kubernetes Service&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Validate order&lt;/td&gt;
&lt;td&gt;OrderService&lt;/td&gt;
&lt;td&gt;Application runtime&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Save order&lt;/td&gt;
&lt;td&gt;OrderRepository&lt;/td&gt;
&lt;td&gt;RDS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Publish event&lt;/td&gt;
&lt;td&gt;EventPublisher&lt;/td&gt;
&lt;td&gt;Kafka&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Process payment&lt;/td&gt;
&lt;td&gt;PaymentConsumer&lt;/td&gt;
&lt;td&gt;Kafka Consumer Group&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Notify customer&lt;/td&gt;
&lt;td&gt;NotificationService&lt;/td&gt;
&lt;td&gt;SQS&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This is one of the most valuable parts of the documentation.&lt;/p&gt;

&lt;p&gt;It connects business behaviour to code and infrastructure.&lt;/p&gt;




&lt;h1&gt;
  
  
  6. Architecture Diagram Standards
&lt;/h1&gt;

&lt;p&gt;Use diagrams to explain relationships, not decorate the document.&lt;/p&gt;

&lt;h2&gt;
  
  
  6.1 Recommended diagram types
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Diagram&lt;/th&gt;
&lt;th&gt;Main purpose&lt;/th&gt;
&lt;th&gt;Audience&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;System Context&lt;/td&gt;
&lt;td&gt;Show system boundaries&lt;/td&gt;
&lt;td&gt;Architects&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Container&lt;/td&gt;
&lt;td&gt;Show major applications and infrastructure&lt;/td&gt;
&lt;td&gt;Architects, Platform&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Component&lt;/td&gt;
&lt;td&gt;Show internal application structure&lt;/td&gt;
&lt;td&gt;Developers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Class&lt;/td&gt;
&lt;td&gt;Show important code relationships&lt;/td&gt;
&lt;td&gt;Developers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sequence&lt;/td&gt;
&lt;td&gt;Show runtime interactions&lt;/td&gt;
&lt;td&gt;All technical audiences&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data Flow&lt;/td&gt;
&lt;td&gt;Show information movement&lt;/td&gt;
&lt;td&gt;Developers, Architects&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deployment&lt;/td&gt;
&lt;td&gt;Show runtime placement&lt;/td&gt;
&lt;td&gt;Platform Engineers&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  6.2 Diagram rules
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use consistent names.&lt;/li&gt;
&lt;li&gt;Use meaningful labels on connections.&lt;/li&gt;
&lt;li&gt;Show the direction of communication.&lt;/li&gt;
&lt;li&gt;Distinguish synchronous and asynchronous communication.&lt;/li&gt;
&lt;li&gt;Show system boundaries.&lt;/li&gt;
&lt;li&gt;Avoid unnecessary detail.&lt;/li&gt;
&lt;li&gt;Keep diagrams readable.&lt;/li&gt;
&lt;li&gt;Use the same component names in text and diagrams.&lt;/li&gt;
&lt;li&gt;Do not show relationships that are not supported by evidence.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Prefer Mermaid when the repository supports Markdown-based diagrams.&lt;/p&gt;

&lt;p&gt;Keep diagram source under version control.&lt;/p&gt;

&lt;h2&gt;
  
  
  6.3 Diagram accuracy
&lt;/h2&gt;

&lt;p&gt;Every diagram must represent the implementation.&lt;/p&gt;

&lt;p&gt;For example, do not draw a direct API call between two services if the actual interaction uses Kafka.&lt;/p&gt;

&lt;p&gt;Do not draw a database connection if the service only receives data through another component.&lt;/p&gt;

&lt;p&gt;Do not represent a logical architecture as a physical deployment diagram.&lt;/p&gt;

&lt;p&gt;State when a diagram shows a logical view rather than the actual deployment topology.&lt;/p&gt;




&lt;h1&gt;
  
  
  7. Architecture Pattern Identification
&lt;/h1&gt;

&lt;p&gt;Architecture pattern identification requires special care.&lt;/p&gt;

&lt;p&gt;A pattern must be supported by behaviour, not technology names.&lt;/p&gt;

&lt;h2&gt;
  
  
  7.1 Event-Driven Architecture
&lt;/h2&gt;

&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Event producers.&lt;/li&gt;
&lt;li&gt;Event contracts.&lt;/li&gt;
&lt;li&gt;Asynchronous consumers.&lt;/li&gt;
&lt;li&gt;Event-based service interactions.&lt;/li&gt;
&lt;li&gt;Event ownership and processing responsibilities.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Explain the event lifecycle.&lt;/p&gt;

&lt;h2&gt;
  
  
  7.2 Saga
&lt;/h2&gt;

&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A business transaction spanning multiple services.&lt;/li&gt;
&lt;li&gt;Multiple independent processing steps.&lt;/li&gt;
&lt;li&gt;Distributed state.&lt;/li&gt;
&lt;li&gt;Compensation actions.&lt;/li&gt;
&lt;li&gt;Central orchestration or event-driven choreography.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Document the actual compensation flow.&lt;/p&gt;

&lt;p&gt;If no compensation behaviour exists in the source, do not claim that a complete Saga is implemented.&lt;/p&gt;

&lt;h2&gt;
  
  
  7.3 Transactional Outbox
&lt;/h2&gt;

&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A business database transaction.&lt;/li&gt;
&lt;li&gt;An event or outbox record written in the same transaction.&lt;/li&gt;
&lt;li&gt;A separate publisher or relay.&lt;/li&gt;
&lt;li&gt;Publication status or retry handling.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not identify Outbox merely because a database and Kafka are both present.&lt;/p&gt;

&lt;h2&gt;
  
  
  7.4 CQRS
&lt;/h2&gt;

&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Separate command and query responsibilities.&lt;/li&gt;
&lt;li&gt;Separate write and read models.&lt;/li&gt;
&lt;li&gt;Different processing paths for writes and reads.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Separate controller classes alone do not establish CQRS.&lt;/p&gt;

&lt;h2&gt;
  
  
  7.5 Choreography and Orchestration
&lt;/h2&gt;

&lt;p&gt;For choreography, identify the participating services and the events that connect them.&lt;/p&gt;

&lt;p&gt;For orchestration, identify the central component that controls the workflow.&lt;/p&gt;

&lt;p&gt;Explain how the next processing step is selected.&lt;/p&gt;




&lt;h1&gt;
  
  
  8. Source Code Analysis Methodology
&lt;/h1&gt;

&lt;p&gt;Do not ask an LLM to generate the final architecture document from a repository in one step.&lt;/p&gt;

&lt;p&gt;Use a controlled analysis process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 1 — Repository Discovery
&lt;/h2&gt;

&lt;p&gt;Identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Programming languages.&lt;/li&gt;
&lt;li&gt;Frameworks.&lt;/li&gt;
&lt;li&gt;Modules.&lt;/li&gt;
&lt;li&gt;Build files.&lt;/li&gt;
&lt;li&gt;Application entry points.&lt;/li&gt;
&lt;li&gt;Configuration files.&lt;/li&gt;
&lt;li&gt;Infrastructure definitions.&lt;/li&gt;
&lt;li&gt;API specifications.&lt;/li&gt;
&lt;li&gt;Message schemas.&lt;/li&gt;
&lt;li&gt;Tests.&lt;/li&gt;
&lt;li&gt;Existing documentation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;A repository inventory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 2 — Component Discovery
&lt;/h2&gt;

&lt;p&gt;Identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Controllers.&lt;/li&gt;
&lt;li&gt;Services.&lt;/li&gt;
&lt;li&gt;Repositories.&lt;/li&gt;
&lt;li&gt;Interfaces.&lt;/li&gt;
&lt;li&gt;Event publishers.&lt;/li&gt;
&lt;li&gt;Event consumers.&lt;/li&gt;
&lt;li&gt;Message handlers.&lt;/li&gt;
&lt;li&gt;Data models.&lt;/li&gt;
&lt;li&gt;External clients.&lt;/li&gt;
&lt;li&gt;Configuration classes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Group components by responsibility.&lt;/p&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;A component inventory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 3 — Flow Reconstruction
&lt;/h2&gt;

&lt;p&gt;Trace the important business flows.&lt;/p&gt;

&lt;p&gt;Start from an entry point.&lt;/p&gt;

&lt;p&gt;Follow the execution path.&lt;/p&gt;

&lt;p&gt;Identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Method calls.&lt;/li&gt;
&lt;li&gt;Data transformations.&lt;/li&gt;
&lt;li&gt;Database operations.&lt;/li&gt;
&lt;li&gt;API calls.&lt;/li&gt;
&lt;li&gt;Message publication.&lt;/li&gt;
&lt;li&gt;Message consumption.&lt;/li&gt;
&lt;li&gt;Error handling.&lt;/li&gt;
&lt;li&gt;Final outputs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;An end-to-end flow description.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 4 — Integration Discovery
&lt;/h2&gt;

&lt;p&gt;Identify all external interactions.&lt;/p&gt;

&lt;p&gt;For each interaction, determine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Producer.&lt;/li&gt;
&lt;li&gt;Consumer.&lt;/li&gt;
&lt;li&gt;Transport.&lt;/li&gt;
&lt;li&gt;Contract.&lt;/li&gt;
&lt;li&gt;Direction.&lt;/li&gt;
&lt;li&gt;Purpose.&lt;/li&gt;
&lt;li&gt;Configuration.&lt;/li&gt;
&lt;li&gt;Failure handling.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;An integration inventory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 5 — Platform Discovery
&lt;/h2&gt;

&lt;p&gt;Inspect relevant infrastructure definitions.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dockerfiles.&lt;/li&gt;
&lt;li&gt;Helm charts.&lt;/li&gt;
&lt;li&gt;Kubernetes manifests.&lt;/li&gt;
&lt;li&gt;Terraform.&lt;/li&gt;
&lt;li&gt;CloudFormation.&lt;/li&gt;
&lt;li&gt;SAM templates.&lt;/li&gt;
&lt;li&gt;CI/CD pipelines.&lt;/li&gt;
&lt;li&gt;Application configuration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Identify the relationship between application components and infrastructure resources.&lt;/p&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;A platform dependency map.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 6 — Architecture Analysis
&lt;/h2&gt;

&lt;p&gt;Identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Architecture style.&lt;/li&gt;
&lt;li&gt;Design patterns.&lt;/li&gt;
&lt;li&gt;Integration patterns.&lt;/li&gt;
&lt;li&gt;Data ownership.&lt;/li&gt;
&lt;li&gt;Transaction boundaries.&lt;/li&gt;
&lt;li&gt;Failure boundaries.&lt;/li&gt;
&lt;li&gt;Important design decisions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Separate verified patterns from possible patterns.&lt;/p&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;An architecture analysis.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 7 — Business Context
&lt;/h2&gt;

&lt;p&gt;Review available:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Existing documentation.&lt;/li&gt;
&lt;li&gt;Domain terminology.&lt;/li&gt;
&lt;li&gt;API names.&lt;/li&gt;
&lt;li&gt;Event names.&lt;/li&gt;
&lt;li&gt;Business rules.&lt;/li&gt;
&lt;li&gt;Acceptance criteria.&lt;/li&gt;
&lt;li&gt;Repository descriptions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Identify the business purpose.&lt;/p&gt;

&lt;p&gt;Do not invent missing business information.&lt;/p&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;A business context summary and a list of questions requiring confirmation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 8 — Documentation Generation
&lt;/h2&gt;

&lt;p&gt;Generate the README and supporting architecture documents.&lt;/p&gt;

&lt;p&gt;Use the standard structure.&lt;/p&gt;

&lt;p&gt;Use consistent terminology.&lt;/p&gt;

&lt;p&gt;Include diagrams and source references.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 9 — Validation
&lt;/h2&gt;

&lt;p&gt;Check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Technical accuracy.&lt;/li&gt;
&lt;li&gt;Diagram accuracy.&lt;/li&gt;
&lt;li&gt;Component relationships.&lt;/li&gt;
&lt;li&gt;Input and output contracts.&lt;/li&gt;
&lt;li&gt;Upstream and downstream relationships.&lt;/li&gt;
&lt;li&gt;Architecture pattern claims.&lt;/li&gt;
&lt;li&gt;Infrastructure relationships.&lt;/li&gt;
&lt;li&gt;Source references.&lt;/li&gt;
&lt;li&gt;Missing information.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;A validated documentation set.&lt;/p&gt;




&lt;h1&gt;
  
  
  9. Evidence and Traceability Rules
&lt;/h1&gt;

&lt;p&gt;The LLM must provide traceability for important technical statements.&lt;/p&gt;

&lt;p&gt;Use the following evidence categories.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verified
&lt;/h2&gt;

&lt;p&gt;Directly supported by source code, configuration or infrastructure definitions.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;OrderService calls KafkaTemplate to publish an event.&lt;/p&gt;

&lt;p&gt;Evidence:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;OrderService.java&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Inferred
&lt;/h2&gt;

&lt;p&gt;Supported by multiple observations, but not explicitly established.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;The application appears to use event-driven communication between order and payment processing.&lt;/p&gt;

&lt;p&gt;Evidence:&lt;/p&gt;

&lt;p&gt;Event publisher, message contract and downstream consumer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Unknown
&lt;/h2&gt;

&lt;p&gt;The available repository does not establish the answer.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;The business reason for selecting the message retention period is not documented.&lt;/p&gt;

&lt;h2&gt;
  
  
  Important rules
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Never invent source paths.&lt;/li&gt;
&lt;li&gt;Never invent class names.&lt;/li&gt;
&lt;li&gt;Never invent message fields.&lt;/li&gt;
&lt;li&gt;Never assume a consumer exists because a topic exists.&lt;/li&gt;
&lt;li&gt;Never assume a topic is consumed by a particular application without evidence.&lt;/li&gt;
&lt;li&gt;Never assume deployment configuration matches the current production environment.&lt;/li&gt;
&lt;li&gt;Never assume a pattern exists because a framework supports it.&lt;/li&gt;
&lt;li&gt;Clearly identify missing evidence.&lt;/li&gt;
&lt;li&gt;Distinguish source-code facts from runtime behaviour.&lt;/li&gt;
&lt;li&gt;Record assumptions that require human confirmation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Where practical, reference source paths and line numbers.&lt;/p&gt;

&lt;p&gt;For large repositories, maintain an evidence inventory during analysis.&lt;/p&gt;




&lt;h1&gt;
  
  
  10. Recommended Output Structure for a Large Repository
&lt;/h1&gt;

&lt;p&gt;For a small application, one README may be sufficient.&lt;/p&gt;

&lt;p&gt;For a larger system, use a documentation hierarchy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;architecture/
│
├── README.md
│
├── business-context.md
│
├── system-context.md
│
├── architecture-overview.md
│
├── application-flow.md
│
├── component-design.md
│
├── integration-contracts.md
│
├── messaging-architecture.md
│
├── platform-architecture.md
│
├── resilience-and-failure-handling.md
│
├── security-and-observability.md
│
├── architecture-observations.md
│
└── diagrams/
    ├── system-context.mmd
    ├── container-diagram.mmd
    ├── component-diagram.mmd
    ├── class-diagram.mmd
    ├── sequence-diagram.mmd
    └── deployment-diagram.mmd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The root README must remain the entry point.&lt;/p&gt;

&lt;p&gt;It must contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application purpose.&lt;/li&gt;
&lt;li&gt;Business context.&lt;/li&gt;
&lt;li&gt;High-level architecture.&lt;/li&gt;
&lt;li&gt;Main processing flow.&lt;/li&gt;
&lt;li&gt;Important integrations.&lt;/li&gt;
&lt;li&gt;Links to detailed sections.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not duplicate the same explanation in multiple files.&lt;/p&gt;




&lt;h1&gt;
  
  
  11. Quality Criteria
&lt;/h1&gt;

&lt;p&gt;The final documentation must pass the following checks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Business accuracy
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Does it explain why the application exists?&lt;/li&gt;
&lt;li&gt;Does it describe the business capability?&lt;/li&gt;
&lt;li&gt;Does it distinguish verified benefits from assumptions?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Architecture accuracy
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Does it identify system boundaries?&lt;/li&gt;
&lt;li&gt;Does it show upstream and downstream systems?&lt;/li&gt;
&lt;li&gt;Does it describe the actual communication mechanisms?&lt;/li&gt;
&lt;li&gt;Are the architecture patterns supported by evidence?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Application accuracy
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Does it identify the important classes?&lt;/li&gt;
&lt;li&gt;Does it explain their responsibilities?&lt;/li&gt;
&lt;li&gt;Does it show how they interact?&lt;/li&gt;
&lt;li&gt;Are the inputs and outputs correct?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Platform accuracy
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Does it explain how the application uses infrastructure?&lt;/li&gt;
&lt;li&gt;Are Kafka, SQS, Kubernetes and AWS relationships correct?&lt;/li&gt;
&lt;li&gt;Does it distinguish application behaviour from platform behaviour?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Diagram quality
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Do the diagrams match the written explanation?&lt;/li&gt;
&lt;li&gt;Are communication directions clear?&lt;/li&gt;
&lt;li&gt;Are synchronous and asynchronous interactions distinguishable?&lt;/li&gt;
&lt;li&gt;Are diagrams readable?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Writing quality
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Is the main purpose clear?&lt;/li&gt;
&lt;li&gt;Are sentences concise?&lt;/li&gt;
&lt;li&gt;Is technical terminology consistent?&lt;/li&gt;
&lt;li&gt;Is there unnecessary repetition?&lt;/li&gt;
&lt;li&gt;Does the document avoid generic technology explanations?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Evidence quality
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Can a developer verify important claims?&lt;/li&gt;
&lt;li&gt;Are assumptions identified?&lt;/li&gt;
&lt;li&gt;Are unknowns clearly stated?&lt;/li&gt;
&lt;li&gt;Are source references accurate?&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  12. Master LLM Prompt
&lt;/h1&gt;

&lt;p&gt;The following prompt is intended for repeated use with different repositories.&lt;/p&gt;

&lt;p&gt;It combines the methodology into one reusable instruction.&lt;/p&gt;

&lt;p&gt;Copy it into a new conversation when starting an architecture documentation task.&lt;/p&gt;




&lt;h2&gt;
  
  
  MASTER PROMPT: Source-to-Architecture Documentation
&lt;/h2&gt;

&lt;p&gt;You are acting as a Senior Software Architect, Application Reverse Engineer and Technical Documentation Specialist.&lt;/p&gt;

&lt;p&gt;Your task is to analyse the supplied source code and generate high-quality architecture documentation for multiple technical audiences.&lt;/p&gt;

&lt;p&gt;The target audiences are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Software Developers.&lt;/li&gt;
&lt;li&gt;Solution Architects.&lt;/li&gt;
&lt;li&gt;Enterprise Architects.&lt;/li&gt;
&lt;li&gt;Platform Engineers.&lt;/li&gt;
&lt;li&gt;SREs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The objective is to reconstruct and explain the actual system architecture from source-code evidence.&lt;/p&gt;

&lt;p&gt;This is not a tutorial.&lt;/p&gt;

&lt;p&gt;Do not explain generic technologies such as Kafka, Kubernetes, AWS, Terraform or Spring Boot unless the explanation is directly relevant to how this application uses them.&lt;/p&gt;

&lt;p&gt;Focus on the application, its behaviour, its architecture and its business purpose.&lt;/p&gt;

&lt;h3&gt;
  
  
  A. Documentation principles
&lt;/h3&gt;

&lt;p&gt;Apply the following principles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Pyramid Principle and BLUF&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Present the main purpose first.&lt;/li&gt;
&lt;li&gt;Organise supporting information logically.&lt;/li&gt;
&lt;li&gt;Move from high-level architecture to implementation details.&lt;/li&gt;
&lt;li&gt;Avoid introducing implementation details before explaining their purpose.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. ASD-STE100 — Approximately 80%&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use short sentences.&lt;/li&gt;
&lt;li&gt;Use simple language.&lt;/li&gt;
&lt;li&gt;Prefer active voice.&lt;/li&gt;
&lt;li&gt;Keep essential technical terminology.&lt;/li&gt;
&lt;li&gt;Avoid filler and repetition.&lt;/li&gt;
&lt;li&gt;Preserve technical accuracy and depth.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Diátaxis&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Treat this as architecture explanation documentation.&lt;/p&gt;

&lt;p&gt;Do not turn the document into a tutorial or generic reference guide.&lt;/p&gt;

&lt;p&gt;Use reference tables for contracts, configuration and interfaces where appropriate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. C4 Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use suitable architecture views:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;System Context.&lt;/li&gt;
&lt;li&gt;Container.&lt;/li&gt;
&lt;li&gt;Component.&lt;/li&gt;
&lt;li&gt;Dynamic or Sequence.&lt;/li&gt;
&lt;li&gt;Deployment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use class diagrams where they help explain implementation relationships.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. arc42&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use relevant architecture documentation concepts to organise the content.&lt;/p&gt;

&lt;p&gt;Do not force unnecessary sections into the document.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Feynman Technique&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Explain complex interactions in clear language.&lt;/p&gt;

&lt;p&gt;Use concrete application examples.&lt;/p&gt;

&lt;p&gt;Explain what happens and why it matters.&lt;/p&gt;

&lt;p&gt;Do not remove technical depth.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Cognitive Load and Progressive Disclosure&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Explain the system in layers.&lt;/li&gt;
&lt;li&gt;Introduce one major concept at a time.&lt;/li&gt;
&lt;li&gt;Keep high-level views separate from detailed implementation views.&lt;/li&gt;
&lt;li&gt;Avoid overwhelming the reader with unrelated technical details.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;8. Evidence-Based Analysis&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Base technical claims on source-code evidence.&lt;/li&gt;
&lt;li&gt;Distinguish verified facts, inferences and unknowns.&lt;/li&gt;
&lt;li&gt;Do not invent components, relationships, schemas or behaviour.&lt;/li&gt;
&lt;li&gt;Identify missing business context.&lt;/li&gt;
&lt;li&gt;Do not assume that a technology implies an architecture pattern.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  B. Required analysis
&lt;/h3&gt;

&lt;p&gt;Analyse the repository in stages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 1 — Repository discovery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Identify languages, frameworks, modules, entry points, configuration, infrastructure files, tests and existing documentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 2 — Component discovery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Identify important classes, interfaces, services, controllers, repositories, handlers, producers, consumers and external clients.&lt;/p&gt;

&lt;p&gt;Group them by responsibility.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 3 — Business flow reconstruction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Trace important flows from entry point to final output.&lt;/p&gt;

&lt;p&gt;Identify validation, processing, persistence, transformation, publication, consumption and error handling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 4 — Integration discovery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Identify upstream systems, downstream systems, APIs, Kafka topics, SQS queues, databases and external dependencies.&lt;/p&gt;

&lt;p&gt;Identify producers, consumers and message contracts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 5 — Platform discovery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inspect relevant infrastructure and deployment definitions.&lt;/p&gt;

&lt;p&gt;Identify how the application uses Kubernetes, AWS and other platform services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 6 — Architecture analysis&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Identify architecture style, patterns, transaction boundaries, data ownership, failure boundaries and design decisions.&lt;/p&gt;

&lt;p&gt;Only claim a pattern when evidence supports it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 7 — Business context&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Establish why the application exists using available domain information and existing documentation.&lt;/p&gt;

&lt;p&gt;Do not invent business objectives or benefits.&lt;/p&gt;

&lt;p&gt;List questions where human confirmation is required.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 8 — Documentation generation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Produce the architecture documentation using the structure below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 9 — Validation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check all important claims, diagrams, source references, relationships and contracts against the available evidence.&lt;/p&gt;

&lt;p&gt;Do not generate final documentation before completing sufficient analysis.&lt;/p&gt;

&lt;p&gt;If the repository is too large to analyse in one pass, work incrementally and maintain an analysis inventory.&lt;/p&gt;

&lt;h3&gt;
  
  
  C. Required documentation structure
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Executive Summary.&lt;/li&gt;
&lt;li&gt;Business Context.&lt;/li&gt;
&lt;li&gt;System Context.&lt;/li&gt;
&lt;li&gt;Architecture Overview.&lt;/li&gt;
&lt;li&gt;End-to-End Processing Flow.&lt;/li&gt;
&lt;li&gt;Component and Class Design.&lt;/li&gt;
&lt;li&gt;Input and Output Contracts.&lt;/li&gt;
&lt;li&gt;Integration and Messaging Architecture.&lt;/li&gt;
&lt;li&gt;Architecture Patterns.&lt;/li&gt;
&lt;li&gt;Platform and Deployment Architecture.&lt;/li&gt;
&lt;li&gt;Failure Handling and Resilience.&lt;/li&gt;
&lt;li&gt;Security and Observability.&lt;/li&gt;
&lt;li&gt;Source Code Navigation.&lt;/li&gt;
&lt;li&gt;Architecture Observations.&lt;/li&gt;
&lt;li&gt;Evidence and Open Questions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Adapt the sections to the actual application.&lt;/p&gt;

&lt;p&gt;Do not create empty or generic sections.&lt;/p&gt;

&lt;h3&gt;
  
  
  D. Architecture flow requirements
&lt;/h3&gt;

&lt;p&gt;For every important business flow, explain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What triggers the flow.&lt;/li&gt;
&lt;li&gt;Which component receives the request or event.&lt;/li&gt;
&lt;li&gt;What validation occurs.&lt;/li&gt;
&lt;li&gt;Which components execute the business logic.&lt;/li&gt;
&lt;li&gt;What data is created or transformed.&lt;/li&gt;
&lt;li&gt;Where data is persisted.&lt;/li&gt;
&lt;li&gt;Which external systems are called.&lt;/li&gt;
&lt;li&gt;Which events or messages are published.&lt;/li&gt;
&lt;li&gt;Which downstream components consume them.&lt;/li&gt;
&lt;li&gt;What the final output is.&lt;/li&gt;
&lt;li&gt;How errors and retries are handled.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Distinguish synchronous and asynchronous processing.&lt;/p&gt;

&lt;p&gt;Explain where the original transaction ends and where subsequent processing begins.&lt;/p&gt;

&lt;h3&gt;
  
  
  E. Integration requirements
&lt;/h3&gt;

&lt;p&gt;For each integration, identify:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attribute&lt;/th&gt;
&lt;th&gt;Required information&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Producer&lt;/td&gt;
&lt;td&gt;Component or external system&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Consumer&lt;/td&gt;
&lt;td&gt;Component or external system&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Transport&lt;/td&gt;
&lt;td&gt;REST, Kafka, SQS or other&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Contract&lt;/td&gt;
&lt;td&gt;Actual request, response or message schema&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Direction&lt;/td&gt;
&lt;td&gt;Incoming or outgoing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Purpose&lt;/td&gt;
&lt;td&gt;Application responsibility&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Configuration&lt;/td&gt;
&lt;td&gt;Relevant source or infrastructure reference&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Failure handling&lt;/td&gt;
&lt;td&gt;Verified retry, timeout or error behaviour&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  F. Architecture pattern requirements
&lt;/h3&gt;

&lt;p&gt;Assess relevant patterns, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Event-Driven Architecture.&lt;/li&gt;
&lt;li&gt;Saga.&lt;/li&gt;
&lt;li&gt;Choreography.&lt;/li&gt;
&lt;li&gt;Orchestration.&lt;/li&gt;
&lt;li&gt;CQRS.&lt;/li&gt;
&lt;li&gt;Transactional Outbox.&lt;/li&gt;
&lt;li&gt;Hexagonal Architecture.&lt;/li&gt;
&lt;li&gt;Layered Architecture.&lt;/li&gt;
&lt;li&gt;Repository.&lt;/li&gt;
&lt;li&gt;Adapter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For each pattern:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identify the participating components.&lt;/li&gt;
&lt;li&gt;Explain the implementation.&lt;/li&gt;
&lt;li&gt;Provide supporting evidence.&lt;/li&gt;
&lt;li&gt;Explain why the pattern matters.&lt;/li&gt;
&lt;li&gt;Identify missing evidence.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not claim Saga without evidence of a distributed business transaction and its coordination or compensation behaviour.&lt;/p&gt;

&lt;p&gt;Do not claim Transactional Outbox without evidence of the required transactional persistence and publication mechanism.&lt;/p&gt;

&lt;h3&gt;
  
  
  G. Diagram requirements
&lt;/h3&gt;

&lt;p&gt;Generate suitable Mermaid diagrams.&lt;/p&gt;

&lt;p&gt;Prefer diagrams that provide meaningful architectural information.&lt;/p&gt;

&lt;p&gt;At minimum, assess whether the following are required:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;System Context.&lt;/li&gt;
&lt;li&gt;Component.&lt;/li&gt;
&lt;li&gt;Sequence.&lt;/li&gt;
&lt;li&gt;Deployment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use consistent component names.&lt;/p&gt;

&lt;p&gt;Label communication mechanisms.&lt;/p&gt;

&lt;p&gt;Show direction.&lt;/p&gt;

&lt;p&gt;Distinguish synchronous and asynchronous interactions.&lt;/p&gt;

&lt;p&gt;Do not invent relationships.&lt;/p&gt;

&lt;p&gt;Ensure the diagrams match the written documentation.&lt;/p&gt;

&lt;h3&gt;
  
  
  H. Evidence requirements
&lt;/h3&gt;

&lt;p&gt;Classify important statements as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verified.&lt;/li&gt;
&lt;li&gt;Inferred.&lt;/li&gt;
&lt;li&gt;Unknown.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use actual repository paths.&lt;/p&gt;

&lt;p&gt;Include line references where available.&lt;/p&gt;

&lt;p&gt;Never fabricate source references.&lt;/p&gt;

&lt;p&gt;Separate application implementation from infrastructure configuration and runtime behaviour.&lt;/p&gt;

&lt;h3&gt;
  
  
  I. Output quality
&lt;/h3&gt;

&lt;p&gt;The final document must:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Be suitable for storage in a software repository.&lt;/li&gt;
&lt;li&gt;Support developers, architects and platform engineers.&lt;/li&gt;
&lt;li&gt;Explain business flow and technical implementation.&lt;/li&gt;
&lt;li&gt;Connect application components to platform dependencies.&lt;/li&gt;
&lt;li&gt;Use clear and concise technical English.&lt;/li&gt;
&lt;li&gt;Avoid generic technology descriptions.&lt;/li&gt;
&lt;li&gt;Avoid unnecessary repetition.&lt;/li&gt;
&lt;li&gt;Preserve important implementation details.&lt;/li&gt;
&lt;li&gt;Identify unknowns instead of guessing.&lt;/li&gt;
&lt;li&gt;Provide useful diagrams and source references.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result must be an architecture document, not a source-code summary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Most important instruction: Reconstruct the architecture from evidence first. Explain it clearly second. Generate the documentation third.&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  13. Recommended Working Practice
&lt;/h1&gt;

&lt;p&gt;The master prompt defines the desired result.&lt;/p&gt;

&lt;p&gt;For better results, use it with a controlled workflow.&lt;/p&gt;

&lt;p&gt;Do not start by asking the LLM to write the README.&lt;/p&gt;

&lt;p&gt;Start with analysis.&lt;/p&gt;

&lt;p&gt;Use the following sequence:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1 — Understand the repository
&lt;/h3&gt;

&lt;p&gt;Ask the LLM to identify the repository structure, technology stack and important entry points.&lt;/p&gt;

&lt;p&gt;Do not generate the README yet.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2 — Reconstruct the main flow
&lt;/h3&gt;

&lt;p&gt;Ask it to trace the main business transaction.&lt;/p&gt;

&lt;p&gt;Request the relevant classes, methods, inputs, outputs and external interactions.&lt;/p&gt;

&lt;p&gt;Validate this analysis before moving on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3 — Reconstruct the architecture
&lt;/h3&gt;

&lt;p&gt;Ask it to identify the system boundary, integrations, patterns and infrastructure dependencies.&lt;/p&gt;

&lt;p&gt;Request supporting source references.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4 — Generate diagrams
&lt;/h3&gt;

&lt;p&gt;Generate the diagrams from the verified flow and component relationships.&lt;/p&gt;

&lt;p&gt;Do not let the LLM independently invent diagram relationships.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5 — Generate the documentation
&lt;/h3&gt;

&lt;p&gt;Use the master prompt.&lt;/p&gt;

&lt;p&gt;Generate the README and supporting documents.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6 — Perform an architecture review
&lt;/h3&gt;

&lt;p&gt;Ask the LLM to act as a critical reviewer.&lt;/p&gt;

&lt;p&gt;Ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which statements are unsupported?&lt;/li&gt;
&lt;li&gt;Which relationships are inferred?&lt;/li&gt;
&lt;li&gt;Which flows are incomplete?&lt;/li&gt;
&lt;li&gt;Which components are missing?&lt;/li&gt;
&lt;li&gt;Which patterns have been incorrectly identified?&lt;/li&gt;
&lt;li&gt;Which diagrams do not match the source?&lt;/li&gt;
&lt;li&gt;What important information is missing for each audience?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 7 — Finalise
&lt;/h3&gt;

&lt;p&gt;Review the business context with a business owner or product owner.&lt;/p&gt;

&lt;p&gt;Review architectural claims with an architect.&lt;/p&gt;

&lt;p&gt;Review infrastructure behaviour with a platform engineer.&lt;/p&gt;

&lt;p&gt;This final review is important because source code alone cannot establish every business decision or runtime fact.&lt;/p&gt;




&lt;h1&gt;
  
  
  14. Final Principle
&lt;/h1&gt;

&lt;p&gt;Good architecture documentation is not measured by the number of classes, diagrams or pages.&lt;/p&gt;

&lt;p&gt;It is measured by how well it helps someone understand the system.&lt;/p&gt;

&lt;p&gt;A developer should be able to trace the implementation.&lt;/p&gt;

&lt;p&gt;An architect should be able to understand the design and integration boundaries.&lt;/p&gt;

&lt;p&gt;A platform engineer should be able to understand the infrastructure dependencies.&lt;/p&gt;

&lt;p&gt;All three should be able to follow the same end-to-end business flow.&lt;/p&gt;

&lt;p&gt;The LLM must therefore do more than summarise code.&lt;/p&gt;

&lt;p&gt;It must reconstruct the relationships between:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Business purpose → Application behaviour → Component interactions → Data flow → Integration architecture → Platform dependencies.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That is the central objective of this framework.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reconstruct accurately. Explain clearly. Document with evidence.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>documentation</category>
      <category>llm</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>LLM and how to get max output</title>
      <dc:creator>Karthi Mahadevan</dc:creator>
      <pubDate>Sun, 04 Oct 2026 11:46:55 +0000</pubDate>
      <link>https://dev.to/mkarthiatgithub/llm-and-how-to-get-max-output-2gai</link>
      <guid>https://dev.to/mkarthiatgithub/llm-and-how-to-get-max-output-2gai</guid>
      <description>&lt;p&gt;Use five core techniques and one delivery principle:&lt;/p&gt;

&lt;p&gt;BLUF/Pyramid — structure.&lt;/p&gt;

&lt;p&gt;ASD-STE100 — language.&lt;/p&gt;

&lt;p&gt;Diátaxis — content type.&lt;/p&gt;

&lt;p&gt;Feynman — understanding.&lt;/p&gt;

&lt;p&gt;Cognitive Load — complexity.&lt;/p&gt;

&lt;p&gt;Progressive Disclosure — delivery sequence.&lt;/p&gt;

&lt;p&gt;C4 Model — Architecture visualisation&lt;/p&gt;

&lt;p&gt;Use different views to explain system context, containers, components and interactions.&lt;/p&gt;

&lt;p&gt;Arc42 — Architecture documentation structure&lt;/p&gt;

&lt;p&gt;Use its architecture documentation concepts to organise decisions, building blocks, runtime behaviour, deployment and cross-cutting concerns.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Kubernetes Gateway API and my experience</title>
      <dc:creator>Karthi Mahadevan</dc:creator>
      <pubDate>Wed, 05 Nov 2025 17:05:01 +0000</pubDate>
      <link>https://dev.to/mkarthiatgithub/kubernetes-gateway-api-and-my-experience-3g3e</link>
      <guid>https://dev.to/mkarthiatgithub/kubernetes-gateway-api-and-my-experience-3g3e</guid>
      <description>&lt;p&gt;&lt;a href="https://gateway-api.sigs.k8s.io/" rel="noopener noreferrer"&gt;https://gateway-api.sigs.k8s.io/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://kubernetes.io/docs/concepts/services-networking/gateway/" rel="noopener noreferrer"&gt;https://kubernetes.io/docs/concepts/services-networking/gateway/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The traditional Kubernetes Ingress resource has served as the primary mechanism for exposing HTTP(S) applications to the outside world. It defines host- and path-based routing rules that an Ingress Controller (like NGINX or AWS ALB Ingress Controller) translates into load balancer configurations.&lt;/p&gt;

&lt;p&gt;While effective for simple setups, Ingress has several limitations:&lt;/p&gt;

&lt;p&gt;Limited expressiveness — routing rules and filters are basic.&lt;/p&gt;

&lt;p&gt;Controller-specific annotations — leading to vendor lock-in.&lt;/p&gt;

&lt;p&gt;Difficult separation of concerns — operations and developers share the same configuration surface.&lt;/p&gt;

&lt;p&gt;The Gateway API was designed by the Kubernetes networking SIG to address these challenges. It introduces a richer and more modular model:&lt;/p&gt;

&lt;p&gt;GatewayClass: Defines the type of underlying infrastructure (e.g., AWS ALB).&lt;/p&gt;

&lt;p&gt;Gateway: Represents the actual entry point into the cluster.&lt;/p&gt;

&lt;p&gt;Route (e.g., HTTPRoute, TCPRoute, GRPCRoute): Defines routing rules, attached to one or more Gateways.&lt;/p&gt;

&lt;p&gt;Service: Still used as the backend target for traffic, just like before.&lt;/p&gt;

&lt;p&gt;n an AWS EKS cluster, the AWS Load Balancer Controller can interpret Gateway and Route resources to automatically provision and configure AWS Application Load Balancers (ALBs) or Network Load Balancers (NLBs).&lt;/p&gt;

&lt;p&gt;A typical traffic flow looks like this:&lt;br&gt;
Client → (AWS ALB via Gateway) → Gateway (reverse proxy) → HTTPRoute → Service → Pod&lt;/p&gt;

&lt;p&gt;This is conceptually similar to the classic:&lt;br&gt;
Client → (AWS ALB) → Ingress Controller → Service → Pod&lt;/p&gt;

&lt;p&gt;Main take away for me is &lt;br&gt;
Reduced Vendor Lock-In&lt;br&gt;
Gateway API defines a consistent, cloud-agnostic schema.&lt;br&gt;
The same Gateway and Route manifests can work across AWS, GCP, Azure, or on-prem — you only change the GatewayClass to fit the environment. No more provider-specific annotations cluttering your YAML.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ficd8g24u5zg82dvi8tme.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ficd8g24u5zg82dvi8tme.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>New Python Package manager (UV) and Using Ray</title>
      <dc:creator>Karthi Mahadevan</dc:creator>
      <pubDate>Fri, 14 Mar 2025 11:00:56 +0000</pubDate>
      <link>https://dev.to/mkarthiatgithub/new-python-package-manager-uv-and-using-ray-4b9i</link>
      <guid>https://dev.to/mkarthiatgithub/new-python-package-manager-uv-and-using-ray-4b9i</guid>
      <description>&lt;p&gt;While I was in my earlier platform engineer role, one of my teammate said about &lt;a href="https://docs.astral.sh/uv/" rel="noopener noreferrer"&gt;UV&lt;/a&gt;, I didn't pay attention to it. But when I started using it, I realised how fast it is. &lt;/p&gt;

&lt;p&gt;While I was reading and learning about &lt;a href="https://docs.ray.io/en/latest/ray-overview/index.html" rel="noopener noreferrer"&gt;Ray&lt;/a&gt; , I got to know they use UV internally. Nice. &lt;/p&gt;

</description>
      <category>python</category>
      <category>mlops</category>
    </item>
    <item>
      <title>How we created EKS cluster</title>
      <dc:creator>Karthi Mahadevan</dc:creator>
      <pubDate>Fri, 28 Feb 2025 10:26:58 +0000</pubDate>
      <link>https://dev.to/mkarthiatgithub/how-we-created-eks-cluster-1f8o</link>
      <guid>https://dev.to/mkarthiatgithub/how-we-created-eks-cluster-1f8o</guid>
      <description>&lt;p&gt;we used a cluster template.&lt;br&gt;
This is a YAML configuration file for eksctl (a CLI tool for creating and managing Amazon EKS clusters). It’s designed to provision a Kubernetes cluster on AWS with specific networking, IAM, and node group settings.&lt;/p&gt;

&lt;p&gt;Templating:&lt;br&gt;
The configuration uses environment variables (e.g., ${EKS_CLUSTER_NAME}, ${VPC_ID}, etc.) to inject values dynamically. This makes it flexible and reusable across different environments (e.g., dev, staging, prod).&lt;/p&gt;

&lt;p&gt;Resources That Will Be Created&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;EKS Cluster:
    A new EKS cluster is created with a specified name, version, and region.
    Cluster metadata includes tags for identification and categorization (such as Environment, Application, and Role).

VPC &amp;amp; Networking:
    VPC Configuration: Uses a pre-existing VPC (via ${VPC_ID}) with defined CIDRs.
    Subnets:
        Private Subnets: Three subnets (private-one, private-two, private-three) for worker nodes.
        Public Subnets: Three public subnets for resources that might need internet connectivity.
    Endpoint Access: Cluster endpoints are configured for private access only (public access is disabled).

IAM Configuration &amp;amp; Service Accounts:
    OIDC: The cluster is configured to work with OIDC, which is essential for associating IAM roles with Kubernetes service accounts.
    Service Accounts: Multiple service accounts are defined for specific roles:
        Cluster Autoscaler: For automatically adjusting the number of nodes.
        EBS CSI Controller: For managing persistent storage volumes.
        AWS Load Balancer Controller: To manage AWS load balancers.
        External DNS, CloudWatch Exporter, Cert Manager, Secrets Manager, Parameter Store, and others: Each with tailored IAM policies (either pre-defined “wellKnownPolicies” or custom policies via inline JSON).

Addons:
    The vpc-cni addon is included with an attached policy for managing networking on EKS worker nodes.

Managed Node Groups:
    Core Node Group:
        Designed to run primary workloads.
        Uses Bottlerocket AMI for enhanced security and performance.
        Configured with multiple instance types, private networking, EBS volumes (with encryption), scaling parameters (min, desired, max sizes), and specific labels/tags (including those for cluster autoscaler integration).


CloudWatch Logging:
    Enables cluster logging for all available log types, which is crucial for monitoring and troubleshooting.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Patterns and Structure&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Modular Design:
The configuration cleanly separates different concerns:
    Cluster and VPC settings (networking, endpoints)
    IAM and Service Accounts (roles, policies)
    Node Groups (resource definitions, scaling, labels)
    Addons and Logging

Environment-Driven Templating:
Using placeholders for values allows this file to be easily adapted to different environments or clusters by simply setting environment variables during deployment.

Best Practices:
    Security: Private endpoints and encrypted volumes.
    Scalability: Defined node groups with autoscaling tags.
    Observability: CloudWatch logging is enabled for full cluster visibility.
    Separation of Responsibilities: Distinct IAM roles for different services minimize permissions and adhere to least-privilege principles.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;While configuration sets up the core EKS cluster, IAM roles, managed node groups, and logging, the following additions can help to achieve a more production-ready environment:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Secrets Encryption: Encrypt Kubernetes secrets using a customer-managed KMS key.
Network Policies: Enforce pod-to-pod and pod-to-external communication restrictions.
Enhanced RBAC and Audit Logging: Refine RBAC rules and enable detailed audit logs.
Refined Security Groups: Use restrictive security groups, including at the pod level.
AWS Integrations: Leverage CloudTrail, GuardDuty, and managed add-ons for improved security and observability.
Backup/DR Planning: Implement backup strategies to safeguard your cluster and workloads.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
    <item>
      <title>How I use Cloudwatch and fluentbit</title>
      <dc:creator>Karthi Mahadevan</dc:creator>
      <pubDate>Fri, 28 Feb 2025 10:13:47 +0000</pubDate>
      <link>https://dev.to/mkarthiatgithub/how-i-use-cloudwatch-and-fluentbit-24b0</link>
      <guid>https://dev.to/mkarthiatgithub/how-i-use-cloudwatch-and-fluentbit-24b0</guid>
      <description>&lt;p&gt;Fluent Bit is deployed as a DaemonSet (a POD that runs on every node of the cluster). When Fluent Bit runs, it will read, parse and filter the logs of every POD and will enrich log with some more information.&lt;/p&gt;

&lt;p&gt;This will enable container (open policy agent) logs available in aws cloudwatch. The log group name where the logs will be /aws/containerinsights/${CLUSTER_NAME}/application ; here CLUSTER_NAME will be "tooling" for prod.&lt;/p&gt;

&lt;p&gt;fluentbit.yaml will have &lt;/p&gt;

&lt;p&gt;Here’s how the ClusterRole, ClusterRoleBinding, and ConfigMap are linked and their roles in this configuration:&lt;/p&gt;

&lt;h3&gt;
  
  
  ClusterRole
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;ClusterRole&lt;/code&gt; named &lt;code&gt;fluent-bit-role&lt;/code&gt; defines the permissions that Fluent Bit requires to interact with Kubernetes resources. It specifies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Non-resource URL access&lt;/strong&gt;: Allows access to &lt;code&gt;/metrics&lt;/code&gt; with the &lt;code&gt;get&lt;/code&gt; verb.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource access&lt;/strong&gt;: Grants permissions to &lt;code&gt;namespaces&lt;/code&gt;, &lt;code&gt;pods&lt;/code&gt;, &lt;code&gt;pods/logs&lt;/code&gt;, &lt;code&gt;nodes&lt;/code&gt;, and &lt;code&gt;nodes/proxy&lt;/code&gt; with the &lt;code&gt;get&lt;/code&gt;, &lt;code&gt;list&lt;/code&gt;, and &lt;code&gt;watch&lt;/code&gt; verbs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ClusterRoleBinding
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;ClusterRoleBinding&lt;/code&gt; named &lt;code&gt;fluent-bit-role-binding&lt;/code&gt; links the &lt;code&gt;ClusterRole&lt;/code&gt; to a subject, enabling Fluent Bit to use the permissions. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Subject&lt;/strong&gt;: The &lt;code&gt;ServiceAccount&lt;/code&gt; named &lt;code&gt;fluent-bit&lt;/code&gt; in the &lt;code&gt;logging&lt;/code&gt; namespace.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RoleRef&lt;/strong&gt;: Specifies that the binding refers to the &lt;code&gt;fluent-bit-role&lt;/code&gt; ClusterRole.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This linkage ensures that the &lt;code&gt;fluent-bit&lt;/code&gt; ServiceAccount has the necessary permissions to collect logs and interact with Kubernetes objects.&lt;/p&gt;

&lt;h3&gt;
  
  
  ConfigMap
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;ConfigMap&lt;/code&gt; named &lt;code&gt;fluent-bit-config&lt;/code&gt; provides configuration data for Fluent Bit. It contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fluent Bit configurations&lt;/strong&gt;: Specifies input sources (e.g., application logs), filtering (e.g., Kubernetes metadata), and output destinations (e.g., CloudWatch Logs).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Parser definitions&lt;/strong&gt;: Defines parsers for structured log formats, such as &lt;code&gt;docker&lt;/code&gt; and &lt;code&gt;syslog&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How They Are Linked
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Permissions for Log Access&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;fluent-bit&lt;/code&gt; DaemonSet runs pods using the &lt;code&gt;fluent-bit&lt;/code&gt; ServiceAccount.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;fluent-bit-role-binding&lt;/code&gt; binds the &lt;code&gt;fluent-bit-role&lt;/code&gt; ClusterRole to the &lt;code&gt;fluent-bit&lt;/code&gt; ServiceAccount.&lt;/li&gt;
&lt;li&gt;This setup allows Fluent Bit to access logs, Kubernetes metadata, and node information.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configuration Data&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The DaemonSet mounts the &lt;code&gt;fluent-bit-config&lt;/code&gt; ConfigMap to &lt;code&gt;/fluent-bit/etc/&lt;/code&gt; within its pods.&lt;/li&gt;
&lt;li&gt;Fluent Bit reads configurations from this directory to process logs according to the defined rules.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This structure ensures Fluent Bit operates with the correct permissions and configurations in a Kubernetes environment. Let me know if you need further clarification or adjustments!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
