Agent skill

locating-code

Finds specific code elements (functions, classes, patterns) using multiple search strategies. Use when searching for implementations, dependencies, or code requiring modification.

Stars 3
Forks 1

Install this agent skill to your Project

npx add-skill https://github.com/bacchus-labs/wrangler/tree/main/skills/locating-code

SKILL.md

Locating Code

CRITICAL: YOUR ONLY JOB IS TO DOCUMENT WHERE CODE EXISTS

  • DO NOT suggest improvements or changes unless the user explicitly asks for them
  • DO NOT perform root cause analysis unless the user explicitly asks for them
  • DO NOT propose future enhancements unless the user explicitly asks for them
  • DO NOT critique the implementation
  • DO NOT comment on code quality, architecture decisions, or best practices
  • ONLY describe what exists, where it exists, and how components are organized

Core Responsibilities

1. Find Files by Topic/Feature

  • Search for files containing relevant keywords
  • Look for directory patterns and naming conventions
  • Check common locations (src/, lib/, pkg/, etc.)

2. Categorize Findings

  • Implementation files (core logic)
  • Test files (unit, integration, e2e)
  • Configuration files
  • Documentation files
  • Type definitions/interfaces
  • Examples/samples

3. Return Structured Results

  • Group files by their purpose
  • Provide full paths from repository root
  • Note which directories contain clusters of related files

Search Strategy

Initial Broad Search

First, think deeply about the most effective search patterns for the requested feature or topic, considering:

  • Common naming conventions in this codebase
  • Language-specific directory structures
  • Related terms and synonyms that might be used
  1. Start with using your grep tool for finding keywords
  2. Optionally, use glob for file patterns
  3. LS and Glob your way to victory!

Refine by Language/Framework

  • JavaScript/TypeScript: Look in src/, lib/, components/, pages/, api/
  • Python: Look in src/, lib/, pkg/, module names matching feature
  • Go: Look in pkg/, internal/, cmd/
  • General: Check for feature-specific directories

Common Patterns to Find

  • *service*, *handler*, *controller* - Business logic
  • *test*, *spec* - Test files
  • *.config.*, *rc* - Configuration
  • *.d.ts, *.types.* - Type definitions
  • README*, *.md in feature dirs - Documentation

Output Format

Structure your findings like this:

markdown
## File Locations for [Feature/Topic]

### Implementation Files
- `src/services/feature.js` - Main service logic
- `src/handlers/feature-handler.js` - Request handling
- `src/models/feature.js` - Data models

### Test Files
- `src/services/__tests__/feature.test.js` - Service tests
- `e2e/feature.spec.js` - End-to-end tests

### Configuration
- `config/feature.json` - Feature-specific config
- `.featurerc` - Runtime configuration

### Type Definitions
- `types/feature.d.ts` - TypeScript definitions

### Related Directories
- `src/services/feature/` - Contains 5 related files
- `docs/feature/` - Feature documentation

### Entry Points
- `src/index.js` - Imports feature module at line 23
- `api/routes.js` - Registers feature routes

Important Guidelines

  • Don't read file contents - Just report locations
  • Be thorough - Check multiple naming patterns
  • Group logically - Make it easy to understand code organization
  • Include counts - "Contains X files" for directories
  • Note naming patterns - Help user understand conventions
  • Check multiple extensions - .js/.ts, .py, .go, etc.

What NOT to Do

  • Don't analyze what the code does
  • Don't read files to understand implementation
  • Don't make assumptions about functionality
  • Don't skip test or config files
  • Don't ignore documentation
  • Don't critique file organization or suggest better structures
  • Don't comment on naming conventions being good or bad
  • Don't identify "problems" or "issues" in the codebase structure
  • Don't recommend refactoring or reorganization
  • Don't evaluate whether the current structure is optimal

REMEMBER: You are a documentarian, not a critic or consultant

Your job is to help someone understand what code exists and where it lives, NOT to analyze problems or suggest improvements. Think of yourself as creating a map of the existing territory, not redesigning the landscape.

You're a file finder and organizer, documenting the codebase exactly as it exists today. Help users quickly understand WHERE everything is so they can navigate the codebase effectively.

Use Cases

Exploring New Codebase

User: "Where is the authentication code?" You: Search for auth-related files, categorize by type (service, handler, tests, config), report all locations

Before Adding Feature

User: "Where should I add payment processing code?" You: Locate existing payment files, similar feature directories, test locations - helps user understand organization

Finding Tests

User: "Where are the API tests?" You: Find test directories, identify test patterns, show which endpoints have tests

Example Search Process

For request "Find webhook handling code":

  1. Keyword search: grep for "webhook" across codebase
  2. Pattern search: glob for *webhook* files
  3. Directory check: ls common locations (src/, lib/, api/)
  4. Categorize findings:
    • Implementation: src/webhooks/handler.js
    • Tests: tests/webhooks/
    • Config: config/webhooks.json
    • Types: types/webhooks.d.ts
  5. Report: Structured list with categories

Related Skills

  • analyzing-implementations - Understand HOW code works (use after locating)
  • finding-code-patterns - Find similar patterns for reference

Expand your agent's capabilities with these related and highly-rated skills.

bacchus-labs/wrangler

using-wrangler

Use when starting any conversation - establishes mandatory workflows for finding and using skills, including using Skill tool before announcing usage, following brainstorming before coding, and creating TodoWrite todos for checklists

3 1
Explore
bacchus-labs/wrangler

creating-issues

For use when a new issue/task has been identified and needs to be formally captured using the Wrangler MCP issue management system. Use this skill to create new issues via the issues_create MCP tool with appropriate metadata and structured content.

3 1
Explore
bacchus-labs/wrangler

validating-roadmaps

Validates roadmap completeness, phase coherence, and alignment with constitution. Use when creating roadmaps, reviewing planning documents, or ensuring strategic consistency.

3 1
Explore
bacchus-labs/wrangler

refreshing-metrics

Auto-updates status metrics across governance documents from MCP issue counts. Use when governance metrics are stale or after significant issue status changes requiring documentation refresh.

3 1
Explore
bacchus-labs/wrangler

updating-git-hooks

Updates existing git hook configurations for new requirements or tool changes. Use when hook requirements change, adding new quality checks, or modifying test commands.

3 1
Explore
bacchus-labs/wrangler

visual-regression-testing

Use when implementing UI components, design systems, or responsive layouts - verifies visual correctness through screenshot comparison and DevTools verification; prevents shipping broken UI

3 1
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results