Agent skill

memory-index-sync

Detect and heal index.md drift — finds memory files on disk not registered in index.md and registers them. Run when /gaai-status reports unregistered files, after batch memory operations, or as a post-delivery gate.

Stars 123
Forks 27

Install this agent skill to your Project

npx add-skill https://github.com/Fr-e-d/GAAI-framework/tree/main/.gaai/core/skills/cross/memory-index-sync

Metadata

Additional technical details for this skill

id
SKILL-MEMORY-INDEX-SYNC-001
track
cross-cutting
author
gaai-framework
status
stable
version
1.0
category
cross
updated at
1772496000

SKILL.md

Memory Index Sync

Purpose / When to Activate

Activate when:

  • /gaai-status reports files on disk not registered in index.md
  • After a batch of DEC files were created outside the decision-extraction skill
  • As a lightweight post-delivery gate to confirm index integrity
  • Before running memory-refresh or memory-compact (ensures index accuracy first)

This skill heals drift — it does NOT create new knowledge. It only registers things that already exist on disk but are missing from index.md.


Process

Step 1 — Decision Registry Sync

  1. Read index.md Decision Registry table — extract all registered DEC IDs
  2. Glob decisions/DEC-*.md — list all files on disk, extract IDs from filenames
  3. For each DEC file on disk not in the registry:
    • Read its YAML frontmatter: id, domain, level, title, status, superseded_by
    • Add one row to the Decision Registry: | DEC-{N} | {domain} | {level} | {title} |
    • If frontmatter status: superseded and superseded_by is set: append ⚠️ SUPERSEDED by DEC-{M} to the description column
  4. For each registered DEC with no file on disk: flag ⚠️ MISSING FILE in the sync report — do NOT delete registry rows (possible archive situation)

Step 2 — File Count Update

Re-count all DEC-*.md files on disk. Update the Shared Categories table file count in index.md to match.

Step 3 — Summary File Sync

  1. Read index.md Summaries section — extract registered summary filenames
  2. Glob summaries/*.summary.md — list all files on disk
  3. For each summary on disk not registered in index.md: read its frontmatter, add entry to Summaries section
  4. For each registered summary with no file on disk: flag ⚠️ MISSING FILE — update pointer or delete entry in sync report

Step 4 — Supersession Reconciliation

  1. For each DEC file on disk with status: superseded in frontmatter:
    • Check if its registry row carries the ⚠️ SUPERSEDED by DEC-{M} marker
    • If not: add the marker to the registry row
  2. Verify the Superseded/Retracted table in index.md is consistent with the Decision Registry (no contradictions)

Step 5 — Index Frontmatter Update

Update index.md frontmatter updated_at field:

  • Format: {YYYY-MM-DD} ({N} entries synced, {M} anomalies flagged) — or (no drift — confirmed clean) if nothing changed

Output: Sync Report (inline, after completion)

# Memory Index Sync — {date}

## Changes Applied
- Registered: DEC-{A}, DEC-{B}, ..., DEC-{Z} (10 entries added to registry)
- Supersession markers added: DEC-{X} (→ DEC-{Y})
- File count updated: N → M

## Anomalies Flagged (requires human review)
- ⚠️ MISSING FILE: DEC-{N} registered but no file on disk
- ⚠️ ORPHAN SUMMARY: decisions-80-89.summary.md on disk, not in index

## Result: CLEAN | DRIFT_HEALED | ANOMALIES_FOUND

Quality Checks

  • Only registers what exists on disk — never invents registry rows
  • Never deletes existing registry rows (only flags anomalies)
  • Sync report is always produced, even if no changes needed (CLEAN)
  • Idempotent — running twice produces no additional changes
  • Does not modify any file except index.md

Non-Goals

This skill must NOT:

  • Create new DEC files (use decision-extraction)
  • Ingest new knowledge (use memory-ingest)
  • Compact or archive memory (use memory-compact or memory-refresh)
  • Modify DEC file content

Memory-index-sync heals the registry. It does not create or delete knowledge.

Expand your agent's capabilities with these related and highly-rated skills.

Fr-e-d/GAAI-framework

ci-watch-and-fix

Watch 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.

123 27
Explore
Fr-e-d/GAAI-framework

qa-review

Validate that implemented code fully satisfies Story acceptance criteria, respects rules, and introduces no regressions. This is the hard quality gate — no pass means no delivery. Activate after implementation is complete.

123 27
Explore
Fr-e-d/GAAI-framework

compose-team

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.

123 27
Explore
Fr-e-d/GAAI-framework

coordinate-handoffs

Validate sub-agent handoff artefacts, sequence phase transitions, and manage retry and escalation logic. Activate after each sub-agent terminates to determine next action.

123 27
Explore
Fr-e-d/GAAI-framework

implement

Generate correct, minimal, maintainable code that satisfies a validated Story's acceptance criteria against an execution plan. Activate when a Story is validated, a plan exists, and all prerequisites are unambiguous.

123 27
Explore
Fr-e-d/GAAI-framework

delivery-high-level-plan

Transform validated Stories into a clear, minimal, governed execution plan. Used by the Planning Sub-Agent as the first planning pass before prepare-execution-plan for Tier 2/3, or as the sole planning output for simple Stories.

123 27
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results