andrej-karpathy-skills  by forrestchang

LLM code generation guidelines for enhanced reliability

Created 1 month ago
6,802 stars

Top 7.5% on SourcePulse

GitHubView on GitHub
Project Summary

This repository offers a CLAUDE.md file containing a set of guidelines designed to mitigate common pitfalls observed in Large Language Model (LLM) code generation. Inspired by Andrej Karpathy's analysis, these principles address issues such as LLMs making incorrect assumptions, overcomplicating solutions, performing unverified code modifications, and failing to manage confusion. The primary benefit is enabling users to elicit more reliable, simpler, and verifiable code from LLMs, particularly useful for developers integrating AI assistance into their workflows.

How It Works

The core methodology is built upon four guiding principles: "Think Before Coding," "Simplicity First," "Surgical Changes," and "Goal-Driven Execution." "Think Before Coding" combats hidden confusion and unwarranted assumptions by mandating explicit reasoning, clear articulation of assumptions, presentation of alternative interpretations, and proactive identification of ambiguities. "Simplicity First" counters overengineering by prioritizing minimal, problem-specific code, eschewing speculative features, unnecessary abstractions, and excessive configurability. "Surgical Changes" enforces precision, ensuring that modifications strictly target the requested changes without unintended side effects on adjacent code, comments, or formatting. Lastly, "Goal-Driven Execution" capitalizes on LLMs' iterative capabilities by transforming imperative instructions into declarative, verifiable success criteria, such as tests, enabling autonomous refinement and validation.

Quick Start & Requirements

Installation is straightforward: use the recommended CLI command npx skills add forrestchang/andrej-karpathy-skills. Alternatively, the CLAUDE.md file can be fetched directly using curl for integration into new or existing projects. No specific software prerequisites beyond npx (which comes with Node.js/npm) are detailed for applying these guidelines.

Highlighted Details

  • The guidelines are directly derived from Andrej Karpathy's observations on LLM coding behaviors and pitfalls.
  • The entire set of principles is consolidated into a single CLAUDE.md file for easy integration into LLM prompts.
  • A key insight highlights the LLM's proficiency in iterative refinement when provided with clear, verifiable success criteria, transforming instructions into declarative goals.
  • The guidelines are designed for customization and can be merged with project-specific coding standards and instructions.

Maintenance & Community

The provided README does not contain specific information regarding maintainers, community channels (such as Discord or Slack), sponsorships, or a public roadmap for the project.

Licensing & Compatibility

This project is distributed under the MIT License. This permissive open-source license generally allows for broad usage, including commercial applications and integration into closed-source software, with minimal restrictions.

Limitations & Caveats

These guidelines intentionally prioritize caution and thoroughness over rapid execution. For exceedingly simple tasks, such as minor typo corrections or straightforward one-line code adjustments, users are encouraged to exercise discretion and apply judgment rather than strictly adhering to every principle, to avoid introducing unnecessary overhead.

Health Check
Last Commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
12
Issues (30d)
12
Star History
6,990 stars in the last 30 days

Explore Similar Projects

Starred by John Resig John Resig(Author of jQuery; Chief Software Architect at Khan Academy) and Didier Lopes Didier Lopes(Founder of OpenBB).

CCPlugins by brennercruvinel

0.3%
3k
Claude Code CLI enhancement framework
Created 7 months ago
Updated 4 months ago
Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Travis Fischer Travis Fischer(Founder of Agentic), and
6 more.

AlphaCodium by Codium-ai

0.1%
4k
Code generation research paper implementation
Created 2 years ago
Updated 1 year ago
Starred by Eric Zhu Eric Zhu(Coauthor of AutoGen; Research Scientist at Microsoft Research) and Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems").

PromptWizard by microsoft

0.8%
4k
Agent-driven framework for task-aware prompt optimization
Created 1 year ago
Updated 4 months ago
Feedback? Help us improve.