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.
Applies NASA Power of 10 rules for safety-critical verifiable code. Use when auditing financial, medical, or high-reliability system code.
$ npx -y skills add athola/claude-night-market --skill safety-critical-patterns --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/safety-critical-patternsContext preview
The summary Claude sees to decide when to auto-load this skill.
Applies NASA Power of 10 rules for safety-critical verifiable code. Use when auditing financial, medical, or high-reliability system code.
name: safety-critical-patterns description: Applies NASA Power of 10 rules for safety-critical verifiable code. Use when auditing financial, medical, or high-reliability system code. alwaysApply: false category: code-quality tags: - safety - defensive-coding - assertions - NASA - robustness - verification tools: [] complexity: intermediate model_hint: standard estimated_tokens: 600 dependencies: - pensive:code-refinement - imbue:review-core - imbue:structured-output
Guidelines adapted from NASA's Power of 10 rules for safety-critical software.
**Full rigor**: Safety-critical systems, financial transactions, data integrity code **Selective application**: Business logic, API handlers, core algorithms **Light touch**: Scripts, prototypes, non-critical utilities
> "Match rigor to consequence" - The real engineering principle
bloat that `prefer-invariants-over-fallbacks` targets (use `conserve:code-quality-principles`)
Avoid `goto`, `setjmp/longjmp`, and **limit recursion**.
**Why**: Ensures acyclic call graphs that tools can verify. **Adaptation**: Recursion acceptable with provable termination (tail recursion, bounded depth).
All loops should have verifiable upper bounds.
# Good - bound is clear
for i in range(min(len(items), MAX_ITEMS)):
process(item)
# Risky - unbounded
while not_done: # When does this end?
process_next()**Adaptation**: Document expected bounds; add safety limits on potentially unbounded loops.
Avoid heap allocation in critical paths after startup.
**Why**: Prevents allocation failures at runtime. **Adaptation**: Pre-allocate pools; use object reuse patterns in hot paths.
Functions should fit on one screen/page.
**Why**: Cognitive limits on comprehension remain valid. **Adaptation**: Flexible for declarative code; strict for complex logic.
Include defensive assertions documenting expectations.
def transfer_funds(from_acct, to_acct, amount):
assert from_acct != to_acct, "Cannot transfer to same account"
assert amount > 0, "Transfer amount must be positive"
assert from_acct.balance >= amount, "Insufficient funds"
# ... implementation**Adaptation**: Focus on boundary conditions and invariants, not arbitrary quotas.
Declare variables at narrowest possible scope.
# Good - scoped tightly
for item in items:
total = calculate(item) # Only exists in loop
results.append(total)
# Avoid - unnecessarily broad
total = 0 # Why is this outside?
for item in items:
total = calculate(item)
results.append(total)Validate inputs; never ignore return values.
# Good
result = parse_config(path)
if result is None:
raise ConfigError(f"Failed to parse {path}")
# Bad
parse_config(path) # Ignored returnRestrict macros, decorators, and code generation.
**Why**: Makes static analysis possible. **Adaptation**: Document metaprogramming thoroughly; prefer explicit over magic.
Limit indirection levels; be explicit about ownership.
**Adaptation**: Use type hints, avoid deep nesting of optionals, prefer immutable data.
Compile/lint with strictest settings from day one.
# Python ruff check --select=ALL mypy --strict # TypeScript tsc --strict --noImplicitAny
| Rule | When to Relax | |------|---------------| | No recursion | Tree traversal, parser combinators with bounded depth | | No dynamic memory | GC languages, short-lived processes | | 60-line functions | Declarative configs, state machines | | No function pointers | Callbacks, event handlers, strategies |
Reference this skill from:
auto-detection row when assertion density is low, loops are unbounded, or recursion lacks a termination proof
For each rule violation, report:
Rule N: <rule name> Location: file.py:42 Anchor: `<verbatim source text at line 42>` Issue: <what violates the rule> Fix: <concrete remediation>
Every finding must cite a real location and a verbatim anchor. Write findings to `.review/findings.json` and confirm each citation resolves:
python plugins/imbue/scripts/citation_verifier.py \ --findings .review/findings.json --repo-root .
Drop or label `UNVERIFIED` any finding the verifier fails (exit `1`); only verified findings enter the report. See `Skill(imbue:review-core)` Step 5 and `Skill(imbue:structured-output)` for the schema.
(applies / violated / not applicable), not a silent skip
rule number it breaks
allocation in this module") rather than being omitted
provable upper bound; unbounded loops are reported
termination argument
safety-critical use, or which rules block that judgment
confirmed by `citation_veri
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.