/kernel:simplifyfrom kernel
Simplifies code, plans, and systems by deleting unnecessary machinery while preserving required outcomes. For code, uses AST-measured complexity with regression gates. Invoked via: simplify, refactor, complexity, overengineered, dead code.
Ships in kernel. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
For code, this skill forces a measured per-function number, records its movement, and installs the same check in the project's normal verification. Prose about "cleaner code" is not accepted.
Adapted from saurabhkumar8112/cyclomatic-complexity-skill (Apache-2.0). The refactoring model never signs its own result; a verifier re-measures and runs the armed project gate.
<on_start> agentdb recall "simplify complexity <files/symbols>" --global </on_start>
Pick one at the top of the run and say which: - `code` — source changes. Full measure + gate path below. - `system` — plans, roadmaps, backlogs, docs, pipelines, process. Preservation contract and deletion doctrine apply; the complexity table does not. Never emit `Reduced: 0 · regressed: 0` for work with no functions in it; use the system report block. Mixed work runs both blocks, never one blurred into the other.<deletion_doctrine> Deletion beats repair. When something is broken, the first question is whether it should exist.
Cut fast and hard. Do not stage a deprecation for code only this repo calls.
Repair instead of deleting only when: it is on the preservation contract; or it is the sole defense against an irreversible failure (data loss, secret leak, production destruction); or deleting it breaks a published API or another repo's contract. Name which one applies.
Every deletion is recorded: what, why it earned nothing, what now covers the case (or that nothing needs to). Deleting an item on the preservation contract is a scope cut, not a simplification, and is forbidden. </deletion_doctrine>
Run before measuring. A mid-run analyzer failure is a preventable state, not a surprise. ```bash ${CLAUDE_PLUGIN_ROOT}/scripts/complexity.sh --engine auto >/dev/null # exit 3 = no analyzer git fetch -q origin && git diff --quiet origin/ -- .complexity-baseline.tsv .ccnrc \ || echo "baseline/config differs from the default branch: refresh before measuring" ``` - No analyzer (exit 3) or invalid config (exit 2): stop and install it. Never hand-count. - JS/TS without project ESLint: the lizard fallback cannot see object-literal methods. Install ESLint or skip the file with that exact reason. Never call the fallback proof. - The baseline is a committed file measured against the current default branch. A baseline from a stale checkout is not a baseline; refresh it from `origin/` first and say so. - Sandboxed workspace: `complexity.py` redirects an unwritable uv cache to tmp on its own. ```bash # violations, worst first (TSV: file, line, function, ccn, nloc) ${CLAUDE_PLUGIN_ROOT}/scripts/complexity.sh # only what this branch changed ${CLAUDE_PLUGIN_ROOT}/scripts/complexity.sh # complete snapshot + before/current diff ${CLAUDE_PLUGIN_ROOT}/scripts/complexity.sh --all > before.tsv ${CLAUDE_PLUGIN_ROOT}/scripts/complexity.sh --diff before.tsv # CI ratchet: baseline contains only current over-budget debt ${CLAUDE_PLUGIN_ROOT}/scripts/complexity.sh --check-baseline .complexity-baseline.tsv ```Project config is .ccnrc JSON:
{
"version": 1,
"default": 15,
"budgets": { "src/machine.ts:transition": 20 },
"skip": { "src/legacy-repo.ts:*": "lizard cannot enter createLegacyRepo's returned methods" }
}
Selectors are repo-relative-file:function globs. --skip 'selector=reason' is the one-run
equivalent. A skip without a reason is invalid. Budgets are declared design constraints, not a
way to bless today's number: name why the function earns the higher ceiling in the config diff.
Ladder (default, project config outranks it):
<hard_rules>
self, builder self-measure, primary lane validation, a script the builder wrote this session, and an unfilled <verifier identity>
placeholder are all invalid signatures. An unsigned report is an unfinished run.
</hard_rules>ACCEPTANCE: every contract line has an equally strong delivery route; every deletion is justified under the deletion doctrine; no measured function regresses; budgets hold; the project's normal verify path runs the gate
ACCEPT WHEN: contract file checks line by line with zero removed, weakened, newly deferred, or optional outcomes; every deleted test/guard/path names what it failed to earn and what covers the case now; fresh --diff says regressed=0; project verify passes; seeded over-budget fixture makes it fail; no exported signature changed
CHECK: diff .simplify-contract.md against the source of truth and the result line by line; ${CLAUDE_PLUGIN_ROOT}/scripts/complexity.sh --diff <before.tsv> <repo>; <project verify command>; <seeded failure probe>; git diff <base-ref> --diff-filter=D --name-only; git diff <base-ref> -- <files> | grep -E '^[-+](def |export |func |pub fn )'
ESCALATE IF: any contract line lacks a route or became weaker/later/optional; a deletion removed the only defense against an irreversible failure; AST-aware JS/TS parsing is unavailable for object-literal methods; any row regresses; a skip lacks a concrete parser limitation; or a one-liner replaced a branch without a name
DISCOVERY AXIS: invariant
Builder and verifier identities go on the receipt and must differ. The builder never fills in "behavior verified".
End with the block for the mode you ran, and nothing after it.code:
## Complexity report
Reduced: N · unchanged: N · regressed: 0 · removed: N
Deleted: <file:symbol - what it failed to earn> | none
Destination: N/N contract lines preserved · weakened/deferred/removed: 0 (.simplify-contract.md)
Budgets: <config path>; exceptions: <none | selectors + reasons>
Gate: <project verify command> (seeded red -> clean green), baseline @ <ref>
Verified by: <verifier identity, not the builder>
system:
## Simplification report
Destination: N/N contract lines preserved · weakened/deferred/removed: 0 (.simplify-contract.md)
Removed: <duplicated mechanism / dead step / unearning gate - why it earned nothing> | none
Collapsed: <what merged into what>
Sequenced: <item - later phase, its delivery route, its acceptance condition> | none
Verified by: <verifier identity, not the builder>
Keep prose minimal. Numbers and diffs do the talking.
What SKILL.md sets; muted values are Claude Code's defaults
28 skills in this plugin
/app-devMobile/web build pipeline: fastlane-first local builds, store submission, pre-submission checklists. Triggers: app, mobile, store submission, deploy app, fastlane, expo, react native, flutter./architectureModular design, interface stability, dependency management, AI-code health. Triggers: architecture, design, structure, modules, dependencies, coupling, system design./buildPlan and implement a requested code feature when the solution requires choosing among implementation approaches./checkpointSave bounded progress as kernel.checkpoint/v1 for exact resume after reset. Triggers: checkpoint, save progress, context reset, compact soon, long task./context-mgmtContext engineering: compaction, progressive disclosure, structured notes via AgentDB. Triggers: tokens, compaction, memory, handoff, summarize, context window./debugDiagnosis before prescription: reproduce, hypothesize, isolate, fix root cause, add a regression test; refactor mode maps deps, coupling and blast radius. Triggers: bug, error, fix, broken, not working, crashed, stack trace, exception, refactor, restructure, coupling, dependency map.npx claudepluginhub ariaxhan/kernel-claude --plugin kernelOther plugins' skills for the same job