context-building

$npx mdskill add Fr-e-d/GAAI-framework/context-building

Assemble a minimal execution context bundle from retrieved memory and artefacts.

  • Merges fragmented memory and artefacts before complex tasks.
  • Depends on retrieved memory bundle and artefacts/rules directories.
  • Validates, deduplicates, and prioritizes inputs by relevance.
  • Outputs a structured execution context bundle in canonical order.

SKILL.md

.github/skills/context-buildingView on GitHub ↗
---
name: context-building
description: Assemble a minimal, high-signal execution context bundle from already-retrieved memory, governed artefacts, and applicable rules. Activate after memory-retrieve and before any reasoning or execution skill.
license: ELv2
compatibility: Works with any filesystem-based AI coding agent
metadata:
  author: gaai-framework
  version: "1.0"
  category: cross
  track: cross-cutting
  id: SKILL-CONTEXT-BUILDING-001
  updated_at: 2026-02-26
  status: stable
inputs:
  - retrieved_memory_bundle
  - contexts/artefacts/**  (relevant only)
  - contexts/rules/**  (applicable only)
outputs:
  - execution_context_bundle
---

# Context Building

## Purpose / When to Activate

Activate when context is fragmented or multiple memory sources need to be merged before a complex task:
- After `memory-retrieve` when inputs come from multiple memory files
- Before planning or implementation skills on complex, multi-artefact Stories
- When previous context bundles are stale or need restructuring

For simple, single-artefact tasks, an agent may reason directly without this skill. This skill does not retrieve knowledge — it **structures and composes** already-selected inputs into a focused bundle.

---

## Process

1. Validate inputs are scoped and minimal
2. Remove duplicated or overlapping information
3. Prioritize: acceptance criteria, constraints, decisions, current artefacts
4. Structure the bundle in canonical order:
   - Current Objective
   - Governed Artefacts (Epics / Stories / Plans)
   - Acceptance Criteria & Constraints
   - Applicable Rules
   - Relevant Memory

5. Enforce minimal token footprint

---

## Outputs

```
=== EXECUTION CONTEXT ===

OBJECTIVE:
...

ARTEFACTS:
...

ACCEPTANCE & CONSTRAINTS:
...

RULES:
...

RELEVANT MEMORY:
...

=========================
```

No prose. No fluff. No hidden reasoning.

---

## Quality Checks

- Context is focused and task-specific
- No irrelevant memory included
- No artefacts outside scope
- Token usage minimized
- All constraints explicit

---

## Non-Goals

This skill must NOT:
- Retrieve memory (use `memory-retrieve` first)
- Infer missing artefacts
- Add assumptions or expand scope
- Inject creative interpretation

**Retrieval decides what is relevant. Context building decides how it is fed to reasoning.**

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.