/elon-musk-algorithm-skills:musk-step-2-delete-partsfrom elon-musk-algorithm-skills
Step 2 of the Musk algorithm for deleting parts or processes. Use when reviewing existing systems, codebases, or accumulated complexity to aggressively prune unnecessary components.
Ships in elon-musk-algorithm-skills. 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.
Cut first. If you do not add back ~10%, you did not cut hard enough.
Part of the [[musk-algorithm]]. Second in the strict order.
Before this step, verify in the conversation or diff:
If absent, stop. Run step 1 first. No exceptions.
Smart engineers default to addition. Adding a part feels like progress. Removing one feels risky. The Musk algorithm inverts this default: every part is guilty until proven necessary by a surviving requirement from step 1.
Musk's calibration rule: if you do not end up adding back at least 10% of what you deleted, you did not delete enough. Adding back zero means the cuts were never load-bearing in the first place, which means the system has even more bloat than was just removed.
For every part in scope (feature, endpoint, table, column, service, dependency, config flag, document, meeting, role, dashboard, report):
Inventory: [list of all parts in scope]
Deletion list: [parts proposed for removal, with one-line justification each]
Justifications for kept parts: [each kept part tied to a named-owner requirement from step 1]
Predicted add-back: [parts you expect to restore, with reasoning]
Expected add-back percentage: [explicit number, target 10-25%]
Hidden invariants identified: [what kept code or processes assert]
Cut executed: [what was actually deleted]
Audit plan: [when and how the actual add-back will be measured]
The original algorithm is about hardware. For software, data, and AI work:
| Hardware concept | Software equivalent |
|---|---|
| Part | Feature, endpoint, table, column, service, dependency, config flag, document, meeting, role |
| Process step | Pipeline stage, manual review, approval gate, deployment step |
| Bracket / fastener | Adapter, wrapper, glue function, indirection layer |
| Test fixture | Mock, stub, fixture data |
Critical rule for code: deleted code can hide invariants the system depends on. Before deleting, identify what the code asserts (its preconditions, postconditions, ordering guarantees, error handling). Then either relocate the assertion or accept that it goes away. Test coverage and observability are the seatbelts. Cuts made without them are reckless, not aggressive.
This step is done when:
Only then can [[musk-step-3-simplify-optimize]] begin.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
musk-algorithm, pruning, complexity-reduction, code-cleanup, refactoring
npx claudepluginhub wezendy/elon-musk-algorithm-skills --plugin elon-musk-algorithm-skills6 skills in this plugin
/musk-algorithmApply Elon Musk's 5-step engineering algorithm in strict order. PRIMARY USE CASE is reviewing, auditing, cleaning up, or restructuring existing systems (brownfield work). Trigger on phrases like "clean this up", "optimize this", "we have too many", "should we keep X", "let's automate Y", "this is bloated", "review this architecture", or any request to evaluate or compress an existing system. SECONDARY USE CASE is greenfield planning ("should we build X", "do we need this feature") with translation. Steps 2, 4, 5 reinterpret as "default to no", "design for iteration", "design for manual first". DO NOT use for function-level coding decisions like variable naming, error handling style, or refactoring patterns; for those, pair this framework with andrej-karpathy-skills which operates at the function level./musk-step-1-question-requirementsStep 1 of the Musk algorithm. Question every requirement and demand a named human originator. Applies to BOTH brownfield (reviewing existing requirements) and greenfield (evaluating new requirements before building). Use whenever the user introduces a requirement, constraint, policy, or "we need to" statement. Trigger on phrases like "we need to", "the requirement is", "compliance says", "best practice is", "the team wants", "X is required because", "should we build X", "do we need this feature", or any rule or feature request that lacks a clear named owner. Also trigger as the first step when the [[musk-algorithm]] overview is invoked./musk-step-3-simplify-optimizeStep 3 of the Musk algorithm. Simplify and optimize what survived deletion. Applies to BOTH brownfield (simplify existing survivors) and greenfield (build the simplest thing that works). Use whenever the user wants to optimize performance, refactor code, reduce complexity, improve a DAX measure, tune a query, restructure a pipeline, or choose the simplest viable implementation for a new feature. Trigger on phrases like "optimize this", "make this faster", "refactor", "simplify", "clean up", "reduce complexity", "improve performance", or "build the simplest version". Requires [[musk-step-1-question-requirements]] and [[musk-step-2-delete-parts]] to be complete first. This is the most common entry point where engineers want to skip ahead; refuse./musk-step-4-accelerate-cycle-timeStep 4 of the Musk algorithm. Accelerate cycle time on what survived simplification. BROWNFIELD ONLY. Requires an existing, operational process with measurable cycle times. Not applicable to greenfield work where no cycle exists yet. Use whenever the user wants to reduce latency, shorten build/deploy time, speed up an existing pipeline, reduce time-to-insight on an established workflow, or compress any measured feedback loop. Trigger on phrases like "make this faster", "reduce cycle time", "speed up", "shorten the loop", "reduce latency", "less waiting", or "compress this process". Requires steps 1, 2, and 3 to be complete first./musk-step-5-automateStep 5 of the Musk algorithm. Automate only what survived steps 1 through 4. BROWNFIELD ONLY. Requires the target process to have been operated manually long enough to surface edge cases. Not applicable to greenfield work; for new applications, design for manual operation first, automate later. Use whenever the user wants to automate an existing manual task, build a workflow, create an N8N/Make/Zapier flow, write a script for an established repetitive process, or replace proven manual work with code. Trigger on phrases like "let's automate this", "build an automation for", "create a workflow", "script this", "make this run on a schedule", or "the AI should handle this automatically". The Fremont rule applies - automating too early is the costliest engineering mistake. Requires steps 1 through 4 to be complete first.Other plugins' skills for the same job