Skip to content

feat: pre-flight discipline rule (karpathy principles)#46

Merged
rohitg00 merged 1 commit intomainfrom
feat/karpathy-principles
Apr 16, 2026
Merged

feat: pre-flight discipline rule (karpathy principles)#46
rohitg00 merged 1 commit intomainfrom
feat/karpathy-principles

Conversation

@rohitg00
Copy link
Copy Markdown
Owner

@rohitg00 rohitg00 commented Apr 14, 2026

Summary

Adds a fifth always-on rule that encodes the four upstream-failure preventions Andrej Karpathy named for LLM coding: silent assumptions, overcomplicated diffs, drive-by edits, vague success criteria.

Pro-workflow already quotes Karpathy's 80/20 line in SKILL.md but none of the four behavioral principles were encoded as rules. The closest existing rules — quality-gates and self-correction — both fire after the mistake. This one fires before.

Rule Prevents
Surface, don't assume Wrong interpretation, hidden confusion, missing tradeoffs
Minimum viable code 200-line diffs that should be 50, speculative abstractions
Stay in your lane Drive-by refactors, "improvements" to adjacent code
Verifiable goals Endless re-clarification, "make it work" loops

Changes

  • New: rules/pre-flight-discipline.mdc (alwaysApply: true, ~60 lines)
  • Edit: skills/pro-workflow/SKILL.md — adds §1b "Pre-Flight Discipline" between Self-Correction (§1) and Worktrees (§2), with a CLAUDE.md snippet and a pointer to the rule file
  • No changes to existing rules, agents, hooks, commands, or contexts

Attribution

Adapted from forrestchang/andrej-karpathy-skills (MIT) — single-skill repo of the same four principles. Reframed lightly to match pro-workflow's voice (pre-flight-discipline vs. karpathy-guidelines, principle headings rewritten) but the substance is intentionally faithful. Source link preserved in both files.

Test plan

  • rules/pre-flight-discipline.mdc loads as an always-on rule (frontmatter parses, alwaysApply: true)
  • SKILL.md renders cleanly with the new §1b section
  • No links broken, no duplicated content with existing rules
  • Manual eat-the-dog-food check: this PR itself follows rule ci: Bump actions/setup-node from 4 to 6 #3 (every changed line traces to "add karpathy principles") — no drive-by edits to other files

Summary by CodeRabbit

  • Documentation
    • Added comprehensive development guidelines to improve code quality and maintainability.
    • Enhanced workflow documentation with best practices for requirement scoping, assumption validation, and verification-driven development.

Encodes the four upstream-failure preventions Karpathy named: silent
assumptions, overcomplicated diffs, drive-by edits, vague success
criteria. Self-correction catches mistakes after the fact - this
catches them before.

Adds rules/pre-flight-discipline.mdc (alwaysApply: true) and a §1b
cross-reference in SKILL.md so it sits next to self-correction in
the narrative. No changes to existing rules or agents.

Adapted from forrestchang/andrej-karpathy-skills (MIT) with light
reframing to match pro-workflow's voice and structure.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

📝 Walkthrough

Walkthrough

This PR introduces pre-flight discipline guidelines by creating a new rules file (rules/pre-flight-discipline.mdc) containing quality gates for code execution, and updates the pro-workflow skill documentation to reference and explain these guidelines across four core principles: surfacing assumptions, minimizing scope, avoiding unrelated refactors, and using verifiable success criteria.

Changes

Cohort / File(s) Summary
New Rules File
rules/pre-flight-discipline.mdc
New guidelines document defining four quality gates for code execution: surface assumptions rather than assume silently, write minimum viable code, stay strictly in scope, and prefer verifiable goals over imperatives. Includes tradeoff notes and attribution.
Pro-Workflow Skill Documentation
skills/pro-workflow/SKILL.md
Added "1b. Pre-Flight Discipline" section after Self-Correction Loop, presenting four pre-coding rules in table format, referencing external resources, and linking to the new rules file with alwaysApply: true. Includes guidance on stating assumptions, avoiding drive-by edits, and translating imperatives into verifiable goals.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 With whiskers twitching, I check twice—
No silent leaps, just measured advice,
Surface the truth, keep changes tight,
Verify each step; let goals guide the flight!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a pre-flight discipline rule based on Karpathy principles. It is concise, specific, and directly reflects the primary changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/karpathy-principles

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
skills/pro-workflow/SKILL.md (1)

82-87: Consider adding a reminder about minimum viable code.

The CLAUDE.md snippet covers rules 1, 3, and 4, but omits rule 2 ("Minimum viable code"). While the full rules are always-on via the .mdc file, adding a brief mention could reinforce this key principle.

💡 Proposed addition
 ## Pre-Flight Discipline
 Before coding: state assumptions, present ambiguity, push back if simpler exists.
+Keep changes minimal - no abstractions or features beyond the request.
 Every changed line traces to the request - no drive-by edits.
 Convert imperatives to verifiable goals: "fix bug" → "failing test → make it pass".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/pro-workflow/SKILL.md` around lines 82 - 87, Add a short reminder
about "Minimum viable code" to the "Pre-Flight Discipline" section: edit the
block under the "## Pre-Flight Discipline" header and append or insert a concise
sentence (one line) that states developers should implement the smallest change
that satisfies the failing behavior or test (e.g., "Prefer minimum viable code:
implement the smallest, testable change to satisfy the requirement"). Ensure
this new line sits alongside the existing lines about assumptions/ambiguity and
converting imperatives to verifiable goals so the principle is visible in the
same guidance paragraph.
rules/pre-flight-discipline.mdc (1)

21-21: Consider clarifying the error handling guideline.

"No error handling for scenarios that cannot happen" could be misinterpreted as discouraging defensive error handling in production code. While the intent (preventing over-engineering of impossible scenarios) is clear in context, consider clarifying to distinguish between truly impossible cases and merely unlikely errors.

📝 Potential clarification
-- No error handling for scenarios that cannot happen.
+- No error handling for scenarios that are logically impossible (e.g., null-checking hardcoded constants).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@skills/pro-workflow/SKILL.md`:
- Around line 82-87: Add a short reminder about "Minimum viable code" to the
"Pre-Flight Discipline" section: edit the block under the "## Pre-Flight
Discipline" header and append or insert a concise sentence (one line) that
states developers should implement the smallest change that satisfies the
failing behavior or test (e.g., "Prefer minimum viable code: implement the
smallest, testable change to satisfy the requirement"). Ensure this new line
sits alongside the existing lines about assumptions/ambiguity and converting
imperatives to verifiable goals so the principle is visible in the same guidance
paragraph.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e417f4e3-5c18-42f3-8b69-4072133759e7

📥 Commits

Reviewing files that changed from the base of the PR and between 1de1554 and 1119ae2.

📒 Files selected for processing (2)
  • rules/pre-flight-discipline.mdc
  • skills/pro-workflow/SKILL.md

@rohitg00 rohitg00 merged commit f460dd3 into main Apr 16, 2026
5 checks passed
@rohitg00 rohitg00 deleted the feat/karpathy-principles branch April 16, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant