agent-knowledge-cli 0.1.2__py3-none-any.whl

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.
Files changed (88) hide show
  1. agent_knowledge/__init__.py +3 -0
  2. agent_knowledge/__main__.py +3 -0
  3. agent_knowledge/assets/__init__.py +0 -0
  4. agent_knowledge/assets/claude/global.md +44 -0
  5. agent_knowledge/assets/claude/project-template.md +46 -0
  6. agent_knowledge/assets/claude/scripts/install.sh +85 -0
  7. agent_knowledge/assets/commands/doctor.md +21 -0
  8. agent_knowledge/assets/commands/global-knowledge-sync.md +27 -0
  9. agent_knowledge/assets/commands/graphify-sync.md +26 -0
  10. agent_knowledge/assets/commands/knowledge-sync.md +26 -0
  11. agent_knowledge/assets/commands/ship.md +29 -0
  12. agent_knowledge/assets/rules/generate-architecture-doc.mdc +87 -0
  13. agent_knowledge/assets/rules/history-backfill.mdc +67 -0
  14. agent_knowledge/assets/rules/memory-bootstrap.mdc +53 -0
  15. agent_knowledge/assets/rules/memory-writeback.mdc +90 -0
  16. agent_knowledge/assets/rules/shared-memory.mdc +102 -0
  17. agent_knowledge/assets/rules/workflow-orchestration.mdc +93 -0
  18. agent_knowledge/assets/rules-global/action-first.mdc +26 -0
  19. agent_knowledge/assets/rules-global/no-icons-emojis.mdc +16 -0
  20. agent_knowledge/assets/rules-global/no-unsolicited-docs.mdc +20 -0
  21. agent_knowledge/assets/scripts/bootstrap-memory-tree.sh +389 -0
  22. agent_knowledge/assets/scripts/compact-memory.sh +191 -0
  23. agent_knowledge/assets/scripts/doctor.sh +137 -0
  24. agent_knowledge/assets/scripts/global-knowledge-sync.sh +372 -0
  25. agent_knowledge/assets/scripts/graphify-sync.sh +397 -0
  26. agent_knowledge/assets/scripts/import-agent-history.sh +706 -0
  27. agent_knowledge/assets/scripts/install-project-links.sh +258 -0
  28. agent_knowledge/assets/scripts/lib/knowledge-common.sh +875 -0
  29. agent_knowledge/assets/scripts/measure-token-savings.py +540 -0
  30. agent_knowledge/assets/scripts/ship.sh +256 -0
  31. agent_knowledge/assets/scripts/update-knowledge.sh +341 -0
  32. agent_knowledge/assets/scripts/validate-knowledge.sh +265 -0
  33. agent_knowledge/assets/skills/decision-recording/SKILL.md +124 -0
  34. agent_knowledge/assets/skills/history-backfill/SKILL.md +115 -0
  35. agent_knowledge/assets/skills/memory-compaction/SKILL.md +115 -0
  36. agent_knowledge/assets/skills/memory-management/SKILL.md +134 -0
  37. agent_knowledge/assets/skills/project-ontology-bootstrap/SKILL.md +173 -0
  38. agent_knowledge/assets/skills/session-management/SKILL.md +116 -0
  39. agent_knowledge/assets/skills-cursor/create-rule/SKILL.md +164 -0
  40. agent_knowledge/assets/skills-cursor/create-skill/SKILL.md +498 -0
  41. agent_knowledge/assets/skills-cursor/create-subagent/SKILL.md +225 -0
  42. agent_knowledge/assets/skills-cursor/migrate-to-skills/SKILL.md +134 -0
  43. agent_knowledge/assets/skills-cursor/shell/SKILL.md +24 -0
  44. agent_knowledge/assets/skills-cursor/update-cursor-settings/SKILL.md +122 -0
  45. agent_knowledge/assets/templates/dashboards/project-overview.template.md +24 -0
  46. agent_knowledge/assets/templates/dashboards/session-rollup.template.md +23 -0
  47. agent_knowledge/assets/templates/hooks/hooks.json.template +11 -0
  48. agent_knowledge/assets/templates/integrations/claude/CLAUDE.md +7 -0
  49. agent_knowledge/assets/templates/integrations/codex/AGENTS.md +7 -0
  50. agent_knowledge/assets/templates/integrations/cursor/agent-knowledge.mdc +11 -0
  51. agent_knowledge/assets/templates/integrations/cursor/hooks.json +11 -0
  52. agent_knowledge/assets/templates/memory/MEMORY.root.template.md +36 -0
  53. agent_knowledge/assets/templates/memory/branch.template.md +33 -0
  54. agent_knowledge/assets/templates/memory/decision.template.md +33 -0
  55. agent_knowledge/assets/templates/memory/profile.hybrid.yaml +16 -0
  56. agent_knowledge/assets/templates/memory/profile.ml-platform.yaml +18 -0
  57. agent_knowledge/assets/templates/memory/profile.robotics.yaml +19 -0
  58. agent_knowledge/assets/templates/memory/profile.web-app.yaml +16 -0
  59. agent_knowledge/assets/templates/portfolio/.obsidian/README.md +21 -0
  60. agent_knowledge/assets/templates/portfolio/.obsidian/app.json +5 -0
  61. agent_knowledge/assets/templates/portfolio/.obsidian/core-plugins.json +7 -0
  62. agent_knowledge/assets/templates/project/.agent-project.yaml +36 -0
  63. agent_knowledge/assets/templates/project/.agentknowledgeignore +10 -0
  64. agent_knowledge/assets/templates/project/AGENTS.md +87 -0
  65. agent_knowledge/assets/templates/project/agent-knowledge/.obsidian/README.md +23 -0
  66. agent_knowledge/assets/templates/project/agent-knowledge/.obsidian/app.json +5 -0
  67. agent_knowledge/assets/templates/project/agent-knowledge/.obsidian/core-plugins.json +7 -0
  68. agent_knowledge/assets/templates/project/agent-knowledge/Evidence/README.md +34 -0
  69. agent_knowledge/assets/templates/project/agent-knowledge/Evidence/imports/README.md +29 -0
  70. agent_knowledge/assets/templates/project/agent-knowledge/Evidence/raw/README.md +25 -0
  71. agent_knowledge/assets/templates/project/agent-knowledge/Memory/MEMORY.md +37 -0
  72. agent_knowledge/assets/templates/project/agent-knowledge/Memory/decisions/decisions.md +31 -0
  73. agent_knowledge/assets/templates/project/agent-knowledge/Outputs/README.md +24 -0
  74. agent_knowledge/assets/templates/project/agent-knowledge/STATUS.md +43 -0
  75. agent_knowledge/assets/templates/project/agent-knowledge/Sessions/README.md +21 -0
  76. agent_knowledge/assets/templates/project/agent-knowledge/Templates/README.md +19 -0
  77. agent_knowledge/assets/templates/project/gitignore.agent-knowledge +13 -0
  78. agent_knowledge/cli.py +457 -0
  79. agent_knowledge/runtime/__init__.py +0 -0
  80. agent_knowledge/runtime/integrations.py +154 -0
  81. agent_knowledge/runtime/paths.py +46 -0
  82. agent_knowledge/runtime/shell.py +22 -0
  83. agent_knowledge/runtime/sync.py +255 -0
  84. agent_knowledge_cli-0.1.2.dist-info/METADATA +155 -0
  85. agent_knowledge_cli-0.1.2.dist-info/RECORD +88 -0
  86. agent_knowledge_cli-0.1.2.dist-info/WHEEL +4 -0
  87. agent_knowledge_cli-0.1.2.dist-info/entry_points.txt +2 -0
  88. agent_knowledge_cli-0.1.2.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,498 @@
1
+ ---
2
+ name: create-skill
3
+ description: >-
4
+ Guides users through creating effective Agent Skills for Cursor. Use when you
5
+ want to create, write, or author a new skill, or asks about skill structure,
6
+ best practices, or SKILL.md format.
7
+ ---
8
+ # Creating Skills in Cursor
9
+
10
+ This skill guides you through creating effective Agent Skills for Cursor. Skills are markdown files that teach the agent how to perform specific tasks: reviewing PRs using team standards, generating commit messages in a preferred format, querying database schemas, or any specialized workflow.
11
+
12
+ ## Before You Begin: Gather Requirements
13
+
14
+ Before creating a skill, gather essential information from the user about:
15
+
16
+ 1. **Purpose and scope**: What specific task or workflow should this skill help with?
17
+ 2. **Target location**: Should this be a personal skill (~/.cursor/skills/) or project skill (.cursor/skills/)?
18
+ 3. **Trigger scenarios**: When should the agent automatically apply this skill?
19
+ 4. **Key domain knowledge**: What specialized information does the agent need that it wouldn't already know?
20
+ 5. **Output format preferences**: Are there specific templates, formats, or styles required?
21
+ 6. **Existing patterns**: Are there existing examples or conventions to follow?
22
+
23
+ ### Inferring from Context
24
+
25
+ If you have previous conversation context, infer the skill from what was discussed. You can create skills based on workflows, patterns, or domain knowledge that emerged in the conversation.
26
+
27
+ ### Gathering Additional Information
28
+
29
+ If you need clarification, use the AskQuestion tool when available:
30
+
31
+ ```
32
+ Example AskQuestion usage:
33
+ - "Where should this skill be stored?" with options like ["Personal (~/.cursor/skills/)", "Project (.cursor/skills/)"]
34
+ - "Should this skill include executable scripts?" with options like ["Yes", "No"]
35
+ ```
36
+
37
+ If the AskQuestion tool is not available, ask these questions conversationally.
38
+
39
+ ---
40
+
41
+ ## Skill File Structure
42
+
43
+ ### Directory Layout
44
+
45
+ Skills are stored as directories containing a `SKILL.md` file:
46
+
47
+ ```
48
+ skill-name/
49
+ ├── SKILL.md # Required - main instructions
50
+ ├── reference.md # Optional - detailed documentation
51
+ ├── examples.md # Optional - usage examples
52
+ └── scripts/ # Optional - utility scripts
53
+ ├── validate.py
54
+ └── helper.sh
55
+ ```
56
+
57
+ ### Storage Locations
58
+
59
+ | Type | Path | Scope |
60
+ |------|------|-------|
61
+ | Personal | ~/.cursor/skills/skill-name/ | Available across all your projects |
62
+ | Project | .cursor/skills/skill-name/ | Shared with anyone using the repository |
63
+
64
+ **IMPORTANT**: Never create skills in `~/.cursor/skills-cursor/`. This directory is reserved for Cursor's internal built-in skills and is managed automatically by the system.
65
+
66
+ ### SKILL.md Structure
67
+
68
+ Every skill requires a `SKILL.md` file with YAML frontmatter and markdown body:
69
+
70
+ ```markdown
71
+ ---
72
+ name: your-skill-name
73
+ description: Brief description of what this skill does and when to use it
74
+ ---
75
+
76
+ # Your Skill Name
77
+
78
+ ## Instructions
79
+ Clear, step-by-step guidance for the agent.
80
+
81
+ ## Examples
82
+ Concrete examples of using this skill.
83
+ ```
84
+
85
+ ### Required Metadata Fields
86
+
87
+ | Field | Requirements | Purpose |
88
+ |-------|--------------|---------|
89
+ | `name` | Max 64 chars, lowercase letters/numbers/hyphens only | Unique identifier for the skill |
90
+ | `description` | Max 1024 chars, non-empty | Helps agent decide when to apply the skill |
91
+
92
+ ---
93
+
94
+ ## Writing Effective Descriptions
95
+
96
+ The description is **critical** for skill discovery. The agent uses it to decide when to apply your skill.
97
+
98
+ ### Description Best Practices
99
+
100
+ 1. **Write in third person** (the description is injected into the system prompt):
101
+ - ✅ Good: "Processes Excel files and generates reports"
102
+ - ❌ Avoid: "I can help you process Excel files"
103
+ - ❌ Avoid: "You can use this to process Excel files"
104
+
105
+ 2. **Be specific and include trigger terms**:
106
+ - ✅ Good: "Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction."
107
+ - ❌ Vague: "Helps with documents"
108
+
109
+ 3. **Include both WHAT and WHEN**:
110
+ - WHAT: What the skill does (specific capabilities)
111
+ - WHEN: When the agent should use it (trigger scenarios)
112
+
113
+ ### Description Examples
114
+
115
+ ```yaml
116
+ # PDF Processing
117
+ description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
118
+
119
+ # Excel Analysis
120
+ description: Analyze Excel spreadsheets, create pivot tables, generate charts. Use when analyzing Excel files, spreadsheets, tabular data, or .xlsx files.
121
+
122
+ # Git Commit Helper
123
+ description: Generate descriptive commit messages by analyzing git diffs. Use when the user asks for help writing commit messages or reviewing staged changes.
124
+
125
+ # Code Review
126
+ description: Review code for quality, security, and best practices following team standards. Use when reviewing pull requests, code changes, or when the user asks for a code review.
127
+ ```
128
+
129
+ ---
130
+
131
+ ## Core Authoring Principles
132
+
133
+ ### 1. Concise is Key
134
+
135
+ The context window is shared with conversation history, other skills, and requests. Every token competes for space.
136
+
137
+ **Default assumption**: The agent is already very smart. Only add context it doesn't already have.
138
+
139
+ Challenge each piece of information:
140
+ - "Does the agent really need this explanation?"
141
+ - "Can I assume the agent knows this?"
142
+ - "Does this paragraph justify its token cost?"
143
+
144
+ **Good (concise)**:
145
+ ```markdown
146
+ ## Extract PDF text
147
+
148
+ Use pdfplumber for text extraction:
149
+
150
+ \`\`\`python
151
+ import pdfplumber
152
+
153
+ with pdfplumber.open("file.pdf") as pdf:
154
+ text = pdf.pages[0].extract_text()
155
+ \`\`\`
156
+ ```
157
+
158
+ **Bad (verbose)**:
159
+ ```markdown
160
+ ## Extract PDF text
161
+
162
+ PDF (Portable Document Format) files are a common file format that contains
163
+ text, images, and other content. To extract text from a PDF, you'll need to
164
+ use a library. There are many libraries available for PDF processing, but we
165
+ recommend pdfplumber because it's easy to use and handles most cases well...
166
+ ```
167
+
168
+ ### 2. Keep SKILL.md Under 500 Lines
169
+
170
+ For optimal performance, the main SKILL.md file should be concise. Use progressive disclosure for detailed content.
171
+
172
+ ### 3. Progressive Disclosure
173
+
174
+ Put essential information in SKILL.md; detailed reference material in separate files that the agent reads only when needed.
175
+
176
+ ```markdown
177
+ # PDF Processing
178
+
179
+ ## Quick start
180
+ [Essential instructions here]
181
+
182
+ ## Additional resources
183
+ - For complete API details, see [reference.md](reference.md)
184
+ - For usage examples, see [examples.md](examples.md)
185
+ ```
186
+
187
+ **Keep references one level deep** - link directly from SKILL.md to reference files. Deeply nested references may result in partial reads.
188
+
189
+ ### 4. Set Appropriate Degrees of Freedom
190
+
191
+ Match specificity to the task's fragility:
192
+
193
+ | Freedom Level | When to Use | Example |
194
+ |---------------|-------------|---------|
195
+ | **High** (text instructions) | Multiple valid approaches, context-dependent | Code review guidelines |
196
+ | **Medium** (pseudocode/templates) | Preferred pattern with acceptable variation | Report generation |
197
+ | **Low** (specific scripts) | Fragile operations, consistency critical | Database migrations |
198
+
199
+ ---
200
+
201
+ ## Common Patterns
202
+
203
+ ### Template Pattern
204
+
205
+ Provide output format templates:
206
+
207
+ ```markdown
208
+ ## Report structure
209
+
210
+ Use this template:
211
+
212
+ \`\`\`markdown
213
+ # [Analysis Title]
214
+
215
+ ## Executive summary
216
+ [One-paragraph overview of key findings]
217
+
218
+ ## Key findings
219
+ - Finding 1 with supporting data
220
+ - Finding 2 with supporting data
221
+
222
+ ## Recommendations
223
+ 1. Specific actionable recommendation
224
+ 2. Specific actionable recommendation
225
+ \`\`\`
226
+ ```
227
+
228
+ ### Examples Pattern
229
+
230
+ For skills where output quality depends on seeing examples:
231
+
232
+ ```markdown
233
+ ## Commit message format
234
+
235
+ **Example 1:**
236
+ Input: Added user authentication with JWT tokens
237
+ Output:
238
+ \`\`\`
239
+ feat(auth): implement JWT-based authentication
240
+
241
+ Add login endpoint and token validation middleware
242
+ \`\`\`
243
+
244
+ **Example 2:**
245
+ Input: Fixed bug where dates displayed incorrectly
246
+ Output:
247
+ \`\`\`
248
+ fix(reports): correct date formatting in timezone conversion
249
+
250
+ Use UTC timestamps consistently across report generation
251
+ \`\`\`
252
+ ```
253
+
254
+ ### Workflow Pattern
255
+
256
+ Break complex operations into clear steps with checklists:
257
+
258
+ ```markdown
259
+ ## Form filling workflow
260
+
261
+ Copy this checklist and track progress:
262
+
263
+ \`\`\`
264
+ Task Progress:
265
+ - [ ] Step 1: Analyze the form
266
+ - [ ] Step 2: Create field mapping
267
+ - [ ] Step 3: Validate mapping
268
+ - [ ] Step 4: Fill the form
269
+ - [ ] Step 5: Verify output
270
+ \`\`\`
271
+
272
+ **Step 1: Analyze the form**
273
+ Run: \`python scripts/analyze_form.py input.pdf\`
274
+ ...
275
+ ```
276
+
277
+ ### Conditional Workflow Pattern
278
+
279
+ Guide through decision points:
280
+
281
+ ```markdown
282
+ ## Document modification workflow
283
+
284
+ 1. Determine the modification type:
285
+
286
+ **Creating new content?** → Follow "Creation workflow" below
287
+ **Editing existing content?** → Follow "Editing workflow" below
288
+
289
+ 2. Creation workflow:
290
+ - Use docx-js library
291
+ - Build document from scratch
292
+ ...
293
+ ```
294
+
295
+ ### Feedback Loop Pattern
296
+
297
+ For quality-critical tasks, implement validation loops:
298
+
299
+ ```markdown
300
+ ## Document editing process
301
+
302
+ 1. Make your edits
303
+ 2. **Validate immediately**: \`python scripts/validate.py output/\`
304
+ 3. If validation fails:
305
+ - Review the error message
306
+ - Fix the issues
307
+ - Run validation again
308
+ 4. **Only proceed when validation passes**
309
+ ```
310
+
311
+ ---
312
+
313
+ ## Utility Scripts
314
+
315
+ Pre-made scripts offer advantages over generated code:
316
+ - More reliable than generated code
317
+ - Save tokens (no code in context)
318
+ - Save time (no code generation)
319
+ - Ensure consistency across uses
320
+
321
+ ```markdown
322
+ ## Utility scripts
323
+
324
+ **analyze_form.py**: Extract all form fields from PDF
325
+ \`\`\`bash
326
+ python scripts/analyze_form.py input.pdf > fields.json
327
+ \`\`\`
328
+
329
+ **validate.py**: Check for errors
330
+ \`\`\`bash
331
+ python scripts/validate.py fields.json
332
+ # Returns: "OK" or lists conflicts
333
+ \`\`\`
334
+ ```
335
+
336
+ Make clear whether the agent should **execute** the script (most common) or **read** it as reference.
337
+
338
+ ---
339
+
340
+ ## Anti-Patterns to Avoid
341
+
342
+ ### 1. Windows-Style Paths
343
+ - ✅ Use: `scripts/helper.py`
344
+ - ❌ Avoid: `scripts\helper.py`
345
+
346
+ ### 2. Too Many Options
347
+ ```markdown
348
+ # Bad - confusing
349
+ "You can use pypdf, or pdfplumber, or PyMuPDF, or..."
350
+
351
+ # Good - provide a default with escape hatch
352
+ "Use pdfplumber for text extraction.
353
+ For scanned PDFs requiring OCR, use pdf2image with pytesseract instead."
354
+ ```
355
+
356
+ ### 3. Time-Sensitive Information
357
+ ```markdown
358
+ # Bad - will become outdated
359
+ "If you're doing this before August 2025, use the old API."
360
+
361
+ # Good - use an "old patterns" section
362
+ ## Current method
363
+ Use the v2 API endpoint.
364
+
365
+ ## Old patterns (deprecated)
366
+ <details>
367
+ <summary>Legacy v1 API</summary>
368
+ ...
369
+ </details>
370
+ ```
371
+
372
+ ### 4. Inconsistent Terminology
373
+ Choose one term and use it throughout:
374
+ - ✅ Always "API endpoint" (not mixing "URL", "route", "path")
375
+ - ✅ Always "field" (not mixing "box", "element", "control")
376
+
377
+ ### 5. Vague Skill Names
378
+ - ✅ Good: `processing-pdfs`, `analyzing-spreadsheets`
379
+ - ❌ Avoid: `helper`, `utils`, `tools`
380
+
381
+ ---
382
+
383
+ ## Skill Creation Workflow
384
+
385
+ When helping a user create a skill, follow this process:
386
+
387
+ ### Phase 1: Discovery
388
+
389
+ Gather information about:
390
+ 1. The skill's purpose and primary use case
391
+ 2. Storage location (personal vs project)
392
+ 3. Trigger scenarios
393
+ 4. Any specific requirements or constraints
394
+ 5. Existing examples or patterns to follow
395
+
396
+ If you have access to the AskQuestion tool, use it for efficient structured gathering. Otherwise, ask conversationally.
397
+
398
+ ### Phase 2: Design
399
+
400
+ 1. Draft the skill name (lowercase, hyphens, max 64 chars)
401
+ 2. Write a specific, third-person description
402
+ 3. Outline the main sections needed
403
+ 4. Identify if supporting files or scripts are needed
404
+
405
+ ### Phase 3: Implementation
406
+
407
+ 1. Create the directory structure
408
+ 2. Write the SKILL.md file with frontmatter
409
+ 3. Create any supporting reference files
410
+ 4. Create any utility scripts if needed
411
+
412
+ ### Phase 4: Verification
413
+
414
+ 1. Verify the SKILL.md is under 500 lines
415
+ 2. Check that the description is specific and includes trigger terms
416
+ 3. Ensure consistent terminology throughout
417
+ 4. Verify all file references are one level deep
418
+ 5. Test that the skill can be discovered and applied
419
+
420
+ ---
421
+
422
+ ## Complete Example
423
+
424
+ Here's a complete example of a well-structured skill:
425
+
426
+ **Directory structure:**
427
+ ```
428
+ code-review/
429
+ ├── SKILL.md
430
+ ├── STANDARDS.md
431
+ └── examples.md
432
+ ```
433
+
434
+ **SKILL.md:**
435
+ ```markdown
436
+ ---
437
+ name: code-review
438
+ description: Review code for quality, security, and maintainability following team standards. Use when reviewing pull requests, examining code changes, or when the user asks for a code review.
439
+ ---
440
+
441
+ # Code Review
442
+
443
+ ## Quick Start
444
+
445
+ When reviewing code:
446
+
447
+ 1. Check for correctness and potential bugs
448
+ 2. Verify security best practices
449
+ 3. Assess code readability and maintainability
450
+ 4. Ensure tests are adequate
451
+
452
+ ## Review Checklist
453
+
454
+ - [ ] Logic is correct and handles edge cases
455
+ - [ ] No security vulnerabilities (SQL injection, XSS, etc.)
456
+ - [ ] Code follows project style conventions
457
+ - [ ] Functions are appropriately sized and focused
458
+ - [ ] Error handling is comprehensive
459
+ - [ ] Tests cover the changes
460
+
461
+ ## Providing Feedback
462
+
463
+ Format feedback as:
464
+ - 🔴 **Critical**: Must fix before merge
465
+ - 🟡 **Suggestion**: Consider improving
466
+ - 🟢 **Nice to have**: Optional enhancement
467
+
468
+ ## Additional Resources
469
+
470
+ - For detailed coding standards, see [STANDARDS.md](STANDARDS.md)
471
+ - For example reviews, see [examples.md](examples.md)
472
+ ```
473
+
474
+ ---
475
+
476
+ ## Summary Checklist
477
+
478
+ Before finalizing a skill, verify:
479
+
480
+ ### Core Quality
481
+ - [ ] Description is specific and includes key terms
482
+ - [ ] Description includes both WHAT and WHEN
483
+ - [ ] Written in third person
484
+ - [ ] SKILL.md body is under 500 lines
485
+ - [ ] Consistent terminology throughout
486
+ - [ ] Examples are concrete, not abstract
487
+
488
+ ### Structure
489
+ - [ ] File references are one level deep
490
+ - [ ] Progressive disclosure used appropriately
491
+ - [ ] Workflows have clear steps
492
+ - [ ] No time-sensitive information
493
+
494
+ ### If Including Scripts
495
+ - [ ] Scripts solve problems rather than punt
496
+ - [ ] Required packages are documented
497
+ - [ ] Error handling is explicit and helpful
498
+ - [ ] No Windows-style paths
@@ -0,0 +1,225 @@
1
+ ---
2
+ name: create-subagent
3
+ description: >-
4
+ Create custom subagents for specialized AI tasks. Use when you want to create
5
+ a new type of subagent, set up task-specific agents, configure code reviewers,
6
+ debuggers, or domain-specific assistants with custom prompts.
7
+ disable-model-invocation: true
8
+ ---
9
+ # Creating Custom Subagents
10
+
11
+ This skill guides you through creating custom subagents for Cursor. Subagents are specialized AI assistants that run in isolated contexts with custom system prompts.
12
+
13
+ ## When to Use Subagents
14
+
15
+ Subagents help you:
16
+ - **Preserve context** by isolating exploration from your main conversation
17
+ - **Specialize behavior** with focused system prompts for specific domains
18
+ - **Reuse configurations** across projects with user-level subagents
19
+
20
+ ### Inferring from Context
21
+
22
+ If you have previous conversation context, infer the subagent's purpose and behavior from what was discussed. Create the subagent based on specialized tasks or workflows that emerged in the conversation.
23
+
24
+ ## Subagent Locations
25
+
26
+ | Location | Scope | Priority |
27
+ |----------|-------|----------|
28
+ | `.cursor/agents/` | Current project | Higher |
29
+ | `~/.cursor/agents/` | All your projects | Lower |
30
+
31
+ When multiple subagents share the same name, the higher-priority location wins.
32
+
33
+ **Project subagents** (`.cursor/agents/`): Ideal for codebase-specific agents. Check into version control to share with your team.
34
+
35
+ **User subagents** (`~/.cursor/agents/`): Personal agents available across all your projects.
36
+
37
+ ## Subagent File Format
38
+
39
+ Create a `.md` file with YAML frontmatter and a markdown body (the system prompt):
40
+
41
+ ```markdown
42
+ ---
43
+ name: code-reviewer
44
+ description: Reviews code for quality and best practices
45
+ ---
46
+
47
+ You are a code reviewer. When invoked, analyze the code and provide
48
+ specific, actionable feedback on quality, security, and best practices.
49
+ ```
50
+
51
+ ### Required Fields
52
+
53
+ | Field | Description |
54
+ |-------|-------------|
55
+ | `name` | Unique identifier (lowercase letters and hyphens only) |
56
+ | `description` | When to delegate to this subagent (be specific!) |
57
+
58
+ ## Writing Effective Descriptions
59
+
60
+ The description is **critical** - the AI uses it to decide when to delegate.
61
+
62
+ ```yaml
63
+ # ❌ Too vague
64
+ description: Helps with code
65
+
66
+ # ✅ Specific and actionable
67
+ description: Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code.
68
+ ```
69
+
70
+ Include "use proactively" to encourage automatic delegation.
71
+
72
+ ## Example Subagents
73
+
74
+ ### Code Reviewer
75
+
76
+ ```markdown
77
+ ---
78
+ name: code-reviewer
79
+ description: Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code.
80
+ ---
81
+
82
+ You are a senior code reviewer ensuring high standards of code quality and security.
83
+
84
+ When invoked:
85
+ 1. Run git diff to see recent changes
86
+ 2. Focus on modified files
87
+ 3. Begin review immediately
88
+
89
+ Review checklist:
90
+ - Code is clear and readable
91
+ - Functions and variables are well-named
92
+ - No duplicated code
93
+ - Proper error handling
94
+ - No exposed secrets or API keys
95
+ - Input validation implemented
96
+ - Good test coverage
97
+ - Performance considerations addressed
98
+
99
+ Provide feedback organized by priority:
100
+ - Critical issues (must fix)
101
+ - Warnings (should fix)
102
+ - Suggestions (consider improving)
103
+
104
+ Include specific examples of how to fix issues.
105
+ ```
106
+
107
+ ### Debugger
108
+
109
+ ```markdown
110
+ ---
111
+ name: debugger
112
+ description: Debugging specialist for errors, test failures, and unexpected behavior. Use proactively when encountering any issues.
113
+ ---
114
+
115
+ You are an expert debugger specializing in root cause analysis.
116
+
117
+ When invoked:
118
+ 1. Capture error message and stack trace
119
+ 2. Identify reproduction steps
120
+ 3. Isolate the failure location
121
+ 4. Implement minimal fix
122
+ 5. Verify solution works
123
+
124
+ Debugging process:
125
+ - Analyze error messages and logs
126
+ - Check recent code changes
127
+ - Form and test hypotheses
128
+ - Add strategic debug logging
129
+ - Inspect variable states
130
+
131
+ For each issue, provide:
132
+ - Root cause explanation
133
+ - Evidence supporting the diagnosis
134
+ - Specific code fix
135
+ - Testing approach
136
+ - Prevention recommendations
137
+
138
+ Focus on fixing the underlying issue, not the symptoms.
139
+ ```
140
+
141
+ ### Data Scientist
142
+
143
+ ```markdown
144
+ ---
145
+ name: data-scientist
146
+ description: Data analysis expert for SQL queries, BigQuery operations, and data insights. Use proactively for data analysis tasks and queries.
147
+ ---
148
+
149
+ You are a data scientist specializing in SQL and BigQuery analysis.
150
+
151
+ When invoked:
152
+ 1. Understand the data analysis requirement
153
+ 2. Write efficient SQL queries
154
+ 3. Use BigQuery command line tools (bq) when appropriate
155
+ 4. Analyze and summarize results
156
+ 5. Present findings clearly
157
+
158
+ Key practices:
159
+ - Write optimized SQL queries with proper filters
160
+ - Use appropriate aggregations and joins
161
+ - Include comments explaining complex logic
162
+ - Format results for readability
163
+ - Provide data-driven recommendations
164
+
165
+ For each analysis:
166
+ - Explain the query approach
167
+ - Document any assumptions
168
+ - Highlight key findings
169
+ - Suggest next steps based on data
170
+
171
+ Always ensure queries are efficient and cost-effective.
172
+ ```
173
+
174
+ ## Subagent Creation Workflow
175
+
176
+ ### Step 1: Decide the Scope
177
+
178
+ - **Project-level** (`.cursor/agents/`): For codebase-specific agents shared with team
179
+ - **User-level** (`~/.cursor/agents/`): For personal agents across all projects
180
+
181
+ ### Step 2: Create the File
182
+
183
+ ```bash
184
+ # For project-level
185
+ mkdir -p .cursor/agents
186
+ touch .cursor/agents/my-agent.md
187
+
188
+ # For user-level
189
+ mkdir -p ~/.cursor/agents
190
+ touch ~/.cursor/agents/my-agent.md
191
+ ```
192
+
193
+ ### Step 3: Define Configuration
194
+
195
+ Write the frontmatter with the required fields (`name` and `description`).
196
+
197
+ ### Step 4: Write the System Prompt
198
+
199
+ The body becomes the system prompt. Be specific about:
200
+ - What the agent should do when invoked
201
+ - The workflow or process to follow
202
+ - Output format and structure
203
+ - Any constraints or guidelines
204
+
205
+ ### Step 5: Test the Agent
206
+
207
+ Ask the AI to use your new agent:
208
+
209
+ ```
210
+ Use the my-agent subagent to [task description]
211
+ ```
212
+
213
+ ## Best Practices
214
+
215
+ 1. **Design focused subagents**: Each should excel at one specific task
216
+ 2. **Write detailed descriptions**: Include trigger terms so the AI knows when to delegate
217
+ 3. **Check into version control**: Share project subagents with your team
218
+ 4. **Use proactive language**: Include "use proactively" in descriptions
219
+
220
+ ## Troubleshooting
221
+
222
+ ### Subagent Not Found
223
+ - Ensure file is in `.cursor/agents/` or `~/.cursor/agents/`
224
+ - Check file has `.md` extension
225
+ - Verify YAML frontmatter syntax is valid