coding-standard

A set of always-on coding rules for TypeScript projects, covering types, component structure, reusable UI components, and Tailwind CSS styling. It also defines when to use server or client components and how to structure them.

In plain words
What is it for?
Use it to guide TypeScript components and functions, prop interfaces, server and client components, shadcn/ui components, and Tailwind-based styling.
Why use it?
It gives the coding agent consistent project conventions, reducing inconsistent types, unnecessary client-side code, and one-off UI patterns.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/muzaffar640/commitpress/coding-standard
Clone the repo
git clone --depth 1 https://github.com/muzaffar640/commitpress

Made for: Cursor.

Per session 438 This file is loaded in full into every session.
When invoked 438 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00438 $0.00438
Opus 5 $0.00219 $0.00219
Sonnet 5 $0.00088 $0.00088
Haiku 4.5 $0.00044 $0.00044

Measured yesterday against content hash 0ac1da585e8e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

coding-standard 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 yesterday.

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/coding-standard.mdc · 69 lines

What it actually says


description: globs: alwaysApply: true

Coding Standards

TypeScript Guidelines

  • Use TypeScript for all components and functions
  • Define proper interfaces for component props
  • Avoid using any type
  • Use proper type annotations for functions and variables

Component Structure

  • Server Components are the default (no 'use client' directive needed)
  • Only use Client Components when interactivity or hooks are required
  • Use the following component definition syntax:
// Server Component (default)
const ComponentName = ({ prop1, prop2 }: ComponentNameProps) => {
  return <div>Content</div>;
};

// Client Component
'use client'

const ClientComponent = ({ prop1, prop2 }: ClientComponentProps) => {
  const [state, setState] = useState(initialState);
  return <div>Interactive Content</div>;
};

UI Component Library

  • Use shadcn/ui for new reusable components whenever possible
  • Follow shadcn/ui patterns and examples in the app/components/ui directory
  • Customize shadcn components with Tailwind CSS to match the design system
  • When extending shadcn components, maintain consistent API patterns
  • Only create custom components when a suitable shadcn component doesn't exist

Styling with Tailwind CSS

  • Use Tailwind classes for all styling
  • Follow responsive design patterns (mobile-first)
  • Use the project's color scheme defined in tailwind.config.ts
  • Avoid inline styles

File Structure

  • Use .tsx extension for React components
  • Use .ts extension for utility functions and types
  • Create reusable components in the components directory
  • Organize related components in subdirectories

Next.js Best Practices

  • Use metadata API for SEO in layout or page files
  • Implement efficient data fetching in Server Components
  • Use proper loading and error handling with loading.tsx and error.tsx
  • Use Next.js Image component for optimized images
  • Implement appropriate caching strategies
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. yesterday First seen · 69 lines · 438 tokens per session scan A 0ac1da585e8e

Subscribe to this mod's changes

coding-standard is a cursor rule published in the GitHub repository muzaffar640/commitpress (7 stars, last pushed 1y ago), licensed MIT. It adds 438 tokens to every session, about $0.0022 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-31.