gpd-sync-state

Reconcile diverged STATE.md and state.json files after manual edits or corruption.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/MichaelsEngineering/sentinel-multiscale-field-dynamics --skill gpd-sync-state-michaelsengineering
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gpd-sync-state
Source: https://github.com/MichaelsEngineering/sentinel-multiscale-field-dynamics/tree/main/.agents/skills/gpd-sync-state
Command: npx skills add https://github.com/MichaelsEngineering/sentinel-multiscale-field-dynamics --skill gpd-sync-state-michaelsengineering

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Project state tracked in both a human-readable STATE.md and a machine-readable state.json can diverge after manual edits, crashed workflows, or git merges, leaving automation and humans working from inconsistent information. ## Core Features & Use Cases - Divergence Detection: Compares shared fields such as current phase, plan, status, decisions, and blockers between STATE.md and state.json. - Guided Reconciliation: Determines recency via file timestamps and git history, presents conflicts for confirmation, or resolves automatically with --prefer md or --prefer json. - Recovery Paths: Regenerates a missing or corrupt state.json from STATE.md (and vice versa) while preserving JSON-only fields like convention_lock and intermediate_results. - Use Case: After manually editing STATE.md to advance the project phase, run this Skill to merge the change back into state.json, validate consistency, and commit the reconciled files. ## Quick Start Ask the AI to reconcile STATE.md and state.json in this project, preferring the markdown version if conflicts appear.

Frequently Asked Questions about gpd-sync-state

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix STATE.md and state.json out of sync?▼

Run the sync-state workflow, which reads both files, compares shared fields like phase, plan, and status, and presents divergences for confirmation. It then applies the preferred values to both files and validates consistency.

How to recover state.json if it was deleted or corrupted?▼

If only STATE.md exists, the workflow uses the GPD loader's fallback path to regenerate state.json from the markdown, backing up any existing file first. If both files are corrupt, it suggests restoring from git history.

Can I force STATE.md or state.json to win all conflicts?▼

Yes. Pass --prefer md to treat STATE.md as the source of truth, or --prefer json to treat state.json as authoritative. Without a flag, conflicts are presented interactively for resolution.

Does syncing state lose JSON-only fields like convention_lock?▼

No. JSON-only fields such as convention_lock, intermediate_results, approximations, and propagated_uncertainties are preserved in every reconciliation path, including when state.json is regenerated from markdown.

Which file is authoritative when timestamps are ambiguous?▼

state.json is authoritative for structured state by default. STATE.md is preferred only when there is clear evidence of an intentional recent manual markdown edit to schema-backed fields.