@tech-leads-club/agent-skills 0.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,683 @@
1
+ ---
2
+ name: cursor-subagent-creator
3
+ description: Creates Cursor-specific AI subagents with isolated context for complex multi-step workflows. Use when creating subagents for Cursor editor specifically, following Cursor's patterns and directories (.cursor/agents/). Triggers on "cursor subagent", "cursor agent".
4
+ ---
5
+
6
+ # Cursor Subagent Creator
7
+
8
+ You are an expert in creating Subagents following Cursor's best practices.
9
+
10
+ ## When to Use This Skill
11
+
12
+ Use this skill when the user asks to:
13
+ - Create a new subagent/agent
14
+ - Create a specialized assistant
15
+ - Implement a complex workflow with multiple steps
16
+ - Create verifiers, auditors, or domain experts
17
+ - Tasks that require isolated context and multiple steps
18
+
19
+ **DO NOT use for simple, one-off tasks** - for those, use skills.
20
+
21
+ ## What are Subagents?
22
+
23
+ Subagents are specialized assistants that Cursor's Agent can delegate tasks to. Characteristics:
24
+
25
+ - **Isolated context**: Each subagent has its own context window
26
+ - **Parallel execution**: Multiple subagents can run simultaneously
27
+ - **Specialization**: Configured with specific prompts and expertise
28
+ - **Reusable**: Defined once, used in multiple contexts
29
+
30
+ ### Foreground vs Background
31
+
32
+ | Mode | Behavior | Best for |
33
+ |------|----------|----------|
34
+ | **Foreground** | Blocks until complete, returns result immediately | Sequential tasks where you need the output |
35
+ | **Background** | Returns immediately, works independently | Long-running tasks or parallel workstreams |
36
+
37
+ ## Subagent Structure
38
+
39
+ A subagent is a markdown file in `.cursor/agents/` (project) or `~/.cursor/agents/` (user).
40
+
41
+ ### File Format
42
+
43
+ ```markdown
44
+ ---
45
+ name: agent-name
46
+ description: Description of when to use this subagent. The Agent reads this to decide delegation.
47
+ model: inherit # or fast, or specific model ID
48
+ readonly: false # true to restrict write permissions
49
+ is_background: false # true to execute in background
50
+ ---
51
+
52
+ You are an [expert in X].
53
+
54
+ When invoked:
55
+ 1. [Step 1]
56
+ 2. [Step 2]
57
+ 3. [Step 3]
58
+
59
+ [Detailed instructions about expected behavior]
60
+
61
+ Report [type of expected result]:
62
+ - [Output format]
63
+ - [Metrics or specific information]
64
+ ```
65
+
66
+ ## Subagent Creation Process
67
+
68
+ ### 1. Define the Purpose
69
+
70
+ - What specific responsibility does the subagent have?
71
+ - Why does it need isolated context?
72
+ - Does it involve multiple complex steps?
73
+ - Does it require deep specialization?
74
+
75
+ ### 2. Choose the Location
76
+
77
+ - **Project**: `.cursor/agents/agent-name.md` - project-specific
78
+ - **User**: `~/.cursor/agents/agent-name.md` - all projects
79
+
80
+ **Naming convention:**
81
+ - Use kebab-case (words-separated-by-hyphens)
82
+ - Be descriptive of the specialization
83
+ - Examples: `security-auditor`, `test-runner`, `debugger`, `verifier`
84
+
85
+ ### 3. Configure the Frontmatter
86
+
87
+ #### name (optional)
88
+
89
+ Unique identifier. If omitted, uses the filename.
90
+
91
+ ```yaml
92
+ name: security-auditor
93
+ ```
94
+
95
+ #### description (optional but recommended)
96
+
97
+ CRITICAL for automatic delegation. Explains when the Agent should use this subagent.
98
+
99
+ **Good descriptions:**
100
+ - "Security specialist. Use when implementing auth, payments, or handling sensitive data."
101
+ - "Debugging specialist for errors and test failures. Use when encountering issues."
102
+ - "Validates completed work. Use after tasks are marked done to confirm implementations are functional."
103
+
104
+ **Phrases that encourage automatic delegation:**
105
+ - "Use proactively when..."
106
+ - "Always use for..."
107
+ - "Automatically delegate when..."
108
+
109
+ **Avoid:**
110
+ - Vague descriptions: "Helps with general tasks"
111
+ - No context of when to use
112
+
113
+ #### model (optional)
114
+
115
+ ```yaml
116
+ model: inherit # Uses the same model as parent agent (default)
117
+ model: fast # Uses fast model
118
+ model: claude-3-5-sonnet-20250219 # Specific model
119
+ ```
120
+
121
+ **When to use each model:**
122
+ - `inherit`: Default, maintains consistency
123
+ - `fast`: For quick checks, formatting, simple tasks
124
+ - Specific model: When you need specific capabilities
125
+
126
+ #### readonly (optional)
127
+
128
+ ```yaml
129
+ readonly: true # Restricts write permissions
130
+ ```
131
+
132
+ Use when the subagent should only read/analyze, not modify.
133
+
134
+ #### is_background (optional)
135
+
136
+ ```yaml
137
+ is_background: true # Executes in background
138
+ ```
139
+
140
+ Use for:
141
+ - Long-running tasks
142
+ - Continuous monitoring
143
+ - When you don't need the result immediately
144
+
145
+ ### 4. Write the Subagent Prompt
146
+
147
+ The prompt should define:
148
+
149
+ 1. **Identity**: "You are an [expert]..."
150
+ 2. **When invoked**: Context of use
151
+ 3. **Process**: Specific steps to follow
152
+ 4. **Expected output**: Format and content of the result
153
+ 5. **Behavior**: Approach and philosophy
154
+
155
+ **Recommended structure:**
156
+
157
+ ```markdown
158
+ You are an [expert in X] specialized in [Y].
159
+
160
+ When invoked:
161
+ 1. [First action]
162
+ 2. [Second action]
163
+ 3. [Third action]
164
+
165
+ [Detailed instructions about approach]
166
+
167
+ Report [type of result]:
168
+ - [Specific format]
169
+ - [Information to include]
170
+ - [Metrics or criteria]
171
+
172
+ [Philosophy or principles to follow]
173
+ ```
174
+
175
+ ### 5. Be Focused and Specific
176
+
177
+ - **One clear responsibility**: Each subagent has one purpose
178
+ - **Concise prompts**: Don't write 2000 words
179
+ - **Actionable instructions**: Clear and testable steps
180
+ - **Structured output**: Well-defined response format
181
+
182
+ ## Field Configuration
183
+
184
+ | Field | Required | Default | Description |
185
+ |-------|----------|---------|-------------|
186
+ | `name` | No | Filename | Unique identifier (lowercase + hyphens) |
187
+ | `description` | No | - | When to use this subagent (read by Agent) |
188
+ | `model` | No | `inherit` | Model to use (`fast`, `inherit`, or specific ID) |
189
+ | `readonly` | No | `false` | If true, write permissions restricted |
190
+ | `is_background` | No | `false` | If true, executes in background |
191
+
192
+ ## Common Subagent Patterns
193
+
194
+ ### 1. Verification Agent
195
+
196
+ **Purpose**: Independently validates that work declared as complete actually works.
197
+
198
+ ```markdown
199
+ ---
200
+ name: verifier
201
+ description: Validates completed work. Use after tasks are marked done to confirm implementations are functional.
202
+ model: fast
203
+ ---
204
+
205
+ You are a skeptical validator. Your job is to verify that work declared complete actually works.
206
+
207
+ When invoked:
208
+ 1. Identify what was declared as complete
209
+ 2. Verify that the implementation exists and is functional
210
+ 3. Execute tests or relevant verification steps
211
+ 4. Look for edge cases that may have been missed
212
+
213
+ Be thorough and skeptical. Report:
214
+ - What was verified and passed
215
+ - What was declared but is incomplete or broken
216
+ - Specific issues that need to be addressed
217
+
218
+ Don't accept statements at face value. Test everything.
219
+ ```
220
+
221
+ **Use for:**
222
+ - Validating features work end-to-end
223
+ - Catching partially implemented functionality
224
+ - Ensuring tests actually pass
225
+
226
+ ### 2. Debugger
227
+
228
+ **Purpose**: Expert in root cause analysis and error correction.
229
+
230
+ ```markdown
231
+ ---
232
+ name: debugger
233
+ description: Debugging specialist for errors and test failures. Use when encountering issues.
234
+ ---
235
+
236
+ You are a debugging expert specialized in root cause analysis.
237
+
238
+ When invoked:
239
+ 1. Capture the error message and stack trace
240
+ 2. Identify reproduction steps
241
+ 3. Isolate the failure location
242
+ 4. Implement minimal fix
243
+ 5. Verify that the solution works
244
+
245
+ For each issue, provide:
246
+ - Root cause explanation
247
+ - Evidence supporting the diagnosis
248
+ - Specific code fix
249
+ - Testing approach
250
+
251
+ Focus on fixing the underlying issue, not symptoms.
252
+ ```
253
+
254
+ **Use for:**
255
+ - Complex or obscure errors
256
+ - Test failures that need investigation
257
+ - Performance issues
258
+
259
+ ### 3. Security Auditor
260
+
261
+ **Purpose**: Security expert auditing code.
262
+
263
+ ```markdown
264
+ ---
265
+ name: security-auditor
266
+ description: Security specialist. Use when implementing auth, payments, or handling sensitive data.
267
+ model: inherit
268
+ ---
269
+
270
+ You are a security expert auditing code for vulnerabilities.
271
+
272
+ When invoked:
273
+ 1. Identify security-sensitive code paths
274
+ 2. Check for common vulnerabilities (injection, XSS, auth bypass)
275
+ 3. Confirm that secrets are not hardcoded
276
+ 4. Review input validation and sanitization
277
+
278
+ Report findings by severity:
279
+ - **Critical** (must fix before deploy)
280
+ - **High** (fix soon)
281
+ - **Medium** (address when possible)
282
+ - **Low** (suggested improvements)
283
+
284
+ For each finding, include:
285
+ - Vulnerability description
286
+ - Location in code
287
+ - Potential impact
288
+ - Fix recommendation
289
+ ```
290
+
291
+ **Use for:**
292
+ - Authentication/authorization implementations
293
+ - Code handling payments
294
+ - User inputs
295
+ - External API integrations
296
+
297
+ ### 4. Test Runner
298
+
299
+ **Purpose**: Expert in test automation.
300
+
301
+ ```markdown
302
+ ---
303
+ name: test-runner
304
+ description: Test automation expert. Use proactively to run tests and fix failures.
305
+ is_background: false
306
+ ---
307
+
308
+ You are a test automation expert.
309
+
310
+ When you see code changes, proactively execute the appropriate tests.
311
+
312
+ If tests fail:
313
+ 1. Analyze the failure output
314
+ 2. Identify the root cause
315
+ 3. Fix the issue preserving test intent
316
+ 4. Re-run to verify
317
+
318
+ Report test results with:
319
+ - Number of tests passed/failed
320
+ - Summary of any failures
321
+ - Changes made to fix issues
322
+
323
+ Never break existing tests without clear justification.
324
+ ```
325
+
326
+ **Use for:**
327
+ - Running tests automatically after changes
328
+ - Fixing test failures
329
+ - Maintaining a healthy test suite
330
+
331
+ ### 5. Documentation Writer
332
+
333
+ **Purpose**: Expert in creating clear documentation.
334
+
335
+ ```markdown
336
+ ---
337
+ name: doc-writer
338
+ description: Documentation specialist. Use when creating READMEs, API docs, or user guides.
339
+ model: fast
340
+ ---
341
+
342
+ You are a technical documentation expert.
343
+
344
+ When invoked:
345
+ 1. Analyze the code/feature to document
346
+ 2. Identify audience (developers, end users, etc.)
347
+ 3. Structure documentation logically
348
+ 4. Write with clarity and practical examples
349
+ 5. Include code examples when relevant
350
+
351
+ Documentation should include:
352
+ - Purpose overview
353
+ - How to install/configure (if applicable)
354
+ - How to use with examples
355
+ - Available parameters/options
356
+ - Common use cases
357
+ - Troubleshooting (if applicable)
358
+
359
+ Use formatted markdown, clear language, and concrete examples.
360
+ ```
361
+
362
+ ### 6. Orchestrator
363
+
364
+ **Purpose**: Coordinates multiple subagents in sequence.
365
+
366
+ ```markdown
367
+ ---
368
+ name: orchestrator
369
+ description: Coordinates complex workflows across multiple specialists. Use for multi-phase projects.
370
+ ---
371
+
372
+ You are a complex workflow orchestrator.
373
+
374
+ When invoked:
375
+ 1. Analyze complete requirements
376
+ 2. Break into logical phases
377
+ 3. Delegate each phase to appropriate subagent
378
+ 4. Collect and integrate results
379
+ 5. Verify consistency across phases
380
+
381
+ Standard workflow:
382
+ 1. **Planner**: Analyzes requirements and creates technical plan
383
+ 2. **Implementer**: Builds the feature based on plan
384
+ 3. **Verifier**: Confirms implementation matches requirements
385
+
386
+ For each handoff, include:
387
+ - Structured output from previous phase
388
+ - Context needed for next phase
389
+ - Clear success criteria
390
+ ```
391
+
392
+ ## Using Subagents
393
+
394
+ ### Automatic Delegation
395
+
396
+ The Agent delegates automatically based on:
397
+ - Task complexity and scope
398
+ - Custom subagent descriptions
399
+ - Current context and available tools
400
+
401
+ **Encourage automatic delegation** using phrases in the description:
402
+ - "Use proactively when..."
403
+ - "Always use for..."
404
+ - "Automatically apply when..."
405
+
406
+ ### Explicit Invocation
407
+
408
+ `/name` syntax:
409
+
410
+ ```
411
+ > /verifier confirm that the auth flow is complete
412
+ > /debugger investigate this error
413
+ > /security-auditor review the payment module
414
+ ```
415
+
416
+ Or natural mention:
417
+
418
+ ```
419
+ > Use the verifier subagent to confirm the auth flow is complete
420
+ > Ask the debugger subagent to investigate this error
421
+ > Run the security-auditor subagent on the payment module
422
+ ```
423
+
424
+ ### Parallel Execution
425
+
426
+ Launch multiple subagents simultaneously:
427
+
428
+ ```
429
+ > Review the API changes and update documentation in parallel
430
+ ```
431
+
432
+ The Agent sends multiple Task tool calls in a single message.
433
+
434
+ ## Resuming Subagents
435
+
436
+ Subagents can be resumed to continue previous conversations.
437
+
438
+ Each execution returns an agent ID. Pass this ID to resume with preserved context:
439
+
440
+ ```
441
+ > Resume agent abc123 and analyze remaining test failures
442
+ ```
443
+
444
+ Background subagents write their state while executing in `~/.cursor/subagents/`.
445
+
446
+ ## Best Practices
447
+
448
+ ### ✅ DO
449
+
450
+ - **Write focused subagents**: One clear responsibility
451
+ - **Invest in the description**: Determines when the Agent delegates
452
+ - **Keep prompts concise**: Direct and specific
453
+ - **Add to version control**: Share `.cursor/agents/` with the team
454
+ - **Start with Agent-generated**: Let the Agent create the initial draft
455
+ - **Use hooks for file output**: For consistent structured output
456
+ - **Test the description**: Make prompts and see if the correct subagent is triggered
457
+
458
+ ### ❌ AVOID
459
+
460
+ - **Dozens of generic subagents**: 50+ vague subagents are ineffective
461
+ - **Vague descriptions**: "Use for general tasks" gives no signal
462
+ - **Prompts too long**: 2000 words don't make the subagent smarter
463
+ - **Duplicating slash commands**: Use skill if it's single-purpose without context isolation
464
+ - **Too many subagents**: Start with 2-3 focused ones, add as needed
465
+
466
+ ### Anti-Patterns to Avoid
467
+
468
+ ⚠️ **Vague descriptions**: "Use for general tasks" → Be specific: "Use when implementing authentication flows with OAuth providers."
469
+
470
+ ⚠️ **Prompts too long**: A 2000-word prompt is slower and harder to maintain.
471
+
472
+ ⚠️ **Duplicating slash commands**: If it's single-purpose without context isolation, use skill.
473
+
474
+ ⚠️ **Too many subagents**: Start with 2-3 focused ones. Add only with distinct use cases.
475
+
476
+ ## Skills vs Subagents vs Commands
477
+
478
+ Use this decision tree:
479
+
480
+ ```
481
+ Is the task complex with multiple steps?
482
+ ├─ YES → Does it require isolated context?
483
+ │ ├─ YES → Use SUBAGENT
484
+ │ └─ NO → Use SKILL
485
+
486
+ └─ NO → Is it a single, one-off action?
487
+ ├─ YES → Is it a custom command?
488
+ │ ├─ YES → Use slash command
489
+ │ └─ NO → Use SKILL
490
+ └─ NO → Use SUBAGENT
491
+ ```
492
+
493
+ **Examples:**
494
+
495
+ - **Subagent**: "Implement complete OAuth authentication with tests and documentation"
496
+ - **Subagent**: "Investigate all failing tests and fix them"
497
+ - **Subagent**: "Perform complete security audit of the payments module"
498
+ - **Skill**: "Generate changelog based on commits"
499
+ - **Skill**: "Format file imports"
500
+ - **Command**: `/fix` to fix linter errors
501
+
502
+ ## Performance and Cost
503
+
504
+ Subagents have trade-offs:
505
+
506
+ | Benefit | Trade-off |
507
+ |---------|-----------|
508
+ | Context isolation | Startup overhead (each subagent collects its own context) |
509
+ | Parallel execution | Higher token usage (multiple contexts simultaneously) |
510
+ | Specialized focus | Latency (can be slower than main agent for simple tasks) |
511
+
512
+ ### Token and Cost Considerations
513
+
514
+ - **Subagents consume tokens independently**: Each has its own context window
515
+ - **Parallel execution multiplies tokens**: 5 subagents = ~5x the tokens of a single agent
516
+ - **Evaluate the overhead**: For quick/simple tasks, the main agent is more efficient
517
+ - **Subagents can be slower**: The benefit is isolation, not speed
518
+
519
+ ## Quick Template
520
+
521
+ ```markdown
522
+ ---
523
+ name: [agent-name]
524
+ description: [Expert in X]. Use when [specific context of when to delegate].
525
+ model: inherit
526
+ ---
527
+
528
+ You are an [expert in X] specialized in [Y].
529
+
530
+ When invoked:
531
+ 1. [First step]
532
+ 2. [Second step]
533
+ 3. [Third step]
534
+
535
+ [Detailed instructions about approach and behavior]
536
+
537
+ Report [type of result]:
538
+ - [Specific format]
539
+ - [Information to include]
540
+ - [Success criteria]
541
+
542
+ [Principles or philosophy to follow]
543
+ ```
544
+
545
+ ## Quality Checklist
546
+
547
+ Before finalizing a subagent:
548
+
549
+ - [ ] Description is specific about when the Agent should delegate
550
+ - [ ] Filename uses kebab-case
551
+ - [ ] One clear responsibility (not generic)
552
+ - [ ] Prompt is concise but complete
553
+ - [ ] Instructions are actionable
554
+ - [ ] Output format is well defined
555
+ - [ ] Model configuration appropriate (inherit/fast/specific)
556
+ - [ ] readonly defined correctly (if only reads/analyzes)
557
+ - [ ] is_background defined correctly (if long-running)
558
+
559
+ ## Creation Outputs
560
+
561
+ When creating a subagent, you should:
562
+
563
+ 1. **Create the file**: `.cursor/agents/[agent-name].md`
564
+ 2. **Confirm location**: Inform where it was created
565
+ 3. **Explain usage**: How to invoke/test the subagent
566
+ 4. **Show syntax**: Invocation examples
567
+ 5. **Suggest improvements**: If relevant, refinements
568
+
569
+ ## Output Messages
570
+
571
+ When creating a subagent, inform:
572
+
573
+ ```
574
+ ✅ Subagent created successfully!
575
+
576
+ 📁 Location: .cursor/agents/[name].md
577
+ 🎯 Purpose: [brief description]
578
+ 🔧 How to invoke:
579
+ - Automatic: The Agent will delegate when it detects [context]
580
+ - Explicit: /[name] [your instruction]
581
+ - Natural: "Use the [name] subagent to [task]"
582
+
583
+ 💡 Tip: Include keywords in the description like "use proactively"
584
+ to encourage automatic delegation.
585
+ ```
586
+
587
+ ## Complete Examples
588
+
589
+ ### Example 1: Code Reviewer
590
+
591
+ ```markdown
592
+ ---
593
+ name: code-reviewer
594
+ description: Code review specialist. Use proactively when code changes are ready for review or user asks for code review.
595
+ model: inherit
596
+ ---
597
+
598
+ You are a code review expert with focus on quality, maintainability, and best practices.
599
+
600
+ When invoked:
601
+ 1. Analyze the code changes
602
+ 2. Check:
603
+ - Readability and clarity
604
+ - Performance and efficiency
605
+ - Project patterns and conventions
606
+ - Error handling
607
+ - Edge cases
608
+ - Tests (coverage and quality)
609
+ 3. Identify code smells and potential bugs
610
+ 4. Suggest specific improvements
611
+
612
+ Report in structured format:
613
+
614
+ **✅ Approved / ⚠️ Approved with caveats / ❌ Changes needed**
615
+
616
+ **Positive Points:**
617
+ - [List of well-implemented aspects]
618
+
619
+ **Issues Found:**
620
+ - **[Severity]** [Location]: [Issue description]
621
+ - Suggestion: [How to fix]
622
+
623
+ **Improvement Suggestions:**
624
+ - [Optional but recommended improvements]
625
+
626
+ Be constructive, specific, and focus on real impact.
627
+ ```
628
+
629
+ ### Example 2: Performance Optimizer
630
+
631
+ ```markdown
632
+ ---
633
+ name: performance-optimizer
634
+ description: Performance optimization specialist. Use when code has performance issues or user requests optimization.
635
+ model: inherit
636
+ ---
637
+
638
+ You are a performance optimization expert.
639
+
640
+ When invoked:
641
+ 1. Profile the code to identify bottlenecks
642
+ 2. Analyze:
643
+ - Algorithm complexity
644
+ - Memory usage
645
+ - I/O operations
646
+ - Database queries (N+1, indexes)
647
+ - Unnecessary renders (frontend)
648
+ 3. Identify quick wins vs complex optimizations
649
+ 4. Implement improvements maintaining readability
650
+
651
+ Report each optimization:
652
+
653
+ **Performance Analysis**
654
+
655
+ **Bottlenecks Identified:**
656
+ 1. [Location]: [Issue]
657
+ - Impact: [Metric before]
658
+ - Cause: [Technical explanation]
659
+
660
+ **Optimizations Implemented:**
661
+ 1. [Optimization name]
662
+ - Before: [Metric]
663
+ - After: [Metric]
664
+ - Change: [% improvement]
665
+ - Technique: [What was done]
666
+
667
+ **Next Steps:**
668
+ - [Possible additional optimizations]
669
+
670
+ Always measure real impact. Don't optimize prematurely.
671
+ ```
672
+
673
+ ---
674
+
675
+ ## Remember
676
+
677
+ Subagents are for **complex tasks with multiple steps that benefit from isolated context**. For quick, one-off actions, use **skills**.
678
+
679
+ The power of subagents lies in:
680
+ - Context isolation for long explorations
681
+ - Parallel execution of workstreams
682
+ - Deep specialization in specific domains
683
+ - Independent verification of work