Expert system for efficient code search, analysis, and implementation planning across repositories with mandatory discovery-first approach to prevent code duplication.
This skill enforces a rigorous discovery-first methodology for code implementation in Cursor. It prevents code duplication and ensures architectural consistency by mandating comprehensive searches before any code changes.
1. **Search Before Code**: Never write or suggest code without first searching the codebase
2. **Document Everything**: All findings must be documented in a structured format
3. **User Approval Required**: Wait for explicit approval before implementing changes
4. **Prefer Enhancement**: Always enhance existing code over creating new files
5. **Justify New Code**: Creating new files requires detailed justification
Before ANY implementation work, execute these searches:
```bash
grep_search <relevant_keywords>
file_search <related_names>
list_dir <relevant_directories>
```
Create a comprehensive findings report:
```markdown
1. [Detailed first step with effort estimate]
2. [Detailed second step with effort estimate]
3. [Additional steps as needed]
```
Only after approval:
1. Follow the approved implementation plan exactly
2. Update documentation as you progress
3. Run tests and validations at each step
4. Document any deviations from the plan
Search for code patterns, function names, or text across the codebase:
```bash
grep_search "function_name"
grep_search "import.*Component"
grep_search "TODO|FIXME"
```
Find files by name or pattern:
```bash
file_search "component.tsx"
file_search "*.config.js"
file_search "test"
```
Explore directory structure:
```bash
list_dir src/
list_dir components/
list_dir .
```
❌ **NEVER DO THESE**:
**User Request**: "Add authentication middleware"
**Correct Approach**:
```bash
grep_search "middleware"
grep_search "authentication"
file_search "*middleware*"
list_dir src/middleware/
"I found existing authentication middleware at src/middleware/auth.middleware.ts.
It has JWT validation but is missing refresh token support.
Options:
1. Enhance existing middleware with refresh token logic (recommended)
2. Create separate refresh middleware (only if different auth flow needed)
Which approach would you prefer?"
```
**User Request**: "Fix the CSV parsing bug"
**Correct Approach**:
```bash
grep_search "csv"
grep_search "parse"
file_search "*csv*"
```
When working with CI/CD pipelines:
1. Search for existing workflow files: `.github/workflows/`
2. Document current automation setup
3. Identify gaps in testing or deployment
4. Propose enhancements to existing workflows
5. Create new workflows only if justified
✅ A successful implementation includes:
---
**Remember**: The most important rule is to SEARCH FIRST. Code duplication is worse than spending extra time on discovery. When in doubt, search more and ask the user for guidance.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/cursor-search-and-analysis-tool/raw