> cursor-ai
Build software with Cursor, the AI-powered code editor. Use when a user asks to configure Cursor rules, set up .cursorrules files, use Composer for multi-file edits, integrate MCP servers, or optimize AI-assisted coding workflows.
curl "https://skillshub.wtf/TerminalSkills/skills/cursor-ai?format=md"Cursor — AI-First Code Editor
Overview
You are an expert in Cursor, the AI-first code editor built on VS Code. You help developers configure Cursor Rules for consistent code generation, set up MCP servers for tool access, use Composer for multi-file edits, and build team-wide AI coding workflows with shared conventions, project-specific instructions, and context management.
Instructions
Cursor Rules
<!-- .cursor/rules/general.mdc — Project-wide rules -->
<!-- These rules apply to every AI interaction in the project -->
---
description: General coding standards
globs: ["**/*.ts", "**/*.tsx"]
alwaysApply: true
---
## Stack
- TypeScript strict mode, no `any`
- Next.js 15 App Router
- Drizzle ORM + PostgreSQL
- Zod for all validation
- Vitest for testing
## Code Style
- Functional, declarative code — no classes
- Early returns over nested conditionals
- Descriptive variable names: `isLoading`, `hasPermission`, `userCount`
- File naming: `kebab-case.ts` for modules, `PascalCase.tsx` for components
- Imports: absolute paths via `@/` alias
## Error Handling
- Return Result types: `{ success: true, data } | { success: false, error }`
- Never throw in business logic
- Use `try/catch` only at API boundaries
## When Generating Tests
- Colocate test files: `module.test.ts` next to `module.ts`
- Use `describe/it` blocks with clear descriptions
- Test behavior, not implementation
- Mock external services, never databases in integration tests
<!-- .cursor/rules/react.mdc — React-specific rules -->
---
description: React component patterns
globs: ["src/components/**/*.tsx", "src/app/**/*.tsx"]
alwaysApply: false
---
## Components
- Server Components by default
- `"use client"` only for interactivity (state, effects, event handlers)
- Props interface defined and exported above the component
- Use `cn()` utility for conditional classNames (clsx + tailwind-merge)
## Patterns
```tsx
// ✅ Correct pattern
export interface UserCardProps {
user: User;
onSelect?: (userId: string) => void;
}
export function UserCard({ user, onSelect }: UserCardProps) {
return (/* ... */);
}
// ❌ Wrong: arrow function export, inline types
export const UserCard = ({ user }: { user: any }) => {/* ... */};
### MCP Configuration
```json
// .cursor/mcp.json — MCP servers available to Cursor
{
"mcpServers": {
"database": {
"command": "npx",
"args": ["tsx", "mcp-servers/database/index.ts"],
"env": { "DATABASE_URL": "${DATABASE_URL}" }
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "./src"]
}
}
}
Composer (Multi-File Edits)
## Using Composer effectively:
1. Select files with @file — Composer edits multiple files at once
2. Reference docs with @docs — point to API docs, README, or specs
3. Use @codebase — lets AI search your entire codebase for context
4. Agent mode — Cursor runs terminal commands, reads files, iterates
## Example Composer prompts:
"Refactor the auth middleware in @src/middleware.ts to use the new
session validation from @src/lib/auth.ts. Update all API routes
in @src/app/api that import the old middleware."
"Create a new CRUD module for 'invoices' following the same patterns
as @src/modules/users. Include Drizzle schema, API routes, Zod
validation, and tests."
.cursorrules (Legacy) vs .cursor/rules/ (New)
## Migration from .cursorrules to .cursor/rules/
Old: Single `.cursorrules` file at project root (still supported)
New: `.cursor/rules/*.mdc` files with frontmatter (globs, description)
Benefits of new format:
- File-glob targeting: different rules for different file types
- `alwaysApply` vs on-demand: some rules always active, others contextual
- Organized: split rules by concern (typescript.mdc, testing.mdc, api.mdc)
- Shareable: commit to repo, entire team gets the same AI behavior
Examples
Example 1: User asks to set up cursor-ai
User: "Help me set up cursor-ai for my project"
The agent should:
- Check system requirements and prerequisites
- Install or configure cursor-ai
- Set up initial project structure
- Verify the setup works correctly
Example 2: User asks to build a feature with cursor-ai
User: "Create a dashboard using cursor-ai"
The agent should:
- Scaffold the component or configuration
- Connect to the appropriate data source
- Implement the requested feature
- Test and validate the output
Guidelines
- Rules in Git — Commit
.cursor/rules/to the repo; every team member gets the same AI behavior automatically - Glob targeting — Use specific globs (
src/app/api/**/*.ts) for context-specific rules; avoid one giant rules file - MCP for context — Connect databases, APIs, and docs via MCP servers; AI generates better code with real context
- Composer for refactors — Use Composer in Agent mode for multi-file changes; it reads, plans, edits, and tests
- @codebase for discovery — Use
@codebasewhen AI needs to find related code; it searches semantically, not just by filename - Tab completion — Enable Cursor Tab for inline completions; learns your coding style over time
- Review AI diffs — Always review Cursor's proposed changes before accepting; use the diff view to understand what changed
- Rules evolve — Update rules when you find the AI making the same mistake twice; each rule prevents future errors
> related_skills --same-repo
> zustand
You are an expert in Zustand, the small, fast, and scalable state management library for React. You help developers manage global state without boilerplate using Zustand's hook-based stores, selectors for performance, middleware (persist, devtools, immer), computed values, and async actions — replacing Redux complexity with a simple, un-opinionated API in under 1KB.
> zoho
Integrate and automate Zoho products. Use when a user asks to work with Zoho CRM, Zoho Books, Zoho Desk, Zoho Projects, Zoho Mail, or Zoho Creator, build custom integrations via Zoho APIs, automate workflows with Deluge scripting, sync data between Zoho apps and external systems, manage leads and deals, automate invoicing, build custom Zoho Creator apps, set up webhooks, or manage Zoho organization settings. Covers Zoho CRM, Books, Desk, Projects, Creator, and cross-product integrations.
> zod
You are an expert in Zod, the TypeScript-first schema declaration and validation library. You help developers define schemas that validate data at runtime AND infer TypeScript types at compile time — eliminating the need to write types and validators separately. Used for API input validation, form validation, environment variables, config files, and any data boundary.
> zipkin
Deploy and configure Zipkin for distributed tracing and request flow visualization. Use when a user needs to set up trace collection, instrument Java/Spring or other services with Zipkin, analyze service dependencies, or configure storage backends for trace data.