Home › Any stack › Universal vibe-coding guardrails

Universal vibe-coding guardrails

Always-on Cursor rules that keep any AI agent careful: plan first, small diffs, verify, never fake it.

CursorAny stack

How to use

Save this as .cursor/rules/guardrails.mdc in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

.cursor/rules/guardrails.mdcDownload  
---
description: Universal agent guardrails
alwaysApply: true
---

# Guardrails for AI coding agents

## Plan
- Restate the goal in one sentence. If requirements are ambiguous, ask before coding.
- For changes touching more than 3 files, write a short plan first.

## Edit
- Read the files you will change before editing them.
- Make the smallest diff that works. Don't refactor or rename unrelated code.
- Match existing patterns, naming, and libraries in the repo. Don't add dependencies silently.
- Never delete tests to make them pass. Never hardcode values to satisfy a test.

## Verify
- Run the project's lint, typecheck, and tests. Report real output, not assumptions.
- If you couldn't run something, say so plainly.

## Safety
- Never commit secrets or print `.env` contents.
- Ask before destructive actions: dropping data, force-pushing, deleting files, running migrations on shared DBs.

## Report
- End with: what changed, files touched, how it was verified, and any follow-ups.

More: all Any stack rules · all Cursor rules

Related rules

Jest testing rules

Cursor rules for Jest 30 test suites in TypeScript: structure, mocking boundaries, timers, and async tests.

CursorTesting

Web performance (Core Web Vitals) rules

Cursor rules for keeping web apps fast: Core Web Vitals (LCP, INP, CLS), bundle size, images, and measuring first.

CursorWeb performance

Playwright end-to-end testing rules

Cursor rules for Playwright Test (TypeScript): resilient locators, web-first assertions, fixtures, and no flaky waits.

CursorTesting

Safe refactoring rules

Cursor rules for behavior-preserving refactors: small steps, tests first, no mixed feature changes, and clear diffs.

CursorAgent workflows

Web accessibility (WCAG 2.2) rules

Windsurf rules for building accessible web UIs to WCAG 2.2 AA: semantics, keyboard, focus, contrast, and testing.

WindsurfAccessibility

Code review Copilot instructions

Copilot instructions focused on pull request review: what to flag, severity labels, and how to word comments.

GitHub CopilotAgent workflows

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.