# Applying Karpathy-Inspired Guidelines in Monorepos with Multiple Projects

> Learn to apply Karpathy-inspired guidelines effectively within monorepos housing multiple projects. Streamline development workflows and ensure consistency across your codebase.

- Repository: [multica-ai/andrej-karpathy-skills](https://github.com/multica-ai/andrej-karpathy-skills)
- Tags: best-practices
- Published: 2026-04-19

---

**Apply the andrej-karpathy-skills guidelines across monorepo sub-projects by copying or symlinking the `.cursor/rules/karpathy-guidelines.mdc` rule file into each project directory, or by installing the skill into your personal Cursor store for global availability.**

The **multica-ai/andrej-karpathy-skills** repository provides a compact framework for disciplined LLM-assisted coding. When managing multiple projects within a monorepo—such as separate `frontend`, `backend`, and `lib` directories—you can propagate these behavioral guardrails to every sub-project without maintaining duplicate copies of the instructions.

## The Guideline Architecture in a Monorepo Context

The repository defines four principles designed to reduce hallucination and over-engineering:

| Principle | Objective |
|-----------|-----------|
| **Think Before Coding** | Surface assumptions and ask clarifying questions before generating code. |
| **Simplicity First** | Write the minimal code required to solve the task. |
| **Surgical Changes** | Modify only the lines that are strictly necessary. |
| **Goal-Driven Execution** | Define verifiable success criteria and iterate until they are met. |

These principles live in three canonical source files:

- **[`CLAUDE.md`](https://github.com/multica-ai/andrej-karpathy-skills/blob/main/CLAUDE.md)** – The human-readable instruction set used by Claude Code plugins.
- **[`skills/karpathy-guidelines/SKILL.md`](https://github.com/multica-ai/andrej-karpathy-skills/blob/main/skills/karpathy-guidelines/SKILL.md)** – The reusable skill definition for agentic workflows.
- **`.cursor/rules/karpathy-guidelines.mdc`** – The machine-readable Cursor rule that applies automatically when `alwaysApply: true` is set (as implemented in line 7 of [`CURSOR.md`](https://github.com/multica-ai/andrej-karpathy-skills/blob/main/CURSOR.md)).

## Methods for Applying Guidelines to Multiple Projects

A monorepo structure typically isolates teams or services into sub-directories. To ensure every project benefits from the Karpathy guidelines, choose one of the following integration strategies based on your synchronization and isolation requirements.

### Copy the Rule File

Place a physical copy of `.cursor/rules/karpathy-guidelines.mdc` inside each sub-project's `.cursor/rules/` directory. This method guarantees the rule is discovered regardless of how the IDE traverses the file tree, and it allows specific projects to pin to a specific version of the guidelines.

### Create Symbolic Links

Establish a symlink from each sub-project back to the monorepo root's rule file:

```bash

# From within a sub-project directory

mkdir -p .cursor/rules
ln -s ../../.cursor/rules/karpathy-guidelines.mdc .cursor/rules/karpathy-guidelines.mdc

```

This approach maintains a single source of truth on disk. When you update the source file in the root, all linked projects immediately inherit the changes without manual copying.

### Reference from Personal Skill Store

For Cursor users who prefer manual invocation over automatic enforcement, copy [`SKILL.md`](https://github.com/multica-ai/andrej-karpathy-skills/blob/main/SKILL.md) into your global skill directory:

```bash

# Add to personal Cursor skill store

cp skills/karpathy-guidelines/SKILL.md ~/.cursor/skills/karpathy-guidelines.md

```

Once installed, you can trigger the guidelines from any project—including those outside the monorepo—via the Cursor UI (`⌘+Shift+P → Apply Skill → karpathy-guidelines`).

## Workflow for Synchronizing Updates

When modifying the principles, you must propagate changes to all three artefacts to prevent divergence:

1. **Edit [`CLAUDE.md`](https://github.com/multica-ai/andrej-karpathy-skills/blob/main/CLAUDE.md)** to update the human-readable instructions.
2. **Synchronize [`SKILL.md`](https://github.com/multica-ai/andrej-karpathy-skills/blob/main/SKILL.md)** to reflect the same principles in the skill definition.
3. **Commit the updated `.cursor/rules/karpathy-guidelines.mdc`** to ensure auto-applied rules remain current.

The repository's [`CURSOR.md`](https://github.com/multica-ai/andrej-karpathy-skills/blob/main/CURSOR.md) explicitly warns contributors to keep these files consistent (see lines 26-28).

## Implementation Examples

### Distribute Guidelines to a New Service

When adding a `payment-service` to your monorepo, run:

```bash

# From repository root

mkdir -p payment-service/.cursor/rules
cp .cursor/rules/karpathy-guidelines.mdc payment-service/.cursor/rules/
git add payment-service/.cursor/rules/karpathy-guidelines.mdc

```

### Link Existing Projects to Root Rules

For a Unix-based monorepo with `frontend` and `backend` projects:

```bash

# Create symlinks in each project

for dir in frontend backend; do
  mkdir -p "$dir/.cursor/rules"
  ln -s "../../.cursor/rules/karpathy-guidelines.mdc" "$dir/.cursor/rules/karpathy-guidelines.mdc"
done

```

### Install for Claude Code Users

If your team uses Claude Code rather than Cursor, apply the guidelines via the plugin system:

```bash

# One-time setup per developer

/plugin marketplace add forrestchang/andrej-karpathy-skills

# Per-project installation

cd /path/to/monorepo-subproject
/plugin install andrej-karpathy-skills@karpathy-skills

```

## Summary

- **Centralize definitions** in [`CLAUDE.md`](https://github.com/multica-ai/andrej-karpathy-skills/blob/main/CLAUDE.md), [`SKILL.md`](https://github.com/multica-ai/andrej-karpathy-skills/blob/main/SKILL.md), and `.cursor/rules/karpathy-guidelines.mdc` to maintain a single source of truth.
- **Copy or symlink** the `.cursor/rules/karpathy-guidelines.mdc` file into each monorepo sub-project to enforce guidelines automatically.
- **Use the personal skill store** for manual, on-demand application across any project without file duplication.
- **Synchronize all three files** when updating principles to prevent drift between human-readable, skill, and rule representations.

## Frequently Asked Questions

### Can I apply these guidelines selectively to specific projects?

Yes. By copying the rule file only into specific sub-directories rather than the root, you restrict the guidelines to designated projects. Alternatively, omit the `alwaysApply: true` directive in the rule file and manually invoke the skill via the Cursor UI for selective application.

### What happens if the source files update?

If you use **symbolic links**, all projects immediately inherit the updates because they reference the same physical file. If you use **copied files**, you must re-run the copy command or a sync script to propagate updates. The repository recommends checking [`CURSOR.md`](https://github.com/multica-ai/andrej-karpathy-skills/blob/main/CURSOR.md) lines 26-28 for synchronization workflows.

### Do I need Cursor installed to use these guidelines?

No. While the `.cursor/rules/karpathy-guidelines.mdc` file targets Cursor's rule engine, the [`CLAUDE.md`](https://github.com/multica-ai/andrej-karpathy-skills/blob/main/CLAUDE.md) file serves Claude Code users, and the [`SKILL.md`](https://github.com/multica-ai/andrej-karpathy-skills/blob/main/SKILL.md) file works with any agent supporting the skill protocol. You can manually read the principles from [`CLAUDE.md`](https://github.com/multica-ai/andrej-karpathy-skills/blob/main/CLAUDE.md) and apply them regardless of IDE.

### How do the CLAUDE.md and SKILL.md files differ?

[`CLAUDE.md`](https://github.com/multica-ai/andrej-karpathy-skills/blob/main/CLAUDE.md) contains the full human-readable instruction set optimized for Claude Code's plugin system, including conversational context and detailed explanations. [`SKILL.md`](https://github.com/multica-ai/andrej-karpathy-skills/blob/main/SKILL.md) is a condensed, structured definition designed for reuse across different agentic platforms as a modular skill. Both contain the same four principles but differ in formatting and verbosity.