Guides > Configuration
How To: Set Coding Best Practices
# How To: Set Coding Best Practices import VideoEmbed from '@components/VideoEmbed.astro'; import { Steps } from '@astrojs/starlight/components'; Learn how to use Warp’s Rules to enforce coding style, documentation quality, and consistency across projects. <VideoEmbed url="https://youtu.be/AuM2OIvXlnY?si=rxnQH5TH-5vj0LMf" /> --- ## Intro This tutorial teaches you how to create coding Rules that make AI follow your team’s **best practices** automatically.\ \ By specifying formatting, style preferences, and documentation standards, Warp ensures consistent, high-quality code across your repositories. --- <Steps> 1. #### The Problem Developers often have different habits — formatting styles, TypeScript conventions, or comment quality.\ Without clear rules, AI-generated code can be inconsistent or hard to maintain. 2. #### The Rule Setup Define Rules that enforce formatting, type preferences, and doc quality. **Example Rule** ``` Rule: Code Authoring Standards - Always format and check work before returning results. - Prefer `types` over `interfaces` in TypeScript. - Apply concise, human-readable JS Docs using the Hemingway test. ``` :::note The **Hemingway test** ensures code comments are simple and clear — short sentences, active voice, and no unnecessary complexity. ::: 3. #### Benefits * Encourages readable, maintainable code * Improves documentation clarity * Prevents style drift across AI contributions </Steps>Use Warp Rules to enforce coding style, TypeScript conventions, and documentation quality across AI-generated code.
Learn how to use Warp’s Rules to enforce coding style, documentation quality, and consistency across projects.
This tutorial teaches you how to create coding Rules that make AI follow your team’s best practices automatically.
By specifying formatting, style preferences, and documentation standards, Warp ensures consistent, high-quality code across your repositories.
-
The Problem
Section titled “The Problem”Developers often have different habits — formatting styles, TypeScript conventions, or comment quality.
Without clear rules, AI-generated code can be inconsistent or hard to maintain. -
The Rule Setup
Section titled “The Rule Setup”Define Rules that enforce formatting, type preferences, and doc quality.
Example Rule
Rule: Code Authoring Standards- Always format and check work before returning results.- Prefer `types` over `interfaces` in TypeScript.- Apply concise, human-readable JS Docs using the Hemingway test. -
Benefits
Section titled “Benefits”- Encourages readable, maintainable code
- Improves documentation clarity
- Prevents style drift across AI contributions