claude-code-plugin-ref…
Explain plugin, skill, command, agent, and hook mechanics used here. Use when authoring or debugging plugins. Do not use for ops; use night-market-operations.
Recovers broken agent state via crash recovery, context overflow, and merge conflict protocols. Use when an agent session fails or a worktree is corrupted.
$ npx -y skills add athola/claude-night-market --skill damage-control --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/damage-controlContext preview
The summary Claude sees to decide when to auto-load this skill.
Recovers broken agent state via crash recovery, context overflow, and merge conflict protocols. Use when an agent session fails or a worktree is corrupted.
name: damage-control description: Recovers broken agent state via crash recovery, context overflow, and merge conflict protocols. Use when an agent session fails or a worktree is corrupted. alwaysApply: false category: infrastructure tags: - recovery - resilience - crash - context - conflicts - state dependencies: - error-patterns provides: infrastructure: - crash-recovery-protocol - context-overflow-protocol - merge-conflict-resolution - state-reconciliation patterns: - damage-triage - recovery-checkpoints usage_patterns: - agent-crash-recovery - context-limit-handling - conflict-resolution - session-state-repair complexity: intermediate model_hint: standard estimated_tokens: 450 progressive_loading: true modules: - modules/crash-recovery.md - modules/context-overflow.md - modules/merge-conflict-resolution.md - modules/state-reconciliation.md - modules/risk-assessment-checklist.md role: library
Provides recovery protocols for agents that encounter broken state mid-session. Damage control covers four failure classes: agent crashes with partial work on disk, context window overflow that causes state loss, merge conflicts blocking forward progress, and general session state corruption requiring reconciliation.
The skill does not prevent failures. It defines what to do after one has already happened, so recovery is consistent, auditable, and does not silently discard work.
resolve automatically
with expected state
been produced upstream
`Skill(leyline:risk-classification)` instead)
`Skill(attune:war-room)` instead)
`Skill(leyline:error-patterns)` instead)
Use this decision tree to route to the correct module:
flowchart TD
A[Failure detected] --> B{Agent process crashed\nor exited unexpectedly?}
B -->|Yes| C[modules/crash-recovery.md]
B -->|No| D{Context limit hit or\nprior decisions unavailable?}
D -->|Yes| E[modules/context-overflow.md]
D -->|No| F{git merge / rebase /\ncherry-pick conflicts?}
F -->|Yes| G[modules/merge-conflict-resolution.md]
F -->|No| H{State internally inconsistent?\ntask list vs disk vs git index}
H -->|Yes| I[modules/state-reconciliation.md]
H -->|No| J[No damage-control needed]When multiple failure types overlap, start with `state-reconciliation.md` to establish a known baseline, then address the specific failure class.
Before executing Level 1+ tasks, complete the risk assessment checklist from `modules/risk-assessment-checklist.md`. Answer these five questions:
1. **What could fail in production?** List specific failure scenarios. 2. **How would we detect it quickly?** Monitoring, alerts, logs. 3. **What is the fastest safe rollback?** Step-by-step procedure. 4. **What dependency could invalidate this plan?** External dependencies. 5. **What assumption is least certain?** Weakest link in the plan.
Required for Level 1 (Watch) and above. See `modules/risk-assessment-checklist.md` for the full template and examples.
safe resume or rollback after an agent crash.
decision context when the window is exhausted.
resolution strategies for git conflicts, including escalation to human review.
divergent state across task list, git index, and on-disk artifacts.
Level 1+ tasks.
# In your skill's frontmatter dependencies: [leyline:damage-control]
Invoke a specific module when a failure class is identified:
# Crash detected Skill(leyline:damage-control) → modules/crash-recovery.md # Context limit reached Skill(leyline:damage-control) → modules/context-overflow.md
For orchestrators managing multiple agents, invoke state-reconciliation at session boundaries regardless of whether a failure occurred. This establishes a verified checkpoint before the next work phase begins.
verified
reverted scope is documented in the task list
record exists before the session closes
A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.
Explain plugin, skill, command, agent, and hook mechanics used here. Use when authoring or debugging plugins. Do not use for ops; use night-market-operations.
States load-bearing decisions, invariants, and weak points. Use when judging a design change. Do not use for gating; use night-market-change-control.
Rebuild the dev environment: uv, Python tiers, pins, traps. Use when onboarding or toolchain breaks. Do not use for daily commands; use night-market-operations.
Classify, gate, and review changes. Use when landing a PR, releasing, or amending rules. Do not use for failure triage; use night-market-debugging-playbook.
Search and record project memory (Discussions, journal, ADRs). Use before re-investigating anything. Do not use for settled battles; see failure-archaeology.
Bind loop 'done' to unfakeable gates. Use to harden egregore/herald loops or promote completion_integrity. Not for QA gates; use night-market-validation-and-qa.