Rules for AI

This section includes Rules for AI to help you write code that meets Defra’s development standards.

Most Artificial Intelligence Coding Assistants (AICAs) have the concept of rules for AI. AI Rules define consistent and repeatable standards, patterns and conventions across your codebase. Project Rules are committed to version control along with your codebase for consistent use across teams.

For Cursor, the documentation can be found here (opens in new tab), which explains AI Rules in further detail.

Some examples of rules for the programming languages and standards used within Defra are given below.

Node.js

Python