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.
npx agentmods add rules/sitecore/xmcloud-starter-js/code-stylegit clone --depth 1 https://github.com/Sitecore/xmcloud-starter-jsWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01312 | $0.01312 |
| Opus 5 | $0.00656 | $0.00656 |
| Sonnet 5 | $0.00262 | $0.00262 |
| Haiku 4.5 | $0.00131 | $0.00131 |
Grade A, and why
code-style 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 204 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code Style
Vibe-Coding Principles
Core Philosophy:
- Write clean, modular, and idiomatic code
- Prefer declarative over imperative patterns
- Make code readable and self-documenting
- TypeScript-first development approach
- Component-driven architecture with XM Cloud integration
Code Organization:
- Use modern JavaScript/TypeScript features
- Export public types at module boundaries
- Prefer pure functions and thin wrappers
- No top-level side effects (except page entry points)
- Modular architecture with clear separation of concerns
Code Quality Standards
TypeScript Usage:
- Enable strict mode in all projects
- Prefer explicit types over
any - Use discriminated unions for complex state
- Export types at module boundaries for reusability
- Define proper interfaces for XM Cloud data structures
Functional Programming:
- Prefer pure functions where possible
- Use immutable data patterns
- Avoid side effects in business logic
- Compose small, focused functions
- Use React hooks appropriately
Readability:
- Use descriptive variable and function names
- Keep functions small and focused (single responsibility)
- Prefer self-documenting code over extensive comments
- Use consistent naming patterns across all starters
Component Development
React Best Practices:
- Use functional components with hooks
- Implement proper prop validation with TypeScript
- Handle loading and error states explicitly
- Use React.memo for performance optimization when needed
- Follow React 18+ patterns and concurrent features
XM Cloud Component Patterns:
- Always validate field existence before rendering
- Provide meaningful fallbacks for missing content
- Use Sitecore field components for proper rendering
- Handle both editing and preview modes
- Implement proper error boundaries
- Handle destructuring, undefined errors and null values in datasource and field values gracefully
// Good component pattern
import { Text, Image, useSitecore } from '@sitecore-content-sdk/nextjs';
interface HeroProps {
fields: {
data?: {
datasource?: {
title?: { jsonValue?: Field };
subtitle?: { jsonValue?: Field };
backgroundImage?: { jsonValue?: Field };
};
};
};
}
export default function Hero({ fields }: HeroProps) {
const { page } = useSitecore();
const { isEditing } = page.mode;
if (!fields) {
return <div>Hero content not configured</div>;
}
// Handle destructuring errors with safe fallbacks
const { data } = fields || {};
const { datasource } = data || {};
const { title, subtitle, backgroundImage } = datasource || {};
return (
<section className="hero">
{/* Show field components in editing mode even if no content */}
{(title?.jsonValue?.value || isEditing) && <Text field={title?.jsonValue} tag="h1" />}
{(subtitle?.jsonValue?.value || isEditing) && <Text field={subtitle?.jsonValue} tag="p" />}
{(backgroundImage?.jsonValue?.value?.src || isEditing) && (
<Image field={backgroundImage?.jsonValue} />
)}
</section>
);
}
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.
- 2d ago First seen · 204 lines · 1,312 tokens per session scan A b37805bc022e
code-style is a cursor rule published in the GitHub repository Sitecore/xmcloud-starter-js (29 stars, last pushed 7d ago), licensed Apache-2.0. It adds 1,312 tokens to every session, about $0.0066 per session on Opus 5. 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-30.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.
specs
This directory contains product and tech specs for Streamlit features.