AgentSkillsCN

Firestore Index Sync

检测并修复文档记录与实际 Firestore 索引之间的偏差。

SKILL.md
--- frontmatter
name: Firestore Index Sync
description: Detect and fix drift between documented and actual Firestore indexes
owner: Undangan team
last_updated: 2026-01-24

Firestore Index Sync Skill

Purpose

Keep FIRESTORE_INDEXES.md and firestore.indexes.json aligned to prevent query errors.

When to Use

  • Indexes added or removed
  • Query errors indicate missing indexes
  • Documentation updates

Inputs

  • FIRESTORE_INDEXES.md
  • firestore.indexes.json

Outputs

  • Drift report under .agent/artifacts/{conversation-id}/firestore_index_sync.md
  • Minimal patch to align docs and JSON

Prerequisites

  • Awareness of active query patterns

Tools & Availability

  • Local editor + rg for diffing
  • Optional JSON formatter (manual if unavailable)

Methodology

  1. Compare index definitions between MD and JSON.
  2. Identify mismatches (collection, fields, order, query scope).
  3. Update the minimal source of truth (prefer JSON for actual indexes).
  4. Sync documentation to match exact definitions.

Verification

  • Every index in JSON is documented in FIRESTORE_INDEXES.md
  • Documentation contains no indexes missing in JSON
  • File formatting preserved (minimal diff)

Pass/Fail: Pass only if all checks above are satisfied.

Risks & Mitigations

  • Updating docs only → ensure JSON is authoritative
  • Formatting churn → keep minimal line changes