Materialization aware refresh escalation

From ychampion/cskill-agents · View interactive version

Materialization aware refresh escalation is an AI agent skill from the GitHub repository ychampion/cskill-agents. React to marketplace materialization diffs by refreshing plugins when new installs land and escalating to needsRefresh when updates or refresh failures occur.

How to use this skill

Skill file

SKILL: Materialization-Aware Refresh Escalation

Domain: extensions-mcp

Trigger: When background plugin installation reconcilers detect that declared marketplaces differ from what is materialized, use the diff to decide whether to auto-refresh plugins or escalate to a manual refresh prompt.

Source Pattern: Distilled from reviewed extension lifecycle and source-reconciliation patterns.

Core Method

  1. Before reconciling, read the declared marketplaces (getDeclaredMarketplaces()), the previously materialized config (loadKnownMarketplacesConfig()), and compute diffMarketplaces() so you know which names are missing or changed.
  2. Build pendingNames from diff.missing plus diff.sourceChanged so the UI reports exactly which marketplaces are still being processed; return early when that array is empty so no work runs unless there is material change.
  3. Call reconcileMarketplaces({ onProgress }), map the installing/installed/failed events to AppState, track metrics for installed/updated/failed/up-to-date counts, and log them via logEvent and diagnostics helpers.
  4. After reconciliation, inspect the result:

Key Rules

Example Application

Installing a curated marketplace during background startup on a fresh homespace uses this path so the new tools become available without forcing the user to manually run /reload-plugins.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.