Skip to main content

Rules

Persistent instructions (coding standards, conventions, patterns) that are always available to agents. Rules are included in the agent's context automatically.

Rule Reference

RuleDescription
accessibility-standardsAccessibility standards covering WCAG 2.2 AA compliance, keyboard navigation, screen readers, and ARIA patterns.
agent-orchestrationAgent delegation patterns, sub-agent spawning conventions, result aggregation, and multi-agent coordination protocols.
agent-orchestration-detailExtended orchestration reference -- PipelineContext schemas, resilience protocols, observability integration, and auto-mode guardrails.
api-designEndpoint versioning, request validation, idempotency keys, structured error responses, auth, CORS, CSP, pagination, and webhook security.
browser-verificationWhen and how to verify UI changes in the browser via automation MCP -- dev server lifecycle, navigation, interaction, visual regression, screenshot evidence.
ci-cdCI/CD pipeline standards covering stage gates, deployment strategies, and rollback procedures.
code-standardsTypeScript strict mode, naming conventions (camelCase/PascalCase/SCREAMING_SNAKE), and function/file length limits.
component-conventionsComponent structure, typed props/emits, design tokens, WCAG AA accessibility, loading/error/empty states, form UX, and 60fps render targets.
data-classificationData classification standards covering PII handling, encryption, retention policies, and regulatory compliance.
deep-contextAdaptive pre-implementation analysis -- complexity scoring, requirements elicitation, similar implementation discovery, and transitive dependency tracing before coding.
dependency-managementLockfile hygiene, new-dependency justification, CVE patching timelines (48h for critical), and bundle size budgets.
feature-flagsFlag naming (FF_AREA_FEATURE), storage, evaluation, gradual rollout, dependencies, kill switches, 30-day cleanup deadlines, and audit.
git-conventionsGit workflow, branch naming, commit message conventions, and merge strategy.
i18nInternationalization, RTL support, locale management, and ICU message format.
learning-consultWhen and how to consult project learnings during development.
migrationsBackward-compatible schema changes, idempotent scripts, rollback plans, and deploy-then-migrate ordering.
observabilityStructured JSON logging, OpenTelemetry, SLO/SLI, distributed tracing, alerting, dashboards, and no PII in logs.
observability-loggingStructured logging and error reporting conventions for the project.
observability-metricsMetrics, SLO/SLI definitions, alerting, and dashboard conventions for the project.
observability-tracingDistributed tracing, OpenTelemetry semantic conventions, AI agent instrumentation, and correlation ID conventions.
performance-budgetsCore Web Vitals, API latency, database query budgets, bundle size, and enforcement mechanisms.
secrets-managementSecret management, rotation, and secure handling patterns for the project.
security-patternsInput validation, output encoding, auth enforcement, AI/agentic security, and OWASP alignment.
testingDeterministic, isolated, fast tests with clear naming, regression coverage, no network in unit tests, no any.
themingDark mode, prefers-color-scheme, CSS custom properties, and semantic color tokens.
tooling-hierarchyPriority order for knowledge: project specs > codebase > library docs (Context7 MCP) > web research; GitHub CLI-first.

Rule Types

Rules have different application scopes:

  • Always-apply -- active in every conversation (e.g., code-standards, git-conventions)
  • Glob-scoped -- active only when files matching specific patterns are in context (e.g., component-conventions for *.tsx)
  • Agent-attached -- referenced by specific agents

Canonical Location

Rules live in .agents/rules/hatch3r-{id}.md with YAML frontmatter specifying id, type, description, and optional globs or alwaysApply flags.

Customization

Override rule behavior per-project using .hatch3r/rules/{id}.customize.yaml. See Customization.

Rule Precedence and Description Quality

Rule frontmatter accepts an optional precedence field used by static routing to order concatenated rule output and resolve conflicts when multiple rules match a context:

precedence: critical # values: critical | high | normal | low (default: normal)

Per-file rule adapters (cursor, windsurf, copilot, claude, cline) emit filenames prefixed with a two-digit rank (10-, 30-, 50-, 70-) so load order follows precedence. Inline adapters (gemini, aider, amp, goose, zed, antigravity, amazon-q, codex) sort rules before concatenation. Precedence is parity-validated across .md and .mdc variants by scripts/validate-rule-parity.ts.

npx hatch3r validate runs a description-quality lint on every canonical agents/, skills/, rules/, and commands/ artifact: descriptions must be at least 60 characters and must not cosine-collide (threshold >= 0.55) with another description in the same (type, primary-tag) cluster. Authoring guidance lives in .claude/rules/content-authoring.md.