Spectral topology preflight

From Tibsfox/gsd-skill-creator · View interactive version

Spectral topology preflight is an AI agent skill from the GitHub repository Tibsfox/gsd-skill-creator. Before dispatching a multi-agent team, run a spectral diagnostic on the proposed communication graph and emit a (ρ, Δ, κ) coordination signature plus a pass/fail verdict against per-task-class thresholds. Builds the row-stochastic operator P from the team graph, computes the successor representation

How to use this skill

Skill file

Spectral Topology Pre-flight

Why

Production multi-agent LLM systems fail at 41-87% rates from coordination defects, not from capability (Nechepurenko & Shuvalov, arxiv 2605.03310). Parks & Alharthi (arxiv 2605.11453) provide the first pre-inference diagnostic: spectral analysis of the team's communication operator predicts robustness (perfect rank correlation r_s = 1.0), consensus (r_s = 0.5), and drift (r_s = −1.0, inverted) before any agent runs. Cheap to compute, large effect on dispatch quality.

How

Given a proposed team graph (agents = nodes, communication paths = edges):

  1. Get the signature from the tested implementation — do NOT hand-compute it. The linear algebra (build the row-stochastic operator P, form the successor representation M = (I − γP)⁻¹, and take its eigenvalues / condition number / spectral gap) is already implemented and unit-tested. Call the exported topologySignature(topology, n, gamma) in src/learn/generators/team-generator.ts — pass the topology archetype ('pipeline' | 'leader-worker' | 'mesh' | 'ring' | 'tree' | 'bipartite' | 'critique-route'), the agent count n, and optionally gamma (defaults to 0.9). It returns { rho, delta, kappa, gamma } computed from the closed-form spectra in Parks & Alharthi Appendix A. When you are generating the whole team, generateTeam(...) in the same module produces the signature for you as part of its result. Never estimate or fabricate ρ, Δ, or κ by hand — LLMs cannot reliably invert matrices or compute eigenvalues; always source the numbers from the function.
  2. Interpret the three diagnostics returned in the signature:
  1. Compare against per-task-class thresholds:
  1. Emit the signature — coordination_signature: { rho, delta, kappa, verdict, recommendation? }. Verdict is pass / warn / fail. On fail, recommendation suggests a topology edit (drop/add edge, switch chain↔star↔mesh).

Platform-constraint check (added v1.0.1)

Before recommending a topology change, verify the runtime can actually instantiate it. Spawn-only runtimes (Claude Code subagents, some serverless dispatch pools) cannot implement ring, mesh, or critique-route between workers — those runtimes only support star (one parent dispatches to N children; children return-result without inter-peer messaging). In a spawn-only runtime, the spectral menu collapses: ring/mesh/critique-route can only be simulated by the parent brokering messages between rounds, not wired directly between workers.

If the dispatcher is spawn-only, the skill's recommendation must describe what the parent brokers between rounds, not what edges to wire between workers. Concretely, when recommending against a star topology in a spawn-only runtime:

When the runtime supports inter-agent messaging (MCP servers with peer routing, custom orchestration), the spectral recommendations apply directly. Always check the runtime before recommending.

Output schema

{
  "topology": "chain|star|mesh|fully-connected|pipeline|leader-worker|hierarchical-fast-slow",
  "agent_count": 4,
  "coordination_signature": {
    "rho": 0.87,
    "delta": 0.42,
    "kappa": 12.3
  },
  "task_class": "deep-reason",
  "verdict": "warn",
  "recommendation": "drop the leader-to-worker-4 edge; the redundancy is uncalled-for and inflates κ"
}

When to skip

Integration

Cross-references

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.