AgentSkillsCN

repo-navigator

导航并绘制此单体仓库结构。查找文件、包及依赖关系。适用于被要求定位代码、理解包间关系、找到某处定义或探索仓库结构时。

SKILL.md
--- frontmatter
name: repo-navigator
description: Navigate and map this monorepo structure. Find files, packages, and dependencies. Use when asked to locate code, understand package relationships, find where something is defined, or explore repo structure.
allowed-tools: Read, Grep, Glob

Repo Navigator

Maps this Turborepo monorepo and locates code quickly.

When to Use

  • "Where is X defined?"
  • "Find files related to..."
  • "What packages exist?"
  • "Show me the structure"
  • "How do packages depend on each other?"

Quick Reference

Package Locations

PackagePathPurpose
Web Appapps/web/Next.js 16 frontend + API routes
Mobile Appapps/mobile/React Native bare
Databasepackages/db/Drizzle ORM, schema, migrations
Authpackages/auth/Better Auth config
AIpackages/ai/Vercel AI SDK integration
API Clientpackages/api-client/Shared fetch client
Securitypackages/security/Rate limiting
Typespackages/types/Shared TypeScript types
Testspackages/tests/Integration tests
Toolspackages/tools/AI tool definitions
RAGpackages/rag/Embeddings support
Evalspackages/evals/LLM evaluation framework
Obspackages/obs/Observability utilities

Key File Locations

Looking for...Check...
API endpointsapps/web/app/api/
Database schemapackages/db/src/schema.ts
Auth configpackages/auth/src/index.ts
Rate limitingpackages/security/src/rateLimit.ts
Shared typespackages/types/src/index.ts
Integration testspackages/tests/src/
Mobile screensapps/mobile/src/screens/
CI workflows.github/workflows/

Procedure

1. Understand the Request

Identify what the user is looking for:

  • Specific file/function → use Grep with pattern
  • Package overview → use Glob for structure
  • Dependency → check package.json imports

2. Search Strategy

For specific code:

code
Grep pattern: "export (function|const|class) {name}"
Glob pattern: "**/*.ts" or "**/*.tsx"

For package structure:

code
Glob: "{apps,packages}/*/package.json"

For imports/usage:

code
Grep: "from '@acme/{package}'"
Grep: "import.*{name}"

3. Report Findings

Output format:

code
## Found: {description}

**Location:** `{path}:{line}`

**Context:**
- Package: {package-name}
- Exports: {what it exports}
- Used by: {importers}

Common Searches

Find API endpoint

code
Glob: apps/web/app/api/**/*.ts
Grep: "export (async function|const) (GET|POST|PUT|DELETE)"

Find database table

code
Read: packages/db/src/schema.ts
Grep: "export const {tableName}"

Find component

code
Glob: apps/web/components/**/*.tsx
Glob: apps/mobile/src/components/**/*.tsx

Find where package is used

code
Grep: "@acme/{package-name}"

Guardrails

  • DO NOT modify any files
  • DO NOT execute commands
  • Report file paths with line numbers when found
  • If not found, suggest alternative search terms