# Create Rules for agents

> Create reusable Rules in Warp to encode team conventions — like Dockerfile patterns or dependency management — so agents follow your standards.

- 网址：https://funcoding.ai/agents/warp/guides/configuration/creating-rules-for-agents/
- 来源：Warp 官方文档原文（英文），MIT 许可，同步于 2026-10-11
- 官方原文：https://docs.warp.dev/guides/configuration/creating-rules-for-agents/

---
_Speaker: Maggie — Engineer at Warp_

### 1. Starting with Agent Mode evals

I’m currently adding **Evals** (short for evaluations) to test a new feature I’ve been building.

Warp quickly surfaces helpful context — like notebooks and internal docs — written by teammates on how to run Evals.\
\
This makes onboarding onto new tasks fast and collaborative.

---

### 2. Adding a Rust syntax eval

Next, I want to add an Eval that tests for Rust syntax errors.\
So I ask Warp to update the Dockerfile to include Rust.

However, the generated Dockerfile installs Rust differently than I wanted.\
It also includes `gcc` and `python` via a single `apt-get` line, which doesn’t follow our internal conventions.

---

### 3. Stashing changes and creating a Rule

Instead of fixing this manually every time, I decide to stash the current changes and create a reusable Rule that encodes our convention:

> Rule Example:\
> “Always use `apt-get` to install packages and follow the same pattern used for installing Python and GCC.”

This way, future sessions — and even other teammates — can automatically apply the same standard.

---

### 4. Applying the Rule

Now, I just ask Warp’s Agent Mode to try again!

Warp re-runs the request, follows the new rule, and correctly adds Rust with the right syntax. The code now matches our conventions.
