You are helping an enterprise architect design the integration architecture for a multi-agent system — defining inter-agent contracts, message protocols, shared state, and failure isolation boundaries.
User Input
$ARGUMENTS
Instructions
Note: Before generating, scan projects/ for existing project directories. For each project, list all ARC-*.md artifacts, check external/ for reference documents, and check 000-global/ for cross-project policies. If no external docs exist but they would improve output, ask the user.
Prerequisites
- AAGR (Agent Architecture Specification, mandatory — at least one agent design)
- AAGI (Agent Inventory, recommended)
- AAOV (Agent Governance Framework, recommended)
Determine integration scope:
Ask the user: "What agents or agent group should this integration architecture cover? (e.g., a specific project, a swarm, a pipeline, or cross-project integration)"
Use the user's input and $ARGUMENTS to determine scope.
Read existing artifacts from the project context:
MANDATORY (must be present to proceed):
- AAGR (Agent Architecture Specification)
- Extract: Agent definitions, capability profiles, interface requirements
RECOMMENDED (read if available, note if missing):
- AAGI (Agent Inventory)
- Extract: Agent register, capabilities, deployment status
- AAOV (Agent Governance Framework)
- Extract: oversight model, approval workflow, audit requirements, and governance constraints
OPTIONAL (read if available, skip silently if missing):
- AASE (Agent Security Architecture)
- Extract: Security controls, isolation requirements, threat models
- PRIN (Principles)
- Extract: Integration standards, interoperability requirements
- ADMP (ADM Preliminary / Architecture Vision)
- Extract: Integration architecture references, migration phases
Identify the target project:
- Use the ArcKit Project Context (above) to find the project matching the user's input (by name or number)
- If no match, create a new project:
- Use Glob to list
projects/*/ directories and find the highest NNN-* number (or start at 001 if none exist)
- Calculate the next number (zero-padded to 3 digits, e.g.,
002)
- Slugify the project name (lowercase, replace non-alphanumeric with hyphens, trim)
- Use the Write tool to create
projects/{NNN}-{slug}/README.md with the project name, ID, and date — the Write tool will create all parent directories automatically
- Also create
projects/{NNN}-{slug}/external/README.md with a note to place external reference documents here
- Set
PROJECT_ID = the 3-digit number, PROJECT_PATH = the new directory path
Read the template (with user override support):
- First, check if
.arckit/templates-custom/agent-integration-template.md exists in the project root
- If found: Read the user's customized template (user override takes precedence)
- If not found: Read
.arckit/templates/agent-integration-template.md (default)
- Then, read
.arckit/templates/_partials/RENDERING.md and resolve the template's <!-- DOC-CONTROL-HEADER --> marker to the Document Control partial it selects, applying the ${organisation_name} and ${default_classification} substitutions. Remove the marker and its comment from the output — a rendered artefact must never contain either.
Tip: Users can customize templates with $arckit-customize agent-integration
Analyze agent designs for integration points:
Read all AAGR documents to identify:
- Agent interfaces (input/output schemas, communication methods)
- Dependencies between agents
- Shared data requirements
- Orchestration needs (which agents need to coordinate)
For each agent, document:
- Integration Role: Producer, consumer, orchestrator, or broker
- Communication needs: Synchronous vs. asynchronous
- Data contracts: Input/output schemas
- SLA requirements: Latency, throughput, availability
If fewer than 3 agents are found, ask the user: "I've identified fewer than 3 agents for integration. Do you want to expand the scope, or proceed with what exists?"
Build the integration architecture:
A. Integration Architecture Overview:
- Document the overall integration pattern for the multi-agent system
- Select integration patterns based on requirements (Event-Driven, Request-Response, Message Queue, Shared State)
- Justify pattern choices with requirements traceability
B. Inter-Agent Contracts:
- Define formal contracts between agent pairs
- Document: Contract ID, source agent, target agent, interface, protocol, SLA
- Include JSON schema for each contract input/output
- Minimum: ≥3 agent contracts documented
C. Message Protocol (Mermaid sequence diagram):
- Create a sequence diagram showing agent communication flows
- Include orchestrator-worker interactions, shared state reads/writes
- Show message routing through intermediaries (queues, brokers)
- Use Mermaid
sequenceDiagram syntax
D. Shared State Design:
- Document shared state repositories and their purposes
- Specify store type, access patterns, and consistency model
- Include: Redis (session state), PostgreSQL (durable state), Qdrant (semantic search), or other stores
- Document access patterns (read/write/search) per store
E. Failure Isolation Boundaries:
- Define isolation boundaries for different failure modes
- Document: boundary type, isolation level, failure modes, recovery strategies
- Cover: agent process isolation, tool execution sandboxing, message delivery guarantees
- Include recovery strategies (restart, retry, fallback, deduplication)
F. Observability Design:
- Define metrics, alerts, and monitoring per component
- Cover: agent health, message queue status, error rates
- Include threshold values and alert conditions
Read the quality checklist:
Before writing the file, read .arckit/references/quality-checklist.md and verify all Common Checks plus the AAIN per-type checks pass. Fix any failures before proceeding.
Write the output:
- Write to
projects/{project-dir}/ARC-{PROJECT_ID}-AAIN-v1.0.md
- Use the exact template structure from
agent-integration-template.md
- Include all sections even if some areas need further refinement
- Include Mermaid sequence diagram for message protocol
- Include failure isolation boundaries table
IMPORTANT - Auto-Populate Document Information Fields:
Before completing the document, populate document information fields:
Auto-populated fields
[PROJECT_ID] → Extract from project path (e.g., "001")
[VERSION] → Start with "1.0" for new documents
[DATE] / [YYYY-MM-DD] → Current date in YYYY-MM-DD format
[DOCUMENT_TYPE_NAME] → Document purpose
ARC-[PROJECT_ID]-AAIN-v[VERSION] → Generated document ID
[STATUS] → "DRAFT" for new documents
- Classification → comes from the resolved Document Control header, not from a placeholder.
_partials/RENDERING.md fixes the ladder from the artefact's own regime; ${default_classification} applies only where that regime falls through to user config.
User-provided fields
[PROJECT_NAME] → Full project name
[OWNER_NAME_AND_ROLE] → Document owner
Revision History
| 1.0 | {DATE} | ArcKit AI | Initial creation from `$arckit-agent-integration` command |
Generation Metadata Footer
**Generated by**: ArcKit `$arckit-agent-integration` command
**Generated on**: {DATE}
**ArcKit Version**: {ARCKIT_VERSION}
**Project**: {PROJECT_NAME} (Project {PROJECT_ID})
**AI Model**: [Actual model name]
- Summarize what you created:
- Number of integration points defined
- Number of inter-agent contracts documented
- Integration patterns selected and justified
- Shared state repositories and stores
- Failure isolation boundaries defined
- Observability metrics and alerts
- Suggested next steps
Example Usage
User: $arckit-agent-integration Design integration for the research swarm in project 003
You should:
- Check prerequisites (AAGR mandatory, AAGI recommended)
- Find project directory (e.g.,
projects/003-research-swarm/)
- Read agent designs from AAGR documents to identify integration points
- Generate integration architecture:
- Integration overview with pattern selection
- Inter-agent contracts (≥3) with JSON schemas
- Message protocol (Mermaid sequence diagram)
- Shared state design (stores, access patterns)
- Failure isolation boundaries (boundaries, recovery)
- Observability design (metrics, alerts)
- CRITICAL - Token Efficiency: Use the Write tool to create
projects/003-research-swarm/ARC-003-AAIN-v1.0.md
- DO NOT output the full document in your response (this exceeds 32K token limit!)
- Show summary only (see Output Instructions below)
Important Notes
AAGR is mandatory — you need at least one agent design to define integration contracts
Contracts define behavior: Each contract must specify input/output schemas, protocol, and SLA
≥3 agent contracts required — fewer than 3 contracts indicates incomplete integration coverage
Sequence diagram is mandatory — shows message routing and agent interactions
Failure isolation boundaries must cover agent processes, tool executions, and message delivery
Observability must include alerts with specific threshold values
Cross-reference AAGR, AAGI, AAOV to ensure consistency with existing agent definitions
Traceability: All integration decisions must link back to AAGR agent designs
Reference agent architecture reference from .arckit/references/agent-architecture-reference.md for integration patterns and communication models
Markdown escaping: When writing less-than or greater-than comparisons, always include a space after < or > (e.g., < 3 seconds, > 99.9% uptime) to prevent markdown renderers from interpreting them as HTML tags or emoji
Integration with Other Commands
- Input: Uses AAGR (agent designs) and AAGI (agent inventory) to identify integration points
- Output: Feeds into
$arckit-agent-governance (governance for multi-agent orchestration)
- Output: Feeds into
$arckit-agent-security (securing inter-agent communication)
- Output: Feeds into
$arckit-agent-maturity (maturity assessment of integration capabilities)
Quality Checks
Before writing the output file, verify:
- Inter-Agent Contracts: ≥3 contracts with ID, source, target, interface, protocol, SLA
- Contract Specification: JSON schema for each contract with input/output types
- Sequence Diagram: Mermaid sequence diagram present showing message protocol
- Shared State Design: Stores documented with type, purpose, and access pattern
- Failure Isolation Boundaries: Boundaries defined with isolation level, failure mode, and recovery
- Observability Metrics: Metrics defined with specific alerts and thresholds
Output Instructions
CRITICAL - Token Efficiency:
1. Generate Integration Architecture
Create the comprehensive integration architecture following the template structure with all sections.
2. Write Directly to File
Use the Write tool to create projects/{project-dir}/ARC-{PROJECT_ID}-AAIN-v1.0.md with the complete integration architecture.
DO NOT output the full document in your response. This would exceed token limits.
3. Show Summary Only
After writing the file, show ONLY a concise summary:
## Agent Integration Architecture Complete ✅
**Project**: [Project Name]
**File Created**: `projects/[PROJECT]/ARC-{PROJECT_ID}-AAIN-v1.0.md`
### Integration Summary
**Agents**: [Number] agents integrated
**Contracts**: [Number] inter-agent contracts defined
**Patterns**: [Pattern 1, Pattern 2]
**Shared State Stores**: [Number] stores configured
- [Store 1]: [Type/Purpose]
- [Store 2]: [Type/Purpose]
**Failure Isolation**: [Number] boundaries defined
**Observability**: [Number] metrics with [Number] alert thresholds
### What's in the Document
- Integration Architecture Overview (pattern selection and justification)
- Inter-Agent Contracts (≥3 contracts with JSON schemas)
- Message Protocol (Mermaid sequence diagram)
- Shared State Design (stores, access patterns)
- Failure Isolation Boundaries (boundaries, recovery strategies)
- Observability Design (metrics, alerts, thresholds)
- Traceability (AAGR → AAIN links)
### Next Steps
- Run `$arckit-agent-governance` to apply governance to multi-agent orchestration
- Run `$arckit-agent-security` to secure inter-agent communication
Statistics to Include:
- Total agents integrated
- Number of inter-agent contracts
- Integration patterns selected
- Shared state stores
- Failure isolation boundaries
- Observability metrics and alerts
Generate the agent integration architecture now, write to file using Write tool, and show only the summary above.
Suggested Next Steps
After completing this command, consider running:
$arckit-agent-governance -- Apply governance to multi-agent orchestration
$arckit-agent-security -- Secure inter-agent communication
1---2name: arckit-agent-integration3description: Design multi-agent integration — inter-agent contracts, message protocols, shared state, failure isolation4---56You are helping an enterprise architect design the integration architecture for a multi-agent system — defining inter-agent contracts, message protocols, shared state, and failure isolation boundaries.78## User Input910```text11$ARGUMENTS12```1314## Instructions1516> **Note**: Before generating, scan `projects/` for existing project directories. For each project, list all `ARC-*.md` artifacts, check `external/` for reference documents, and check `000-global/` for cross-project policies. If no external docs exist but they would improve output, ask the user.1718### Prerequisites1920- **AAGR** (Agent Architecture Specification, mandatory — at least one agent design)21- **AAGI** (Agent Inventory, recommended)22- **AAOV** (Agent Governance Framework, recommended)23241. **Determine integration scope**:2526 Ask the user: *"What agents or agent group should this integration architecture cover? (e.g., a specific project, a swarm, a pipeline, or cross-project integration)"*2728 Use the user's input and `$ARGUMENTS` to determine scope.29302. **Read existing artifacts from the project context:**3132 **MANDATORY** (must be present to proceed):33 - **AAGR** (Agent Architecture Specification)34 - Extract: Agent definitions, capability profiles, interface requirements3536 **RECOMMENDED** (read if available, note if missing):37 - **AAGI** (Agent Inventory)38 - Extract: Agent register, capabilities, deployment status39 - **AAOV** (Agent Governance Framework)40 - Extract: oversight model, approval workflow, audit requirements, and governance constraints4142 **OPTIONAL** (read if available, skip silently if missing):43 - **AASE** (Agent Security Architecture)44 - Extract: Security controls, isolation requirements, threat models45 - **PRIN** (Principles)46 - Extract: Integration standards, interoperability requirements47 - **ADMP** (ADM Preliminary / Architecture Vision)48 - Extract: Integration architecture references, migration phases49503. **Identify the target project**:5152 - Use the **ArcKit Project Context** (above) to find the project matching the user's input (by name or number)53 - If no match, create a new project:54 1. Use Glob to list `projects/*/` directories and find the highest `NNN-*` number (or start at `001` if none exist)55 2. Calculate the next number (zero-padded to 3 digits, e.g., `002`)56 3. Slugify the project name (lowercase, replace non-alphanumeric with hyphens, trim)57 4. Use the Write tool to create `projects/{NNN}-{slug}/README.md` with the project name, ID, and date — the Write tool will create all parent directories automatically58 5. Also create `projects/{NNN}-{slug}/external/README.md` with a note to place external reference documents here59 6. Set `PROJECT_ID` = the 3-digit number, `PROJECT_PATH` = the new directory path60614. **Read the template** (with user override support):6263 - **First**, check if `.arckit/templates-custom/agent-integration-template.md` exists in the project root64 - **If found**: Read the user's customized template (user override takes precedence)65 - **If not found**: Read `.arckit/templates/agent-integration-template.md` (default)66 - **Then**, read `.arckit/templates/_partials/RENDERING.md` and resolve the template's `<!-- DOC-CONTROL-HEADER -->` marker to the Document Control partial it selects, applying the `${organisation_name}` and `${default_classification}` substitutions. Remove the marker and its comment from the output — a rendered artefact must never contain either.6768 > **Tip**: Users can customize templates with `$arckit-customize agent-integration`69705. **Analyze agent designs for integration points**:7172 Read all AAGR documents to identify:73 - Agent interfaces (input/output schemas, communication methods)74 - Dependencies between agents75 - Shared data requirements76 - Orchestration needs (which agents need to coordinate)7778 For each agent, document:79 - **Integration Role**: Producer, consumer, orchestrator, or broker80 - **Communication needs**: Synchronous vs. asynchronous81 - **Data contracts**: Input/output schemas82 - **SLA requirements**: Latency, throughput, availability8384 > **If fewer than 3 agents are found**, ask the user: *"I've identified fewer than 3 agents for integration. Do you want to expand the scope, or proceed with what exists?"*85866. **Build the integration architecture**:8788 **A. Integration Architecture Overview**:89 - Document the overall integration pattern for the multi-agent system90 - Select integration patterns based on requirements (Event-Driven, Request-Response, Message Queue, Shared State)91 - Justify pattern choices with requirements traceability9293 **B. Inter-Agent Contracts**:94 - Define formal contracts between agent pairs95 - Document: Contract ID, source agent, target agent, interface, protocol, SLA96 - Include JSON schema for each contract input/output97 - Minimum: ≥3 agent contracts documented9899 **C. Message Protocol** (Mermaid sequence diagram):100 - Create a sequence diagram showing agent communication flows101 - Include orchestrator-worker interactions, shared state reads/writes102 - Show message routing through intermediaries (queues, brokers)103 - Use Mermaid `sequenceDiagram` syntax104105 **D. Shared State Design**:106 - Document shared state repositories and their purposes107 - Specify store type, access patterns, and consistency model108 - Include: Redis (session state), PostgreSQL (durable state), Qdrant (semantic search), or other stores109 - Document access patterns (read/write/search) per store110111 **E. Failure Isolation Boundaries**:112 - Define isolation boundaries for different failure modes113 - Document: boundary type, isolation level, failure modes, recovery strategies114 - Cover: agent process isolation, tool execution sandboxing, message delivery guarantees115 - Include recovery strategies (restart, retry, fallback, deduplication)116117 **F. Observability Design**:118 - Define metrics, alerts, and monitoring per component119 - Cover: agent health, message queue status, error rates120 - Include threshold values and alert conditions1211227. **Read the quality checklist**:123124 Before writing the file, read `.arckit/references/quality-checklist.md` and verify all **Common Checks** plus the **AAIN** per-type checks pass. Fix any failures before proceeding.1251268. **Write the output**:127 - Write to `projects/{project-dir}/ARC-{PROJECT_ID}-AAIN-v1.0.md`128 - Use the exact template structure from `agent-integration-template.md`129 - Include all sections even if some areas need further refinement130 - Include Mermaid sequence diagram for message protocol131 - Include failure isolation boundaries table132133**IMPORTANT - Auto-Populate Document Information Fields:**134135Before completing the document, populate document information fields:136137### Auto-populated fields138139- `[PROJECT_ID]` → Extract from project path (e.g., "001")140- `[VERSION]` → Start with "1.0" for new documents141- `[DATE]` / `[YYYY-MM-DD]` → Current date in YYYY-MM-DD format142- `[DOCUMENT_TYPE_NAME]` → Document purpose143- `ARC-[PROJECT_ID]-AAIN-v[VERSION]` → Generated document ID144- `[STATUS]` → "DRAFT" for new documents145- **Classification** → comes from the resolved Document Control header, not from a placeholder. `_partials/RENDERING.md` fixes the ladder from the artefact's own regime; `${default_classification}` applies only where that regime falls through to user config.146147### User-provided fields148149- `[PROJECT_NAME]` → Full project name150- `[OWNER_NAME_AND_ROLE]` → Document owner151152### Revision History153154```markdown155| 1.0 | {DATE} | ArcKit AI | Initial creation from `$arckit-agent-integration` command |156```157158### Generation Metadata Footer159160```markdown161**Generated by**: ArcKit `$arckit-agent-integration` command162**Generated on**: {DATE}163**ArcKit Version**: {ARCKIT_VERSION}164**Project**: {PROJECT_NAME} (Project {PROJECT_ID})165**AI Model**: [Actual model name]166```1671689. **Summarize what you created**:169170- Number of integration points defined171- Number of inter-agent contracts documented172- Integration patterns selected and justified173- Shared state repositories and stores174- Failure isolation boundaries defined175- Observability metrics and alerts176- Suggested next steps177178## Example Usage179180User: `$arckit-agent-integration Design integration for the research swarm in project 003`181182You should:183184- Check prerequisites (AAGR mandatory, AAGI recommended)185- Find project directory (e.g., `projects/003-research-swarm/`)186- Read agent designs from AAGR documents to identify integration points187- Generate integration architecture:188 - Integration overview with pattern selection189 - Inter-agent contracts (≥3) with JSON schemas190 - Message protocol (Mermaid sequence diagram)191 - Shared state design (stores, access patterns)192 - Failure isolation boundaries (boundaries, recovery)193 - Observability design (metrics, alerts)194- **CRITICAL - Token Efficiency**: Use the **Write tool** to create `projects/003-research-swarm/ARC-003-AAIN-v1.0.md`195 - **DO NOT** output the full document in your response (this exceeds 32K token limit!)196- Show summary only (see Output Instructions below)197198## Important Notes199200- **AAGR is mandatory** — you need at least one agent design to define integration contracts201- **Contracts define behavior**: Each contract must specify input/output schemas, protocol, and SLA202- **≥3 agent contracts required** — fewer than 3 contracts indicates incomplete integration coverage203- **Sequence diagram is mandatory** — shows message routing and agent interactions204- **Failure isolation boundaries** must cover agent processes, tool executions, and message delivery205- **Observability must include alerts** with specific threshold values206- **Cross-reference AAGR, AAGI, AAOV** to ensure consistency with existing agent definitions207- **Traceability**: All integration decisions must link back to AAGR agent designs208- **Reference agent architecture reference** from `.arckit/references/agent-architecture-reference.md` for integration patterns and communication models209210- **Markdown escaping**: When writing less-than or greater-than comparisons, always include a space after `<` or `>` (e.g., `< 3 seconds`, `> 99.9% uptime`) to prevent markdown renderers from interpreting them as HTML tags or emoji211212## Integration with Other Commands213214- **Input**: Uses AAGR (agent designs) and AAGI (agent inventory) to identify integration points215- **Output**: Feeds into `$arckit-agent-governance` (governance for multi-agent orchestration)216- **Output**: Feeds into `$arckit-agent-security` (securing inter-agent communication)217- **Output**: Feeds into `$arckit-agent-maturity` (maturity assessment of integration capabilities)218219## Quality Checks220221Before writing the output file, verify:222223- **Inter-Agent Contracts**: ≥3 contracts with ID, source, target, interface, protocol, SLA224- **Contract Specification**: JSON schema for each contract with input/output types225- **Sequence Diagram**: Mermaid sequence diagram present showing message protocol226- **Shared State Design**: Stores documented with type, purpose, and access pattern227- **Failure Isolation Boundaries**: Boundaries defined with isolation level, failure mode, and recovery228- **Observability Metrics**: Metrics defined with specific alerts and thresholds229230## Output Instructions231232**CRITICAL - Token Efficiency:**233234### 1. Generate Integration Architecture235236Create the comprehensive integration architecture following the template structure with all sections.237238### 2. Write Directly to File239240**Use the Write tool** to create `projects/{project-dir}/ARC-{PROJECT_ID}-AAIN-v1.0.md` with the complete integration architecture.241242**DO NOT** output the full document in your response. This would exceed token limits.243244### 3. Show Summary Only245246After writing the file, show ONLY a concise summary:247248```markdown249## Agent Integration Architecture Complete ✅250251**Project**: [Project Name]252**File Created**: `projects/[PROJECT]/ARC-{PROJECT_ID}-AAIN-v1.0.md`253254### Integration Summary255256**Agents**: [Number] agents integrated257**Contracts**: [Number] inter-agent contracts defined258**Patterns**: [Pattern 1, Pattern 2]259260**Shared State Stores**: [Number] stores configured261- [Store 1]: [Type/Purpose]262- [Store 2]: [Type/Purpose]263264**Failure Isolation**: [Number] boundaries defined265**Observability**: [Number] metrics with [Number] alert thresholds266267### What's in the Document268269- Integration Architecture Overview (pattern selection and justification)270- Inter-Agent Contracts (≥3 contracts with JSON schemas)271- Message Protocol (Mermaid sequence diagram)272- Shared State Design (stores, access patterns)273- Failure Isolation Boundaries (boundaries, recovery strategies)274- Observability Design (metrics, alerts, thresholds)275- Traceability (AAGR → AAIN links)276277### Next Steps278279- Run `$arckit-agent-governance` to apply governance to multi-agent orchestration280- Run `$arckit-agent-security` to secure inter-agent communication281```282283**Statistics to Include**:284285- Total agents integrated286- Number of inter-agent contracts287- Integration patterns selected288- Shared state stores289- Failure isolation boundaries290- Observability metrics and alerts291292Generate the agent integration architecture now, write to file using Write tool, and show only the summary above.293294## Suggested Next Steps295296After completing this command, consider running:297298- `$arckit-agent-governance` -- Apply governance to multi-agent orchestration299- `$arckit-agent-security` -- Secure inter-agent communication