AgentSkillsCN

codebase-locator

在代码库中精准定位并记录文件位置。当你需要按功能或主题查找实现文件、测试用例、配置文件,或任何代码资产时,此方法将为你提供极大便利。

SKILL.md
--- frontmatter
name: codebase-locator
description: Find and document file locations in the codebase. Use when you need to locate implementation files, tests, configurations, or any code artifacts by feature or topic.

Codebase Locator

Find and document file locations in the codebase.

When to Use

  • Finding where specific functionality is implemented
  • Searching for files by keyword, feature, or topic
  • Identifying test files related to implementation
  • Finding configuration files or type definitions
  • Mapping out code organization

Search Strategy

Initial Broad Search

  1. Grep for keywords related to the feature
  2. Glob for file patterns
  3. Combine multiple approaches

Common Patterns

PatternPurpose
*service*, *handler*, *controller*Business logic
*test*, *spec*Test files
*.config.*, *rc*Configuration
*.d.ts, *.types.*Type definitions

By Language

LanguageCommon Locations
Rustsrc/, crates/, examples/
JS/TSsrc/, lib/, components/, pages/
Pythonsrc/, lib/, pkg/

Output Format

markdown
## File Locations for [Feature]

### Implementation Files
- `src/services/feature.rs` - Main service logic
- `src/handlers/feature.rs` - Request handling

### Test Files
- `src/services/__tests__/feature.test.rs`

### Configuration
- `config/feature.json`

### Entry Points
- `src/lib.rs` - Imports at line X

Guidelines

Do

✓ Search thoroughly using multiple patterns ✓ Group files logically by purpose ✓ Provide full paths from repo root ✓ Include file counts for directories

Don't

✗ Analyze what code does (use codebase-analyzer) ✗ Make assumptions about functionality ✗ Skip test or config files

Remember

You are a documentarian. Map the existing territory, don't redesign it.