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.
git clone --depth 1 https://github.com/Sitecore/xmcloud-starter-jsWrote 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.
[](https://agentmods.dev/rules/sitecore/xmcloud-starter-js/code-style)<a href="https://agentmods.dev/rules/sitecore/xmcloud-starter-js/code-style"><img src="https://agentmods.dev/badge/rules/sitecore/xmcloud-starter-js/code-style/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.
<a href="https://agentmods.dev/rules/sitecore/xmcloud-starter-js/code-style"><img src="https://agentmods.dev/badge/rules/sitecore/xmcloud-starter-js/code-style.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01312 | $0.01312 |
| Opus 5.5 | $0.00525 | $0.00525 |
| Sonnet 5.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 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.
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.
- 1mo 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 (31 stars, last pushed yesterday), licensed Apache-2.0. It adds 1,312 tokens to every session, about $0.0052 per session on Opus 5.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
nextjs-react-tailwind-cursorrules-prompt-file
Cursor rules for Next.js development with React and Tailwind CSS integration.
react-components-creation-cursorrules-prompt-file
Cursor rules for React component creation and development.
react-chakra-ui-cursorrules-prompt-file
Cursor rules for React development with Chakra UI integration.
react-styled-components-cursorrules-prompt-file
Cursor rules for React development with Styled Components integration.
chakra-ui-best-practices
A set of rules for building React interfaces with Chakra UI, a component library for styled and accessible user interfaces. It covers themes, responsive layouts, accessibility, performance, and reusable components.
react-chakra-ui---folder-structure
A standard folder layout for React and Chakra UI projects, including separate locations for components, pages, themes, hooks, utilities, and assets. It also defines how Chakra UI theme files are grouped.