From forge
Applies Andrej Karpathy's four principles to prevent over-engineering, silent assumptions, scope creep, and unfocused execution in Forge agents. Useful when building or reviewing code to enforce behavioral guardrails.
How this skill is triggered — by the user, by Claude, or both
Slash command
/forge:karpathy-guardrailsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Behavioral guardrails that all Forge agents MUST follow during execution. These four principles prevent the most common failure modes in AI-generated code: silent assumptions, over-engineering, scope creep, and unfocused execution.
Behavioral guardrails that all Forge agents MUST follow during execution. These four principles prevent the most common failure modes in AI-generated code: silent assumptions, over-engineering, scope creep, and unfocused execution.
These guardrails are referenced by forge-executor, forge-reviewer, and forge-planner agents. They are not optional.
Rule: Surface assumptions explicitly. Never hide confusion behind code.
Anti-pattern: Implementing "export users" without asking about scope, format, fields, or volume. Correct pattern: Flag ambiguity, present interpretations, get clarification.
Rule: Write the minimum code that solves only the stated problem.
Anti-pattern: Building abstract strategy patterns and dataclass configurations for a simple discount calculator. Correct pattern: Three lines of direct logic that solve the stated requirement.
Token impact: Simpler code uses fewer tokens to generate, review, and verify. Over-engineering wastes budget across the entire pipeline (executor + reviewer + verifier).
Rule: Modify only what is necessary to fulfill the task's requirements.
Anti-pattern: Fixing an empty email validation bug while also adding username length validation, reformatting the file, and upgrading the test framework. Correct pattern: Fix only the email validation. One bug, one fix, one commit.
Reviewer enforcement: The forge-reviewer MUST flag any changes that do not trace to an acceptance criterion as IMPORTANT (over-engineering).
Rule: Transform vague tasks into verifiable success criteria before writing code.
Why this works: LLMs excel at looping until specific goals are met. Clear success criteria enable independent verification and reduce back-and-forth clarification.
When these guardrails are working:
npx claudepluginhub lucasduys/forge --plugin forgeEnforces Karpathy guidelines to prevent LLM coding errors: read before writing, surgical changes only, verify assumptions, define success upfront. Use for feature implementation, code modifications, or scope discipline.
Reduces common LLM coding mistakes: think before coding, favor simplicity, make surgical changes, define verifiable success criteria. Use when writing, reviewing, or refactoring code.
Applies Karpathy guidelines to reduce LLM coding mistakes: think before coding, prioritize simplicity, make surgical changes, and define verifiable success criteria when writing, reviewing, or refactoring code.