Skip to content

First-5-Agents MVP

๐Ÿงญ Overview

The First-5-Agents MVP defines the minimal functional loop of the ConnectSoft AI Software Factory, where intelligent agents collaboratively turn a software idea into a production-ready, observable microservice โ€” autonomously.

This MVP proves the factoryโ€™s core hypothesis:

That autonomous agents, when coordinated through well-defined prompts, events, and templates, can generate production-grade software services with traceability, resilience, and consistency.


๐ŸŽฏ Objective

Enable a full agentic software generation pipeline starting from a user prompt:

โ€œBuild a BookingService using REST API, NHibernate, and MassTransit.โ€

...and autonomously perform:

  1. Idea formalization (Vision Architect Agent)
  2. Architecture modeling (Enterprise Architect Agent)
  3. Codebase scaffolding (Microservice Generator Agent)
  4. Git traceable commit (Code Committer Agent)
  5. Pull request orchestration (Pull Request Creator Agent)

๐Ÿ” Core Agentic Loop

flowchart TD
    UserInput["๐Ÿง  Feature Idea"] --> VisionAgent["๐ŸŽฏ Vision Architect Agent"]
    VisionAgent --> ArchAgent["๐Ÿ— Enterprise Architect Agent"]
    ArchAgent --> GeneratorAgent["๐Ÿงฑ Microservice Generator Agent"]
    GeneratorAgent --> CommitterAgent["๐Ÿงพ Code Committer Agent"]
    CommitterAgent --> PRAgent["๐Ÿ“ฆ Pull Request Creator Agent"]
    PRAgent --> AzureDevOps["๐Ÿš€ Azure DevOps CI/CD"]
Hold "Alt" / "Option" to enable pan & zoom

๐Ÿ“ฆ Scope of the MVP

This MVP includes:

  • 5 foundational agents with modular roles
  • 1 generated microservice (e.g., BookingService)
  • CI/CD build and deployment
  • Traceability via trace_id, agent_id, blueprint_id
  • Manual or scripted activation of each agent (for now)

๐Ÿ” Not in Scope (Yet)

  • Project management UI or dashboards
  • Full telemetry/insights platform
  • Agent coordination engine (MCP server)
  • Agent retry or human escalation flows
  • Component registry or edition logic

๐Ÿ—๏ธ High-Level Architecture of First-5-Agent Workflow

The First-5-Agents MVP is structured as a modular, event-driven, traceable pipeline where each agent performs a single specialized function. The entire system is built using:

  • Clean Architecture principles
  • Domain-Driven Design (DDD)
  • Autonomous microservices generated from standardized templates
  • Azure DevOps CI/CD for code delivery
  • OpenTelemetry for traceability and observability

๐Ÿง  High-Level Agent Execution Stack

graph TD
    subgraph AgentWorkflow
        A1[Vision Architect Agent] --> A2[Enterprise Architect Agent]
        A2 --> A3[Microservice Generator Agent]
        A3 --> A4[Code Committer Agent]
        A4 --> A5[Pull Request Creator Agent]
    end

    subgraph CI_CD
        A5 --> DevOps[Azure DevOps Pipeline]
        DevOps --> Deployment[Docker / Azure Container App]
    end
Hold "Alt" / "Option" to enable pan & zoom

๐Ÿงฑ Layered Stack Model

Layer Components
Agent Layer 5 autonomous agents (Vision, Arch, Generator, Commit, PR)
Template Layer connectsoft-microservice (.NET template)
Infrastructure Layer Azure DevOps, Git repo, Docker, optional Pulumi
Observability Layer Serilog, OpenTelemetry, trace IDs
Artifact Layer BookingService microservice (REST, NHibernate, MassTransit)

๐Ÿ“‹ Input โ†’ Output Chain

Phase Input Output
1๏ธโƒฃ Vision Idea Structured Vision Document
2๏ธโƒฃ Architecture Vision Document Blueprint + Domain Contracts
3๏ธโƒฃ Generation Blueprint + Contracts Codebase (multi-project solution)
4๏ธโƒฃ Commit Codebase Git commit + trace metadata
5๏ธโƒฃ Pull Request Git changes PR with description + CI trigger

Each agent adds semantic trace metadata like trace_id, agent_name, blueprint_id, artifact_id into logs and outputs.


๐Ÿ‘ฅ List of the 5 Core Agents in Scope

The First-5-Agents MVP introduces a minimal yet complete pipeline by orchestrating 5 specialized autonomous agents. Each agent operates as a standalone microservice (or component) with clear boundaries, traceability, and defined roles.


๐Ÿง  Agent 1: Vision Architect Agent

  • Role: Transforms a human prompt or idea into a structured, machine-consumable Vision Document
  • Outputs: Problem statement, opportunity, personas, feature list, software classification
  • Trigger: Receives raw idea or input message

๐Ÿ— Agent 2: Enterprise Architect Agent

  • Role: Converts the Vision Document into a formal System Architecture Blueprint
  • Outputs: Bounded contexts, aggregates, service boundaries, use cases, transport choices (e.g., REST, messaging)
  • Trigger: VisionDocumentCreated event

๐Ÿงฑ Agent 3: Microservice Generator Agent

  • Role: Generates a full Clean Architecture-based microservice using the connectsoft-microservice template
  • Outputs: Multi-project .NET solution for a domain-specific service
  • Trigger: SystemArchitectureBlueprintCreated event

๐Ÿงพ Agent 4: Code Committer Agent

  • Role: Commits the generated codebase to a Git repository (Azure DevOps) with embedded traceability
  • Outputs: Git commit with trace_id, changelog, and commit metadata
  • Trigger: MicroserviceGenerated event

๐Ÿ“ฆ Agent 5: Pull Request Creator Agent

  • Role: Creates a well-formed Pull Request from the committed code, linking to upstream trace ID, blueprint, and triggering CI
  • Outputs: Pull Request with structured title/body, trace metadata, and CI build trigger
  • Trigger: CodeCommitted event

๐Ÿ” Agent Collaboration Pattern

These agents follow the Sequential Handoff Pattern, where each output becomes the structured input of the next. The handoff is traceable, observable, and event-driven (not tightly coupled).


๐Ÿ“Œ Trace Metadata Fields (Required)

All agents must enrich their outputs with:

  • trace_id โ€” unique lifecycle execution ID
  • agent_id โ€” name or ID of the agent
  • blueprint_id โ€” optional, links to the architectural artifact
  • created_at โ€” UTC timestamp
  • artifact_uri โ€” if applicable, where the output is stored

๐Ÿง  Vision Architect Agent โ€” Purpose & Responsibilities

The Vision Architect Agent is the entry point of the ConnectSoft AI Software Factory pipeline. It converts human-level input (ideas, prompts, business goals) into structured, machine-ready artifacts called Vision Documents.

This agent establishes the foundation for all downstream agents by formalizing the intent behind a software solution.


๐ŸŽฏ Core Purpose

Transform freeform feature ideas into structured, traceable, multi-agent-compatible Vision Documents.

This ensures that architectural and engineering agents can reason over the system using shared terminology, objectives, and constraints.


๐Ÿ“‹ Responsibilities

Responsibility Description
Idea Structuring Parse raw input text and extract key goals, context, and pain points
Problem Framing Define the core business or technical problem the system solves
Opportunity Mapping Identify potential value, innovation vectors, or differentiators
Solution Conceptualization Propose a high-level solution without implementation details
Software Classification Classify the system: SaaS, API, Mobile, AI agent platform, etc.
Feature Decomposition List initial modules, user goals, or features (non-technical)
Persona Definition Identify target users, stakeholders, external systems
Success Criteria Define measurable or outcome-based indicators of success
Vision Artifact Creation Create a structured Vision Document with embedded metadata
Emit System Event Publish VisionDocumentCreated with trace ID and payload for downstream agents

๐Ÿ“ฆ Output: Vision Document

The output is a structured Markdown + JSON artifact containing:

  • Problem definition
  • Opportunity description
  • Solution summary
  • Software type
  • Features/modules
  • Personas
  • Success metrics
  • trace_id, agent_id, and semantic metadata

This document is consumed by the Enterprise Architect Agent to design the system blueprint.


๐Ÿงพ Vision Architect Agent โ€” Inputs, Outputs, and Prompt Patterns

The Vision Architect Agent operates by transforming a raw, often vague idea into a structured vision document that downstream agents can act on. This is achieved using semantic prompt orchestration, domain knowledge, and traceability metadata.


๐Ÿ“ฅ Inputs

Input Type Description Example
Raw Idea (Text) User-provided feature description or goal โ€œBuild a BookingService with REST API and messaging.โ€
Context Tags Optional tags like domain, priority, or constraints "domain": "Scheduling", "target": "SaaS"
Session Metadata Trace ID, blueprint group, originating user or agent trace_id: booking-core-v1
Optional Artifacts Existing documents, workflows, or diagrams (if available) Markdown notes, PDFs, whiteboard export

๐Ÿ“ค Outputs

Output Type Description Format
Vision Document (Markdown) Structured narrative artifact for humans and agents .md
Vision Metadata (JSON) Compact semantic version for downstream systems .json
System Event VisionDocumentCreated event with links and trace info Event Bus message (JSON payload)

Sample Output Fields:

{
  "trace_id": "booking-core-v1",
  "agent_id": "vision-architect",
  "softwareType": ["SaaS", "API"],
  "features": ["Appointment Scheduling", "Notifications"],
  "personas": ["Clinic Admin", "Customer"],
  "successMetrics": ["Reduce no-shows by 25%"]
}

๐Ÿง  Prompt Template Pattern

๐Ÿ“ฅ Input Prompt Template (to the agent):

Human input:
"Build a BookingService with REST API and messaging."

You must respond with:
1. Problem Definition  
2. Opportunity  
3. Proposed Solution (non-technical)  
4. Software Type  
5. Feature List  
6. Stakeholders / Personas  
7. Success Metrics  
8. Vision Document (Markdown + JSON)

๐Ÿงพ System Prompt:

You are a Vision Architect Agent. Convert freeform business ideas into structured software vision documents. Output must include classification, features, personas, and traceable metadata. Format output in Markdown + JSON. Maintain Clean Architecture compatibility.


๐Ÿ—๏ธ Enterprise Architect Agent โ€” Scope & Domain Modeling

The Enterprise Architect Agent is responsible for transforming a high-level Vision Document into a formal, structured architecture blueprint. This blueprint becomes the foundation for system decomposition, service generation, messaging design, and clean architectural alignment.


๐ŸŽฏ Core Scope

Convert vision-level ideas into modular, domain-aligned, event-driven, and cloud-native architecture blueprints that can be implemented autonomously.

The agent operates across business, domain, and technical boundaries, enabling multi-agent collaboration and scalable service orchestration.


๐Ÿงฑ Primary Responsibilities

Area Description
Domain Decomposition Identify bounded contexts and model the core domain using DDD principles
Aggregate Identification Define key aggregates/entities that reflect core business concepts
Use Case Design Specify high-level use cases and operations that the service must support
Transport Selection Decide whether communication should be via REST, messaging, gRPC, etc.
Service Boundary Definition Establish microservice boundaries and team/agent ownership guidelines
Architecture Blueprint Creation Output a structured artifact (SystemArchitectureBlueprint) with all core decisions
Emit Event Publish SystemArchitectureBlueprintCreated event for generator agent

๐Ÿงฉ Example Domain Output (for BookingService)

bounded_context: Booking
aggregate_root: Appointment
value_objects:
  - TimeSlot
  - Location
  - ProviderId
use_cases:
  - CreateAppointment
  - CancelAppointment
  - GetAvailableSlots
service_model: RestApi
persistence_model: NHibernate
messaging_model: MassTransit

๐Ÿ“ฆ Architectural Blueprint Includes

  • Domain model (aggregates, value objects)
  • Application use cases
  • Layer separation (Clean Architecture)
  • Service boundaries
  • Messaging and integration strategy
  • Traceability fields (trace_id, agent_id, blueprint_id)

๐Ÿ‘ฅ Collaboration

  • Consumes output from Vision Architect Agent
  • Produces structured inputs for:
    • Microservice Generator Agent
    • API Designer Agent (in later stages)
    • Event-Driven Architect Agent (if needed)

๐Ÿ“ Enterprise Architect Agent โ€” Outputs and Use Case Design

The Enterprise Architect Agent produces a System Architecture Blueprint that encapsulates the structure, behavior, and operational boundaries of the system to be built. This output serves as the formal contract for downstream engineering agents, particularly the Microservice Generator Agent.


๐Ÿ“ค Outputs

Output Description
SystemArchitectureBlueprint (YAML/JSON) Describes domain, use cases, layers, persistence, and transport strategies
Event Emission Emits SystemArchitectureBlueprintCreated event with trace ID and artifact reference
Domain Model Package A structured model of entities, aggregates, and value objects
Use Case Definitions Declared contracts for application-layer operations
Metadata Includes trace_id, agent_id, blueprint_id, domain tags, ownership, timestamps

๐Ÿงฉ Example Output (YAML Blueprint)

trace_id: booking-core-v1
agent_id: enterprise-architect
blueprint_id: booking-service-blueprint
bounded_context: Booking
aggregate_root: Appointment
entities:
  - Appointment
  - Provider
value_objects:
  - TimeSlot
  - Location
use_cases:
  - CreateAppointment
  - CancelAppointment
  - GetAvailableSlots
service_model: RestApi
persistence_model: NHibernate
messaging_model: MassTransit
authentication_required: true

๐Ÿง  Use Case Design Philosophy

Each use case reflects a business operation modeled using Clean Architecture and DDD boundaries. It defines the application service contract, including:

Field Description
name Name of the use case (CreateAppointment)
input_dto Input data structure
output_dto Output/result
preconditions Optional constraints or validation rules
postconditions Optional success criteria or follow-up events
events_emitted Domain or integration events published (e.g. AppointmentCreated)

๐Ÿ“ฆ Use Case Example (CreateAppointment)

name: CreateAppointment
input_dto:
  - patient_id: string
  - provider_id: string
  - start_time: datetime
  - end_time: datetime
output_dto:
  - appointment_id: string
events_emitted:
  - AppointmentCreated

๐Ÿ” Downstream Consumption

The blueprint and use case definitions are consumed by:

  • โœ… Microservice Generator Agent
  • โœ… Code Committer Agent (as metadata for trace)
  • โœ… CI pipeline scripts (optional code-gen or lint rules)

๐Ÿงฑ Microservice Generator Agent โ€” Template Logic & CLI Parameters

The Microservice Generator Agent transforms a structured System Architecture Blueprint into a real, production-grade microservice using the ConnectSoft .NET template system.

This agent acts as a blueprint interpreter and template executor, ensuring consistent generation of modular, observable, and agent-compatible codebases.


๐ŸŽฏ Core Function

Parse the architectural blueprint and invoke the appropriate parameters of the connectsoft-microservice template โ†’ to scaffold a full Clean Architecture solution aligned to DDD, EDA, and factory-wide conventions.


๐Ÿงฉ Template Engine

  • Template: connectsoft-microservice
  • Language: C# (.NET 8)
  • Mechanism: Invokes dotnet new CLI with extracted blueprint metadata
  • Extensibility: Supports AI-based parameter mapping and dynamic toggling of modules (REST, gRPC, messaging, AI)

โš™๏ธ Key CLI Parameters (mapped from blueprint)

CLI Parameter Derived From Example
--AggregateRootName aggregate_root Appointment
--ServiceModelType service_model RestApi
--PersistenceModelType persistence_model NHibernate
--MessagingModelType messaging_model MassTransit
--UseSemanticKernel enabled by default true
--UseOpenAI optional false
--Swagger, --HealthCheck, --Docker always included true
--TraceId (custom) trace_id booking-core-v1

๐Ÿš€ Sample CLI Command (BookingService)

dotnet new connectsoft-microservice \
  --AggregateRootName Appointment \
  --ServiceModelType RestApi \
  --PersistenceModelType NHibernate \
  --MessagingModelType MassTransit \
  --UseSemanticKernel true \
  --UseOpenAI false \
  --Swagger true \
  --HealthCheck true \
  --Docker true

โœ… Output: A fully structured, multi-project solution ready for commit, traceable by trace_id and blueprint_id.


๐Ÿ“ฆ Output Structure (Example)

BookingService/
โ”œโ”€โ”€ DomainModel/
โ”œโ”€โ”€ EntityModel/
โ”œโ”€โ”€ ApplicationModel/
โ”œโ”€โ”€ ServiceModel.RestApi/
โ”œโ”€โ”€ MessagingModel/
โ”œโ”€โ”€ FlowModel.MassTransit/
โ”œโ”€โ”€ PersistenceModel.NHibernate/
โ”œโ”€โ”€ Application/
โ”œโ”€โ”€ UnitTests/
โ”œโ”€โ”€ DockerCompose/
โ”œโ”€โ”€ InfrastructureModel/
โ””โ”€โ”€ SemanticKernel/

๐Ÿง  Intelligent Parameter Mapping (AI Agent)

The agent supports intelligent mapping:

  • Reads SystemArchitectureBlueprint file
  • Translates domain values into CLI switches
  • Auto-injects trace metadata and initial documentation

๐Ÿงฑ Microservice Generator Agent โ€” Output Structure and Project Breakdown

Once the Microservice Generator Agent executes the connectsoft-microservice template, it produces a multi-project solution aligned with Clean Architecture and domain-driven design. Each project is modular, traceable, and ready for CI/CD and agent collaboration.


๐Ÿ“ฆ Output: Multi-Project Microservice Structure

ConnectSoft.BookingService/
โ”œโ”€โ”€ DomainModel/                    # Use case interfaces, domain services
โ”œโ”€โ”€ EntityModel/                    # Aggregates, entities, value objects
โ”œโ”€โ”€ DomainModel.Impl/              # Use case implementations
โ”œโ”€โ”€ ApplicationModel/              # DI registration, middleware config
โ”œโ”€โ”€ Application/                   # Host application (Main)
โ”œโ”€โ”€ ServiceModel.RestApi/          # REST controllers, API endpoints
โ”œโ”€โ”€ PersistenceModel.NHibernate/   # ORM mappings, repositories
โ”œโ”€โ”€ MessagingModel/                # Event contracts (e.g., AppointmentCreated)
โ”œโ”€โ”€ FlowModel.MassTransit/         # Consumers, sagas, messaging integration
โ”œโ”€โ”€ SemanticKernel/                # AI skill registration (optional)
โ”œโ”€โ”€ DockerCompose/                 # Dev/test container orchestration
โ”œโ”€โ”€ InfrastructureModel/           # Pulumi / deployment config (optional)
โ”œโ”€โ”€ UnitTests/                     # Unit testing layer
โ””โ”€โ”€ ArchitectureModel/             # Mermaid diagrams, service documentation

๐Ÿงฑ Clean Architecture Layer Mapping

graph LR
    UI[ServiceModel.RestApi] --> App[ApplicationModel]
    App --> Domain[DomainModel]
    Domain --> Entity[EntityModel]
    App --> Infra[PersistenceModel + MessagingModel]
Hold "Alt" / "Option" to enable pan & zoom
  • No inner layer references outer layers
  • DI bindings managed in ApplicationModel
  • Entry point (Main) resides in Application

๐Ÿงช Cross-Cutting Features (Generated)

Feature Included?
OpenTelemetry Tracing โœ…
Serilog Structured Logging โœ…
ProblemDetails API Errors โœ…
FluentValidation โœ…
Health Checks (/health/live, etc.) โœ…
Swagger UI (/swagger) โœ…
Feature Flags Support โœ…
Dockerfile + Docker Compose โœ…
CI-ready Git Layout โœ…

๐Ÿง  Traceability Hooks in Code

Every generated service embeds trace ID support via:

  • Logging enrichers (WithTraceId())
  • Correlation ID propagation
  • Metadata in Swagger and CI

This allows downstream agents (e.g., QA, observability) to connect artifacts to the trace_id and blueprint_id.


๐Ÿงพ Code Committer Agent โ€” Git Actions, Metadata, CI Triggering

The Code Committer Agent is responsible for safely and traceably pushing generated code into version control (Azure DevOps Git). It ensures every commit is auditable, agent-attributed, and ready to trigger CI/CD workflows automatically.


๐ŸŽฏ Core Responsibilities

Responsibility Description
Git Integration Clone/pull the correct repo and branch
Stage & Commit Add all generated files with proper trace metadata
Metadata Enrichment Annotate commit with trace_id, agent_id, blueprint_id
Change Log Generation Create or update CHANGELOG.md entry
Event Emission Emit CodeCommitted event with commit ID and URI
Trigger CI/CD Push commit to tracked branch to start Azure DevOps pipeline

๐Ÿ—ƒ๏ธ Example Git Commit Metadata

git commit -m "feat: initial BookingService microservice [trace_id: booking-core-v1] [agent: code-committer]"

Embedded Metadata (in commit message or Git notes):

Field Value
trace_id booking-core-v1
agent_id code-committer
blueprint_id booking-service-blueprint
timestamp UTC now
artifact_type microservice-template-generated

๐Ÿ“„ Changelog Template (Auto-generated)

## [booking-core-v1] - 2025-05-11
### Added
- BookingService microservice scaffolded via connectsoft-microservice
- REST API for Appointment use cases
- NHibernate setup and MassTransit messaging
- OpenTelemetry, health checks, and Swagger

๐Ÿ”„ Event Emission

After committing:

{
  "event": "CodeCommitted",
  "trace_id": "booking-core-v1",
  "agent": "CodeCommitter",
  "commit_sha": "c9e2f84",
  "repo": "https://dev.azure.com/connectsoft/BookingService",
  "branch": "main",
  "changelog_uri": "CHANGELOG.md"
}

๐Ÿš€ CI/CD Triggering

The agent pushes to a branch that has an Azure DevOps pipeline YAML configured (e.g., main or dev), ensuring:

  • Immediate build of the generated microservice
  • Deployment to Docker / Azure environment
  • Test and telemetry validation

๐Ÿ“ฆ Pull Request Creator Agent โ€” PR Title, Traceability, Collaboration

The Pull Request Creator Agent finalizes the delivery of generated code by creating a structured, traceable, and CI-integrated pull request. It ensures human and agent collaborators can review, approve, and merge changes into the production branch โ€” closing the loop on agent-driven delivery.


๐ŸŽฏ Core Responsibilities

Responsibility Description
PR Creation Create a pull request on Azure DevOps for the generated commit(s)
Trace Metadata Injection Include trace_id, agent_id, and blueprint_id in the title and body
Summary Description Auto-generate a concise overview of what the PR includes
CI/CD Integration Ensure PR triggers build + test pipelines
Linkage to Issue or Blueprint Optionally reference a vision, ticket, or design doc

๐Ÿ“ Example PR Title

feat: BookingService initial scaffold [trace_id: booking-core-v1]

๐Ÿ“„ Example PR Body

### ๐Ÿ“ฆ Summary

This pull request adds the generated microservice `BookingService`, created by the Microservice Generator Agent from blueprint `booking-service-blueprint`.

---

### ๐Ÿง  Metadata

- `trace_id`: `booking-core-v1`
- `blueprint_id`: `booking-service-blueprint`
- `agent_id`: `pull-request-creator`
- `created_at`: `2025-05-11T08:45:00Z`

---

### โœ… Included Features

- REST API controllers for Appointment use cases
- NHibernate mappings and repository interfaces
- MassTransit consumers for domain events
- OpenTelemetry tracing, health checks, Swagger UI

---

### ๐Ÿ“Œ Notes

This PR is auto-generated and ready for CI build/test. Please review structure and trace alignment.

๐Ÿ”— Optional Linkages

Linked Object Example
Blueprint Doc /docs/booking/booking-service-blueprint.md
Vision Doc /docs/booking/booking-service-vision.md
Agent Execution Log /logs/booking-core-v1/execution.json
Changelog /CHANGELOG.md

๐Ÿ” Collaboration & Notification

The agent may also:

  • Assign reviewers (e.g. DevOps or QA agents in future)
  • Tag based on agent group (e.g. autogen, scheduling)
  • Add a comment webhook to post updates (e.g., build pass/fail)

๐Ÿ”„ Agent Interaction Flow โ€” Event-Driven Handoff & Traceability Chain

The First-5-Agents MVP relies on an event-driven, loosely coupled architecture, where each agent reacts to structured events emitted by its predecessor. This allows agents to operate independently, maintain traceability, and scale horizontally โ€” all while preserving a shared execution context via trace_id.


๐Ÿงญ Event-Driven Handoff Pattern

Each agent emits a domain event that acts as a handoff trigger for the next agent. These events include:

  • A reference to the produced artifact (e.g., Vision Document, Blueprint, Git commit)
  • The trace_id, which unifies all steps in the same generation flow
  • Agent identity and timestamp for audit and observability

๐Ÿ“œ Sequential Event Chain

sequenceDiagram
    participant User as Human Prompt
    participant Vision as Vision Architect Agent
    participant Arch as Enterprise Architect Agent
    participant Gen as Microservice Generator Agent
    participant Commit as Code Committer Agent
    participant PR as Pull Request Creator Agent

    User->>Vision: "Build BookingService"
    Vision->>Vision: Generate Vision Document
    Vision-->>Arch: Emit `VisionDocumentCreated`

    Arch->>Arch: Generate Architecture Blueprint
    Arch-->>Gen: Emit `SystemArchitectureBlueprintCreated`

    Gen->>Gen: Run CLI, Generate Codebase
    Gen-->>Commit: Emit `MicroserviceGenerated`

    Commit->>Commit: Git commit with trace metadata
    Commit-->>PR: Emit `CodeCommitted`

    PR->>PR: Create Pull Request
    PR-->>CI: Azure DevOps Build Triggered
Hold "Alt" / "Option" to enable pan & zoom

๐Ÿงฉ Traceability Graph

Each artifact (document, blueprint, commit, PR) includes the following minimum trace metadata:

Field Description
trace_id Unifies all artifacts and events in one logical execution
agent_id Indicates which agent produced the artifact
blueprint_id Links to the architectural specification
artifact_type Vision, Architecture, Service Code, Git Commit, PR, etc.
timestamp UTC timestamp of creation
artifact_uri Pointer to file, repo, or URL

๐Ÿง  Trace ID = the connective tissue All agents, artifacts, commits, and events in one generation flow are traceable through a single trace_id.


๐Ÿ“‚ Event Payload Example

{
  "event": "MicroserviceGenerated",
  "trace_id": "booking-core-v1",
  "agent_id": "microservice-generator",
  "blueprint_id": "booking-service-blueprint",
  "output_path": "/services/BookingService",
  "timestamp": "2025-05-11T08:33:21Z"
}

๐Ÿ›ก๏ธ Benefits of Event-Driven Agent Interaction

  • โœ… Loose coupling โ€“ Agents donโ€™t call each other directly
  • โœ… Parallelization Ready โ€“ Multiple services can generate in parallel
  • โœ… Auditable โ€“ Every step is logged and trace-linked
  • โœ… Recoverable โ€“ Any failed step can be retried independently
  • โœ… Composable โ€“ Future agents (QA, Security, Observability) can subscribe to the same events

๐Ÿ“Š Observability, Tracing, and Metadata Enrichment per Agent

The First-5-Agents MVP is designed with observability-first principles, ensuring that every agentโ€™s execution can be traced, measured, audited, and debugged โ€” both in real time and retrospectively.

Each agent enriches its outputs and actions with standardized metadata and emits OpenTelemetry (OTEL)-compliant spans, logs, and metrics.


๐Ÿงญ Core Observability Features

Feature Description
Trace ID Propagation Each agent execution carries a trace_id linking all artifacts together
OpenTelemetry Traces Each major action is wrapped in a traceable span
Structured Logging (Serilog) Logs include trace_id, agent_id, and artifact_id in every message
Metrics Exposure Agents expose Prometheus-compatible metrics (e.g., execution time, failure count)
Validation & Retry Logs Failures and recovery attempts are logged with full input/output diffs

๐Ÿ“‹ Common Metadata Fields

Every output and log line from an agent includes:

Field Example
trace_id booking-core-v1
agent_id microservice-generator
execution_id msgen-8734-x
artifact_type ArchitectureBlueprint, MicroserviceCode
created_at 2025-05-11T08:47:00Z
duration_ms 1750
status success, fail, retry

๐Ÿ“ˆ OpenTelemetry Tracing Example

โ†’ [trace_id=booking-core-v1] [agent=enterprise-architect]
   span: GenerateBlueprint [โœ” 248ms]
โ†’ [trace_id=booking-core-v1] [agent=microservice-generator]
   span: ExecuteCLI 'dotnet new connectsoft-microservice ...' [โœ” 3.2s]
โ†’ [trace_id=booking-core-v1] [agent=code-committer]
   span: CommitToGit 'initial scaffold' [โœ” 612ms]

All spans are tagged with:

  • trace_id
  • agent_id
  • blueprint_id
  • artifact_uri
  • span_status

โœ… Agents emit spans and logs via built-in exporters: OTLP โ†’ Application Insights / Prometheus / Jaeger


๐Ÿงช Failure Recovery Visibility

Failures are logged with full input โ†’ output diff, retry markers, and escalation hints:

{
  "trace_id": "booking-core-v1",
  "agent_id": "microservice-generator",
  "status": "fail",
  "error": "Template execution failed: invalid parameter 'PersistenceModelType'",
  "attempt": 1,
  "next_action": "retry_with_corrected_parameter"
}

๐Ÿ›ฐ๏ธ Observability Pipeline

graph TD
  AgentExec --> OTELCollector --> ApplicationInsights
  AgentExec --> MetricsEndpoint --> Prometheus
  AgentExec --> StructuredLogs --> AzureLogAnalytics
Hold "Alt" / "Option" to enable pan & zoom

๐Ÿ“Œ Optional Enhancements (Post-MVP)

  • Correlate Git commits and PRs in dashboards
  • Visualize agent spans with Gantt-style execution timelines
  • Integrate logs into a searchable trace explorer
  • Include agent resource usage (CPU/memory) per task

๐Ÿš€ Deployment Environment โ€” Azure DevOps Pipelines, Docker, Pulumi

The deployment phase of the First-5-Agents MVP is handled via a cloud-native CI/CD pipeline, configured in Azure DevOps, and powered by Docker and optionally Pulumi for infrastructure-as-code.

This environment ensures that every agent-generated service is:

  • Built reproducibly
  • Deployed consistently
  • Observable in production or dev
  • Traceable back to agent actions and commits

๐Ÿ› ๏ธ CI/CD Pipeline โ€“ Azure DevOps

Each generated microservice includes a preconfigured azure-pipelines.yml file, which handles:

Stage Tasks
Build Restore NuGet, compile all projects
Test Run unit tests, generate coverage
Package Build Docker image
Push Push image to Azure Container Registry (or local registry)
Deploy Use Docker or Pulumi to deploy to Azure App Service, Container Apps, or Kubernetes
Trace Injection Annotate logs and environment with trace_id, artifact_type, agent_id

๐Ÿงช Sample azure-pipelines.yml

trigger:
  branches:
    include: [main]

variables:
  trace_id: '$(Build.SourceBranchName)-$(Build.BuildId)'

stages:
  - stage: BuildAndTest
    jobs:
      - job: Build
        steps:
          - task: UseDotNet@2
            inputs:
              packageType: sdk
              version: '8.x'
          - script: dotnet build --configuration Release
          - script: dotnet test --no-build --logger trx

  - stage: Dockerize
    jobs:
      - job: DockerBuild
        steps:
          - task: Docker@2
            inputs:
              command: buildAndPush
              repository: connectsoft/booking-service
              tags: |
                latest
                $(Build.BuildId)

๐Ÿณ Docker-Based Runtime (Default)

Each microservice is packaged as a Docker container, with:

  • Health checks (/health/live, /health/ready)
  • Trace ID injection via environment variables
  • Logging via Serilog to console or file
  • OpenTelemetry exporter preconfigured

โœ… This makes it deployable locally, on AKS, Azure Container Apps, or Docker Compose


๐ŸŒ Optional: Pulumi-Based IaC

If --UsePulumi is enabled during generation:

Resource Pulumi Module
Azure App Service azure-native:web
Azure Key Vault azure-native:keyvault
Azure Container Registry azure-native:containerregistry
Service Bus azure-native:servicebus
DNS/SSL azure-native:network

This allows agents or infrastructure scripts to deploy environments via Pulumi CLI, using typesafe C#.


๐Ÿ” Traceability in Deployment Logs

Deployment logs automatically include:

{
  "trace_id": "booking-core-v1",
  "stage": "Deploy",
  "agent": "pull-request-creator",
  "container_tag": "booking-service:20250511.1",
  "status": "Success",
  "region": "East US"
}

๐Ÿงฉ Future Enhancements (Post-MVP)

  • Blue/green deployments with rollback
  • Deployment agent with observability feedback loop
  • Canary testing support
  • GitOps sync integration (e.g., FluxCD, ArgoCD)

๐Ÿ”ฎ Future Enhancements โ€” Agent Insights, Validation, Feedback Loops

While the First-5-Agents MVP delivers a complete autonomous generation loop, the long-term evolution of the ConnectSoft AI Software Factory depends on layering in insight, self-correction, validation, and feedback-driven intelligence.

These enhancements will move the system from automated code generation to a resilient, adaptive software production ecosystem.


๐Ÿ“Š 1. Agent Insights Service (Telemetry and Audit)

A lightweight microservice (AgentInsightsService) can be introduced to:

  • Collect and store agent span data (start/stop, duration, output status)
  • Track failures, retries, and human interventions
  • Enable dashboards for:
    • Most active agents
    • Generation time per service
    • Failed executions by cause
  • Correlate agent output with test and deploy metrics

๐Ÿ’ก Powered by OpenTelemetry + MongoDB or SQL + SignalR for live updates.


โœ… 2. Output Validation Agent (Structure, Semantics, Security)

Introduce a new agent to review the outputs from any previous agent:

Validation Area Check
Structure Does the vision/blueprint/code follow ConnectSoft schemas?
Semantics Are domain concepts and use cases coherent?
Security Are sensitive data fields encrypted, protected, and role-restricted?
Traceability Does the output carry trace_id, agent_id, and versioning?

This agent can act before PR creation or deployment, enabling a guardrail layer.


๐Ÿ” 3. Feedback Loop Integration (Autonomous Improvement)

Agents can evolve through internal feedback signals, such as:

  • โœ… Automated test failures โ†’ trigger bug resolver agent
  • โœ… Architecture validation failures โ†’ trigger blueprint correction
  • โœ… Human review flags โ†’ post feedback to root trace_id thread

๐Ÿง  These patterns allow agents to self-heal, ask for clarification, or adapt prompt strategies.


๐Ÿงช 4. Metrics + Anomaly Detection

The platform can detect patterns in:

  • Repeated failures from the same agent type
  • Latency spikes in specific blueprint configurations
  • Commitโ†’deploy cycles that exceed expected durations

This paves the way for runtime optimizers, cost controllers, and auto-scaling logic.


๐Ÿ“Œ Future Agents Enabled by These Enhancements

Agent Role
AgentInsightsCollector Real-time trace and span logger
OutputValidatorAgent Pre-PR compliance and contract enforcer
FeedbackRouterAgent Aggregates error, QA, and human feedback into agent prompts
BlueprintCorrectionAgent Refines system architecture from failed attempts

๐Ÿงญ Summary, Roadmap, and Next Steps

The First-5-Agents MVP lays the foundational loop of the ConnectSoft AI Software Factory, enabling the platform to autonomously turn a high-level idea into a production-ready microservice โ€” with traceability, observability, and CI/CD integration.

This MVP proves the feasibility of agentic software creation through modular, event-driven workflows and AI-enhanced execution.


โœ… What Weโ€™ve Built

Phase Outcome
๐Ÿง  Vision Input โ†’ Structured Vision Document
๐Ÿ— Architecture โ†’ Clean, modular System Architecture Blueprint
๐Ÿงฑ Generation โ†’ Full microservice scaffold using connectsoft-microservice
๐Ÿงพ Commit โ†’ Git commit with full trace metadata
๐Ÿ“ฆ Pull Request โ†’ CI-enabled PR linked to upstream artifacts
๐Ÿš€ Deploy โ†’ Service deployed via Azure DevOps & Docker/Pulumi
๐Ÿ“Š Trace โ†’ OTEL spans and structured logs per agent execution

๐Ÿ” MVP Agent Lifecycle Summary

flowchart TD
    Input["Human Prompt"] --> Vision["Vision Architect Agent"]
    Vision --> Blueprint["Enterprise Architect Agent"]
    Blueprint --> Code["Microservice Generator Agent"]
    Code --> Commit["Code Committer Agent"]
    Commit --> PR["Pull Request Creator Agent"]
    PR --> Azure["Azure DevOps CI/CD"]
    Azure --> Deploy["Microservice Live"]
Hold "Alt" / "Option" to enable pan & zoom

๐Ÿง  Core Agent Roles Recap

Agent Function
Vision Architect Converts ideas into structured software visions
Enterprise Architect Creates the domain, use case, and transport blueprint
Microservice Generator Scaffolds full service based on Clean Architecture
Code Committer Pushes commits with trace_id, version info
Pull Request Creator Publishes PRs and triggers CI/CD workflows

๐Ÿ”ฎ Roadmap: What Comes Next

Stage Focus
๐Ÿ” Agent Insights Service Real-time telemetry collection and visualization
๐Ÿ”’ Output Validation Agent Pre-PR contract enforcement
๐Ÿ‘ฅ Human-in-the-loop Feedback Review triggers for failed agent paths
๐Ÿง  Feedback-Enriched Agents Enable retry, improvement, and correction
๐ŸŒ Component Registry Service Catalog generated services and their metadata
๐Ÿ“š Knowledge Memory Integration Long-term blueprint and vision recall via vector DB
๐ŸŽ› MCP-Based Orchestration Introduce formal agent planner + skill router (MCP server)

๐Ÿš€ Next Steps

  1. โœ… Finish .NET new generation and commit BookingService
  2. โœ… Finalize Azure DevOps CI/CD pipeline and deployment
  3. โœ… Log all agent events with trace_id
  4. โœ… Create an execution transcript for this MVP
  5. ๐Ÿ” Begin design of AgentInsightsService and OutputValidatorAgent
  6. ๐Ÿง  Expand agent catalog with additional engineering and orchestration roles

๐ŸŽฏ The MVP demonstrates that ConnectSoft can autonomously generate, trace, and ship software components. From here, we begin the journey toward fully adaptive, insight-driven software factories.