state-safety
CommunityProtect colony state with atomic writes.
Authorcalcosmic
Version1.0.0
Installs0
System Documentation
What problem does it solve?
State files used by the colony can become corrupted or lost during unexpected shutdowns or concurrent updates. This skill teaches safe handling of critical JSON state files to prevent data loss and ensure recoverability.
Core Features & Use Cases
- Atomic writes for state mutations: write to a temporary file first, then rename to the target to prevent partial writes.
- File locking and guarded mutations: acquire a lock before modifying COLONY_STATE.json, pheromones.json, constraints.json, or session.json to avoid race conditions.
- Post-write validation and backups: validate the resulting JSON and restore from backups if validation fails.
- Automatic backup strategy: maintain a single, valid backup per file to enable rollback after failures.
- Read-time corruption checks: verify files exist, are non-empty, and parse correctly; fall back to backups when needed.
- State files and critical fields awareness: track essential files and their required keys to maintain integrity.
Quick Start
Enable atomic writes and locking across state files and perform a backup after every successful write.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: state-safety Download link: https://github.com/calcosmic/Aether/archive/main.zip#state-safety Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.