# /add-skill Guide the user through creating a new Agent Skill. ## Instructions for Cursor You will help the user create a reusable skill in `.cursor/skills/[skill-name]/SKILL.md`. ### Mode Use **Plan Mode** for the interview. Switch to **Act Mode** for file creation. ### Process **Step 1: Introduction** Explain what skills are: "Skills are reusable instruction sets for complex, multi-step tasks. Unlike rules (which apply automatically to files), skills are invoked on demand. Good skills: - Solve a repeatable problem - Have clear inputs and outputs - Guide through a multi-step process - Can reference other files and tools" **Step 2: Interview Questions** Ask these questions ONE AT A TIME: 1. **Skill Purpose** "What task should this skill help accomplish? Describe the end-to-end process." 2. **Trigger Phrases** "What might someone say to invoke this skill? Give 2-3 example phrases. (e.g., 'deploy to production', 'set up a new API endpoint', 'review this PR')" 3. **Prerequisites** "What needs to exist before this skill can run? (e.g., specific files, environment setup, dependencies)" 4. **Steps** "Walk me through the steps this skill should perform. Be specific about: - Questions to ask the user - Files to create or modify - Commands to run - Validations to perform" 5. **Outputs** "What should exist when this skill completes successfully? (e.g., files created, state changes, user confirmations)" 6. **Edge Cases** "What could go wrong? How should the skill handle: - Missing prerequisites - User errors - Partial completion" 7. **Skill Name** "What should this skill be called? I'll create it at `.cursor/skills/[name]/SKILL.md` Use kebab-case (e.g., `deploy-production`, `setup-api-endpoint`)" **Step 3: Draft the Skill** Create a draft and show the user for review. **Step 4: Generate SKILL.md** Create the skill with this structure: ```markdown # [Skill Name] > [One-line description] ## When to Use Use this skill when: - [Trigger condition 1] - [Trigger condition 2] Example invocations: - "[example phrase 1]" - "[example phrase 2]" ## Prerequisites Before running this skill, ensure: - [ ] [Prerequisite 1] - [ ] [Prerequisite 2] ## Process ### Step 1: [Step Name] **Action:** [What to do] **Questions to ask:** 1. [Question 1] 2. [Question 2] **Validation:** - [ ] [Check 1] ### Step 2: [Step Name] **Action:** [What to do] [Continue for each step...] ### Step N: Completion **Verify:** - [ ] [Output 1 exists] - [ ] [Output 2 is valid] **Report to user:** "[Summary of what was accomplished]" ## Error Handling ### [Error Scenario 1] **Symptom:** [How to detect] **Resolution:** [What to do] ### [Error Scenario 2] [Continue...] ## Outputs This skill produces: - [Output 1]: [Description] - [Output 2]: [Description] ## Related - [Link to related skill or rule] - [Link to documentation] ``` **Step 5: Optional Supporting Files** Ask if the skill needs: - Template files in the skill folder - Example configurations - Helper scripts If yes, create them in `.cursor/skills/[skill-name]/`. **Step 6: Confirm** "Skill created at `.cursor/skills/[skill-name]/SKILL.md`! To use this skill, simply describe the task matching these triggers: [list trigger phrases] Want to: 1. Test the skill now? 2. Add supporting files? 3. Create another skill?" ### Token Efficiency - Skills should be self-contained but reference external docs when needed - Keep each step focused on one action - Use checklists for validations