$npx -y skills add girijashankarj/cursor-handbook --skill component-searchSearch across cursor-handbook rules, agents, commands, and skills for a specific term or topic. Use when the user asks to find a component, search for a keyword, or locate where something is defined.
| 1 | # Skill: Component Search |
| 2 | |
| 3 | Search across all cursor-handbook component types (rules, agents, commands, skills) to find files matching a term or topic. |
| 4 | |
| 5 | ## Trigger |
| 6 | When the user asks to find a rule, agent, skill, or command by keyword — or wants to know where a specific topic is covered in the handbook. |
| 7 | |
| 8 | ## Prerequisites |
| 9 | - [ ] cursor-handbook `.cursor/` directory exists |
| 10 | - [ ] `grep` command available (standard on macOS/Linux) |
| 11 | |
| 12 | ## Usage |
| 13 | |
| 14 | Run the bundled script: |
| 15 | |
| 16 | ```bash |
| 17 | scripts/search-components.sh <search-term> |
| 18 | ``` |
| 19 | |
| 20 | ### Examples |
| 21 | |
| 22 | Find all components related to "security": |
| 23 | ```bash |
| 24 | scripts/search-components.sh security |
| 25 | ``` |
| 26 | |
| 27 | Find components mentioning "database": |
| 28 | ```bash |
| 29 | scripts/search-components.sh database |
| 30 | ``` |
| 31 | |
| 32 | Find components referencing "correlationId": |
| 33 | ```bash |
| 34 | scripts/search-components.sh correlationId |
| 35 | ``` |
| 36 | |
| 37 | ## Steps |
| 38 | |
| 39 | ### Step 1: Identify Search Term |
| 40 | - [ ] Determine what the user is looking for |
| 41 | - [ ] If vague, suggest specific terms or ask for clarification |
| 42 | |
| 43 | ### Step 2: Run Search |
| 44 | - [ ] Execute `scripts/search-components.sh <term>` using the Shell tool |
| 45 | - [ ] Capture output grouped by component type |
| 46 | |
| 47 | ### Step 3: Present Results |
| 48 | - [ ] Format results as a table grouped by type (rules, agents, commands, skills) |
| 49 | - [ ] Include file paths and brief descriptions where available |
| 50 | - [ ] Highlight the most relevant matches |
| 51 | |
| 52 | ### Step 4: Suggest Actions |
| 53 | - [ ] Offer to read the most relevant file(s) |
| 54 | - [ ] Suggest related search terms if few results found |
| 55 | - [ ] Recommend creating a new component if nothing exists for the topic |
| 56 | |
| 57 | ## How It Works |
| 58 | |
| 59 | The script searches recursively through `.cursor/rules/`, `.cursor/agents/`, `.cursor/commands/`, and `.cursor/skills/` using case-insensitive `grep`. Results are grouped by component type. |
| 60 | |
| 61 | ## Rules |
| 62 | - Search is **case-insensitive** by default |
| 63 | - Only searches within `.cursor/` subdirectories |
| 64 | - Large result sets are not truncated — filter with a more specific term if needed |
| 65 | |
| 66 | ## Completion |
| 67 | List of matching files grouped by component type, with suggestions for next steps. |
| 68 | |
| 69 | ## If a Step Fails |
| 70 | - **No results:** Suggest alternative search terms, check spelling, or broader keywords |
| 71 | - **`.cursor/` not found:** Verify the user is in the correct project root |
| 72 | - **Too many results:** Suggest a more specific search term |