Main Site ↗

file-search

by massgen912102GitHub

A highly practical skill that provides expert guidance on using ripgrep and ast-grep for efficient codebase exploration, with exceptional emphasis on targeted search strategies to avoid overwhelming results.

Loading...

Output Preview

output_preview.md

File Search Results: Authentication Patterns

Search Configuration

  • Tool: ripgrep (rg)
  • Pattern: class.*Auth.*Service
  • File Types: Python, JavaScript, TypeScript
  • Scope: src/ directory only
  • Exclusions: node_modules, venv, tests

Summary

Found 8 relevant files across the codebase containing authentication service classes.

Detailed Results

High Priority Matches (Core Services)

# src/services/auth_service.py:15-30 class AuthenticationService: """Main authentication service handling user login/logout""" def __init__(self, config: AuthConfig): self.config = config self.session_manager = SessionManager() async def authenticate(self, credentials: UserCredentials) -> AuthResult: # OAuth 2.0 implementation token = await self._get_oauth_token(credentials) return AuthResult(success=True, token=token) # src/services/oauth_service.py:42-55 class OAuthService(AuthenticationService): """OAuth-specific authentication service""" def __init__(self, provider: str): super().__init__(get_oauth_config(provider)) self.provider = provider

Secondary Matches (Supporting Services)

// src/client/services/auth-client.js:88-102 class ClientAuthService { constructor(apiClient) { this.apiClient = apiClient; this.tokenStorage = new TokenStorage(); } async login(email, password) { const response = await this.apiClient.post('/auth/login', { email, password }); this.tokenStorage.setToken(response.token); return response.user; } } // src/admin/services/admin-auth.js:12-25 class AdminAuthService extends AuthenticationService { // Admin-specific authentication with 2FA async authenticateAdmin(credentials, twoFactorCode) { // Implementation... } }

Statistics

  • Python files: 3 matches
  • JavaScript files: 4 matches
  • TypeScript files: 1 match
  • Total lines of code: ~240 lines across all services

Recommendations

  1. Centralization Opportunity: Consider consolidating ClientAuthService and AdminAuthService into the main AuthenticationService
  2. Security Review: Check all authentication services for consistent token validation
  3. Testing Coverage: Verify unit tests exist for all 8 authentication service classes

Next Steps

  1. Run AST-grep search for authentication middleware patterns: sg --pattern 'function $MIDDLEWARE($$) { $$ }' --lang js src/middleware/
  2. Search for authentication-related environment variables: rg -i 'auth.*key|secret.*token' --type env
  3. Find all authentication API endpoints: rg 'POST.*auth|GET.*auth' --type py src/api/

Target Audience

Software developers, code reviewers, technical leads, and anyone needing to explore, understand, or refactor codebases efficiently.

9
Clarity
10
Practicality
9
Quality
8
Maintainability
7
Innovation
Development
code-searchripgrepast-grepcode-analysisrefactoring
Compatible Agents
Claude Code
Claude Code
~/.claude/skills/
Codex CLI
Codex CLI
~/.codex/skills/
Gemini CLI
Gemini CLI
~/.gemini/skills/
O
OpenCode
~/.opencode/skills/
O
OpenClaw
~/.openclaw/skills/
GitHub Copilot
GitHub Copilot
~/.copilot/skills/
Cursor
Cursor
~/.cursor/skills/
W
Windsurf
~/.codeium/windsurf/skills/
C
Cline
~/.cline/skills/
R
Roo Code
~/.roo/skills/
K
Kiro
~/.kiro/skills/
J
Junie
~/.junie/skills/
A
Augment Code
~/.augment/skills/
W
Warp
~/.warp/skills/
G
Goose
~/.config/goose/skills/
SKILL.md

File Search Skill

Fast file-name and content search using fd and rg (ripgrep).

Find Files by Name

Search for files matching a pattern:

fd "\.rs$" /home/xrx/projects

Find files by exact name:

fd -g "Cargo.toml" /home/xrx/projects

Search File Contents

Search for a regex pattern across files:

rg "TODO|FIXME" /home/xrx/projects

Search with context lines:

rg -C 3 "fn main" /home/xrx/projects --type rust

Install

sudo dnf install fd-find ripgrep

Source: https://github.com/massgen/MassGen#massgen~skills~file-search

Content curated from original sources, copyright belongs to authors

Grade S
9.0AI Score
Best Practices
Checking...
Try this Skill

User Rating

USER RATING

0UP
0DOWN
Loading files...

WORKS WITH

Claude Code
Claude
Codex CLI
Codex
Gemini CLI
Gemini
O
OpenCode
O
OpenClaw
GitHub Copilot
Copilot
Cursor
Cursor
W
Windsurf
C
Cline
R
Roo
K
Kiro
J
Junie
A
Augment
W
Warp
G
Goose