---
name: rules-file
description: Write a short house-rules file (CLAUDE.md) for a project, so an AI assistant backs up before big changes, asks before deleting anything, keeps passwords out of the chat and explains what it changed. Use when someone is starting to work on a project with Claude or another AI assistant and there is no rules file yet, or the one they have is thin.
heading: A rules file for Claude on your project.
summary: Ten minutes that makes every later session safer. Claude reads the file at the start of each session and follows it, so the rules you'd otherwise repeat get written down once.
time: About 10 minutes
timeISO: PT10M
needs: A project folder and Claude Code, or any assistant that can write files
---

## What this does

Claude Code reads a file called `CLAUDE.md` at the start of every session in a project. Whatever it says, Claude treats as standing instructions. Most people starting out don't have one, so Claude has to guess how careful to be.

This skill writes one with you. It looks at your project, asks a few questions, and drafts a short file in plain words. Nothing is written until you've read it and said yes.

## How to undo it

Delete `CLAUDE.md`. Nothing else is changed.

## When this stops being a small job

If your project is several folders or repositories, or it runs a live shop or handles customer data, the rules need more thought than ten minutes. Ask for help.

## Instructions for the assistant

You are helping someone who is fairly new to working with AI on their own project. Be plain, be brief, and don't change anything until they agree.

### 1. Look before touching anything

Look at the project folder. Work out what it is, how it's built, how it runs, where it's likely hosted, and whether it uses git. Check whether a `CLAUDE.md` or `AGENTS.md` already exists.

Don't edit or create any files in this step. Tell the person what you found in three or four plain sentences.

### 2. Ask a few questions

Ask these, as one numbered list, and wait for the answers:

1. Is this project live anywhere? If so, where?
2. How do changes get from here to the live version, if they do?
3. Is there a copy for testing, separate from the live one?
4. Is there anything you must never touch or delete?
5. How do you like changes explained: one line each, or more detail?

### 3. Draft the file

Write a draft `CLAUDE.md` of no more than 40 lines, in plain words the person can read. It has two parts.

**About this project**, from steps 1 and 2: what it is, where it runs, how changes go live, and anything that must never be touched.

**House rules**, adapted to what you learned:

- Before a change that touches more than one file, say what you're about to do and wait for a yes.
- Before anything risky, make sure there's a way back: a git commit, or a backup the person confirms.
- Never delete a file, a database record or a setting without asking first.
- Try changes on the test copy before the live one. If there's no test copy, say so each time.
- Never ask for a password, API key or token to be pasted into the chat. Say where it should go instead.
- After each change, say what changed, in one sentence per file.
- If a job turns out bigger or riskier than it looked, stop and say so before carrying on.

Leave out any rule that doesn't fit. For example, drop the test-copy rule if they've said there will never be one, and note that instead.

### 4. Show it, then write it

Show the whole draft and ask whether to save it. Only write the file after a yes.

If a `CLAUDE.md` already exists, don't replace it. Show the lines you'd add and where, and add only those.

If they use other AI tools as well, offer to save the same rules as `AGENTS.md`, which many other tools read.

### 5. Check it worked

Read the saved file back and confirm it's in the project's top folder. Tell the person that Claude Code picks it up at the start of the next session, and that they can edit it any time in a text editor.

If the project is published by uploading the whole folder, tell them the file will go up too and be readable by anyone at `/CLAUDE.md` on their site. It holds nothing secret, but they may want to leave it out of the upload.

Finish with one line: what the file is called, where it is, and how to undo it.
