Purpose
Monitors the exports/ folder for new cycle data and syncs to local SQLite for fast querying. This is the foundation for all other GodWorld skills.
What It Does
- •Reads
exports/manifest.jsonto detect new cycles - •Compares checksums to avoid duplicate processing
- •Loads
cycle-XX-context.jsonfor the latest cycle - •Updates local SQLite tables:
- •
cycles(city state, risk flags) - •
citizens(active citizens, mention tracking) - •
initiatives(civic outcomes)
- •
- •Updates
sync_stateto track progress
Triggers
| Trigger | When |
|---|---|
manual | Run "sync godworld" |
watch:exports/manifest.json | When manifest changes (new cycle exported) |
schedule:0 * * * * | Every hour as backup |
Required Config
json
{
"godworld": {
"exportsPath": "./exports",
"dbPath": "./godworld/godworld.db"
}
}
Outputs
- •Updates SQLite database
- •Logs sync summary to console
- •Returns:
{ cyclesSynced: number, recordsUpdated: number }
Error Handling
- •If manifest missing: logs warning, exits cleanly
- •If checksum matches: skips sync (idempotent)
- •If DB error: logs error, does not mark as synced
Dependencies
- •
better-sqlite3(npm package) - •SQLite database initialized with
schemas/godworld.sql