← All Patterns
Squad Layer Pattern diagram
Squad Layer Pattern — structural diagram  ·  click to enlarge

Motivation

Three-layer decoupling says each layer knows only the layer below it. The common way to break it is quiet: the orchestrator builds its squads' agents. It imports none of them; it lists their names, fills an agent registry and hands that to a squad loader. Import checks pass, yet every change to a squad's team means editing the orchestrator.

The Squad Layer pattern gives agent construction to the layer that owns the team. The entry point builds the squad loader once; orchestrators load squads by YAML file and id; the loader builds the agents each squad's YAML names. Squad-level behaviour lives in one application class, instantiated per squad.

Structure

Key Concepts

SquadLoader.from_agents load_one(config=) BaseSquad.before_step <App>Squad K9-DEC-002

Used in K9-AIF

K9-AIF 1.18.1 DAS — DasSquad (nine squads) k9aif new scaffold