Structured recovery procedure for monorepo incidents โ accidental history destruction, orphan branches, folder deletion, force-push damage, and merge conflicts
Walks through a 5-phase workflow: assess current state, identify recovery sources, execute recovery, verify restored state, and document the incident. Every destructive step requires explicit human confirmation.
Monorepo Disaster Recovery
TL;DR
How To Start
STEP 1Initiate Disaster Recovery
-
monorepo_path
· string · required
Path to the cloned monorepo root. -
session_id
· string · required
Current session ID for incident tracking. -
project_id
· string · required
Project initiating the recovery. -
incident_description
· string · required
Human-provided description of what went wrong. -
backup_dir
· string · optional · default: {monorepo_path}/backups
Directory containing snapshot bundles. -
backup_repo_url
· string · optional · default: craft-framework-backup
URL of backup GitHub repository.
Usage Examples
EXAMPLE 1Recovery from snapshot bundle
EXAMPLE 2Critical incident — structure damaged
EXAMPLE 3No automated recovery sources
How AI Reads This Recipe
- Phase 1: Assess current state. Check .git integrity. Inspect branch state, working tree, recent history, directory structure (framework/ and specifications/ for two-repo model), and remote sync. Classify severity: CRITICAL (structure damage, detached HEAD, corrupted history), MODERATE (cannot reach remote), MINOR (accessible, structure intact). Present formatted assessment report.
- Phase 2: Identify recovery sources. Check in priority order: local snapshot bundles (backup_dir), automated zip backups (project zips in backups/project/, framework zips in ~/Documents/Claude/craft-framework-beta-dev-backups/), snapshot log history, backup repository remote, and git reflog. Present sources with recommendation. Ask human to select.
- Phase 3: Execute recovery. Create pre-recovery snapshot of damaged state first. Execute based on selected source: snapshot bundles (verify, clone, check structure), zip backups (verify, extract to temp, review before applying), backup repo (fetch, compare, human-confirmed reset), reflog (show entries, confirmed reset). Every destructive operation requires explicit human confirmation.
- Phase 4: Verify restored state. Check structure (framework/, specifications/, templates/), branch (must be main), history, framework file count, specification file count. Compare against Global file manifest if available. Report PASS or FAIL.
- Phase 5: Document and notify. Write incident entry to MONOREPO-INCIDENT-LOG.txt. Update changelog. Prepare CWK-039 notification for connected projects (CRITICAL urgency). Create post-recovery snapshot via CWK-037. Present final report with next steps: use CWK-046 for all post-recovery pushes, notify projects, investigate root cause.
When To Use This Recipe
Recipe FAQ
What recovery sources does this recipe check?
Why does every destructive step need human confirmation?
What if recovery verification fails?
How does this work with the two-repo architecture?
What are the automated zip backups?
Version History
Get this recipe with CRAFT for Claude Cowork
Cowork recipes ship bundled with CRAFT for Claude Cowork — there’s no separate download. Clone the framework once, and your AI runs every recipe automatically when invoked.
Pull anytime to stay on the latest version — free to clone, no login or email required.
Then start your session
Once CRAFT is in your project folder, open a new Cowork session and ask Claude to initialize. For example:
You
Claude
Not familiar with Git? Download as a ZIP
No command line needed. Just download, move, and unzip:
- Open the CRAFT framework repo on GitHub.
- Click the green Code button, then choose Download ZIP.
- Move the downloaded ZIP into your Claude Cowork project folder.
- Unzip it: double-click on Mac, or right-click → Extract All on Windows.
