Skip to content
architectural-forensics logo

Architectural Forensics Protocol

architectural-forensics

Master protocol for deconstructing agent frameworks to inform derivative system architecture. Use when (1) analyzing an agent framework's codebase comprehensively, (2) comparing multiple frameworks to select best practices, (3) designing a new agent system based on prior art, (4) documenting arch...

SKILL.md

Full skill instructions

Architectural Forensics Protocol

Deconstruct agent frameworks to inform derivative system architecture.

Mission

Distinguish between software engineering decisions (how it runs) and cognitive architecture decisions (how it thinks) to extract reusable patterns for new systems.

Quick Start

# 1. Map the codebase (uses codebase-mapping skill's script)
python .claude/​skills/​codebase-mapping/​scripts/​map_codebase.py /​path/​to/​framework --output codebase-map.json

# 2. Run analysis via the command
/​analyze-frameworks

Protocol Phases

Phase 1: Engineering Chassis

Analyze the software substrate. See references/​phase1-engineering.md for detailed guidance.

AnalysisFocus FilesOutput
Data Substratetypes.py, schema.py, state.pyTyping strategy, mutation patterns
Execution Enginerunner.py, executor.py, agent.pyAsync model, control flow topology
Component Modelbase_*.py, interfaces.pyAbstraction depth, DI patterns
Resilienceexecutor.py, try/​except blocksError propagation, sandboxing

Phase 2: Cognitive Architecture

Extract agent "business logic". See references/​phase2-cognitive.md for detailed guidance.

AnalysisFocus FilesOutput
Control Loopagent.py, loop.pyReasoning pattern, step function
Memorymemory.py, context.pyContext assembly, eviction policies
Tool Interfacetool.py, functions.pySchema generation, error feedback
Harness-Model Protocolllm.py, adapters/, stream.pyWire format, tool call encoding, agentic primitives
Multi-Agentorchestrator.py, router.pyCoordination model, state sharing

Phase 3: Synthesis

Generate actionable outputs:

  1. Best-of-Breed Matrix → Framework comparison table
  2. Anti-Pattern Catalog → "Do Not Repeat" list
  3. Reference Architecture → New framework specification

Execution Workflow

┌─────────────────────────────────────────────────────────┐
│                    For Each Framework                    │
├─────────────────────────────────────────────────────────┤
│  1. codebase-mapping                                    │
│       ↓                                                 │
│  2. Phase 1 Analysis (parallel)                         │
│     ├── data-substrate-analysis                         │
│     ├── execution-engine-analysis                       │
│     ├── component-model-analysis                        │
│     └── resilience-analysis                             │
│       ↓                                                 │
│  3. Phase 2 Analysis (parallel)                         │
│     ├── control-loop-extraction                         │
│     ├── memory-orchestration                            │
│     ├── tool-interface-analysis                         │
│     ├── harness-model-protocol                          │
│     └── multi-agent-analysis (if applicable)            │
└─────────────────────────────────────────────────────────┘
        ↓
┌─────────────────────────────────────────────────────────┐
│                      Synthesis                           │
├─────────────────────────────────────────────────────────┤
│  4. comparative-matrix                                   │
│  5. antipattern-catalog                                  │
│  6. architecture-synthesis                               │
└─────────────────────────────────────────────────────────┘

Quick Analysis (Single Framework)

For rapid assessment, run the minimal path:

codebase-mapping → execution-engine-analysis → control-loop-extraction → tool-interface-analysis

Output Directory Structure

forensics-output/                    # Working/​intermediate files
├── .state/
│   ├── manifest.json
│   └── {framework}.state.json
└── frameworks/
    └── {framework}/
        ├── codebase-map.json
        ├── phase1/​*.md
        └── phase2/​*.md

reports/                             # Final deliverables
├── frameworks/
│   └── {framework}.md               # Framework summary
└── synthesis/
    ├── comparison-matrix.md
    ├── antipatterns.md
    ├── reference-architecture.md
    └── executive-summary.md

State Management & Resumption

The protocol is designed to be stateful and resumable.

  • Idempotency: The Orchestrator tracks progress in manifest.json and will skip frameworks marked as completed.
  • Clean Slate Resumption: If a run is interrupted, frameworks marked as in_progress are considered "stale". Use python scripts/​state_manager.py reset-running to move them back to pending and delete their partial output directories, ensuring a clean restart for those items.

Agent Orchestration

This skill uses a 4-tier hierarchy of specialized agents for context efficiency:

Orchestrator
    │
    └── Framework Agents (parallel, one per framework)
            │
            └── Skill Agents (parallel, one per skill) [COORDINATORS]
                    │
                    └── Reader Agents (parallel, one per file cluster) [EXTRACTORS]
                            │
                            └── Synthesis Agent (cross-framework synthesis)

Agent Roles

AgentContext BudgetReadsProduces
Orchestrator~10KState filesCoordination decisions
Framework Agent~50KSkill outputsFramework summary report
Skill Agent~25KCluster extractsSkill analysis report
Reader Agent~20K1-5 source filesJSON extract (~2K)
Synthesis Agent~40KAll framework reportsComparison matrix, architecture spec

Key Innovation: Cluster-Based Reading

Reader Agents read file clusters (1-5 related files) rather than individual files:

  • Clusters are grouped by relationship: hierarchy, module cohort, type+usage, interface+impl
  • Cross-file patterns (inheritance, imports, shared state) are captured in the extract
  • This enables understanding architectural patterns that span multiple files

See:

  • references/​orchestrator-agent.md — Top-level coordination
  • references/​framework-agent.md — Per-framework analysis coordination
  • references/​skill-agent.md — Skill coordination and cluster assignment
  • references/​reader-agent.md — File cluster extraction
  • references/​synthesis-agent.md — Cross-framework synthesis

Sub-Skill Reference

SkillPurposeKey Outputs
codebase-mappingRepository structureFile tree, dependencies, entry points
data-substrate-analysisType systemTyping strategy, serialization
execution-engine-analysisControl flowAsync model, event architecture
component-model-analysisExtensibilityAbstraction patterns, DI
resilience-analysisError handlingError propagation, sandboxing
control-loop-extractionReasoning loopPattern classification, step function
memory-orchestrationContext managementAssembly, eviction, tiers
tool-interface-analysisTool systemSchema gen, error feedback
harness-model-protocolLLM interface layerWire format, encoding, agentic primitives
multi-agent-analysisCoordinationHandoffs, state sharing
comparative-matrixComparisonDecision tables
antipattern-catalogTech debtDo-not-repeat list
architecture-synthesisNew designReference spec

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View