cursor-advanced-composer
Advanced Cursor Composer techniques: agent mode, parallel agents, complex refactoring, and multi-step orchestration. Triggers on "advanced composer", "composer patterns", "multi-file generation", "composer refactoring", "agent mode", "parallel agents".
Best use case
cursor-advanced-composer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Advanced Cursor Composer techniques: agent mode, parallel agents, complex refactoring, and multi-step orchestration. Triggers on "advanced composer", "composer patterns", "multi-file generation", "composer refactoring", "agent mode", "parallel agents".
Teams using cursor-advanced-composer should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/cursor-advanced-composer/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How cursor-advanced-composer Compares
| Feature / Agent | cursor-advanced-composer | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Advanced Cursor Composer techniques: agent mode, parallel agents, complex refactoring, and multi-step orchestration. Triggers on "advanced composer", "composer patterns", "multi-file generation", "composer refactoring", "agent mode", "parallel agents".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
SKILL.md Source
# Cursor Advanced Composer
Advanced patterns for Cursor Composer including agent orchestration, complex multi-file refactoring, architecture migrations, and quality-control workflows.
## Agent Mode Deep Dive
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.
### Agent Tool Capabilities
| 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 |
### Controlling Agent Behavior
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
```
### Checkpoint Pattern
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.
## Parallel Agent Workflows
Run up to 8 Composer agents simultaneously, each in its own tab.
### Use Case: Parallel Feature Development
```
# 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.
### Conflict Resolution Between Agents
If two agents modify the same file, the second write overwrites the first. Mitigate this by:
- Assigning non-overlapping file scopes to each agent
- Running agents sequentially for shared files
- Using git to cherry-pick the best changes
## Complex Refactoring Patterns
### Pattern: Extract and Replace
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.
```
### Pattern: Interface-First Migration
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.
```
### Pattern: Test-Driven Refactoring
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.
```
## Multi-Codebase Orchestration
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).
```
## Quality Control Workflows
### Pre-Apply Review Checklist
Before clicking "Apply All":
1. **Read every diff** -- do not blindly apply multi-file changes
2. **Check imports** -- Composer sometimes generates wrong import paths
3. **Verify types** -- ensure type annotations are correct, not `any`
4. **Look for hallucinations** -- methods or modules that do not exist
5. **Run build** -- `Cmd+`` > run your build command after applying
### Post-Apply Validation
```
# In Composer or terminal:
npm run build # Catches import errors, type mismatches
npm run lint # Catches style violations
npm run test # Catches behavior regressions
```
### Rollback Strategy
If applied changes break the build:
```bash
# 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.
## Advanced Prompting Techniques
### System-Level Instructions via Rules
Create a Composer-specific rule:
```yaml
# .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
```
### Iterative Refinement
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.
## Enterprise Considerations
- **Compliance**: Review generated code for license compliance before committing
- **Security**: Composer may generate code with SQL injection or XSS vulnerabilities -- always audit
- **Cost**: Agent mode with reasoning models (o1, Opus) can consume thousands of tokens per session
- **Audit trail**: Commit Composer output with descriptive messages for code review traceability
## Resources
- [Composer Overview](https://docs.cursor.com/composer/overview)
- [Agent Mode Documentation](https://docs.cursor.com/agent)
- [Cursor 2.0 Agent Architecture](https://cursor.com/blog)Related Skills
windsurf-advanced-troubleshooting
Advanced Windsurf debugging for hard-to-diagnose IDE, Cascade, and indexing issues. Use when standard troubleshooting fails, Cascade produces consistently wrong output, or investigating deep configuration problems. Trigger with phrases like "windsurf deep debug", "windsurf mystery error", "windsurf impossible to fix", "cascade keeps failing", "windsurf advanced debug".
vercel-advanced-troubleshooting
Advanced debugging for hard-to-diagnose Vercel issues including cold starts, edge errors, and function tracing. Use when standard troubleshooting fails, investigating intermittent failures, or preparing evidence for Vercel support escalation. Trigger with phrases like "vercel hard bug", "vercel mystery error", "vercel intermittent failure", "difficult vercel issue", "vercel deep debug".
supabase-advanced-troubleshooting
Deep Supabase diagnostics: pg_stat_statements for slow queries, lock debugging with pg_locks, connection leak detection, RLS policy conflicts, Edge Function cold starts, and Realtime connection drop analysis. Use when standard troubleshooting fails, investigating performance regressions, debugging race conditions, or building evidence for Supabase support escalation. Trigger: "supabase deep debug", "supabase slow query", "supabase lock contention", "supabase connection leak", "supabase RLS conflict", "supabase cold start".
snowflake-advanced-troubleshooting
Apply advanced Snowflake debugging with query profiling, spill analysis, lock contention, and performance deep-dives using ACCOUNT_USAGE views. Use when standard troubleshooting fails, investigating slow queries, or diagnosing warehouse performance issues. Trigger with phrases like "snowflake hard bug", "snowflake slow query debug", "snowflake query profile", "snowflake spilling", "snowflake deep debug".
shopify-advanced-troubleshooting
Debug complex Shopify API issues using cost analysis, request tracing, webhook delivery inspection, and GraphQL introspection. Trigger with phrases like "shopify hard bug", "shopify mystery error", "shopify deep debug", "difficult shopify issue", "shopify intermittent failure".
sentry-advanced-troubleshooting
Advanced Sentry troubleshooting for complex SDK issues, silent event drops, source map failures, distributed tracing gaps, and SDK conflicts. Use when events silently disappear, source maps fail to resolve, traces break across service boundaries, or the SDK conflicts with other libraries like OpenTelemetry or winston. Trigger with phrases like "sentry events missing", "sentry source maps broken", "sentry debug", "sentry not capturing errors", "sentry tracing gaps", "sentry memory leak", "sentry sdk conflict".
salesforce-advanced-troubleshooting
Apply Salesforce advanced debugging with debug logs, SOQL query plans, and EventLogFile analysis. Use when standard troubleshooting fails, investigating SOQL performance issues, or analyzing Apex governor limit violations. Trigger with phrases like "salesforce hard bug", "salesforce debug log", "salesforce governor limit", "salesforce query plan", "salesforce deep debug", "SOQL slow".
retellai-advanced-troubleshooting
Retell AI advanced troubleshooting — AI voice agent and phone call automation. Use when working with Retell AI for voice agents, phone calls, or telephony. Trigger with phrases like "retell advanced troubleshooting", "retellai-advanced-troubleshooting", "voice agent".
replit-advanced-troubleshooting
Debug hard Replit issues: container lifecycle, Nix build failures, deployment crashes, and memory leaks. Use when standard troubleshooting fails, investigating intermittent failures, or diagnosing complex Replit platform behavior. Trigger with phrases like "replit hard bug", "replit mystery error", "replit impossible to debug", "replit intermittent", "replit deep debug".
perplexity-advanced-troubleshooting
Apply advanced debugging techniques for hard-to-diagnose Perplexity Sonar API issues. Use when standard troubleshooting fails, investigating inconsistent citations, or preparing evidence for support escalation. Trigger with phrases like "perplexity hard bug", "perplexity mystery error", "perplexity inconsistent results", "difficult perplexity issue", "perplexity deep debug".
notion-advanced-troubleshooting
Deep debugging for Notion API: response inspection, permission chain tracing, property type mismatches, pagination edge cases, and block nesting limits. Use when standard troubleshooting fails or investigating intermittent errors. Trigger with phrases like "notion deep debug", "notion permission trace", "notion property mismatch", "notion pagination bug", "notion nesting limit".
hubspot-advanced-troubleshooting
Debug complex HubSpot API issues with systematic isolation and evidence collection. Use when standard troubleshooting fails, investigating intermittent CRM errors, or preparing evidence bundles for HubSpot support escalation. Trigger with phrases like "hubspot hard bug", "hubspot mystery error", "hubspot intermittent failure", "hubspot deep debug", "hubspot support ticket".