Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

agent-chain-analyzer

БесплатноБез исполняемых скриптовНе проверен

Detects and analyzes agent chain anti-patterns where agents invoke other agents sequentially causing massive context load

diegosouzapwот diegosouzapw★ 68 звёзд на GitHub

Об этом скилле

Agent Chain Analyzer Skill

You detect and analyze the **Agent Chain anti-pattern** - one of the most severe architectural issues in pre-skills Claude Code projects.

Agent Chain Pattern: Agent1 invokes Agent2 via Task tool, which invokes Agent3, forming a sequential chain with massive context load.

Impact:

  • 180K+ tokens for 4-agent chain (4 × 45K)
  • No state persistence across chain
  • No user approval workflow
  • Fragile (single failure breaks chain)

Solution: Convert to Manager-as-Agent + Skills (53% context reduction)

You execute deterministic scripts to detect chains, map dependencies, calculate depth, and estimate context impact.

1. ALWAYS detect ALL agent chains in project (not just obvious ones) 2. ALWAYS calculate full chain depth and context impact 3. ALWAYS map complete dependency graph 4. ALWAYS return structured JSON output 5. NEVER modify project files (read-only analysis) 6. NEVER miss indirect chains (Agent1 → Agent2 → Agent3 → Agent4)

detect-agent-chains

Detect all agent chain patterns in project.

Input:

  • project_path: Path to Claude Code project root

Process:

  1. Execute: scripts/detect-agent-chains.sh "{project_path}"
  2. Parse JSON output
  3. Return chain detection results

Output:

{
  "status": "success",
  "chains_detected": true,
  "chain_count": 2,
  "chains": [
    {
      "chain_id": "catalog-process-chain",
      "entry_point": "catalog-fetcher",
      "agents": ["catalog-fetcher", "catalog-analyzer", "catalog-validator", "catalog-reporter"],
      "depth": 4,
      "locations": [
        ".claude/agents/catalog-fetcher.md",
        ".claude/agents/catalog-analyzer.md",
        ".claude/agents/catalog-validator.md",
        ".claude/agents/catalog-reporter.md"
      ],
      "invocation_pattern": "Task tool",
      "context_estimate": 180000
    }
  ],
  "total_agents_in_chains": 7,
  "max_chain_depth": 4
}

analyze-chain-depth

Analyze chain depth and complexity for each detected chain.

Input:

  • project_path: Path to Claude Code project root
  • chains: Detected chains from detect-agent-chains operation

Process:

  1. Execute: scripts/analyze-chain-depth.sh "{project_path}" "{chains_json}"
  2. Calculate depth metrics
  3. Identify complexity factors

Output:

{
  "status": "success",
  "depth_analysis": [
    {
      "chain_id": "catalog-process-chain",
      "depth": 4,
      "complexity_score": 0.85,
      "complexity_factors": [
        "Deep chain (4 agents)",
        "No error handling between agents",
        "No state persistence",
        "Sequential only (no parallelism)"
      ],
      "migration_complexity": "high",
      "estimated_refactor_days": 15
    }
  ],
  "average_depth": 3.5,
  "deepest_chain": {
    "chain_id": "catalog-process-chain",
    "depth": 4
  }
}

map-chain-dependencies

Map complete dependency graph for agent chains.

Input:

  • project_path: Path to Claude Code project root
  • chains: Detected chains from detect-agent-chains operation

Process:

  1. Execute: scripts/map-chain-dependencies.sh "{project_path}" "{chains_json}"
  2. Build dependency graph
  3. Identify data flow between agents

Output:

{
  "status": "success",
  "dependency_graph": {
    "nodes": [
      {"id": "catalog-fetcher", "type": "entry_point"},
      {"id": "catalog-analyzer", "type": "intermediate"},
      {"id": "catalog-validator", "type": "intermediate"},
      {"id": "catalog-reporter", "type": "terminal"}
    ],
    "edges": [
      {
        "from": "catalog-fetcher",
        "to": "catalog-analyzer",
        "data_passed": ["catalog_data", "metadata"],
        "invocation_method": "Task tool"
      },
      {
        "from": "catalog-analyzer",
        "to": "catalog-validator",
        "data_passed": ["analysis_results"],
        "invocation_method": "Task tool"
      },
      {
        "from": "catalog-validator",
        "to": "catalog-reporter",
        "data_passed": ["validation_results"],
        "invocation_method": "Task tool"
      }
    ]
  },
  "data_flow": [
    "catalog_data (fetcher → analyzer)",
    "analysis_results (analyzer → validator)",
    "validation_results (validator → reporter)"
  ],
  "parallelization_opportunities": [
    "analyzer and validator could run in parallel if refactored"
  ]
}

estimate-chain-context

Calculate context load impact for agent chains.

Input:

  • project_path: Path to Claude Code project root
  • chains: Detected chains from detect-agent-chains operation

Process:

  1. Execute: scripts/estimate-chain-context.sh "{project_path}" "{chains_json}"
  2. Calculate current context load
  3. Estimate post-migration load
  4. Calculate reduction percentage

Output:

{
  "status": "success",
  "context_estimates": [
    {
      "chain_id": "catalog-process-chain",
      "current_context": {
        "agents": 4,
        "tokens_
Полный SKILL.md на GitHub

Установить agent-chain-analyzer в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

metadata.json

FAQ

Что делает скилл agent-chain-analyzer?

Detects and analyzes agent chain anti-patterns where agents invoke other agents sequentially causing massive context load

Как установить скилл agent-chain-analyzer?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл agent-chain-analyzer запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить agent-chain-analyzer с