skills/cursor-code-style/SKILL.md
Rules for consistent, high-quality code style covering variable naming, control flow, comments, function design, and error handling. Extracted from Cursor Agent prompt patterns.
npx skillsauth add adilkalam/orca cursor-code-styleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Rules extracted from Cursor Agent prompt for consistent, high-quality code.
DO:
getUserById, calculateTotal, validateInputuserCount, totalPrice, validationResultDON'T:
i, j, k and coordinates x, y)genYmdStr -> generateDateStringdata, info, temp, result without contextBad: const d = getData()
Good: const userProfile = fetchUserProfile()
Bad: function proc(x) { ... }
Good: function processPayment(transaction) { ... }
Bad: let n = users.length
Good: let userCount = users.length
DO:
switch or object lookup over long if-else chainsDON'T:
else after a return statement// BAD: Deep nesting
function processUser(user) {
if (user) {
if (user.isActive) {
if (user.hasPermission) {
// happy path buried 3 levels deep
return doWork(user)
}
}
}
return null
}
// GOOD: Guard clauses
function processUser(user) {
if (!user) return null
if (!user.isActive) return null
if (!user.hasPermission) return null
return doWork(user) // happy path at top level
}
DO:
DON'T:
// BAD: Restates the code
// Increment counter by 1
counter++
// GOOD: Explains why
// Rate limit: max 100 requests per minute per user
if (requestCount > 100) return rateLimitError()
// BAD: TODO that never gets done
// TODO: handle edge case
// GOOD: Actually handle it or create an issue
if (edgeCase) {
throw new NotImplementedError('Edge case X - see issue #123')
}
DO:
DON'T:
// BAD: Too many parameters
function createUser(name, email, age, role, department, startDate, manager) { ... }
// GOOD: Object parameter
function createUser({ name, email, age, role, department, startDate, manager }) { ... }
// BAD: Boolean changes behavior
function fetchData(includeMetadata) {
if (includeMetadata) { ... }
else { ... }
}
// GOOD: Separate functions
function fetchData() { ... }
function fetchDataWithMetadata() { ... }
DO:
DON'T:
// BAD: Silent failure
try {
await saveUser(user)
} catch (e) {
// nothing
}
// GOOD: Meaningful handling
try {
await saveUser(user)
} catch (error) {
logger.error('Failed to save user', { userId: user.id, error })
throw new UserSaveError(`Could not save user ${user.id}: ${error.message}`)
}
DO:
DON'T:
Apply these rules to ALL code you write or modify, regardless of language or framework. When modifying existing code, follow the established patterns in that codebase unless they violate these rules egregiously.
content-media
Download YouTube video transcripts when user provides a YouTube URL or asks to download/get/fetch a transcript from YouTube. Also use when user wants to transcribe or get captions/subtitles from a YouTube video.
development
Web UI quality rules: interactions, forms, loading, animations, layout, content, performance, accessibility, design. Apply to all web UI work. Adapted from Vercel Design Guidelines.
testing
MANDATORY protocol enforcing knowledge check before EVERY response - prevents explaining systems without reading docs, claiming without verification, and ignoring auto-loaded context
testing
Typography hierarchy and spacing scale fallbacks. Yields to project design-dna when present.