# Agentic Infrastructure
> [!NOTE]
> **Enterprise-Grade AI Agent Support System**
This document describes the comprehensive agentic infrastructure that powers the AI Coding Tools platform. Beyond the core Orchestrator and Agentic Team engines, we provide a complete ecosystem of specialized agents, skills, MCP tools, and a graph-based context system that enables AI agents to learn and improve over time.
---
## Table of Contents
- [Overview](#overview)
- [Architecture](#architecture)
- [Specialized Agents](#specialized-agents)
- [Skills Library](#skills-library)
- [MCP Tools](#mcp-tools)
- [Graph Context System](#graph-context-system)
- [Project-Scoped Context](#project-scoped-context)
- [Portability and Multi-Project Support](#portability-and-multi-project-support)
- [Domain Rules](#domain-rules)
- [Integration](#integration)
- [Best Practices](#best-practices)
- [Production Readiness](#production-readiness)
---
## Overview
The AI Coding Tools platform provides not just orchestration capabilities, but a complete **agentic infrastructure** that empowers AI agents to accomplish any development task effectively. This infrastructure includes:
```mermaid
graph TB
subgraph "🧠Agentic Infrastructure"
direction TB
subgraph "Specialized Agents"
WEB[Web Frontend]
API[Backend API]
SEC[Security]
DEVOPS[DevOps]
AIML[AI/ML]
DB[Database]
MOBILE[Mobile]
PERF[Performance]
DOCS[Documentation]
end
subgraph "Skills Library"
DEV_SKILLS[Development Skills]
TEST_SKILLS[Testing Skills]
SEC_SKILLS[Security Skills]
OPS_SKILLS[DevOps Skills]
ML_SKILLS[AI/ML Skills]
DOC_SKILLS[Documentation Skills]
end
subgraph "MCP Tools"
CODE_TOOLS[Code Analysis]
SEC_TOOLS[Security Scanning]
TEST_TOOLS[Testing Utils]
OPS_TOOLS[DevOps Tools]
CTX_TOOLS[Context Memory]
end
subgraph "Graph Context System"
GRAPH[(Graph Store)]
EMBED[Embeddings]
BM25[BM25 Index]
HYBRID[Hybrid Search]
end
end
subgraph "🤖 AI Agents"
CLAUDE[Claude]
CODEX[Codex]
GEMINI[Gemini]
COPILOT[Copilot]
OLLAMA[Ollama]
LLAMA[llama.cpp]
end
WEB & API & SEC --> CLAUDE & CODEX
DEV_SKILLS & TEST_SKILLS --> GEMINI & COPILOT
CODE_TOOLS & SEC_TOOLS --> OLLAMA & LLAMA
GRAPH --> HYBRID
HYBRID --> CTX_TOOLS
```
### Key Capabilities
| Capability | Description | Components |
|------------|-------------|------------|
| **Domain Expertise** | 9 specialized agents covering all development domains | `.claude/agents/`, `.codex/agents/` |
| **Reusable Skills** | 22 skills across 6 categories for common tasks | `.claude/skills/` |
| **MCP Integration** | 34+ tools for code analysis, security, testing, DevOps | `mcp_server/tools/` |
| **Persistent Memory** | Graph-based context with hybrid search | `orchestrator/context/` |
| **Domain Rules** | Best practices and coding standards | `.claude/rules/`, `.codex/rules/` |
---
## Architecture
### Component Overview
```mermaid
flowchart TD
subgraph "User Request"
USER[👤 Developer]
end
subgraph "Entry Points"
CLI[CLI Shell]
WEB[Web UI]
MCP[MCP Server]
end
subgraph "Orchestration Layer"
ORCH[Orchestrator Engine]
TEAM[Agentic Team Engine]
end
subgraph "Agentic Infrastructure"
direction TB
subgraph "Agent Selection"
AGENTS[Specialized Agents]
RULES[Domain Rules]
end
subgraph "Skill Resolution"
SKILLS[Skills Library]
end
subgraph "Tool Execution"
TOOLS[MCP Tools]
end
subgraph "Context & Memory"
CONTEXT[Graph Context]
SEARCH[Hybrid Search]
end
end
subgraph "AI Backends"
CLOUD[Cloud AI
Claude, Codex, Gemini, Copilot]
LOCAL[Local AI
Ollama, llama.cpp]
end
USER --> CLI & WEB & MCP
CLI & WEB --> ORCH & TEAM
MCP --> TOOLS
ORCH & TEAM --> AGENTS
AGENTS --> RULES
AGENTS --> SKILLS
AGENTS --> TOOLS
TOOLS --> CONTEXT
CONTEXT --> SEARCH
AGENTS --> CLOUD & LOCAL
```
### Directory Structure
```
AI-Coding-Tools-Collaborative/
├── .claude/
│ ├── agents/ # 9 specialized Claude agents
│ │ ├── web-frontend.md
│ │ ├── backend-api.md
│ │ ├── security-specialist.md
│ │ ├── devops-infrastructure.md
│ │ ├── ai-ml-engineer.md
│ │ ├── database-architect.md
│ │ ├── mobile-developer.md
│ │ ├── performance-engineer.md
│ │ └── documentation-writer.md
│ ├── skills/ # 22 reusable skills
│ │ ├── development/ # 6 development skills
│ │ ├── testing/ # 4 testing skills
│ │ ├── security/ # 4 security skills
│ │ ├── devops/ # 3 DevOps skills
│ │ ├── ai-ml/ # 3 AI/ML skills
│ │ └── documentation/ # 3 documentation skills
│ └── rules/ # Domain-specific rules
│ ├── security.md
│ ├── database.md
│ ├── api-design.md
│ ├── performance.md
│ └── ai-ml.md
├── .codex/
│ ├── agents/ # 9 specialized Codex agents (TOML)
│ └── rules/ # Codex domain rules
├── orchestrator/
│ └── context/ # Graph context system
│ ├── schemas.py # Node & edge types
│ ├── graph_store.py # SQLite + FTS5
│ ├── embeddings.py # Sentence transformers
│ ├── bm25_index.py # BM25 keyword search
│ ├── hybrid_search.py # RRF fusion search
│ └── memory_manager.py# High-level API
└── mcp_server/
└── tools/ # 5 MCP tool modules
├── code_analysis.py # 4 code analysis tools
├── security_tools.py# 4 security tools
├── testing_tools.py # 4 testing tools
├── devops_tools.py # 5 DevOps tools
└── context_tools.py # 7 context memory tools
```
---
## Specialized Agents
The platform provides 9 specialized agents, each with deep domain expertise:
```mermaid
mindmap
root((Specialized
Agents))
Web Development
web-frontend
React/Vue/Angular
CSS/Tailwind
Accessibility
Backend
backend-api
REST/GraphQL
Microservices
Authentication
database-architect
Schema Design
Query Optimization
Migrations
Security
security-specialist
OWASP Top 10
Vulnerability Scanning
Secure Coding
Infrastructure
devops-infrastructure
Docker/K8s
CI/CD
Cloud Platforms
performance-engineer
Profiling
Optimization
Load Testing
AI/ML
ai-ml-engineer
ML Pipelines
LLM Integration
RAG Systems
Mobile
mobile-developer
React Native
Flutter
Native iOS/Android
Documentation
documentation-writer
API Docs
Architecture
README
```
### Agent Capabilities Matrix
| Agent | Languages | Frameworks | Specializations |
|-------|-----------|------------|-----------------|
| **web-frontend** | JS/TS, CSS | React, Vue, Angular, Svelte | Components, State, A11y |
| **backend-api** | Python, Go, Node | FastAPI, Express, Django | REST, GraphQL, gRPC |
| **security-specialist** | All | All | OWASP, Pen Testing, Audits |
| **devops-infrastructure** | YAML, HCL | Docker, K8s, Terraform | CI/CD, Cloud, IaC |
| **ai-ml-engineer** | Python | PyTorch, LangChain, FAISS | ML Ops, RAG, Embeddings |
| **database-architect** | SQL | PostgreSQL, MySQL, MongoDB | Schema, Indexing, Scaling |
| **mobile-developer** | Dart, JS, Swift | Flutter, RN, SwiftUI | Cross-platform, Native |
| **performance-engineer** | All | k6, Locust, cProfile | Profiling, Caching, CDN |
| **documentation-writer** | Markdown | OpenAPI, Mermaid | API Docs, Diagrams |
### Usage Examples
```bash
# Claude with specialized agent
claude -a security-specialist "Review this authentication code"
claude -a backend-api "Design a REST API for user management"
claude -a ai-ml-engineer "Build a RAG pipeline with vector search"
# Codex with specialized agent
codex --agent devops-infrastructure "Create Kubernetes deployment"
codex --agent database-architect "Optimize this slow query"
```
---
## Skills Library
Skills are reusable templates that guide AI agents through specific tasks:
```mermaid
graph LR
subgraph "📚 Skills Library"
subgraph "Development"
RC[react-components]
RA[rest-api-design]
PA[python-async]
DQ[database-queries]
GD[graphql-development]
EH[error-handling]
end
subgraph "Testing"
UT[unit-testing]
IT[integration-testing]
TD[test-driven-development]
PT[performance-testing]
end
subgraph "Security"
IV[input-validation]
AU[authentication]
SC[secure-coding]
VA[vulnerability-assessment]
end
subgraph "DevOps"
DC[docker-containerization]
CI[ci-cd-pipelines]
KD[kubernetes-deployment]
end
subgraph "AI/ML"
ER[embeddings-retrieval]
LI[llm-integration]
RP[rag-pipeline]
end
subgraph "Documentation"
AD[api-documentation]
AR[architecture-docs]
CD[code-documentation]
end
end
```
### Skill Structure
Each skill follows a consistent structure:
```markdown
# Skill Name
## Purpose
What this skill accomplishes.
## Triggers
Keywords that activate this skill.
## Steps
1. Step-by-step instructions
2. With concrete guidance
3. And verification steps
## Examples
Code examples and patterns.
## Best Practices
Guidelines for effective use.
## Related Skills
Links to complementary skills.
```
### Skills by Category
#### Development Skills (6)
| Skill | Description |
|-------|-------------|
| `react-components` | Build React components with hooks and best practices |
| `rest-api-design` | Design RESTful APIs following conventions |
| `python-async` | Write async Python code properly |
| `database-queries` | Write optimized SQL queries |
| `graphql-development` | Build GraphQL schemas and resolvers |
| `error-handling` | Implement proper error handling |
#### Testing Skills (4)
| Skill | Description |
|-------|-------------|
| `unit-testing` | Write comprehensive unit tests |
| `integration-testing` | Create integration tests for APIs |
| `test-driven-development` | Follow TDD methodology |
| `performance-testing` | Write load and performance tests |
#### Security Skills (4)
| Skill | Description |
|-------|-------------|
| `input-validation` | Validate and sanitize user inputs |
| `authentication` | Implement secure auth patterns |
| `secure-coding` | Follow secure coding practices |
| `vulnerability-assessment` | Assess and fix vulnerabilities |
#### DevOps Skills (3)
| Skill | Description |
|-------|-------------|
| `docker-containerization` | Create optimized Docker images |
| `ci-cd-pipelines` | Build CI/CD workflows |
| `kubernetes-deployment` | Deploy to Kubernetes clusters |
#### AI/ML Skills (3)
| Skill | Description |
|-------|-------------|
| `embeddings-retrieval` | Work with embeddings and vectors |
| `llm-integration` | Integrate LLMs into applications |
| `rag-pipeline` | Build RAG pipelines |
#### Documentation Skills (3)
| Skill | Description |
|-------|-------------|
| `api-documentation` | Generate OpenAPI/Swagger docs |
| `architecture-docs` | Create architecture documentation |
| `code-documentation` | Write code comments and docstrings |
---
## MCP Tools
The Model Context Protocol (MCP) server provides 34+ tools across 5 categories:
```mermaid
graph TB
subgraph "🔧 MCP Tools (34+)"
subgraph "Code Analysis"
CA1[analyze_python_complexity]
CA2[find_code_patterns]
CA3[analyze_dependencies]
CA4[generate_code_summary]
end
subgraph "Security Scanning"
SS1[scan_secrets]
SS2[scan_injection_risks]
SS3[check_security_headers]
SS4[audit_dependencies_security]
end
subgraph "Testing Utilities"
TU1[generate_test_cases]
TU2[generate_test_stub]
TU3[analyze_test_coverage]
TU4[parse_test_results]
end
subgraph "DevOps Tools"
DO1[analyze_dockerfile]
DO2[analyze_compose_file]
DO3[check_ci_config]
DO4[generate_deploy_checklist]
DO5[analyze_env_config]
end
subgraph "Context Memory"
CM1[store_conversation]
CM2[store_task_result]
CM3[search_context]
CM4[get_relevant_context]
CM5[log_mistake]
CM6[store_pattern]
CM7[get_context_stats]
end
end
```
### Tool Categories
#### Code Analysis Tools
```yaml
analyze_python_complexity:
description: "Analyze cyclomatic complexity and code metrics"
inputs: [file_path]
outputs: [complexity_score, functions, classes, metrics]
find_code_patterns:
description: "Detect design patterns and anti-patterns"
inputs: [directory, patterns_to_find]
outputs: [patterns_found, locations, suggestions]
analyze_dependencies:
description: "Analyze project dependencies and relationships"
inputs: [project_path]
outputs: [dependencies, versions, conflicts, updates]
generate_code_summary:
description: "Generate natural language summary of code"
inputs: [file_path]
outputs: [summary, key_functions, dependencies]
```
#### Security Tools
```yaml
scan_secrets:
description: "Scan code for hardcoded secrets and credentials"
inputs: [directory, patterns]
outputs: [secrets_found, severity, locations]
scan_injection_risks:
description: "Detect SQL injection and XSS vulnerabilities"
inputs: [file_path, language]
outputs: [vulnerabilities, severity, remediation]
check_security_headers:
description: "Verify HTTP security headers configuration"
inputs: [url_or_config]
outputs: [headers_present, headers_missing, recommendations]
audit_dependencies_security:
description: "Audit dependencies for known vulnerabilities"
inputs: [requirements_file]
outputs: [vulnerabilities, severity, updates_available]
```
#### Testing Tools
```yaml
generate_test_cases:
description: "Generate test cases for functions/classes"
inputs: [code, framework]
outputs: [test_cases, edge_cases, mocks]
generate_test_stub:
description: "Generate test file skeleton"
inputs: [source_file, test_framework]
outputs: [test_file_content]
analyze_test_coverage:
description: "Analyze and report test coverage"
inputs: [coverage_file]
outputs: [coverage_percent, uncovered_lines, recommendations]
```
#### DevOps Tools
```yaml
analyze_dockerfile:
description: "Analyze Dockerfile for best practices"
inputs: [dockerfile_path]
outputs: [issues, optimizations, security_concerns]
check_ci_config:
description: "Validate CI/CD configuration"
inputs: [config_file, platform]
outputs: [valid, errors, suggestions]
generate_deploy_checklist:
description: "Generate deployment checklist"
inputs: [environment, deployment_type]
outputs: [checklist_items, pre_deploy, post_deploy]
```
#### Context Memory Tools
```yaml
store_conversation:
description: "Store conversation in context memory"
inputs: [content, metadata]
outputs: [conversation_id]
search_context:
description: "Search context using hybrid search"
inputs: [query, limit]
outputs: [results, scores]
log_mistake:
description: "Log mistake for future learning"
inputs: [error_description, context, correction]
outputs: [mistake_id]
```
---
## Graph Context System
The Graph Context System provides persistent memory with intelligent retrieval:
```mermaid
graph TB
subgraph "📊 Graph Context System"
subgraph "Storage Layer"
SQLITE[(SQLite DB)]
FTS5[FTS5 Index]
VECTORS[(Vector Store)]
end
subgraph "Node Types"
CONV[ConversationNode]
TASK[TaskNode]
MISTAKE[MistakeNode]
PATTERN[PatternNode]
DECISION[DecisionNode]
CODE[CodeSnippetNode]
PREF[PreferenceNode]
end
subgraph "Edge Types"
RT[RELATED_TO]
CB[CAUSED_BY]
FB[FIXED_BY]
ST[SIMILAR_TO]
DO[DEPENDS_ON]
LF[LEARNED_FROM]
end
subgraph "Search Engine"
BM25[BM25 Index]
EMBED[Embeddings
all-MiniLM-L6-v2]
RRF[RRF Fusion]
end
subgraph "API"
MM[MemoryManager]
end
end
CONV & TASK & MISTAKE --> SQLITE
SQLITE --> FTS5
EMBED --> VECTORS
BM25 --> RRF
EMBED --> RRF
RRF --> MM
MM --> CONV & TASK & MISTAKE
```