degraded-mode-design
БесплатноБез исполняемых скриптовНе проверенDecision-aid skill for fail-closed vs fail-open behavior. Forces a degraded-mode matrix and rejects "type Y to override" prompts in favor of multi-step…
от jmagly★ 233 звезды на GitHubОб этом скилле
degraded-mode-design
Decision aid for what a system does when something goes wrong: a key is missing, a verification fails, a sensor times out, a network partition is detected. Use when designing or reviewing any code path labeled "emergency", "fallback", "recovery", or "graceful degradation".
The skill exists because the wrong fallback can defeat the entire design. Review finding B4 ("emergency-lock copies VM disk unencrypted") is the canonical example: the fallback intended to preserve availability also preserved the assets in plaintext, defeating the encryption that was the entire point of the system.
Triggers
- "fail closed" / "fail open"
- "emergency lock" / "panic" / "kill switch"
- "degraded mode" / "graceful degradation"
- "fallback path" / "recovery path"
- "what happens when" / "edge case in"
- "override" / "type Y to continue"
Section 1: Default principle — security products fail CLOSED
The CIA triad (Confidentiality, Integrity, Availability) ranks differently for different systems:
| System type | Priority | Failure default |
|---|---|---|
| Security product (encryption, auth) | C > I > A | Fail closed: no operation rather than insecure operation |
| Safety system (medical, aviation) | A > I > C | Fail safe: known-good degraded behavior |
| Financial system | I > C > A | Fail closed for writes, log everything |
| Communication infrastructure | A > I > C | Fail open: best effort, alert on issues |
For a security product, the default behavior on any failure is: stop, preserve confidentiality and integrity, alert the operator. Preserving availability of the secret operation when its protection is failing is the wrong trade.
This is the rule review finding B4 violated: when both YubiKeys were missing, the emergency-lock script copied the VM disk unencrypted to "preserve the session." The premise — losing session is worse than brief unencrypted exposure — is wrong for a security-first product. The whole point of the dual-YubiKey design was that no keys = no session.
Section 2: Anti-patterns (BLOCK on these)
Plaintext fallback when encrypted operation fails
# WRONG (review B4)
if both_keys_missing; then
cp vm.disk.encrypted /backup/vm.disk.plaintext # preserve session at cost of confidentiality
fi
"Type Y to override" prompts on integrity failure (review M8)
# WRONG
echo "[!] Manifest verification failed."
read -p "Type Y to continue anyway: " ans
[ "$ans" = "Y" ] && exec ./unlock.sh
Operators learn to autoresponse-Y. The override defeats integrity exactly when integrity matters most: when something has changed.
Mode-mixing during failure
# WRONG
if encryption_module_unavailable; then
log "encryption disabled, continuing"
write_plaintext "$@"
fi
Operators forget which mode they were in. Two minutes later, they expect ciphertext on disk, but it's plaintext.
Recovery path that reuses operational keys
If the operational path uses keys A+B and the recovery path uses keys A+B+C, then the recovery path is a strict superset of the operational path. An attacker with A+B has both. Recovery must use a separate key set (e.g., HQ escrow key, not held by the operator).
Section 3: Required pattern — separate operational vs escrow paths
A system that needs both:
- Operational availability (the main use case must work end-to-end with all factors present), AND
- Recovery from total factor loss (operator stranded, hardware failure, etc.)
…must design two distinct paths that do not share key material:
Operational path:
factors {A, B, C} → unlock(...) → secret operation
Escrow path:
HQ-only key K_escrow → encrypt-to-K_escrow at provisioning
…
Recovery: HQ + K_escrow → re-derive operational state
Properties:
- The escrow path is opt-in at provisioning — the operator chooses to encrypt to HQ key
- The escrow path's keys are never present when operational path is active
- Use of escrow path is logged and alertable at HQ — no quiet recovery
- The escrow path does not preserve the operational secrets in plaintext at any point — the recovery target is HQ's controlled environment, not the operator's device
This is the remediation pattern for review finding B4.
Section 4: Override ceremonies (when override is unavoidable)
Sometimes manual override is genuinely necessary (system migration, key rotation, legitimate emergency). When it is:
Anti-pattern (review M8)
[!] Integrity check failed. Type Y to override:
Required pattern: multi-step ceremony
A real override requires:
- Type a verification artifact — operator types the SHA-256 prefix of the failing file (forces them to look at it, not autoresponse)
- Witness confirmation — second person physically present, ideally with their own credential
- External logging — override event written to a log the operator cannot suppress (HQ-side syslog, append
Установить degraded-mode-design в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл degraded-mode-design?
Decision-aid skill for fail-closed vs fail-open behavior. Forces a degraded-mode matrix and rejects "type Y to override" prompts in favor of multi-step ceremonies
Как установить скилл degraded-mode-design?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл degraded-mode-design запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic