/cursor-pack:cursor-advanced-composerfrom cursor-pack
Guides advanced Cursor Composer workflows: agent mode, parallel agents, complex refactoring, and multi-step orchestration with strict review gates.
Ships in cursor-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use Composer for bounded multi-file proposals when a human owner can inspect the plan, diff, tests, and rollback before applying changes.
| Condition | Safe response |
|---|---|
| Composer proposes unrelated files | Reject or split the request; do not apply all. |
| Output conflicts with rules/tests | Treat project controls as authoritative and revise manually or with a narrower prompt. |
| Sensitive context is attached | Stop, remove it, and follow exposure handling. |
Ask Composer to add a feature only in src/feature/ and its existing tests, requiring a plan first. Apply no files until the plan and diff are reviewed; run the focused suite and revert the commit if acceptance fails.
Advanced patterns for Cursor Composer including agent orchestration, complex multi-file refactoring, architecture migrations, and quality-control workflows.
In Agent mode, Composer autonomously chains tool calls: reading files, searching the codebase, running terminal commands, and writing code. It operates in a loop until the task is complete or it hits the 25-tool-call limit.
| Tool | What it does | Approval needed? |
|---|---|---|
| Read file | Reads any file in workspace | No |
| Search codebase | Semantic + text search | No |
| Write file | Creates or overwrites files | Shows diff first |
| Edit file | Modifies sections of files | Shows diff first |
| Run terminal command | Executes shell commands | Yes (click Allow) |
| List directory | Browses folder structure | No |
Give the agent constraints in your prompt:
Migrate all React class components in src/components/ to functional
components with hooks.
Constraints:
- Do NOT modify test files
- Preserve all existing prop types
- Replace lifecycle methods with useEffect equivalents
- Keep the same file names and export structure
- Run `npm test` after each file to verify
For large refactors, use explicit checkpoints:
Phase 1: Create the new database schema types in src/types/schema-v2.ts.
Show me the types before proceeding.
Phase 2: Update the repository layer to use the new types.
Run tests after each repository file change.
Phase 3: Update the API routes to use the new repository methods.
Phase 4: Update the frontend components to match the new API response shapes.
Stop after each phase and show me a summary of changes.
The agent pauses after 25 tool calls automatically. Click "Continue" to allow more.
Run up to 8 Composer agents simultaneously, each in its own tab.
# Agent 1 (Tab: "Auth")
Implement JWT authentication:
- src/middleware/auth.ts
- src/services/token.service.ts
- src/api/auth/login/route.ts
- src/api/auth/refresh/route.ts
# Agent 2 (Tab: "Products")
Implement product catalog:
- prisma/schema additions
- src/api/products/route.ts
- src/services/product.service.ts
# Agent 3 (Tab: "Tests")
Write integration tests for the existing user API:
- tests/integration/users.test.ts
Each agent has its own context and conversation history. They can modify the same codebase simultaneously, but be careful with overlapping files.
If two agents modify the same file, the second write overwrites the first. Mitigate this by:
Extract a pattern into a shared utility, then replace all occurrences:
@src/api/
I see repeated error handling in every API route:
try { ... } catch (err) { if (err instanceof ZodError) ... }
Step 1: Create src/utils/api-handler.ts with a withValidation()
wrapper that handles the try/catch + Zod pattern.
Step 2: Update ALL route files in src/api/ to use withValidation()
instead of manual try/catch.
Show me api-handler.ts first, then refactor the routes.
Define the target interface, then migrate implementations:
@src/services/
Step 1: Create src/interfaces/repository.ts with a generic
Repository<T> interface:
- findById(id: string): Promise<T | null>
- findMany(filter: Filter<T>): Promise<T[]>
- create(data: CreateInput<T>): Promise<T>
- update(id: string, data: UpdateInput<T>): Promise<T>
- delete(id: string): Promise<void>
Step 2: Refactor UserService to implement Repository<User>.
Step 3: Refactor ProductService to implement Repository<Product>.
Step 4: Update API routes to use the Repository interface type.
Write tests first, then refactor with confidence:
@src/services/payment.service.ts
Step 1: Write comprehensive tests for the current PaymentService
behavior. Cover all public methods and edge cases.
Run `npm test` to verify they pass.
Step 2: Refactor PaymentService to use the Strategy pattern for
different payment providers (Stripe, PayPal, manual).
Run `npm test` after each change to ensure nothing breaks.
For monorepos or multi-root workspaces:
@packages/shared/src/types/
@packages/api/src/routes/
@packages/web/src/hooks/
Add a "notifications" feature across all packages:
1. shared: NotificationType enum, Notification interface
2. api: GET /notifications, POST /notifications/mark-read endpoints
3. web: useNotifications hook, NotificationBell component
Use the shared types in both api and web packages.
Import from @myorg/shared (the workspace alias).
Before clicking "Apply All":
any# In Composer or terminal:
npm run build # Catches import errors, type mismatches
npm run lint # Catches style violations
npm run test # Catches behavior regressions
If applied changes break the build:
# Undo all uncommitted changes
git checkout .
# Or selectively undo specific files
git checkout -- src/api/products/route.ts
Always commit working code before starting a Composer session.
Create a Composer-specific rule:
# .cursor/rules/composer-standards.mdc
---
description: "Standards for Composer-generated code"
globs: ""
alwaysApply: true
---
When generating code via Composer:
- Always include JSDoc comments on exported functions
- Always add error handling (never let functions throw unhandled)
- Generate corresponding test files for new modules
- Use named exports, never default exports
- Import types with `import type` syntax
After first pass:
The generated product.service.ts looks good but:
1. Add pagination support to findMany (page, limit params)
2. Add a findByCategory method
3. Use transactions for createWithItems
Composer retains conversation context, so follow-up instructions build on previous output.
references/advanced-patterns.md (opens in a new tab)references/complex-refactoring.md (opens in a new tab)references/composer-strategies.md (opens in a new tab)references/errors.md (opens in a new tab)references/examples.md (opens in a new tab)references/multi-file-orchestration.md (opens in a new tab)references/quality-control.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cursor, composer, agent-mode, multi-file-refactoring, code-review, ai-assisted
30 skills in this plugin
/cursor-ai-chatMaster Cursor AI Chat with @-mentions, inline edit, and conversation patterns. Triggers on "cursor chat",
"cursor ai chat", "ask cursor", "cursor conversation", "chat with cursor", "Cmd+L", "inline edit".
/cursor-api-key-managementConfigure BYOK API keys for OpenAI, Anthropic, Google, Azure, and custom models in Cursor.
Triggers on "cursor api key", "cursor openai key", "cursor anthropic key", "own api key cursor",
"BYOK cursor", "cursor azure key".
/cursor-codebase-indexingSet up and optimize Cursor codebase indexing for semantic code search and @Codebase queries.
Triggers on "cursor index", "codebase indexing", "index codebase", "cursor semantic search",
"@codebase", "cursor embeddings".
/cursor-common-errorsTroubleshoot common Cursor IDE errors: authentication, completion, indexing, API, and performance
issues. Triggers on "cursor error", "cursor not working", "cursor issue", "cursor problem",
"fix cursor", "cursor crash".
/cursor-compliance-auditCompliance and security auditing for Cursor IDE usage: SOC 2, GDPR, HIPAA assessment, evidence
collection, and remediation. Triggers on "cursor compliance", "cursor audit", "cursor security review",
"cursor soc2", "cursor gdpr", "cursor data governance".
/cursor-composer-workflowsMaster Cursor Composer for multi-file AI editing, scaffolding, and refactoring. Triggers on "cursor composer",
"multi-file edit", "cursor generate files", "composer workflow", "cursor scaffold", "Cmd+I".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin cursor-packOther plugins' skills for the same job