/elon-musk-algorithm-skills:musk-step-5-automatefrom elon-musk-algorithm-skills
Step 5 of the Musk algorithm: automate only what survived steps 1-4. For brownfield manual tasks only. Use when automating existing workflows, building N8N/Make/Zapier flows, or scripting repetitive processes.
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.
Last. The Fremont rule.
Part of the [[musk-algorithm]]. Fifth and final in the strict order.
Before this step, verify in the conversation or diff:
If any is absent, stop. Run the missing step first. The Fremont rule says automating before this is complete is the costliest engineering mistake.
The Tesla "alien dreadnought" production line at Fremont was Musk's most public lesson. He attempted to automate the assembly line first. The automation encoded assumptions that turned out to be wrong. Tesla had to rip out the automation, run the line manually long enough to learn the edge cases, simplify the process, and then re-automate only what had proven its shape.
The Fremont rule, stated as a principle: automate only what has been run manually long enough to surface every edge case the automation must handle. Otherwise the automation encodes wrong assumptions, becomes expensive to remove, and creates false confidence that the system "works" when it has only deferred its failures.
What is being automated: [specific step that survived 1-4]
Survived steps:
- Step 1: requirement [steelmanned, named owner]
- Step 2: deletion list complete, add-back audited
- Step 3: complexity delta [measured]
- Step 4: manual cycle time measured [duration]
Edge cases discovered during manual execution:
- [edge case 1]: [how automation handles it]
- [edge case 2]: [how automation handles it]
- ...
Inputs: [precise]
Outputs: [precise]
Success criteria: [verifiable]
Failure modes: [named, with detection]
Explicitly NOT automated: [list, with reasoning]
Reversibility plan:
- Trigger to rip out: [conditions under which we revert to manual]
- Manual fallback: [how the work continues without the automation]
- Estimated rip-out cost: [effort, time, blast radius]
Before any automation work begins, the team or individual must be able to answer:
If any answer is missing, the automation is premature.
| Hardware automation | Software equivalent |
|---|---|
| Robot arm on assembly line | N8N / Make / Zapier flow, scheduled job, cron |
| Conveyor system | Pipeline orchestrator (Airflow, Azure Data Factory, Prefect) |
| Vision inspection | LLM-based extraction, OCR pipeline |
| Self-correcting machine | Agent loop with retry / verification |
Critical for AI automations: LLM-based automations are especially vulnerable to the Fremont failure. The edge cases that humans handle implicitly are exactly what LLMs miss. Run the work manually with a structured log first. Only automate the patterns that prove stable.
This step is done when:
A system that has been through the full [[musk-algorithm]] has:
If the system does not have all six properties, the algorithm was not completed. Return to the earliest incomplete step.
What SKILL.md sets; muted values are Claude Code's defaults
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-2-delete-partsStep 2 of the Musk algorithm. Delete aggressively. PRIMARILY BROWNFIELD - use whenever the user is reviewing an existing system, codebase, process, set of features, dashboard, document collection, or any inventory of accumulated parts. Trigger on phrases like "clean this up", "we have too many", "should we keep", "is this still used", "let's prune", "what can we remove", or any review of accumulated complexity. The 10% add-back rule is the calibration signal. GREENFIELD ANALOG - "default to no" on every speculative abstraction, configurability hook, or feature that lacks a named requirement from step 1. Requires [[musk-step-1-question-requirements]] to be complete first./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.Other plugins' skills for the same job