๐ Documentation Blueprint¶
๐งญ Purpose of the Documentation Blueprint**¶
๐ฏ Objective¶
Define the role and rationale of the documentation-blueprint.md within the ConnectSoft AI Software Factory โ clarifying why it exists, what it governs, and how it serves both agents and humans in a modular, autonomous development system.
๐ What Is the Documentation Blueprint?¶
The documentation-blueprint.md is a meta-standard that defines how all documentation across the AI Software Factory is:
- Generated by agents
- Structured using templates and metadata
- Stored in retrievable, observable formats
- Linked to memory, traces, modules, and features
- Consumed by humans, agents, CI/CD, and copilots
It serves as the governing contract for all documentation-related behavior in the platform.
๐ค Why It Matters in an AI Software Factory¶
In traditional software systems, documentation is an afterthought. In ConnectSoft, documentation is:
- A first-class output of the generation pipeline
- A source of knowledge and memory for future agent runs
- A validation surface during CI/CD and policy enforcement
- A guidance layer for human developers via copilots and Studio
โIf an agent emits a module without documentation, itโs incomplete. If a human reads a doc without traceability, itโs untrustworthy.โ
๐ Documentation as Code, Memory, and Signal¶
In ConnectSoft, documentation isn't static:
| Dimension | Role |
|---|---|
| As Code | It is versioned, diffed, structured, and validated |
| As Memory | It becomes part of the knowledge graph and vector-retrievable context |
| As Signal | It emits trace metadata, quality scores, and audit events |
๐งฉ Blueprint Scope¶
The documentation blueprint governs all documentation outputs including:
README.md,HowItWorks.md,vision-blueprint.md- Feature specs, test docs, glossary files, architecture diagrams
- Execution summaries, prompt rationales, memory manifests
- DevOps logs, agent notes, and Studio view fragments
๐ Trust, Scale, and Traceability¶
The blueprint ensures documentation can scale securely and traceably by:
- Enforcing tenant and module scoping
- Embedding agentId, traceId, and skillId in every doc
- Validating format and metadata via CI
- Linking documentation to Studio views, agent memory, and semantic graphs
โ Summary¶
The Documentation Blueprint defines:
- What constitutes documentation in the Factory
- How it is structured, generated, versioned, and consumed
- How it aligns with memory, observability, and autonomy goals
โ It transforms documentation from passive text into machine-actionable, traceable knowledge across the lifecycle of autonomous SaaS generation.
๐๏ธ Types of Documentation in the Factory¶
๐ฏ Objective¶
Define and categorize the full spectrum of documentation types produced, consumed, and reused throughout the ConnectSoft AI Software Factory โ spanning technical, architectural, operational, and memory-bound knowledge.
๐ Core Documentation Categories¶
| Category | Purpose |
|---|---|
| Blueprints | High-level design intents, vision artifacts, service specs |
| Architecture Docs | System design, decisions, diagrams, and modular decomposition |
| API and Contract Specs | OpenAPI, gRPC, GraphQL, and event schemas |
| Execution Summaries | execution-metadata.json, agent logs, status reports |
| Test Documentation | BDD .feature files, coverage maps, test outcomes |
| How-To Guides | Procedural guidance for developers, ops, and integrators |
| Agent Notes | Contextual explanations of why decisions were made |
| Glossaries | Domain-specific and system-wide terminology definitions |
| Diagrams and Views | Visual representations (e.g., Mermaid, SVG, PlantUML) |
| Prompt Trace Records | Original prompts, planner flows, AI responses |
| Validation Artifacts | Checklists, approvals, rationale docs from governance flows |
| Module Snapshots | README.md, changelogs, module.json summaries per microservice or lib |
๐งฉ By Output Format¶
Documentation in ConnectSoft is natively multi-format and composable:
| Format | Examples | Generated By |
|---|---|---|
.md |
Vision, architecture, how-to, feature specs | Documentation Writer Agent |
.json |
Metadata, trace logs, summaries, embedding indexes | Coordinator, Validator Agents |
.yaml |
Blueprints, configs, CI pipelines | Solution Architect, DevOps Agent |
.feature |
BDD scenarios | Test Generator Agent |
.bicep |
Infrastructure diagrams-as-code | IaC Agent |
.svg |
Visuals for architecture or flows | Diagram Generator Agent |
๐ง By Memory Function¶
Docs are also classified by how they contribute to long-term memory:
| Memory Role | Example |
|---|---|
| Context Recall | VisionDocument.md, prompt-original.md |
| Reasoning Aid | generator-notes.md, design-decisions.md |
| Execution Trace | execution-metadata.json, agent-status.md |
| Semantic Vector | Embedded blueprint text, prompt-response logs |
๐ Cross-Stage Coverage¶
Documentation is emitted at every stage of the factory pipeline:
| Stage | Example Docs Generated |
|---|---|
| Vision / Planning | VisionDocument.md, domain overview |
| Architecture | service maps, module decomposition diagrams |
| Engineering | README, spec files, how-to, validation reports |
| Testing | .feature, test logs, coverage |
| Deployment | changelogs, configs, release manifests |
| Observability | trace overviews, alerts, system health views |
โ Summary¶
The AI Software Factory treats documentation as a modular, memory-bound, lifecycle-spanning output. It goes beyond static README files, embracing:
- Multi-agent, multi-format, multi-language artifacts
- Systemic traceability, quality signals, and semantic indexing
- Rich, layered content tied to blueprints, prompts, and memory
โ Every doc has a purpose, producer, consumer, and trace identity.
๐ฅ Who Produces and Who Consumes Docs¶
๐ฏ Objective¶
Define the roles, agents, tools, and stakeholders involved in the generation, validation, consumption, and refinement of documentation across the ConnectSoft AI Software Factory.
๐ค Primary Producers¶
| Producer Agent | Responsibilities |
|---|---|
| Documentation Writer Agent | Generates README.md, HowItWorks.md, summaries, changelogs, etc. |
| Solution Architect Agent | Emits architectural overviews, system maps, blueprint YAMLs |
| DevOps Agent | Outputs deployment diagrams, CI/CD pipelines, execution-metadata.json |
| Test Generator Agent | Generates .feature specs, coverage reports, test summaries |
| UX Designer Agent | Provides human-readable flows, onboarding docs, glossary terms |
| Prompt Planner Agents | Capture prompt intent, reasoning traces, planner flows |
๐จโ๐ป Human Authors and Editors¶
While most documentation is agent-generated, human engineers enhance it via:
- Manual edits in version-controlled markdown
- Injecting additional rationale or context
- Reviewing output in Studio or VSCode Copilot
- Linking external artifacts (e.g., screenshots, attachments)
Humans act as curators, validators, and quality editors โ not just readers.
๐ง Embedded AI Consumers¶
Documentation is also consumed by agents at runtime:
| Agent Role | How It Uses Documentation |
|---|---|
| Planner Agent | Pulls blueprint documents to reason over system scope |
| Developer Agent | Uses feature specs to generate modules, handlers, events |
| Validator Agent | Reads test plans and quality criteria |
| Release Manager Agent | Extracts version info and changelogs to label releases |
| Studio Interface Agent | Maps docs to timeline, trace tree, and previews in user interface |
๐งโ๐ผ Human Consumers¶
| Persona | Consumption Mode |
|---|---|
| Architects | Architecture diagrams, service overviews, system maps |
| Developers | API specs, README, test cases, feature specs |
| Testers | Test plans, .feature files, validation reports |
| Product Owners | Vision docs, capability summaries, glossary entries |
| DevOps Engineers | Pipeline manifests, environment-specific configs |
| Support Teams | Troubleshooting guides, change logs |
๐ Feedback and Update Flows¶
Documentation is a living memory updated by:
- Agent re-generation based on trace feedback
- Human pull requests with manual refinements
- Observability agents flagging outdated or missing docs
- Copilots suggesting doc improvements inline (e.g., VS Code)
๐งญ Dual Nature: Machine and Human-Oriented¶
Every documentation artifact must be:
| Machine-Readable | Human-Friendly |
|---|---|
| Structured metadata | Natural language, readable Markdown |
| Semantic embeddings | Visual diagrams and contextual guides |
| Memory-indexed for retrieval | Linked for Studio navigation |
| Referenced in CI validations | Reviewed in Git or Copilot interfaces |
โ Summary¶
Documentation in the ConnectSoft Factory is a shared asset:
- Produced by agents
- Refined by humans
- Read by both
- Indexed in memory
- Used in copilots, Studio, CI/CD, and runtime agents
โ It's the linking tissue between intelligence, execution, and understanding.
๐ค AI-Generated, Human-Augmented¶
๐ฏ Objective¶
Define how documentation is created as a collaborative artifact between autonomous agents and human engineers โ blending machine precision with human insight to produce high-quality, traceable, and useful documentation.
๐ง Generation by Intelligent Agents¶
The majority of documentation in the Factory is initially produced by agents. These agents:
- Operate based on prompts, blueprints, and memory
- Follow structural and metadata schemas
- Leverage past documentation as semantic examples
- Produce consistent formats such as
.md,.json,.yaml,.svg
Examples:
| Agent | Output Example |
|---|---|
Documentation Writer Agent |
README.md, HowItWorks.md, changelogs |
Test Generator Agent |
BDD .feature files, test docs, coverage |
Solution Architect Agent |
service-maps, domain-overviews, system diagrams |
โ๏ธ Augmentation by Humans¶
Human engineers enhance generated docs through:
- Clarification of business rationale
- Refinement of examples, explanations, and visuals
- Fixing contextual gaps or outdated terminology
- Linking additional source references
- Converting agent-output to production-quality writing
These changes are tracked via Git, Studio audit logs, or CI doc checks.
๐ Iterative Co-Authoring Loop¶
sequenceDiagram
participant Agent as AI Agent
participant Git as Git Repo
participant Human as Developer
participant Studio as Studio
Agent->>Git: Commit generated doc
Human->>Git: Refine and commit improvements
Studio->>Git: Track versions and metadata
Git-->>Agent: Feed back changes for future prompts
This loop ensures that agents learn from human refinements and future generations become more accurate, contextual, and complete.
๐ Co-Ownership Model¶
| Responsibility | Agent Role | Human Role |
|---|---|---|
| Initial generation | Generate complete doc structure + content | Review and contextualize |
| Metadata + trace links | Inject traceId, agentId, type, tags | Validate and update scope/context |
| Visual assets | Generate diagrams and layout | Refine narrative, polish, or override |
| Observability signals | Emit quality metrics, stale flags | Confirm status and documentation health |
๐ง Memory-Driven Improvement¶
Agent-generated docs improve through:
- Memory embeddings of human-updated examples
- Trace feedback loops (e.g.,
DocCorrected,MisleadingDocFlagged) - Copilot suggestion mining and auto-refactor injection
๐งญ Governance Rules¶
All agent-produced docs include:
generatedByandgeneratedAtmetadatatraceId,skillId, anddocTypetags- Clear section delimiters for human edits
- Change audit trail (
doc-revision.jsonor commit diff)
โ Summary¶
The AI Software Factory uses a co-authoring paradigm for documentation:
- Agents ensure speed, structure, and memory linkage
- Humans ensure clarity, trust, and contextual relevance
โ Together, they produce documentation thatโs alive, intelligent, and production-grade.
๐ Documentation Lifecycle and Statuses¶
๐ฏ Objective¶
Define the lifecycle stages and status management of documentation artifacts โ from initial generation to production approval, deprecation, or regeneration โ ensuring auditability, clarity, and consistency across modules and agents.
๐ Key Lifecycle States¶
| Status | Description |
|---|---|
Draft |
Initial version, generated by agent or human, not yet reviewed |
InReview |
Pending human/agent review or approval process |
Approved |
Validated for production use; included in Studio, CI/CD, and release views |
Outdated |
Valid but flagged as stale or superseded by a newer trace |
Deprecated |
No longer recommended; archived or auto-excluded from runtime use |
Regenerated |
Recreated from a new traceId or feature input |
Each document includes a status field in its metadata for traceability.
๐งฌ Metadata Example¶
{
"docType": "FeatureSpec",
"moduleId": "BookingService",
"status": "InReview",
"generatedBy": "test-generator-agent",
"traceId": "trace-9c28a1f",
"version": "v1.3.0",
"createdAt": "2025-06-13T12:14:00Z",
"reviewedBy": null
}
โ Status Workflow Overview¶
flowchart TD
Draft --> InReview
InReview --> Approved
Approved --> Outdated
Approved --> Deprecated
Outdated --> Regenerated
โ
Each transition is logged in doc-revision.json and reflected in Studio views.
๐ Agent-Aware Lifecycle Behaviors¶
| Agent Type | Lifecycle Integration |
|---|---|
Documentation Writer |
Sets initial Draft status |
Validator Agent |
Triggers move to InReview or flags inconsistencies |
Release Manager Agent |
Requires Approved docs before tagging deployments |
Observability Agent |
Flags Outdated docs via freshness heuristics and trace gaps |
Copilot Plugin |
Excludes Deprecated or low-trust docs from injected memory |
๐ง Factors That Trigger Status Change¶
- Time since last trace match โ
Outdated - Feature or module deleted โ
Deprecated - Manual override in Studio or Git โ Any state
- CI validation failure โ Blocks
Approved - Human review โ Promotes from
InReviewtoApproved
๐ฅ Enforcement in CI/CD¶
CI pipelines validate:
- All modules must include at least 1
ApprovedREADME and test doc - Documentation without required metadata is blocked
Deprecateddocs cannot be linked from blueprints or included in releases
๐ Studio and Trace View Integration¶
- Status badge shown per document
- Filters available:
Only Approved,Needs Review,Deprecated - Visual history diff and trace-linked revision logs
โ Summary¶
Documentation in the Factory is versioned, governed, and traceable across its lifecycle:
- Each doc moves through clear statuses (
Draft โ Approved โ Deprecated) - Transitions are enforced by CI, agents, and Studio views
- Status metadata is required and consistently applied
โ Enabling trust, governance, and automation of knowledge evolution.
๐ Folder Structures and Naming Conventions¶
๐ฏ Objective¶
Establish consistent, predictable, and traceable conventions for where documentation is stored, how it's named, and how it's resolved across modules, agents, and Studio views โ supporting modularity, discovery, and trace linking at scale.
๐๏ธ Core Folder Structure¶
Every module or service in the Factory includes a standardized docs/ directory:
/modules/
BookingService/
docs/
README.md
feature-booking-availability.md
test-scenarios.feature
changelog.md
execution-metadata.json
diagrams/
booking-flow.mmd
service-structure.svg
Top-level documentation exists at the project or tenant scope:
/blueprints/
vision/
vision-overview.md
system-decomposition.md
architecture/
service-map.mmd
context-boundaries.md
glossary/
terms-en.md
terms-ru.md
๐ Naming Convention Rules¶
| Element | Convention |
|---|---|
| README files | README.md, HowItWorks.md |
| Feature docs | feature-<feature-name>.md or .feature |
| Test scenarios | test-<module/feature>.feature |
| Execution metadata | execution-metadata.json |
| Trace-linked docs | trace-<traceId>-<docType>.md |
| Agent notes | agent-<agentId>-<skill>.md |
| Diagrams | Use .mmd, .svg, .plantuml โ inside docs/diagrams/ folder |
| Change logs | changelog.md, release-notes.md per version folder |
โ These filenames are parsed and verified by both the CI and Studio indexer.
๐ฆ Multi-Version Folder Layout¶
Versioned outputs use:
Each version folder includes trace-linked and status-tagged documentation with its own execution-metadata.json.
๐ง Traceable Location Resolution¶
Documentation is resolved using a 3-part identity:
โ This allows Studio, CI/CD, and memory agents to locate the correct document without hardcoded paths.
๐ Discovery Rules¶
Studio, copilots, and agents resolve docs by:
- Checking
docs/folders in module path - Falling back to
/blueprints/for shared/system-wide docs - Resolving via
traceId,agentId,docTypewhen embedded in metadata - Filtering by
status: Approvedby default
๐ ๏ธ Enforcement and Linting¶
CI pipelines include a Doc Structure Validator:
- Flags misplaced or misnamed files
- Warns if required docs (e.g.,
README.md,execution-metadata.json) are missing - Validates semantic folders like
diagrams/,glossary/,architecture/
โ Summary¶
Consistent folder and naming structures:
- Enable machine lookup, Studio rendering, and search
- Improve reusability, versioning, and memory indexing
- Reduce ambiguity for both agents and humans
โ Every documentation artifact is discoverable, structured, and trace-linked by design.
๐ท๏ธ Documentation Metadata Schema¶
๐ฏ Objective¶
Define the required and optional metadata fields that every documentation artifact must include to support traceability, versioning, status tracking, semantic search, Studio indexing, and memory embedding.
๐ Required Metadata Fields¶
All docs โ whether Markdown, JSON, YAML, or .feature โ must include a machine-readable metadata block.
Example (YAML frontmatter or embedded JSON):
---
docType: FeatureSpec
moduleId: BookingService
traceId: trace-7a82f9
agentId: test-generator-agent
status: Approved
version: v1.1.0
generatedAt: 2025-06-13T15:04:00Z
tags: [appointments, testing, BDD]
language: en
memoryEmbedding: true
---
๐งฌ Field Definitions¶
| Field | Type | Description |
|---|---|---|
docType |
string | Type of doc (e.g., FeatureSpec, Readme, Changelog, VisionDoc) |
moduleId |
string | The module, service, or library this doc belongs to |
traceId |
string | The trace that triggered this documentation's generation |
agentId |
string | Which agent created this doc (e.g., documentation-writer-agent) |
status |
string | Lifecycle stage: Draft, InReview, Approved, Deprecated, etc. |
version |
string | Version of the associated module or artifact |
generatedAt |
timestamp | ISO 8601 timestamp of when this doc was produced |
tags |
array | Semantic tags (used in search, filtering, memory graphs) |
language |
string | Language code (e.g., en, ru, es) |
memoryEmbedding |
boolean | Whether this doc should be embedded for semantic retrieval |
๐ Optional Fields¶
| Field | Type | Purpose |
|---|---|---|
relatedDocs |
array | References to related docIds or paths |
sourcePromptId |
string | ID of prompt that led to this doc's generation |
reviewedBy |
string | Human reviewer (if applicable) |
correctedFrom |
string | traceId of earlier version this doc was regenerated from |
embeddingVectorId |
string | ID used in vector store if semantically indexed |
๐ Storage Format Examples¶
-
YAML Frontmatter in Markdown Used for docs like
README.md,HowItWorks.md, or feature specs. -
JSON Metadata Block in
.featureor.mmdEmbedded as comments or sidecar.meta.jsonfiles. -
Separate
doc-metadata.jsonUsed when the primary format is not text-editable (e.g.,.svg,.bicep).
๐ง Why This Matters¶
Consistent metadata enables:
- Studio navigation and visual overlays
- Search and filtering in copilots and dashboards
- Observability signals (e.g., stale docs, missing tags)
- Memory graph integration for retrieval-augmented generation
๐ Validation Rules¶
CI pipelines and the Doc Structure Validator enforce:
- Presence of all required fields
- Correct typing and format
- Consistency between folder structure and metadata values
โ Summary¶
Metadata transforms documentation into a machine-consumable, traceable, and AI-integrable asset:
- Required for search, filtering, CI/CD, and memory indexing
- Drives trace-first visibility and semantic discovery
- Aligns every document with the platform's modular and observable nature
โ Every doc becomes a first-class citizen in the autonomous software factory.
๐งฑ Documentation Templates and Layouts¶
๐ฏ Objective¶
Establish reusable, modular, and memory-compatible layout templates for every major documentation type โ ensuring consistency, automation compatibility, and human readability across all docs produced by the factory.
๐ Standardized Template Types¶
Each doc type in the factory is backed by a predefined layout template, structured with reusable sections, optional fields, and embedded metadata.
| Doc Type | Template File | Description |
|---|---|---|
README.md |
templates/docs/readme-template.md |
Overview, usage, trace info, status, links |
HowItWorks.md |
templates/docs/howitworks.md |
Runtime logic, workflows, diagrams, decisions |
FeatureSpec.md |
templates/docs/feature-spec.md |
Requirements, user stories, inputs/outputs |
.feature |
templates/docs/test-scenario.feature |
BDD Given/When/Then for QA and automation |
changelog.md |
templates/docs/changelog.md |
Versioned release notes + trace logs |
execution-metadata.json |
templates/docs/execution-metadata.json |
Trace, agent, and runtime data summary |
๐งฉ Composable Layout Sections¶
Templates are composed of named sections that can be reused or injected independently by agents:
| Section Name | Usage Context |
|---|---|
## Purpose |
README, feature docs |
## Trace Metadata |
All doc types |
## Inputs / Outputs |
Feature specs, use cases |
## Prompt Rationale |
AI-generated decisions and flows |
## Visual Flow |
HowItWorks, architecture views |
## Related Artifacts |
Links to code, blueprints, tests |
## Audit History |
Reviewed by, status changes, commits |
Each section is labeled for Studio parsing, copilot highlighting, and memory chunking.
๐ Sample: Feature Spec Template¶
---
docType: FeatureSpec
traceId: trace-abcdef12
moduleId: InvoiceService
generatedBy: business-analyst-agent
status: Approved
version: v1.2.0
---
## Purpose
Describes the requirements for generating recurring invoices.
## Inputs / Preconditions
- Valid subscription
- Defined billing cycle
## Outputs / Postconditions
- New invoice created
- Payment schedule updated
## User Story
> As a platform admin, I want recurring invoices generated automatically...
## Prompt Rationale
Generated based on `vision-billing.md` + planner-agent suggestion.
## Related Artifacts
- `test-recurring-invoice.feature`
- `InvoiceCreatedEvent.cs`
- `HowItWorks.md`
๐ Visual Templates¶
Docs that contain diagrams reference .mmd, .plantuml, or .svg components, either inline or via:
โ These are parsed by Studio or rendered by CI markdown pipelines.
๐ง Injection by Agents¶
- Agents can inject section fragments dynamically
- Each section is optional unless required by
docType - Templates support parameterization via
{{placeholders}}during prompt composition
โ Summary¶
Documentation templates provide:
- Consistency for humans, agents, and validation tools
- Structured injection and composition of content sections
- Reusable scaffolding for every
docType, traceable across versions and modules
โ The factory doesnโt just generate content โ it formats it for traceability, reuse, and quality.
๐ง Modular Knowledge Blocks¶
๐ฏ Objective¶
Define how documentation is composed of modular, reusable knowledge blocks โ allowing agents and humans to assemble, reuse, and trace documentation components across modules, tenants, and systems.
๐งฉ What Is a Knowledge Block?¶
A knowledge block is a self-contained, semantically tagged, and trace-linked documentation fragment that:
- Has a clear scope (e.g., โInvoice flow diagramโ or โRetry policy rationaleโ)
- Is versioned and optionally embedded in vector memory
- Can be referenced, reused, or injected into other documentation
๐ฆ Block Format and Metadata¶
---
blockId: kb-74df12
type: Diagram
title: Invoice Flow Logic
tags: [invoicing, billing, retry]
traceId: trace-7a2b81
moduleId: InvoiceService
version: v1.0.1
generatedBy: architect-agent
memoryEmbedding: true
---
## ๐งพ Invoice Flow Logic (kb-74df12)
```mermaid
sequenceDiagram
Customer->>BillingService: Subscribe
BillingService->>Scheduler: Schedule Invoice
Scheduler-->>BillingService: Timer Trigger
BillingService->>InvoiceService: CreateInvoice
---
### ๐ง Types of Knowledge Blocks
| Type | Description |
|-------------------|------------------------------------------------------------|
| `Definition` | A glossary entry or domain explanation |
| `Rationale` | Prompt decision or architectural choice explanation |
| `Diagram` | A `.mmd`, `.plantuml`, or `.svg` visual element |
| `Checklist` | A validation or approval list for agents/humans |
| `Prompt Trace` | Original planner input and output summary |
| `Code Snippet` | Agent-generated example embedded in explanation |
| `Reference Link` | Cross-module or cross-service doc or code reference |
| `Audit Block` | Reviewer comments, status change records, decision logs |
---
### ๐ Block Injection and Referencing
Knowledge blocks can be **injected** using link-style references:
```markdown
:::kb[Invoice Flow Logic](kb-74df12)
Or embedded inline during generation:
โ Both methods allow agents and copilots to resolve, version, and embed the block during generation.
๐ Registry and Reuse¶
Knowledge blocks are stored in:
/knowledge-blocks/folders per module, domain, or featurekb-index.jsonfor Studio, CI, and memory ingestion- Referenced by traceId, tags, or logical grouping (e.g.
payment-domain/)
They can be reused in:
- Multiple feature specs
- Agent reasoning steps
- README summaries
- CI validation outputs
๐ง Memory Graph Linking¶
Each knowledge block is:
- Stored as a vector-embedded memory chunk if
memoryEmbedding: true - Cross-linked to other blocks using shared tags, source prompts, or usage traces
- Included in search, similarity, and prompt reasoning
โ Summary¶
Modular knowledge blocks:
- Enable composability of documentation like Lego pieces
- Reduce duplication across modules and teams
- Improve traceability and memory-driven reuse
- Power AI copilots and Studio views with context-aware injection
โ Every block becomes a building unit of the Factoryโs living documentation graph.
๐ Linking to Blueprints and Modules¶
๐ฏ Objective¶
Define how documentation artifacts are tightly linked to the blueprints, features, and modules they describe โ enabling trace-based navigation, memory integrity, reuse across components, and accurate semantic associations.
๐งฑ What Should Be Linked¶
Every documentation file must be explicitly associated with at least one of the following:
| Link Target | Description |
|---|---|
BlueprintId |
E.g., vision-booking-platform, infra-template-aks |
FeatureId |
E.g., recurring-invoicing, multi-tenant-isolation |
ModuleId |
E.g., InvoiceService, UserGateway, LocalizationLibrary |
AgentTraceId |
E.g., trace-f2b98d8a that represents the planning or generation flow |
PromptTemplateId |
ID of the template or persona skill that initiated the doc |
๐งฌ Embedded Metadata Fields¶
All documentation must include linkage metadata:
---
moduleId: InvoiceService
blueprintId: billing-core-blueprint
featureId: recurring-invoices
traceId: trace-a1b2c3
promptTemplateId: ft-generate-recurring
---
This enables Studio, memory graphs, copilots, and CI validation to link documentation directly to:
- Source modules and code
- Feature specs and BDDs
- Prompt reasoning flows and AI-generated blueprints
๐งฉ Practical Linking Examples¶
| Doc Type | Expected Linkage |
|---|---|
README.md |
moduleId only |
feature-recurring.md |
featureId, moduleId, optional blueprintId |
execution-metadata.json |
traceId, moduleId, agentId |
vision-overview.md |
blueprintId, agentId, no module required |
agent-rationale.md |
traceId, promptTemplateId, possibly featureId |
๐ง Why Linking Matters¶
| Capability | Enabled By Linking |
|---|---|
| Trace Visualization | Studio shows upstream โ downstream links |
| Memory Indexing | Search relevance improves via shared links |
| Modular Reuse | Shared features/docs across microservices |
| Prompt Debugging | Reverse-trace what prompt produced which doc |
| Multi-Agent Coordination | Different agents contribute linked docs to the same entity |
| CI/CD Validation | Blocks release if required links are missing |
๐ Studio and Copilot Integration¶
- Studio renders a linked graph of all documentation per blueprint/module
- Copilots resolve links to inject additional context during code or prompt generation
- Hover or click reveals inline preview from related docs
๐ Cross-Linking Patterns¶
Documentation can also link to other docs explicitly:
๐ Related:
- [Recurring Invoice Feature Spec](./feature-recurring.md)
- [Test Scenarios](./test-recurring.feature)
- [System Diagram](./diagrams/invoice-flow.mmd)
These are parsed and validated by the Studio indexer and injected into Studio navigation panels.
โ Summary¶
Linking documentation to features, modules, and blueprints:
- Enables trace-based doc discovery, validation, and reuse
- Powers memory graphs, prompt reasoning, and agent coordination
- Establishes a semantic mesh of documentation as part of the systemโs intelligence
โ Every doc becomes part of a resolvable, navigable, and composable network of system knowledge.
๐ฐ๏ธ Traceability and Observability Fields¶
๐ฏ Objective¶
Define the required traceability and observability metadata that must be embedded into documentation artifacts to support end-to-end visibility, lifecycle tracking, change audits, and semantic memory correlation.
๐ Why Traceability Is Critical¶
Traceability ensures that documentation is:
- Linked to who/what/why/when it was generated
- Trustworthy (has clear provenance)
- Fully observable, versioned, and validated
- Usable in Studio dashboards, copilot memory, and CI pipelines
โ Traceability is the foundation of governance, automation, and knowledge integrity in the factory.
๐ Required Traceability Fields¶
| Field | Purpose |
|---|---|
traceId |
Ties doc to a specific execution or generation flow |
agentId |
Identifies which agent produced the doc |
generatedAt |
ISO timestamp of generation |
generatedBy |
Agent type or skill responsible for doc creation |
promptTemplateId |
Template or planner used to generate doc |
docVersion |
Version of the documentation or its schema |
status |
Draft, InReview, Approved, Deprecated, etc. |
reviewedBy |
Human reviewer (optional for audit trail) |
observabilityTags |
Tags used in logging/metrics (e.g. docs.module.invoice) |
๐ง Observability Hooks in Documentation¶
Agents and CI systems emit observability signals such as:
DocGeneratedโ when a doc is createdDocValidatedโ when format or links are checkedDocFlaggedOutdatedโ when last update exceeds freshness policyDocModifiedByHumanโ tracked via Git or Studio editorDocMissingRequiredSectionโ emitted by the doc validatorDocEmbeddedToMemoryโ used in semantic memory indexing
These are used to generate documentation quality dashboards, Studio alerts, and copilot quality scores.
๐ Observability Fields in Execution Metadata¶
execution-metadata.json captures structured trace logs:
{
"traceId": "trace-28bfa0",
"agentId": "documentation-writer-agent",
"moduleId": "InvoiceService",
"docTypesGenerated": ["README", "FeatureSpec", "Changelog"],
"durationMs": 920,
"status": "success",
"qualityScore": 0.93,
"issues": [],
"emittedAt": "2025-06-13T16:32:01Z"
}
๐ Studio Integration¶
- Studio dashboards use
traceIdto group related docs - Visual diff and timeline views depend on
generatedAt,status, andreviewedBy - Missing trace metadata triggers warning banners in the Studio UI
- Quality heatmaps are built from
observabilityTagsandqualityScore
๐ ๏ธ CI Enforcement¶
The CI pipeline checks:
- All documentation includes required trace and observability fields
- Agent ID and status match known platform agents and status enum
- Prompt template ID (if present) resolves to a known planner/skill
traceIdexists in execution logs and trace registry
โ Summary¶
Traceability and observability fields transform documentation into a trustworthy, validated, and measurable artifact:
- Traceable across its origin, lifecycle, and usage
- Observable across the pipeline and Studio
- Auditable and quality-assessable via metadata and telemetry
โ Every doc is part of a trace-first, memory-aware, and CI-validated documentation mesh.
๐ Versioning, Change Logs, and Audit Trails¶
๐ฏ Objective¶
Define how documentation artifacts are versioned, tracked, and audited โ ensuring historical integrity, traceable changes, reproducibility across builds, and alignment with code, prompts, and features over time.
๐งพ Versioning Strategy¶
Every documentation artifact is assigned:
| Field | Description |
|---|---|
version |
Corresponds to the version of the module, feature, or platform release |
docVersion |
Optional field for independently versioning a document structure or content |
traceId |
Unique per generation flow (acts as implicit version ID) |
gitCommit |
If authored/updated manually, includes the corresponding commit hash |
Docs may live under versioned folders:
/modules/InvoiceService/v1.0.0/docs/README.md
/modules/InvoiceService/v1.1.0/docs/README.md
/modules/InvoiceService/latest -> v1.1.0
Studio resolves the correct version via version + status: Approved.
๐ Changelog Conventions¶
Each module must include a changelog.md:
# InvoiceService โ Changelog
## [v1.1.0] - 2025-06-12
- Added retry logic for invoice creation
- Improved error handling (linked to `execution-metadata.json`)
- Feature: `recurring-invoicing`
## [v1.0.0] - 2025-05-10
- Initial release
Generated changelogs include:
- Features added or modified
- Related trace IDs and links to prompts
- Known regressions, manual edits, or deprecations
๐ Audit Trail Elements¶
| Metadata Field | Purpose |
|---|---|
createdBy |
Which agent or human generated the first version |
lastModifiedBy |
Agent or human who last modified the document |
reviewedBy |
Optional human reviewer, linked to change log or Studio action |
changeType |
Generated, Corrected, Reviewed, Refactored, Merged, etc. |
sourcePromptId |
Links to the original prompt that produced the doc (if AI-generated) |
previousTraceId |
Link to an older version that this replaces |
๐ Regeneration Logic¶
If a module is regenerated:
- New
traceIdis issued - Prior trace is marked
DeprecatedorOutdated correctedFrommetadata links back to the previous doc- Changelog automatically notes regeneration in context of feature or blueprint
๐ง Studio Timeline View¶
Studio provides:
- Version diffs per document, per section
- Timeline of changes with who/what/when
- Compare between versions or branches
- Audit log of prompt โ document โ human edits
๐ CI Enforcement¶
Pipeline ensures:
- No
Approveddocument is missingversionortraceId - Every
README.mdmust be listed inchangelog.md Deprecateddocs are excluded from active feature graphs- Semantic diffs are validated (if configured)
โ Summary¶
Versioning and audit trails turn documentation into a controlled, historical, and explainable artifact:
- Traced through every change, reviewer, and version
- Supports reproducibility and root-cause analysis
- Aligns with clean architecture and release integrity
โ Docs donโt just exist โ they have a life cycle, a lineage, and a ledger.
๐จ๏ธ Multi-Output Targets and Formats¶
๐ฏ Objective¶
Define the output formats and rendering targets for documentation artifacts โ ensuring compatibility across developers, agents, pipelines, Studio interfaces, and external tools.
๐ฆ Supported Output Formats¶
Each documentation artifact can be rendered or exported into multiple formats, depending on context and consumer:
| Format | Purpose / Consumer | Rendered By |
|---|---|---|
.md (Markdown) |
Default authoring format; human-readable source | Agents, humans, MkDocs, GitHub |
.html |
Rich Studio preview, exportable documentation | MkDocs, Studio Renderer, Docs Viewer Agent |
.pdf |
Offline, printable docs, QA specs, reports | PDF Generator Agent or CI export plugin |
.json |
Structured metadata, execution info, memory block | Execution agents, memory graphs, plugins |
.yaml |
Configs, IaC, changelogs, schema-driven outputs | Infra agents, validators, Studio panels |
.feature |
BDD scenarios; parsed by test runners | QA agents, test runners, coverage validators |
.mmd, .svg, .plantuml |
Diagrams-as-code + visual embeds | Mermaid/PlantUML renderers in Studio/CI |
๐ค Output Targets and Interfaces¶
| Output Target | Description |
|---|---|
| MkDocs Site | Canonical, searchable portal for project documentation |
| ConnectSoft Studio | Rich embedded documentation linked to modules and features |
| VSCode Copilot | Inline injected Markdown or metadata fragments |
| ChatGPT Plugin | Queried docs used in assistant-based conversations |
| GitHub View | Source view + preview in GitHub UI |
| PDF Archive | Formal document bundles for review, audit, or compliance |
| CI/CD Logs | Docs included in job outputs, coverage, or diff summaries |
๐ฅ Source โ Output Conversion Flow¶
flowchart TD
A[Markdown + Metadata] --> B(Memory & Semantic Vector)
A --> C(MkDocs HTML)
A --> D(PDF Generator)
A --> E(Studio Preview Engine)
A --> F(Copilot Context Snippet)
A --> G(Chat Plugin Formatter)
๐ ๏ธ Output Configuration by Doc Type¶
| Doc Type | Markdown | HTML | JSON | Studio | Memory | |
|---|---|---|---|---|---|---|
README.md |
โ | โ | โ | ๐ถ | โ | โ |
FeatureSpec.md |
โ | โ | โ | ๐ถ | โ | โ |
changelog.md |
โ | โ | โ | โ | โ | ๐ถ |
.feature |
โ | โ | โ | โ | โ | ๐ถ |
execution-metadata.json |
๐ด | ๐ถ | ๐ถ | โ | โ | โ |
Legend:
- โ = Fully supported
- ๐ถ = Optional / conditional
- ๐ด = Not applicable
๐ง Copilot and Memory Optimization¶
To support AI copilots, documentation is:
- Chunked into memory embeddings
- Converted into structured JSON if needed (
context-snippet.json) - Indexed by docType, moduleId, and traceId
- Rendered as summaries or hoverable help inside tools like Studio or VS Code
๐ Export Examples¶
pdf-bundle/InvoiceService/v1.0.0.pdfdocs-site/BookingFeature/index.htmlmemory/chunks/feature-recurring.vector.jsoncopilot/context-snippet-recurring-invoicing.json
These are created automatically by agents or CI processors and attached to releases or visualized in Studio.
โ Summary¶
Supporting multiple formats and output targets enables:
- Broad accessibility (devs, managers, tools)
- Rich visualization in Studio and GitHub
- Machine integration with CI/CD, copilots, and memory systems
- Offline compatibility via PDF bundles
โ Every documentation artifact becomes multi-surface, multi-format, and multi-intelligence ready.
๐งฎ Support for Diagrams-as-Code¶
๐ฏ Objective¶
Define the standards and mechanisms for integrating visual documentation as diagrams-as-code, ensuring that all diagrams are:
- Version-controlled
- Agent-generable
- Semantic and reusable
- Directly linked to features, modules, and traces
๐ Supported Diagram Formats¶
| Format | Description | Tools Used |
|---|---|---|
.mmd |
Mermaid for sequence, flow, state, class diagrams | Mermaid.js renderer (Studio, MkDocs) |
.plantuml |
PlantUML syntax for component and architecture views | PlantUML server, plugin |
.svg |
Vector-based exported diagrams | Embedded in Markdown |
.png, .jpg |
Optional fallback for static renders | Generated from .mmd or .svg |
โ All source diagrams should be stored as code-first files (.mmd, .plantuml) to support regeneration.
๐ Folder and Naming Convention¶
Diagrams are stored under:
/modules/BookingService/docs/diagrams/
service-overview.mmd
booking-flow-sequence.mmd
context-map.plantuml
legacy-flow.svg
Linked from Markdown using:
Studio renders .mmd and .plantuml inline and interactively.
๐ง Diagram Metadata¶
Each diagram file (or its sidecar .meta.json) includes traceable metadata:
---
diagramId: diag-82bf6a
title: Booking Flow (Sequence)
moduleId: BookingService
traceId: trace-9f83d1
type: sequence
generatedBy: architect-agent
tags: [flow, booking, operations]
memoryEmbedding: false
---
โ Enabling trace-based retrieval, memory linking, and observability triggers.
๐ ๏ธ Agent Diagram Injection¶
Agents like the Architect Agent and DevOps Agent:
-
Generate
.mmdor.plantumlusing templates -
Insert diagrams as sections in documentation:
- Emit separate
.mmdor.svgfiles for rendering
Studio supports editing or regenerating diagrams through UI actions.
๐ Lifecycle and Diffing¶
All diagrams:
- Are version-controlled in Git
- Include a corresponding trace or feature link
- Are diffable via semantic renderers (showing nodes/edges/flow changes)
- Support human override or annotation
โ Studio Rendering Features¶
- Interactive zoom and pan
- Node/edge annotations
- Link nodes to doc sections or code references
- Tooltip previews for features or modules
๐ Observability Hooks¶
Agents emit:
DiagramGeneratedDiagramInvalid(syntax issues)DiagramOutdated(based on trace delta)DiagramLinkedToDeprecatedDoc
These show up in Studio health panels and CI outputs.
โ Summary¶
Diagrams-as-code enable:
- Fully generable, editable, and traceable visual assets
- Seamless integration into documentation and Studio
- CI-validatable visual outputs for feature or system explanation
โ Making visuals first-class citizens of the autonomous documentation lifecycle.
๐ง Semantic Embedding and Memory Integration¶
๐ฏ Objective¶
Define how documentation is embedded into memory graphs and semantic vector stores, enabling AI agents, copilots, and Studio interfaces to perform contextual reasoning, search, retrieval, and knowledge reuse.
๐งฌ What Is Semantic Embedding?¶
Semantic embedding is the process of:
- Chunking documentation into meaningful segments
- Encoding them as vectors using embedding models (e.g., OpenAI, Azure OpenAI, HuggingFace)
- Storing them in memory stores for fast similarity search and AI prompt augmentation
This allows agents to recall relevant documentation fragments at runtime, even across services and features.
๐ฆ Supported Embedding Targets¶
| Target Type | Description |
|---|---|
README.md |
Core service overview and usage context |
feature-*.md |
Functional requirements, input/output contracts |
execution-metadata.json |
Trace summary and generation history |
agent-notes.md |
Prompt reasoning, rationale, known constraints |
kb-*.md (Knowledge Blocks) |
Self-contained reusable documentation blocks |
| Diagrams (converted to text) | Titles, labels, flows extracted from diagrams |
๐ง Embedding Metadata¶
Each document or fragment that is semantically indexed must include:
memoryEmbedding: true
embeddingVectorId: vector-998b21
embeddingSource: doc|diagram|kb
embeddingScope: module|feature|tenant
Studio and memory agents use this to locate and query relevant vectors for:
- Prompt composition
- Refactoring suggestions
- Planning new features
- Answering user queries
๐งฉ Embedding Granularity¶
Documents are automatically chunked into semantically meaningful blocks:
- Paragraph-level for explanations
- Section-level for specs or prompts
- Code snippet-level for examples
Chunks are individually indexed with:
{
"chunkId": "chunk-f02",
"sourceDoc": "feature-booking.md",
"section": "## Inputs and Preconditions",
"vector": [0.123, -0.228, ...]
}
๐ Memory Graph Linking¶
Embedded documents are cross-linked in the memory graph:
- By
traceId,featureId,agentId, andmoduleId - With graph edges like
inspiredBy,usedIn,derivedFrom - Used by planners and copilots for reasoning over context and history
Example:
feature-recurring-invoice.md
โช usedIn โ recurring-invoice-handler.cs
โช derivedFrom โ vision-billing-blueprint.md
๐งช Validation in CI¶
- CI checks that
memoryEmbedding: trueis respected - All required sections are semantically chunked
- Agents log
MemoryChunkStored,MemoryEmbeddingFailed, etc. - Copilot can suggest missing embeddings or stale vectors
๐ง Use in Prompt Composition¶
When an agent is composing a prompt, it queries the memory graph:
"Find all embedded chunks tagged with [billing, retry, monthly-schedule] in modules tagged InvoiceService."
Top-ranked results are injected as memory context into the planner or code generator.
โ Summary¶
Semantic embedding transforms documentation into context-aware, memory-addressable knowledge:
- Powers AI agent memory, copilots, and Studioโs reasoning layer
- Enables context-driven prompt construction and plan generation
- Forms a semantic mesh linking code, docs, and trace
โ Every doc becomes a living memory node in the AI Software Factoryโs brain.
๐ค Copilot and Plugin Support for Documentation¶
๐ฏ Objective¶
Define how documentation is exposed to and enhanced by AI copilots, IDE plugins, and studio extensions, enabling real-time suggestions, inline explanations, memory injection, and automated authoring/refactoring support.
๐งโ๐ป Copilot Use Cases¶
| Scenario | How Documentation Is Used |
|---|---|
| Writing code in VS Code | Copilot injects related README.md, spec, or diagram context |
| Reviewing a PR | Displays linked feature doc, test cases, and execution metadata |
| Writing a new feature spec | Suggests reusable knowledge blocks or past similar features |
| Editing documentation | Offers section templates, glossary terms, and formatting fixes |
| Answering questions via ChatGPT Plugin | Accesses structured documentation using traceId and docType |
๐งฉ Plugin-Accessible Documentation APIs¶
Documentation is exposed through the following plugin APIs:
| Plugin Interface | Description |
|---|---|
getDocByTrace(traceId) |
Returns the latest doc associated with a trace |
searchDocs(tags, docType) |
Finds docs with specific semantic tags |
getModuleDocs(moduleId) |
Fetches all docs (README, changelog, specs) for a module |
injectContext(docId, section) |
Inserts a markdown fragment into editor/prompt |
getGlossaryTerm(term) |
Retrieves explanation from generated glossaries |
๐ง Context Injection Logic¶
Copilots use retrieval heuristics from memory + metadata:
- Match
moduleId,featureId,traceIdbased on current file - Query vector store with current cursor context
- Rank relevant chunks from
README.md,feature.md,execution-metadata.json - Inject top-k context chunks inline or as hover tooltips
๐ ๏ธ Supported Tools and Extensions¶
| Environment | Plugin/Extension |
|---|---|
| VS Code | connectsoft-copilot-docs extension |
| Studio | Copilot sidebar + hover memory injectors |
| ChatGPT | Plugin integration with memory search API |
| GitHub | PR copilot plugin showing related docs |
| CLI | cs-docs get --trace trace-xyz |
๐ Access Control and Filtering¶
- Copilots only access
status: ApprovedorInReviewdocs Deprecatedor stale documents are excluded unless explicitly queried- Plugin context includes user role to tailor suggestions
โจ Inline Smart Features¶
Copilot plugins can:
- Auto-suggest documentation sections based on file type
- Detect and flag missing diagrams or spec links
- Recommend glossary entries when writing docs
- Offer AI-based grammar and structure corrections
"It looks like you're documenting a microservice. Do you want to insert a
## Trace Metadatablock?"
๐ง Memory Feedback Loop¶
Changes made via plugin interfaces trigger:
DocAccessedByCopilotโ updates popularity/usage signalsDocSuggestedRefactorโ logged for validation agent reviewDocUsedInPromptโ links prompt trace to documentation node
โ Summary¶
Copilot and plugin integration turns documentation into an active, intelligent, and interactive experience:
- Enhances developer productivity with just-in-time context
- Brings documentation into the code and planning flow
- Enables AI-aware tooling across the Factoryโs ecosystem
โ Every doc becomes an assistant-enabled, plugin-resolved knowledge asset.
๐ Documentation Snippets, Templates, and Auto-Expansion¶
๐ฏ Objective¶
Define how reusable documentation snippets and section templates can be auto-injected or expanded by agents, copilots, or CI โ enabling composable docs, reducing repetition, and accelerating structured authoring.
๐งฉ What Is a Documentation Snippet?¶
A snippet is a reusable, parameterized block of markdown or metadata that can be:
- Injected into documents during generation
- Suggested by copilots as structured sections
- Automatically filled with trace-linked or prompt-generated content
Each snippet includes:
snippetId: doc-snippet-0012
title: Retry Policy Section
tags: [resiliency, policy, microservice]
parameters: [maxRetries, backoffStrategy]
scope: module
## Retry Policy
This service supports a retry mechanism with the following configuration:
- Max retries: {{maxRetries}}
- Backoff strategy: {{backoffStrategy}}
Retries apply to transient failures such as timeouts or 5xx errors.
๐งฑ Snippet Libraries¶
Documentation snippets are stored in:
Snippets are indexed and tagged to support smart injection and semantic retrieval.
๐ Auto-Expansion by Agents¶
Agents may auto-expand snippet references such as:
or
Resulting in a fully expanded, formatted markdown section during generation.
๐ง Copilot-Assisted Suggestions¶
Copilots can suggest:
- Snippet templates for missing sections (e.g.,
## Inputs and Preconditions) - Parameter completion based on memory context
- Inline expansion previews for human confirmation
โWould you like to auto-fill the
## Related Artifactssection using trace links?โ
๐ ๏ธ Snippet Governance Rules¶
| Rule | Description |
|---|---|
| Traceable | Each injected snippet logs its snippetId, origin, and parameters |
| Overridable | Human edits are respected; expansion is one-time unless re-triggered |
| Diff-aware | CI and Studio track differences between template and injected content |
| Memory-linkable | Snippet chunks are eligible for memory embedding and vector search |
๐ Template Types vs. Snippets¶
| Item | Description | Use Case |
|---|---|---|
| Template | Full document scaffold (e.g., README.md) |
Initial document creation |
| Snippet | Partial reusable block (e.g., retry-policy) |
Section-level injection or reuse |
Both use shared syntax, tagging, and trace metadata.
๐ CI Integration¶
CI validates:
- Snippet expansion completeness
- Parameter correctness
- Version drift detection (e.g.,
snippet-v2used whensnippet-v3exists) - Missing required snippets (e.g.,
trace-metadatablock in all generated docs)
โ Summary¶
Documentation snippets and template expansion:
- Promote structured, high-quality, and consistent documentation
- Enable partial reuse across modules, agents, and teams
- Reduce human effort while increasing completeness and traceability
โ Documentation becomes modular, composable, and automation-friendly at every level.
๐ Documentation Quality Metrics and Observability Hooks¶
๐ฏ Objective¶
Define how the Factory evaluates documentation quality, freshness, and coverage through observability metrics and hooks โ enabling automated feedback loops, stale detection, and AI-assisted improvement.
๐ Quality Signals¶
Each documentation artifact is scored using multiple signal dimensions:
| Metric | Description |
|---|---|
structureCompleteness |
All required sections and metadata present |
traceCoverageScore |
How well it links to traceId, features, and modules |
lastModifiedAgeDays |
Days since last update (used to flag staleness) |
agentConfidenceScore |
Agent's self-assessed output confidence (e.g., via LLM scoring heuristics) |
humanReviewed |
Boolean flag for whether it was reviewed and approved |
copilotUsageFrequency |
Number of times this doc was accessed by plugins or copilots |
similarityToPeerDocs |
Embedding-based consistency score vs. similar modules |
These are visualized in Studio and available via CI annotations.
๐งช Example Quality Summary¶
{
"docId": "feature-recurring-invoice.md",
"structureCompleteness": 0.95,
"traceCoverageScore": 1.0,
"lastModifiedAgeDays": 43,
"agentConfidenceScore": 0.87,
"humanReviewed": true,
"copilotUsageFrequency": 17,
"qualityGrade": "B+"
}
๐ ๏ธ Observability Events and Hooks¶
Agents and pipelines emit:
| Event | Purpose |
|---|---|
DocGenerated |
When a new doc is created |
DocValidated |
Structural checks pass/fail |
DocFlaggedOutdated |
Detected staleness threshold breached |
DocAutoSuggestedUpdate |
AI detects terminology drift or trace delta |
DocUsedInPrompt |
Memory chunk included in prompt context |
DocUsedByCopilot |
Fetched by plugin for suggestion or context |
DocModifiedByHuman |
Changed via Studio editor or Git commit |
These are ingested into observability dashboards.
๐ Quality Risk Levels¶
| Grade | Meaning | Action Recommended |
|---|---|---|
| A / A+ | Fully aligned and up-to-date | No action |
| B / B+ | Minor issues or aging | Review or refresh if possible |
| C | Missing metadata or links | Agent or human correction needed |
| D / F | Obsolete, unlinked, or outdated | Flag for deprecation or regen |
๐ CI Checks and Thresholds¶
CI/CD pipelines enforce quality gates:
- Block promotion if
qualityGrade < B - Warn for documents older than
Xdays with no human review - Require at least
structureCompleteness > 0.8 - Annotate PRs with document quality diffs
๐ง Studio Visualizations¶
- Color-coded heatmap per module or doc
- Timeline of quality score trends
- Suggested next actions (e.g., โUpdate trace linksโ)
- Audit history of quality changes and event logs
โ Summary¶
Documentation quality signals and observability hooks:
- Turn static docs into measurable, improvable assets
- Enable proactive agent feedback and human governance
- Power dashboards, validation gates, and copilot confidence
โ Every doc is scored, tracked, and continuously improved in the software factoryโs knowledge system.
๐งพ Final Blueprint Snapshot and Trace Injection Summary¶
๐ฏ Objective¶
Conclude the documentation blueprint by summarizing:
- What artifacts were generated
- What trace metadata was injected
- Where this blueprint lives within the memory and module graph
- How it is used by agents and humans going forward
๐งฑ Blueprint Summary Structure¶
Each blueprint concludes with a structured blueprint-summary.md block or json/yaml equivalent:
blueprintId: documentation-blueprint
docType: Blueprint
version: v1.0.0
status: Approved
traceId: trace-docs-421ba3
generatedBy: documentation-writer-agent
linkedModules: [core/DocumentationWriterAgent, plugins/CopilotDocs]
createdAt: 2025-06-13T15:42:00Z
tags: [blueprint, documentation, agent-process]
embedding: true
๐ฆ Artifacts This Blueprint Covers¶
| Category | Description |
|---|---|
| ๐ Blueprint Itself | documentation-blueprint.md |
| ๐ Metadata Template | YAML frontmatter spec + example blocks |
| ๐งฑ Templates | README.md, FeatureSpec.md, execution-metadata.json, etc. |
| ๐งฉ Snippets | trace-metadata, retry-policy, inputs-outputs, etc. |
| ๐ผ๏ธ Diagram Patterns | .mmd, .plantuml templates with injection hooks |
| ๐ง Embedding Logic | Memory chunk schema, indexing policies, and trace-linked memory anchors |
| ๐ CI Hooks | DocGenerated, DocValidated, DocFlaggedOutdated, etc. |
| ๐ Observability | Quality scores, usage telemetry, plugin access frequency metrics |
๐ง Memory and Trace Injection¶
The blueprint injects itself into the platform memory graph as:
- A canonical doc type definition for agent awareness
- A schema registry entry for Studio validation
- A copilot hint layer for doc suggestion templates
Trace injection emits:
{
"traceId": "trace-docs-421ba3",
"emittedBy": "documentation-writer-agent",
"linkedDocs": ["documentation-blueprint.md", "snippet-trace-metadata.md"],
"status": "Approved",
"qualityScore": 0.98
}
This is stored in:
trace-registry.jsonmemory/chunks/blueprints/documentation-blueprint.vector.json
๐งฉ Reuse in Other Agents¶
Agents use this blueprint as input when:
| Agent | How Blueprint Is Used |
|---|---|
Documentation Writer Agent |
Core schema for generating, validating, and chunking docs |
Copilot Context Agent |
Resolves templates and snippets for inline support |
Test Generator Agent |
Parses .feature trace blocks and links to memory graphs |
Blueprint Validator Agent |
Scores structure, freshness, linkage, and snippet coverage |
๐ Version and Evolution Plan¶
v1.0.0: Initial release (25 cycles completed)- Future:
v1.1.0may include real-time collaborative editing, diagram diffing, glossary injection
Studio will detect version drifts, prompt upgrades, and render visual deltas.
โ Summary¶
The documentation-blueprint.md is now a complete, traceable, and operational blueprint that:
- Powers autonomous doc generation, validation, and memory embedding
- Links every documentation artifact to modules, agents, and features
- Drives copilot suggestions, Studio visualization, and quality metrics
โ Documentation is no longer static โ it is modular, semantic, and alive inside the software factory.