> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polymet.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Project rules

> Write standing instructions once, and the agent follows them on every generation in the project.

Project rules are instructions the agent follows every time it works on your project. Write "Use sentence case for every button" once, instead of repeating it in every prompt.

Every plan has them.

![Project Settings on the Rules tab, showing rules.md and design.md with their Create file buttons](https://mintcdn.com/polymet/TfIzLh80_L4bW9xQ/images/docs/canvas/project-rules-tab.png?fit=max\&auto=format\&n=TfIzLh80_L4bW9xQ\&q=85\&s=89a4b5be6d4a935d959cba99ef364bbf)

## Two files

| File | Put in it |
| - | - |
| **rules.md** | How the agent should work on this project: product facts, naming, copy style, what never to change |
| **design.md** | How the project should look: layout habits, spacing, which components to use for what |

Both are plain text files in your project, in the `.polymet` folder. You write them in Markdown.

## Create a file

1. Click the **Project settings** icon next to your project's name.
2. Open **Rules**.
3. Click **Create file** next to **rules.md** or **design.md**.
4. The file opens in the code editor with a heading. Write your rules under it.
5. Click **Save**, then **Save** in the dialog.

Until you save, the Rules tab shows **Continue editing**. After you save, it shows **Open in editor**.

You can create files only on the latest version. On an older one, **Create file** is off and its tooltip says "Switch to the latest version to create files."

## Write rules that work

* One rule per line, as a bullet.
* Say what to do, with a name or a number. "Each page has at most one primary button" beats "Keep pages clean".
* Keep it to rules that hold for the whole project. Put one-off requests in the prompt.

An example **rules.md**:

```markdown theme={null}
# Project Rules

- The product is Ledger, a budgeting app for freelancers.
- Write copy in sentence case. Never use exclamation marks.
- Every table has an empty state with one action.
- Do not change the navigation bar unless I ask.
- Use mock data with realistic names and amounts in euros.
```

## With a design system

If the project is linked to a design system, the agent reads the design system's **design.md** first, then yours on top. Where the two disagree, yours wins.

Design guidance is capped at 10,000 characters in total. When both files together run over, the design system's part is shortened first.

## Related

* [Write better prompts](https://docs.polymet.ai/canvas/prompting-guide.md) — what goes in a rule and what goes in a prompt
* [Edit code](https://docs.polymet.ai/canvas/code-editor.md) — the editor the rules files open in
* [Themes](https://docs.polymet.ai/canvas/themes.md) — colors and fonts belong in the theme, not in rules
* [Use a design system in a project](https://docs.polymet.ai/design-systems/use.md) — link the design system whose guidance you build on


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.