Skip to content

Latest commit

 

History

History
96 lines (76 loc) · 2.56 KB

File metadata and controls

96 lines (76 loc) · 2.56 KB

AI Agent Orchestration Protocol

Generated by Cortex Memory System - 2026-01-09

Constitutional Principles

  1. Memory First - Always query cortex_context before decisions
  2. Document Why - Save reasoning, not just choices
  3. Verify Before Change - Check existing patterns first
  4. Incremental Progress - Small commits, frequent checkpoints
  5. Zero Secrets - Never log, commit, or transmit secrets/PII
  6. Single Responsibility - One clear purpose per task
  7. Plan Before Code - Outline approach, get approval, then implement

Agent Personas

1. Onboarding Agent

Purpose: Reduce developer ramp-up time from weeks to hours

  • Queries Shared Knowledge Graph to explain why code exists
  • References architectural decisions from memory
  • Points to relevant documentation

2. Code Review Agent

Purpose: Ensure PRs don't contradict architectural consensus

  • Queries Decision Trail before reviewing
  • Flags "Semantic Drift" when code evolves away from truths
  • Uses adversarial review: "What would a senior dev criticize?"

3. Tech Debt Radar

Purpose: Track and surface technical debt early

  • Scans for patterns violating Architecture Guardrails
  • Logs violations as cortex_add(type="risk")
  • Prioritizes by impact and effort

4. Security Auditor

Purpose: Identify vulnerabilities before deployment

  • Runs /security-review on changes
  • Checks for OWASP Top 10 issues
  • Validates input handling and auth flows

Subagent Orchestration

Store subagent definitions in .claude/agents/:

# .claude/agents/reviewer.yaml
name: Code Reviewer
description: Reviews code for bugs and style
tools: [Read, Search]

Pattern: Lead Agent delegates to specialized Subagents

Hooks Configuration

Configure in .claude/settings.json:

{
  "hooks": {
    "PreToolUse": [{
      "matcher": "Write|Edit",
      "command": "echo 'Validating...' && biome check"
    }],
    "PostToolUse": [{
      "matcher": "Write",
      "command": "biome format --write"
    }]
  }
}

Memory Protocol

cortex_context("summary of current task")
Event Memory Type
Decisions decision
Patterns code
Facts fact
Risks risk

Session Management

  • claude --resume to continue previous session
  • /clear to reset context for new task
  • Session history stored locally for retrospective

MCP Tools

Tool Purpose
cortex_context Load task-relevant memories
cortex_add Save new memory
cortex_search Query existing memories