Documentation Index
Fetch the complete documentation index at: https://www.aidonow.com/llms.txt
Use this file to discover all available pages before exploring further.
Executive Summary
As AI-assisted development organizations scale, the skill files that govern agent behavior tend toward monolithic accumulation: each new stack, workflow, or domain constraint is appended to a single growing document. This accumulation introduces two structural failure modes — context bloat, where token limits and retrieval degradation reduce effective rule compliance; and rule contradiction, where domain-specific guidance from one stack silently conflicts with guidance from another. The federated skill orchestration pattern addresses both failure modes through a modular composition model analogous to how engineering organizations structure themselves: a universal control-plane standard applies to all agents, while domain-specific modules are loaded selectively based on the task at hand. A deterministic composition matrix — mapping task shapes to required module combinations — replaces ad hoc skill loading and makes orchestration behavior auditable and reproducible. Organizations operating more than two active stacks with distinct domain conventions should treat this pattern as a prerequisite for reliable autonomous agent execution.Key Findings
- Monolithic skill files accumulate contradictory rules as organizations scale, producing agent behavior that varies unpredictably based on which section of the skill file the model weighted most heavily during generation.
- Context bloat is a compounding failure mode, not a linear one. As skill files grow, the effective recall of specific rules degrades non-linearly — rules buried deep in a long document are systematically under-weighted relative to rules near the prompt boundary.
- The composition matrix is the highest-leverage artifact in federated skill orchestration. A deterministic mapping from task shape to required modules eliminates the judgment call at dispatch time and makes module loading auditable.
- Core standards must win unconditionally in conflict resolution, with overrides permitted only through a formal Architecture Decision Record. Any weaker policy allows domain modules to silently erode organization-wide standards.
- Repository topology is a reliable, low-latency signal for automatic module injection. The target repository’s stack identity — determinable from crate manifests, package configs, or directory structure — provides sufficient information to select the correct module combination without agent-level inference.
- The review gate must run as a post-composition step, not a per-module step, to catch conflicts that arise from module interaction rather than individual module violations.
1. The Monolithic Skill Problem: Context Bloat and Rule Contradictions at Scale
A single skill file is the correct starting point for an AI agent system. Early in an organization’s lifecycle, the surface area of agent behavior is small enough that one document can govern it coherently. The file describes the task lifecycle, coding standards, review requirements, and domain conventions without internal conflict. The failure mode emerges gradually. A second stack is added — a Rust backend alongside a TypeScript frontend. The skill file grows. Domain conventions that apply exclusively to one stack are placed adjacently to conventions that apply to the other. A Rust-specific DDD layering rule now shares document space with TypeScript component architecture guidance. Neither rule set is wrong. Their proximity is the problem. As the skill file continues to grow — CMS rendering patterns, multi-tenant authorization concerns, CI governance requirements — three distinct failure modes emerge. Context bloat: Large language models do not process all positions in a context window with equal weight. Rules stated early in a prompt exert stronger influence than rules stated late. In a monolithic skill file, the ordering of sections becomes a hidden priority system — one that was never designed as such and that changes each time the file is edited. A rule that was near the top when the file was small may find itself buried after several months of appends. Rule contradiction: Domain-specific guidance from different stacks regularly conflicts at the boundary. A Rust module’s error handling conventions may specify explicit propagation patterns; the TypeScript module’s conventions may specify different exception handling idioms. Both are correct within their domain. In a monolithic file, the model must resolve this conflict implicitly, producing behavior that varies by generation. Rule dilution: Even absent explicit contradiction, a skill file covering five domains produces agents that are less precisely calibrated to any one domain. The agent is attempting to apply Rust DDD conventions, TypeScript product patterns, CMS rendering rules, multi-tenant governance, and CI standards simultaneously — regardless of whether the task requires all of them.2. Architecture: Control-Plane Core Plus Selective Domain Modules
The federated skill orchestration pattern replaces the monolithic skill file with a layered module system. Every agent session loads exactly two categories of modules: the control-plane core, which is always present, and a selected set of domain modules, which are loaded based on the task shape.2.1 The Control-Plane Core Module
The core module contains the rules that apply universally — across all stacks, all workstations, and all task types. Its scope is deliberately narrow: it does not describe how to write Rust code or how to structure a TypeScript component. It describes how work is done, not what work produces. The core module governs:- Domain-Driven Design layer boundaries. The separation between application, domain, and infrastructure layers is a universal constraint. No domain module may contradict it.
- Task lifecycle management. How tasks are created, transitioned, and closed follows a single protocol regardless of which workstation is executing the work.
- State machine conventions. Permitted transitions, gate conditions, and terminal states are defined once and referenced everywhere.
- Governance gates. The conditions under which work requires escalation, human review, or Architecture Decision Record approval are universal by definition.
2.2 Domain Modules
Domain modules contain the stack-specific, context-specific, or workflow-specific rules that would otherwise bloat the core. Each module is coherent within its scope and makes no claims outside it. The standard module set in a multi-stack autonomous development organization includes:- Rust/DDD backend module: Rust-specific DDD patterns, entity and aggregate modeling conventions, repository trait design, error propagation standards, and crate boundary rules. This module is loaded exclusively for tasks targeting Rust crates.
- TypeScript product module: Frontend component architecture, state management conventions, API client patterns, and type-safety standards. This module is loaded for tasks targeting TypeScript repositories.
- CMS and shell rendering module: Content rendering pipeline patterns, shell composition conventions, headless CMS integration standards, and layout system rules. This module is loaded for tasks involving content presentation layers.
- Review gate module: The quality enforcement rules that apply after all other modules have been composed. This module is always loaded last and always present — it functions as a post-composition quality gate.
2.3 Module Boundaries
The boundary between core and domain module is the most important design decision in the federated system. The rule is straightforward: if a convention must hold true regardless of which stack the task targets, it belongs in the core. If a convention is meaningful only within one stack’s context, it belongs in that stack’s module.Module boundaries will require refinement after initial deployment. The first version of a domain module will inevitably contain rules that should have been in the core, and vice versa. Treat the initial module partitioning as a first approximation. The composition matrix (Section 3) will surface misalignments when modules that should always co-occur are consistently loaded together for all task shapes.
3. The Composition Matrix: Deterministic Module Selection From Task Shape
The composition matrix is a declarative mapping that answers a single question: given this task shape, which modules are required? It is the operational heart of the federated system — the artifact that makes module loading deterministic rather than judgment-dependent. The following matrix defines the standard composition for a multi-stack development organization:| Task Shape | Required Modules |
|---|---|
| Rust-only backend | core + rust + review-gate |
| TypeScript-only frontend | core + typescript + review-gate |
| CMS backend API with shell rendering | core + rust + ux-cms + review-gate |
| CMS with authentication and tenancy integration | core + rust + typescript + ux-cms + review-gate |
| Full-stack product feature | core + rust + typescript + review-gate (add ux-cms if content or layout is involved) |
| Cross-repository migration | core + all relevant stack modules + review-gate |
4. Conflict Resolution: Core Standards Win Unless an ADR Overrides
Module composition introduces the possibility of rule conflict. A domain module may specify a convention that, when combined with core standards, produces ambiguous or contradictory guidance. The conflict resolution policy must be unambiguous. The rule is: core standards win unconditionally. When a domain module’s guidance conflicts with the core module’s guidance, the core module’s guidance takes precedence. The domain module does not negotiate; it does not have equal standing; it does not provide context that reinterprets the core. The only exception is a formal Architecture Decision Record that explicitly states an override. An ADR override must:- Name the specific core rule being overridden
- Name the domain module and the specific rule that overrides it
- State the rationale for the override
- Be approved by the organizational governance function before the override takes effect
5. Pipeline Auto-Injection: Repository Topology as the Selection Signal
Manual module selection at task dispatch time introduces two failure modes: human error (the wrong modules are selected) and inconsistency (different dispatchers apply the matrix differently). Both are eliminated by automating module selection based on a signal that is already present in the execution environment: the target repository’s topology. The task executor pipeline determines module composition automatically using the following mapping:| Target Repository Topology | Auto-Injected Modules |
|---|---|
| Rust crates (platform services, foundation, CRM layer) | core + rust + review-gate |
| TypeScript frontend repositories | core + typescript + review-gate |
| CMS repository | core + rust + ux-cms + review-gate |
| Management and operations repository | core + review-gate (no stack module) |
Cargo.toml at the repository root identifies a Rust crate. A package.json with React or TypeScript dependencies identifies a frontend repository. A CMS repository is identifiable by its directory structure and content management configuration.
The pipeline injection step executes before the agent session begins. By the time the agent receives its first prompt, the correct module set is already loaded. The agent does not decide which rules apply — the pipeline has already made that determination.
6. The Review Gate: Quality Enforcement Across All Module Combinations
The review gate module occupies a unique position in the federated architecture. It is not a domain module — it does not describe how to write code for a specific stack. It is not part of the core — its rules are quality-assurance concerns, not governance concerns. It is a post-composition enforcement layer that runs after all domain modules have been loaded. The review gate’s scope includes:- Cross-module consistency. Does the implementation produced under the rust module’s conventions produce artifacts that satisfy the ux-cms module’s integration requirements? This question cannot be answered by either module independently — it requires both modules to be present.
- Core standard adherence. Has the implementation respected the DDD layer boundaries defined in the core module? Have the governance gates been correctly applied?
- Task lifecycle closure. Has the task been transitioned to the correct terminal state? Have all required artifacts been produced?
7. Workstation Alignment and Module Ownership
The composition matrix maps task shapes to modules. The workstation alignment model maps organizational roles to their primary modules. These two mappings work together: the workstation alignment clarifies who owns and maintains each module; the composition matrix governs which modules are active at execution time.| Workstation | Primary Module Ownership |
|---|---|
| Governance / CTO | Core standards module |
| Systems engineering workstation | Rust/DDD module |
| Product and delivery workstation | TypeScript product module |
| Shell and UX workstation | UX/CMS module plus TypeScript |
| Orchestration / Chief of Staff | Orchestration logic, task lifecycle, module composition rules |
8. Implementation Constraints
Module versioning is non-trivial. In a federated system, module updates can change agent behavior for all task shapes that include that module. A change to the Rust/DDD module affects not only Rust-only tasks but also full-stack tasks that load the Rust module as part of a larger composition. Module changes should be versioned and tested against the full composition matrix before deployment. The composition matrix must be treated as a live artifact. As the organization’s stack evolves, new task shapes will emerge. A new integration layer between two existing stacks, for example, may require a composition that the initial matrix does not define. The matrix must be updated when new task shapes are identified — and the update must go through the same governance process as module changes. Module loading latency affects agent session startup time. In environments where agent sessions are initialized frequently, the overhead of loading multiple modules at startup becomes measurable. The practical mitigation is caching: modules that have not changed should be served from cache rather than reloaded from source on each session initialization. Not all agents operate on the same module version simultaneously during transitions. When a module is updated and the change is rolled out progressively across agent sessions, there will be a window during which different agents are operating under different module versions. This is not a theoretical concern — it produces observable inconsistency in parallel task execution. Rolling updates to modules should be applied to all active agent sessions within a single deployment window, not gradually over time.9. Recommendations
- Define your composition matrix before deploying any modules. The matrix is not an output of module design — it is an input. Identify the task shapes your organization actually executes, map them to the module combinations they require, and treat the matrix as the authoritative specification that module boundaries must satisfy.
- Start with the core module alone. Do not attempt to deploy the full federated architecture in a single step. Begin by extracting your universal standards into a core module and running all agents against it. Only after the core module is stable should domain modules be introduced one at a time.
- Enforce the ADR override requirement technically, not just procedurally. Build a validation step into your module composition pipeline that detects when a domain module rule would override a core rule without a corresponding ADR reference. Policy-only enforcement degrades over time; automated detection does not.
- Automate module injection from repository topology. Manual module selection at dispatch time is an error-prone process that will produce inconsistency at scale. The repository topology signal is available, reliable, and requires no inference. Use it.
- Treat the review gate as a merge blocker, not a reviewer. The review gate is a hard gate, not a soft recommendation. Configure your pipeline to prevent merges for tasks that have not passed the review gate. The credibility of the quality system depends on this enforcement being unconditional.
- Assign explicit ownership to each module and require ownership approval for changes. A module without an owner will drift. An owner who does not review changes will produce a module that accumulates inconsistencies. Ownership is not nominal — it means the owning workstation reviews every proposed change before it is merged.
- Version your modules and test changes against the full composition matrix. A module change that passes in isolation may fail when composed with other modules that load alongside it. The composition matrix provides the test surface — run your module change through every composition in the matrix before deployment.
Conclusion and Forward Outlook
The federated skill orchestration pattern resolves the scaling failure mode of monolithic skill files by applying a design principle already validated in human engineering organizations: universal standards are maintained centrally, domain expertise is applied selectively, and the mapping between work types and applicable standards is explicit and governed. The composition matrix is the artifact that makes this principle operational — it transforms module selection from a judgment call into a deterministic lookup. As autonomous development organizations grow in both stack diversity and agent parallelism, the pressure on skill orchestration systems will intensify. More stacks mean more domain modules; more parallel agents mean more simultaneous compositions; more task types mean a richer composition matrix. Organizations that establish the federated architecture early — before the monolithic skill file has grown large enough to produce visible quality degradation — will absorb this growth without structural disruption. Organizations that defer the transition will face a more complex migration: decomposing a monolith of interdependent rules into coherent modules is substantially harder than building modular from the start. The pattern documented here represents current practice. As multi-agent AI development matures, tooling support for module composition, conflict detection, and matrix validation will become commoditized. The organizations best positioned to leverage those tools will be the ones that have already adopted the compositional model — and built the governance discipline around module ownership, ADR-gated overrides, and matrix-driven dispatch that makes the tooling meaningful.All content represents personal learning from personal projects. Code examples are sanitized and generalized. No proprietary information is shared. Opinions are my own and do not reflect my employer’s views.