summarization

$npx mdskill add Fr-e-d/GAAI-framework/summarization

Transforms fragmented session memory into concise summaries

  • Identifies and categorizes large or noisy categories in memory.
  • Deploys summarization when token usage exceeds a threshold or retrieval returns too many results.
  • Decides to summarize based on category size, estimated token count, and retrieval success rate.
  • Delivers summaries directly to the user for quick reference and decision-making.

SKILL.md

.github/skills/summarizationView on GitHub ↗
---
name: summarization
description: Transform large, noisy, or short-term memory into compact, durable, high-signal summaries. Activate when session memory grows large, decisions accumulate, or memory retrieval starts returning too many files.
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-SUMMARIZATION-001
  updated_at: 2026-01-30
  status: stable
inputs:
  - contexts/memory/index.md        (registry — read first to discover all active categories)
  - contexts/memory/**              (any category registered in index.md — resolved at runtime)
outputs:
  - contexts/memory/summaries/*.summary.md
  - contexts/memory/archive/**
  - contexts/memory/index.md  (updated)
---

# Summarization

## Purpose / When to Activate

Activate when:
- Session memory grows large
- Decisions accumulate across sessions
- Project context becomes fragmented
- Memory retrieval returns too many files
- Token usage increases noticeably

This skill is both preventive and corrective.

---

## Process

**Step 0: Enumerate categories.** Read `contexts/memory/index.md`. List all registered categories. For each category, assess whether summarization is warranted: trigger if >5 files in the category OR estimated token count >5000 tokens OR memory-retrieve is returning too many results for this category. Skip categories that do not meet any threshold.

For each category that meets the threshold:

1. **Identify durable information** — extract confirmed decisions, stable constraints, validated assumptions, current priorities, key outcomes, known risks. Ignore brainstorming noise, intermediate reasoning, abandoned ideas.

2. **Compress into structured summary** — use the template below. Prefer bullets over prose.

3. **Archive raw memory** — move original files to `contexts/memory/archive/{category}-{YYYY-MM-DD}.archive.md`. Concatenate multiple files from the same category into a single archive file. Only summaries remain active.

4. **Update memory index** — record new summary files, archived sources, affected categories.

---

## Summary File Template

```markdown
# {Category} — Summary
> Summarized from {N} files on {YYYY-MM-DD}
> Compression: ~{original_tokens} → ~{summary_tokens} ({percentage}%)

## Decisions
- {bullet per confirmed decision}

## Constraints
- {bullet per active constraint}

## Priorities
- {bullet per current priority}

## Open Questions
- {bullet per unresolved question, if still relevant}
```

---

## Outputs

- `contexts/memory/summaries/{category}.summary.md` — compressed, structured summary for each processed category
- `contexts/memory/archive/{category}-{YYYY-MM-DD}.archive.md` — concatenated originals, retained for audit
- `contexts/memory/index.md` — updated to reflect new summaries and archived sources

---

## Quality Checks

A good summary:
- Summary token count is ≤20% of original — verify before replacing active memory
- Every summarized category has its archive file created before the summary replaces it
- Preserves all actionable knowledge
- Removes all conversational fluff
- Supports future decisions without rereading history

---

## Non-Goals

This skill must NOT:
- Invent new knowledge
- Reinterpret decisions
- Remove active constraints
- Keep long narrative text

**Distill knowledge. Delete noise. Small, sharp context always beats full history.**

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.