Routing architect worker

From oimiragieo/agent-studio · View interactive version

Routing architect worker is an AI agent skill from the GitHub repository oimiragieo/agent-studio. Implements hierarchical routing architecture (sub-routers, routing tables, hook updates)

How to use this skill

Skill file

Routing Architect Worker

NOTE: Startup and cleanup are handled by worker-base. This skill defines the WORK PROCEDURE.

When to Use This Skill

Use for features that build the hierarchical routing architecture: creating sub-router agent definitions, building the hierarchical routing table, updating hooks to support domain-based dispatch, and ensuring backward compatibility. Reference the design doc at .claude/designs/hierarchical-routing-architecture.md.

Work Procedure

  1. Read the feature description — it specifies which part of the hierarchy to build.
  1. Read the design document — .claude/designs/hierarchical-routing-architecture.md is the authoritative design. Follow it exactly for domain groupings, agent assignments, and architecture.
  1. Read existing patterns — Before creating new files or modifying existing ones:
  1. Write tests FIRST (red) — For each component:
  1. Implement (green) — Build the component following the design doc:
  1. CRITICAL: Preserve all existing agents — Do NOT modify any file in .claude/agents/. Sub-routers are NEW files alongside existing orchestrator agents.
  1. CRITICAL: Feature flag everything — All new code paths must be gated behind HIERARCHICAL_ROUTING=on. When off, behavior must be identical to pre-change.
  1. Run tests — node --test tests/lib/routing/ and pnpm validate:routing.
  1. Run backward compatibility check — With HIERARCHICAL_ROUTING=off, run pnpm test:framework to confirm no regressions.

Example Handoff

{
  "salientSummary": "Created 9 domain sub-router agent definitions in .claude/agents/orchestrators/. Each includes YAML frontmatter with Task tool, complete agent roster per design doc, default gateway agent, and disambiguation rules for overlapping specializations. Added 15 unit tests covering frontmatter validation, roster completeness, and disambiguation logic.",
  "whatWasImplemented": "9 domain sub-router agent files: domain-router-web-frontend.md (5 agents), domain-router-backend.md (14 agents), domain-router-mobile.md (5 agents), domain-router-ai-ml.md (11 agents), domain-router-infra.md (10 agents), domain-router-security.md (8 agents), domain-router-arch-data.md (11 agents), domain-router-product.md (15 agents), domain-router-niche.md (7 agents). Total 86 domain agents assigned, all 109 agents reachable.",
  "whatWasLeftUndone": "",
  "verification": {
    "commandsRun": [
      {
        "command": "node --test tests/lib/routing/sub-router-agents.test.cjs",
        "exitCode": 0,
        "observation": "15 tests passing: 9 frontmatter checks, 9 roster completeness checks, 5 disambiguation checks"
      },
      {
        "command": "pnpm validate:routing",
        "exitCode": 0,
        "observation": "Routing consistency validated with sub-routers included"
      },
      {
        "command": "HIERARCHICAL_ROUTING=off pnpm test:framework",
        "exitCode": 0,
        "observation": "All framework tests pass with flag off, no regressions"
      }
    ],
    "interactiveChecks": [
      {
        "action": "Verified all 109 agents reachable: union of direct routes + meta-orchestration + sub-router rosters",
        "observed": "109/109 agents covered. No orphaned agents."
      },
      {
        "action": "Verified no agent in multiple sub-routers",
        "observed": "All pairwise intersections empty."
      }
    ]
  },
  "tests": {
    "added": [
      {
        "file": "tests/lib/routing/sub-router-agents.test.cjs",
        "cases": [
          {
            "name": "all 9 sub-router files exist with valid frontmatter",
            "verifies": "VAL-HIER-001, VAL-HIER-002"
          },
          { "name": "each sub-router has complete agent roster", "verifies": "VAL-HIER-003" },
          { "name": "each sub-router declares default gateway", "verifies": "VAL-HIER-004" }
        ]
      }
    ]
  },
  "discoveredIssues": []
}

When to Return to Orchestrator

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.