This document defines the standardised tagging system used across all Cursor rules. These tags provide a structured, hierarchical way to categorise rules and enable selective installation based on project requirements.
Tags follow a hierarchical structure with the following levels:
- Language - The primary programming language the rule applies to
- Framework - The specific framework or CMS the rule targets
- Category - The primary functional category of the rule
- Subcategory - More granular categorisation within the category
- Standard - The formal standard or guideline the rule implements
- Risk - The specific risk identifier (when applicable)
Tags use lowercase with hyphens separating multiple words, and colons separating the tag type from its value:
type:value
For example: language:javascript, framework:react, category:security
Language tags identify the programming language the rule applies to:
language:phplanguage:javascriptlanguage:typescriptlanguage:pythonlanguage:rubylanguage:javalanguage:golanguage:rustlanguage:csharplanguage:bashlanguage:htmllanguage:csslanguage:scss
Framework tags specify the framework or CMS the rule targets:
framework:angularframework:astroframework:bootstrapframework:expressframework:jqueryframework:nextjsframework:nuxtjsframework:reactframework:tailwindframework:vueframework:drupalframework:laravelframework:symfonyframework:wordpressframework:djangoframework:fastapiframework:flask
Category tags define the primary functional focus of the rule:
category:a11y(for accessibility)category:best-practicecategory:ci-cdcategory:configurationcategory:deploymentcategory:documentationcategory:performancecategory:securitycategory:stylecategory:testing
Subcategory tags provide more granular categorisation within the primary category:
For category:security:
subcategory:injectionsubcategory:authenticationsubcategory:authorisationsubcategory:xsssubcategory:csrfsubcategory:cryptographysubcategory:configurationsubcategory:data-protectionsubcategory:api-securitysubcategory:designsubcategory:input-validation
For category:performance:
subcategory:cachingsubcategory:renderingsubcategory:databasesubcategory:assetssubcategory:memory-management
For category:accessibility:
subcategory:screen-readerssubcategory:keyboard-navigationsubcategory:color-contrastsubcategory:form-accessibility
Standard tags identify formal standards or guidelines the rule implements:
standard:owasp-top10- OWASP Top 10 web application security risksstandard:wcag- Web Content Accessibility Guidelinesstandard:pci-dss- Payment Card Industry Data Security Standardstandard:gdpr- General Data Protection Regulationstandard:hipaa- Health Insurance Portability and Accountability Actstandard:psr- PHP Standards Recommendationsstandard:eslint- ESLint recommended rulesstandard:a11y- Accessibility standardsstandard:soc2- Service Organisation Control 2
Risk tags specify the exact risk identifier, particularly for security standards:
For standard:owasp-top10:
risk:a01-broken-access-controlrisk:a02-cryptographic-failuresrisk:a03-injectionrisk:a04-insecure-designrisk:a05-security-misconfigurationrisk:a06-vulnerable-outdated-componentsrisk:a07-identification-authentication-failuresrisk:a08-software-data-integrity-failuresrisk:a09-security-logging-monitoring-failuresrisk:a10-server-side-request-forgery
Some rules may apply to multiple languages, frameworks, or categories. In these cases, multiple tags of the same type can be specified:
language:javascript
language:typescript
framework:react
framework:next
category:security
subcategory:authentication
Tag combinations enable precise rule selection. For example:
- All security rules:
category:security - PHP Drupal security rules:
language:php framework:drupal category:security - OWASP injection rules for JavaScript:
language:javascript category:security standard:owasp-top10 subcategory:injection - Accessibility rules for React:
framework:react category:accessibility
Tags should be included in the metadata section of each rule file (.mdc):
metadata:
tags:
- language:php
- framework:drupal
- category:security
- subcategory:injection
- standard:owasp-top10
- risk:a03-injection- Consistency: Always use the standard format and vocabulary
- Specificity: Be as specific as possible with tags
- Completeness: Include all relevant tag types
- Hierarchy: Maintain the hierarchical relationship between tags
- Relevance: Only include tags that are directly applicable to the rule
The tag system enables selective installation of rules based on project requirements:
- Installation scripts can filter rules based on language, framework, or specific security concerns
- Multiple tag criteria can be combined using logical operations (AND/OR)
- Predefined rule sets can be created for common use cases (e.g., "drupal-security", "react-accessibility")
The tag system is designed to be extensible. New tag types or values can be added as needed:
- Document the new tag type or value in this standard
- Ensure consistency with existing tag formats
- Update rule selection tools to recognise the new tags
- Consider backward compatibility with existing rules