compose-team

$npx mdskill add Fr-e-d/GAAI-framework/compose-team

Assembles context bundles for each sub-agent based on evaluate-story output.

  • Solves context pollution and starvation when spawning sub-agents.
  • Depends on story files, rules, memory index, and specialist registry.
  • Uses evaluate-story tier and triggered specialists to determine bundle contents.
  • Outputs inline file lists passed to each sub-agent at spawn.

SKILL.md

.github/skills/compose-teamView on GitHub ↗
---
name: compose-team
description: Assemble the context bundles for each sub-agent based on evaluate-story output. Produces spawn-ready packages for Planning, Implementation, QA, or MicroDelivery sub-agents. Activate after evaluate-story, before spawning any sub-agent.
license: ELv2
compatibility: Works with any filesystem-based AI coding agent
metadata:
  author: gaai-framework
  version: "1.0"
  category: delivery
  track: delivery
  id: SKILL-DEL-008
  updated_at: 2026-02-18
  status: stable
inputs:
  - contexts/artefacts/stories/**         (the Story)
  - contexts/rules/**                     (applicable rules)
  - contexts/memory/index.md              (registry — resolve memory file paths before composing bundles)
  - contexts/memory/**                    (categories resolved from index.md at runtime)
  - agents/specialists.registry.yaml      (for Tier 3)
  - evaluate-story output                 (inline — tier + specialists_triggered)
outputs:
  - context bundles (inline — file lists passed to each sub-agent at spawn)
---

# Compose Team

## Purpose / When to Activate

Activate after `evaluate-story` returns the tier, before the first sub-agent is spawned.

The Orchestrator must give each sub-agent **exactly the context it needs — no more, no less**. Context pollution wastes tokens and introduces drift. Context starvation causes failures.

This skill determines what goes into each sub-agent's context bundle.

---

## Process

### Step 0 — Resolve memory file paths (always first)

Read `contexts/memory/index.md`. For each bundle below that references a memory category, resolve the actual file path from the index before including it. Never hardcode memory file paths — the index is the source of truth.

Key categories to resolve:
- `project` category → project context file (stack, architecture, constraints)
- `decisions` category → decisions log
- `patterns` category → conventions and code patterns

If a category is absent from the index, omit it from the bundle silently — do not fail.

---

### For Tier 1 (MicroDelivery)

MicroDelivery bundle (minimal):
```
- Story artefact
- patterns category file (resolved from index.md)
- Directly affected file(s) — identified from acceptance criteria
- orchestration.rules.md (relevant sections only)
```

### For Tier 2 / Tier 3 (Core Team)

**Planning Sub-Agent bundle:**
```
- Story artefact
- orchestration.rules.md + artefacts.rules.md
- project category file (resolved from index.md)
- decisions category file (filtered: relevant decisions only — resolved from index.md)
- patterns category file (resolved from index.md)
- codebase-scan artefact (if exists)
```

If `risk_analysis_required: true` from evaluate-story, unconditionally include the decisions category from memory in the Planning Sub-Agent bundle, regardless of other relevance filtering.

**Implementation Sub-Agent bundle:**
```
- Story artefact
- {id}.execution-plan.md (from Planning Sub-Agent)
- patterns category file (resolved from index.md)
- project category file (resolved from index.md)
- Codebase files identified in execution plan (file list, not full content)
```

**QA Sub-Agent bundle:**
```
- Story artefact (acceptance criteria is the test spec)
- {id}.execution-plan.md (test checkpoints)
- {id}.impl-report.md (from Implementation Sub-Agent)
- orchestration.rules.md + artefacts.rules.md
```

**On remediation pass (QA re-spawn):**
```
QA bundle + {id}.qa-report.md (prior failure record)
Implementation bundle + {id}.qa-report.md (failure diagnosis)
```

### For Tier 3 Specialists

For each specialist in `specialists_triggered`:
- Read specialist entry from `agents/specialists.registry.yaml`
- Add `context_bundle` files from registry entry to Implementation Sub-Agent bundle
- Record which specialists are activated (for impl-report)

---

## Output

Returns (inline, to the Orchestrator) the file list for each sub-agent's context bundle. The Orchestrator uses this list when spawning each sub-agent.

Not written to file — this is the Orchestrator's coordination state, not a durable artefact.

---

## Non-Goals

This skill must NOT:
- Enrich bundles beyond what is listed for each tier — more context is not better context
- Load full memory archives into any bundle
- Make strategic decisions about which specialists to include (the Orchestrator decides based on evaluate-story output)
- Invoke any other skill (only agents orchestrate)

---

## Quality Checks

- Every sub-agent receives its required inputs (Story, rules, relevant memory)
- No sub-agent receives another sub-agent's full context (isolation is structural)
- Specialist bundles include only the registry-defined files, not the full memory set
- Remediation passes receive the prior failure artefact — no exceptions

More from Fr-e-d/GAAI-framework

SkillDescription
abort-safe-handlerOrchestrator-level Stage 4 entry gate for /gaai:bootstrap. Presents a pre-loop "Skip Q&A entirely" option, delegates to qa-loop-ui when the user proceeds, and returns a unified abort_safe_result with telemetry on every path. Guarantees no partial state on skip or abort.
ambiguity-detectorTakes surface scan results, optional LLM synthesis open-question entries, and optional tree-sitter AST signals to score project ambiguities (1-10). Outputs structured ambiguity_feed for smart-question-generator. Pure heuristic — no LLM calls. Designed for Stage 3.5 of the /gaai:bootstrap pipeline (between LLM synthesis and Q&A).
approach-evaluationResearch industry standards and best practices, identify viable approaches for a given technical or architectural problem, and produce a structured factual comparison against project-specific constraints. Reports options — does not decide.
architecture-extractConvert raw project structure into clear architectural understanding — module boundaries, data flows, service relationships, and architectural patterns. Activate after codebase-scan during Bootstrap.
bootstrap-llm-synthesisConstruct the LLM synthesis prompt from project surface scan + optional tree-sitter context + optional Q&A answers. Call the LLM. Parse and validate the response into 6-8 structured memory entries with clarity tags and source traceability. Used as Stage 3 of the /gaai:bootstrap pipeline.
bootstrap-memory-ingest-cloudWrite structured memory entries to the Cloud workspace via gaai_memory.store MCP tool with source='bootstrap'. Loops over entries from bootstrap-llm-synthesis, calls the tool per entry, collects success/fail counts. Used as Stage 5 of the /gaai:bootstrap pipeline (Cloud path only).
browser-journey-testValidate user stories by simulating real user journeys in a live browser against deployed application. Activate after implementation to verify actual user experience against acceptance criteria, not just code logic.
build-agents-indexScan all agent and sub-agent definition files in .gaai/core/agents/, extract YAML frontmatter, merge with specialists.registry.yaml, and generate a derived agents-index.yaml at .gaai/core/agents/agents-index.yaml. Activate after adding, modifying, or removing any agent, sub-agent, or specialist entry.
build-skills-indexScan SKILL.md files in .gaai/core/skills/ and .gaai/project/skills/, extract YAML frontmatter, and regenerate separate skills indices for each layer. Core index ships with the OSS framework; project index is project-specific.
ci-watch-and-fixWatch GitHub Actions CI after PR creation, detect failures, extract logs, apply minimal fixes, and re-push — keeping the delivery session alive until CI resolves or escalating after 3 cycles. Activate immediately after gh pr create and before marking the story done.