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.
Audits changes for additive bias and Iron Law compliance. Use when reviewing completed work before merging or after AI-assisted implementation.
$ npx -y skills add athola/claude-night-market --skill justify --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/justifyContext preview
The summary Claude sees to decide when to auto-load this skill.
Audits changes for additive bias and Iron Law compliance. Use when reviewing completed work before merging or after AI-assisted implementation.
name: justify description: Audits changes for additive bias and Iron Law compliance. Use when reviewing completed work before merging or after AI-assisted implementation. alwaysApply: false category: workflow-methodology tags: - justification - proof-of-work - anti-additive-bias - code-review - iron-law dependencies: - imbue:proof-of-work - leyline:additive-bias-defense tools: [] usage_patterns: - post-implementation-review - pre-commit-audit - change-justification complexity: intermediate model_hint: standard estimated_tokens: 2800 role: entrypoint
> The simplest change that fixes the problem is the > safest change to merge. > Adding code is easy. Removing the need for code is > engineering.
AI models are trained to be helpful, which creates a systematic bias toward *adding* code rather than *fixing* root causes:
| AI Default Behavior | Correct Behavior | |---------------------|------------------| | Add a workaround | Fix the root cause | | Modify test expectations | Fix the implementation | | Create a new helper | Use an existing one | | Add error handling | Prevent the error | | Add a compatibility shim | Remove the old code | | Wrap in try/catch | Fix the exception source |
This skill audits changes for these patterns and requires explicit justification for each.
`imbue:karpathy-principles`)
# Determine base branch base=$(git merge-base master HEAD 2>/dev/null \ || git merge-base main HEAD 2>/dev/null) # Get change statistics git diff "$base" --stat git diff "$base" --shortstat git diff "$base" --diff-filter=A --name-only # new files git diff "$base" --diff-filter=M --name-only # modified files git diff "$base" --diff-filter=D --name-only # deleted files
Score each dimension 0-3 (0 = clean, 3 = high bias):
| Signal | Weight | How to Measure | |--------|--------|----------------| | Line ratio | 2x | `additions / max(deletions, 1)` | | New files | 2x | Count of `--diff-filter=A` | | Test logic changes | 3x | Test assertion/expectation diffs | | New abstractions | 1x | New classes, functions, modules | | Workaround patterns | 2x | Try/catch, if/else guards added |
**Line Ratio Scoring:**
| Ratio | Score | Interpretation | |-------|-------|----------------| | < 2:1 | 0 | Balanced change | | 2:1 to 5:1 | 1 | Mildly additive | | 5:1 to 10:1 | 2 | Additive bias likely | | > 10:1 | 3 | Strong additive bias |
**Aggregate Score:**
bias_score = sum(signal_score * weight) / sum(weights)
| Aggregate | Zone | Action | |-----------|------|--------| | 0.0 - 0.5 | GREEN | Proceed | | 0.5 - 1.5 | YELLOW | Justify each signal | | 1.5 - 2.5 | RED | Rethink approach | | 2.5+ | STOP | Likely wrong approach |
The Iron Law states: tests drive implementation, not the other way around. Check for violations:
# Find test files that were modified git diff "$base" --name-only | rg "test_|_test\.|spec\." \ || git diff "$base" --name-only | grep -E "test_|_test\.|spec\." # For each modified test file, check what changed git diff "$base" -- <test_file> | rg "^[-+].*assert|^[-+].*expect|^[-+].*should"
**Violation patterns (test logic was tampered):**
**Each violation requires explicit justification:**
> "I changed this test assertion because the > *requirement* changed, not because my implementation > couldn't meet the original requirement."
If the requirement didn't change, the test should not change. Fix the implementation instead.
For each changed file, answer:
1. **Was this change necessary?** Could the goal be achieved without touching this file?
2. **Was this the minimal change?** Could fewer lines achieve the same result?
3. **Did this change add or remove complexity?** New functions, classes, or control flow = added complexity that needs justification.
4. **Is there a subtraction-first alternative?** Could removing code fix the problem instead of adding code?
Changes can be minimal and still catastrophically wrong if they silently revise a load-bearing design decision. For each changed file, check whether it touches a design invariant:
**What counts as an invariant:**
separation, data flow direction)
normalized vs denormalized)
actor model, shared-nothing)
**Detection heuristic:**
# Check for structural changes (new modules, moved # boundaries, changed interfaces) git diff "$base" --name-only | rg "(interface|abstract|base|core|types|schema|model)" \ || git diff "$base" --name-only | grep -E "(interface|abstract|base|core|types|schema|model)" # Check for pattern-breaking changes git diff "$base" -U5 | rg "(TODO.*refactor|HACK|WORKAROUND|XXX)" \ || git diff "$base" -U5 | grep -E "(TODO.*refactor|HACK|WORKAROUND|XXX)"
**When an invariant conflict is detected:**
Do NOT silently pick a resolution. Present the three options to the human:
| Option | Description | When Righ
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.