codebase-locator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Codebase Locator

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
  1. 使用Grep搜索与功能相关的关键词
  2. 使用Glob匹配文件模式
  3. 结合多种方法

Common Patterns

常见模式

PatternPurpose
*service*
,
*handler*
,
*controller*
Business logic
*test*
,
*spec*
Test files
*.config.*
,
*rc*
Configuration
*.d.ts
,
*.types.*
Type definitions
模式用途
*service*
,
*handler*
,
*controller*
业务逻辑
*test*
,
*spec*
测试文件
*.config.*
,
*rc*
配置文件
*.d.ts
,
*.types.*
类型定义

By Language

按语言分类

LanguageCommon Locations
Rustsrc/, crates/, examples/
JS/TSsrc/, lib/, components/, pages/
Pythonsrc/, lib/, pkg/
语言常见位置
Rustsrc/, crates/, examples/
JS/TSsrc/, lib/, components/, pages/
Pythonsrc/, lib/, pkg/

Output Format

输出格式

markdown
undefined
markdown
undefined

File Locations for [Feature]

[功能名称]的文件位置

Implementation Files

实现文件

  • src/services/feature.rs
    - Main service logic
  • src/handlers/feature.rs
    - Request handling
  • src/services/feature.rs
    - 主要服务逻辑
  • src/handlers/feature.rs
    - 请求处理

Test Files

测试文件

  • src/services/__tests__/feature.test.rs
  • src/services/__tests__/feature.test.rs

Configuration

配置文件

  • config/feature.json
  • config/feature.json

Entry Points

入口文件

  • src/lib.rs
    - Imports at line X
undefined
  • src/lib.rs
    - 第X行导入
undefined

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
✗ 分析代码功能(请使用codebase-analyzer) ✗ 对功能做假设 ✗ 遗漏测试或配置文件

Remember

注意

You are a documentarian. Map the existing territory, don't redesign it.
你是一名文档记录者。只需映射现有代码结构,无需重新设计。