229K-Star Open Source Project: One Rule File Makes AI Coding Behave Better

A 229K-star GitHub repo uses four rules to constrain AI coding assistants and reduce surprise rewrites.
A GitHub repository has earned over 229,000 stars, and its core is not code but a rule list written for AI coding assistants. Written by Forrest Chang and inspired by Andrej Karpathy's complaints about how AI writes code, it distills four habits: ask when the request is unclear, use minimal code, don't touch unrequested files, and clearly define "done" with continuous testing. The goal is fewer surprise rewrites, so developers can delegate with confidence. It can be used as a Claude Code plugin (two commands) or a Cursor rule file.
One File, Embraced by Forty Thousand Developers
A GitHub repository has earned over 229,000 stars, but its core file isn't code — it's a rule list written for AI coding assistants. The list distills four habits aimed at reducing the surprise rewrites that occur when AI edits a project.
According to the video, these habits stem from Andrej Karpathy's complaints about how AI writes code, while the file's actual author is another developer, Forrest Chang. This combination of "big-name insight + community practice" turned a simple text file into a phenomenon-level project.

Four Habits: Making AI Coding Assistants More Controllable
The core of the rule file is four behavioral guidelines, each targeting a common pain point in AI programming.
Habit 1: Stop and Ask When Unclear
When the user's request is ambiguous, the AI should stop guessing and proactively ask. This avoids generating masses of useless code based on wrong assumptions.

Habit 2: Complete the Task with the Minimum Amount of Code
AI tends to over-engineer, and this rule requires it to choose the smallest implementation that solves the problem.
Over-engineering: In the context of AI programming, this refers to the model's tendency to introduce unnecessary abstractions, design patterns, configuration options, or third-party libraries, leading to code bloat and reduced readability. For example, a simple sorting requirement might be implemented as a complex structure involving a strategy pattern and factory classes. This tendency stems from the abundance of "complete project" demonstrations in training data and the model's preference for "generality." The minimal implementation principle requires the AI to prioritize standard libraries, built-in functions, or direct logic, adding complexity only when extension is clearly needed, thereby reducing maintenance costs and review burden.
Habit 3: Don't Touch Files That Weren't Requested
AI often "conveniently" modifies unrelated files, causing unexpected side effects. This rule limits the scope of changes.
Habit 4: Clearly Define "Done" and Keep Testing
AI needs to know clearly what counts as task completion and to keep testing until it passes. This reduces deliveries that "look done" but actually have problems.
Goal: Fewer Surprise Rewrites
The common goal of these rules is to reduce surprise rewrites when AI edits a project. When AI behaves better, developers can hand off tasks with more confidence instead of spending large amounts of time reviewing and fixing.

How to Use: Two Commands or One Rule File
The project offers convenient ways to use it: as a Claude Code plugin, it can be added with just two commands; for Cursor, there is also a standalone rule file. Essentially, it is a reusable guide to AI behavior.
This lightweight approach has become popular because it doesn't rely on complex tools but directly constrains AI behavior through natural-language rules. For developers who use AI programming every day, these four habits offer immediately usable directions for improvement.
Claude Code plugin mechanism: Claude Code is a command-line AI coding assistant launched by Anthropic that supports extending behavior through plugins. A plugin is essentially a set of preset configuration files or scripts that, once installed, are automatically injected into Claude Code's context and influence its decision logic. Users only need to run two commands like claude plugin add <repository URL> to mount the rule file as a persistent behavioral guideline, without manually copying prompts. This lowers the barrier to use and also allows the rules to be updated independently with the project.
Cursor rule file (.cursorrules): Cursor is an AI code editor based on VS Code, and its project-level rule file is usually named .cursorrules, placed in the repository root. Cursor reads the contents of this file on every conversation or code generation as part of its system prompt. Therefore, writing the four habits into .cursorrules lets Cursor automatically follow them when editing a project, similar to equipping the AI with a "team coding standard."
One-line Summary
A GitHub repository with 229K stars uses four rules to constrain AI coding assistants and reduce surprise rewrites.
Paragraph Summary
A GitHub repository has earned over 229,000 stars, and its core is not code but a rule list written for AI coding assistants. Written by Forrest Chang and inspired by Andrej Karpathy's complaints about how AI writes code, the list distills four habits: stop and ask when the request is unclear, complete the task with the minimum amount of code, don't touch files that weren't requested, and clearly define "done" and keep testing. The common goal of the four rules is to reduce surprise rewrites when AI edits a project, so developers can entrust tasks with more confidence. The project can be used as a Claude Code plugin (installed with two commands) or a Cursor rule file, and it has quickly become popular for its lightweight, natural-language constraints, offering immediately usable directions for improvement to developers who use AI programming daily.
Related articles
Tech FrontiersMuJoCo: An Analysis of DeepMind's Open-Source General-Purpose Physics Simulator
An in-depth analysis of Google DeepMind's open-source physics simulator MuJoCo: high-performance C++ kernel, MJCF modeling format, contact solving principles, MJX GPU acceleration, and robot reinforcement learning use cases.
Tech FrontiersClaude API Quick Start: The Official Quickstarts Project Collection
Anthropic's official claude-quickstarts project collection helps developers quickly build deployable apps with the Claude API. Nearly 20k stars, Python-based, great for beginners and prototyping.
Tech FrontiersAI Agents Connecting Directly to APIs: Which Calls Can Be Safely Allowed?
AI agents can call any API, but the real challenge is deciding which calls can be safely allowed. This article analyzes allowance decisions from three dimensions—intent matching, least privilege, and controllable impact—and argues that the control layer should sit outside the agent, combined with audit traceability to build a trustworthy API call governance mechanism.