design-standards

design-standards is a cursor rule for Cursor from bernierllc/agents-environment-config. It costs 0 tokens per session (1,108 once invoked), scanned A, original, MIT.

A set of rules for designing APIs, which are interfaces that let software systems communicate. It covers HTTP response codes, error handling, and patterns for clients using the API.

In plain words
What is it for?
Use it when designing or reviewing API endpoints, errors, status codes, and client usage.
Why use it?
It helps teams make API behaviour consistent and easier for client software to handle.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when designing or reviewing API endpoints, errors, status codes, and client usage.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/bernierllc/agents-environment-config/design-standards
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/bernierllc/agents-environment-config

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for design-standards

README.md
[![agentmods](https://agentmods.dev/badge/rules/bernierllc/agents-environment-config/design-standards/github.svg)](https://agentmods.dev/rules/bernierllc/agents-environment-config/design-standards)
Your own site
<a href="https://agentmods.dev/rules/bernierllc/agents-environment-config/design-standards"><img src="https://agentmods.dev/badge/rules/bernierllc/agents-environment-config/design-standards/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for design-standards

Your own site · 80×15
<a href="https://agentmods.dev/rules/bernierllc/agents-environment-config/design-standards"><img src="https://agentmods.dev/badge/rules/bernierllc/agents-environment-config/design-standards.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,108 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01108
Opus 5.5 $0.00000 $0.00443
Sonnet 5.5 $0.00000 $0.00222
Haiku 4.5 $0.00000 $0.00111

Measured 1mo ago against content hash 0c421dcd55ad, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

design-standards scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/topics/api/design-standards.mdc · 163 lines

How it starts

The opening of the file, as written. The whole thing — 163 lines — stays where its author put it; the contents beside it link to each section on GitHub.

API Standards

HTTP Status Code Standards

4xx Client Errors

  • 400 Bad Request - Invalid request format, missing required fields
  • 401 Unauthorized - Missing or invalid authentication
  • 403 Forbidden - Authenticated but insufficient permissions
  • 404 Not Found - Resource doesn't exist
  • 409 Conflict - Resource state conflict (e.g., duplicate creation)
  • 422 Unprocessable Entity - Valid format but semantic errors

5xx Server Errors

  • 500 Internal Server Error - ONLY for unexpected server conditions
  • 502 Bad Gateway - Upstream service failure
  • 503 Service Unavailable - Service temporarily unavailable

FORBIDDEN Patterns

❌ NEVER return 500 for:

  • Missing resources (use 404)
  • Invalid user input (use 400)
  • Authentication failures (use 401/403)
  • Resource conflicts (use 409)

❌ NEVER return 404 for:

  • Server errors (use 500)
  • Authentication failures (use 401/403)

Response Format Standards

Success Responses

// ✅ Standard success format
return NextResponse.json({
  success: true,
  data: result,
  message: 'Operation completed successfully'
});

Error Responses

// ✅ Standard error format
return NextResponse.json({
  success: false,
  error: 'Human readable error message',
  details: 'Additional context for debugging',
  code: 'ERROR_CODE' // Optional error code
}, { status: appropriateStatus });

Validation Requirements

Input Validation

  • ALWAYS validate required fields
  • ALWAYS validate data types
  • ALWAYS validate business rules
  • ALWAYS return 400 for validation failures

Resource Existence

  • ALWAYS check if resources exist before processing
  • ALWAYS return 404 for missing resources
  • NEVER let missing resources cause 500 errors

Authentication & Authorization

  • ALWAYS check authentication first
  • ALWAYS check permissions before processing
  • ALWAYS return 401/403 for auth failures

API Request Flow

Read the full file on GitHub · 163 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 163 lines · 0 tokens per session scan A 0c421dcd55ad

Subscribe to this mod's changes

design-standards is a cursor rule published in the GitHub repository bernierllc/agents-environment-config (11 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,108 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other cursor rules, from other repositories

igniter-patterns

This guide provides a COMPLETE, ACCURATE, and MANDATORY reference for creating controllers and actions in Igniter.js. It incorporates established architectural patterns, coding best practices, and lessons learned from real-world implementations, ensuring strict adherence for all future development.

felipebarcelospro/igniter-js · 8,510 tokens

igniter-client-usage

Comprehensive guide to using the Igniter.js Client, covering server-side and client-side usage patterns, React hooks (useQuery, useMutation, useRealtime), context management, realtime features, and best practices. This rule explains the universal client architecture and how it works seamlessly across different Next.js…

felipebarcelospro/igniter-js · 5,663 tokens

testing

Defines how API validation tools and browser automation should be integrated into the development workflow for autonomous testing and continuous validation of implemented features.

felipebarcelospro/igniter-js · 3,773 tokens

api-validation-workflow

Integrates API validation tools (OpenAPI spec retrieval and HTTP request testing) into the development workflow, enabling autonomous testing and validation of features. This rule defines when and how to use API validation tools for continuous validation, debugging, and quality assurance throughout the development…

felipebarcelospro/igniter-js · 2,390 tokens

middleware

When you need create a middleware to protect some page of Next.js app.

felipebarcelospro/igniter-js · 14 tokens

igniter-advanced-features

A guide to the advanced features of Igniter.js, including the background jobs system (BullMQ), the caching and pub/sub store (Redis), and the real-time system for live UI updates.

felipebarcelospro/igniter-js · 39 tokens