원클릭으로
ripgrep
Enforces search-before-coding discipline: never create new implementation before checking existing code patterns and utilities.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Enforces search-before-coding discipline: never create new implementation before checking existing code patterns and utilities.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Communicate efficiently without sacrificing clarity - natural, concise, actionable. Global skill loaded for every command and agent.
Use when reviewing or building UI components - ensures keyboard, screen-reader, and visual accessibility (WCAG 2.1 AA) so a11y is built in, not retrofitted.
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
Manages context caching to optimize token usage and cost by creating, incrementally updating, and invalidating caches while verifying integrity before reuse.
Clean code and engineering discipline: modularity, readability, sizing, naming, duplication, separation of concerns, plus the four behavioral principles - think before coding, simplicity first, surgical changes, and goal-driven execution. Global skill applied to all coding work.
Detects and resolves drift between code, documentation, and contextual knowledge, classifying each drift and recommending concrete sync actions to keep artifacts consistent.
| name | ripgrep |
| description | Enforces search-before-coding discipline: never create new implementation before checking existing code patterns and utilities. |
Systematically search existing code before implementing anything new to prevent duplication and ensure consistency.
Prevent wasted effort and inconsistency by:
This skill is automatically selected by the orchestrator when:
Critical rule: This skill MUST be invoked before ANY new implementation.
Before implementing, identify what to search for:
Use ripgrep (rg) to search efficiently:
By functionality:
rg "format.*date" --type ts
rg "validate.*email" --type ts
rg "fetch.*user" --type ts
By pattern:
rg "export.*function.*Api" --type ts
rg "class.*Service.*extends" --type ts
rg "const.*Schema.*=.*z\." --type ts
By imports (find what uses a library):
rg "from 'zod'" --type ts
rg "import.*React.*useState" --type tsx
By file patterns:
rg ".*" --type ts --files | grep -i "user"
rg ".*" --type ts --files | grep -i "api"
For each finding:
Based on search results:
Search Queries Executed:
🔍 Searches performed:
1. rg "validate.*email" --type ts
2. rg "from 'zod'" --type ts
3. rg "export.*Schema" --type ts
4. Find files: rg --files | grep -i validation
Findings:
📦 Existing implementations found:
lib/validators.ts:
✓ validateEmail(email: string): boolean
✓ validatePhone(phone: string): boolean
✓ validateUrl(url: string): boolean
→ Can reuse validateEmail directly
lib/schemas/user.ts:
✓ Uses Zod for validation
✓ Pattern: export const UserSchema = z.object({...})
→ Follow this pattern for new schemas
components/forms/ContactForm.tsx:
✓ Example of form validation with Zod
✓ Uses react-hook-form + Zod resolver
→ Follow this pattern for new forms
Recommendations:
✅ REUSE:
- lib/validators.ts → validateEmail()
- Follow Zod schema pattern from lib/schemas/
🔧 ADAPT:
- Use ContactForm.tsx as template for new form
- Follow same validation approach
🆕 CREATE (nothing found):
- validatePostalCode() - no existing implementation
- Document pattern in lib/validators.ts for consistency
Code Examples to Follow:
// Pattern found in lib/schemas/user.ts
export const NewSchema = z.object({
field: z.string().email(),
// ... following established pattern
});
// Pattern found in components/forms/ContactForm.tsx
const form = useForm({
resolver: zodResolver(NewSchema),
// ... following established pattern
});
Ripgrep is the natural tool for cheap structure-first exploration. For any code file larger than ~100 lines, outline its symbols/signatures before reading it in full, then open only the region for the symbol you need.
# Outline a file's symbols (portable, no AST/runtime dependency)
rg -n "^(export\s+)?(async\s+)?(function|class|const|interface|type|def|enum)\b" path/to/file
The -n flag gives line numbers so you can jump straight to the symbol's body. Reading an entire large file just to find one function is the anti-pattern to eliminate.
Pick the cheapest path that answers the question:
| Approach | Tokens | Use case |
|---|---|---|
| Outline (rg signatures) | ~200–600 | "What's in this file?" |
| Read one symbol/region | ~300–1,500 | "Show me this function" |
| Read full file | ~6,000–12,000+ | "I truly need everything" |
Look for existing implementations of what you need:
rg "function.*formatDate" --type ts
rg "export.*parseJson" --type ts
rg "class.*UserService" --type ts
Find how similar things are done:
rg "\.post\('/api/" --type ts # How we define POST endpoints
rg "useState<.*>" --type tsx # How we use state
rg "try.*catch.*finally" --type ts # How we handle errors
See how libraries are used:
rg "from 'prisma'" --type ts
rg "import.*axios" --type ts
rg "import.*'next/navigation'" --type ts
Find relevant files:
rg --files | grep -i auth
rg --files | grep -i "user"
rg --files --type ts | grep "\.test\."
Find existing types:
rg "interface.*User" --type ts
rg "type.*Props.*=" --type ts
rg "export type.*Response" --type ts
Find configuration patterns:
rg "export.*config" --type ts
rg "process\.env\." --type ts
Before claiming "nothing exists", ensure you searched for:
Task: Implement email validation for registration form
Step 1 - Search for existing validation:
rg "validate.*email" --type ts
# Found: lib/validators.ts has validateEmail()
Step 2 - Search for form patterns:
rg "useForm" --type tsx
# Found: Multiple forms use react-hook-form with Zod
Step 3 - Search for registration-specific code:
rg "register" --type ts | grep -i "form\|component"
# Found: components/auth/LoginForm.tsx (similar pattern)
Decision:
Result: Consistent implementation, no duplication, follows existing patterns
Authentication/Authorization:
rg "auth" --type ts | grep -i "middleware\|guard\|check"
rg "isAuthenticated\|requireAuth" --type ts
Database Operations:
rg "prisma\." --type ts
rg "\.findMany\|\.findUnique\|\.create" --type ts
API Endpoints:
rg "route\.(ts|js)" --files
rg "export.*GET.*POST.*PUT.*DELETE" --type ts
Error Handling:
rg "try.*catch" --type ts -A 3
rg "throw new.*Error" --type ts
State Management:
rg "useState\|useReducer\|useContext" --type tsx
rg "create.*store" --type ts
Consistency:
Efficiency:
Quality:
Knowledge Transfer: