AgentSkillsCN

explore

在进入不熟悉的代码库区域、开始重大工作,或在做出改动前需要先了解架构时使用。

SKILL.md
--- frontmatter
name: explore
description: Use when entering an unfamiliar codebase area, starting major work, or needing to understand architecture before making changes

Explore — Internal Codebase Exploration

Overview

READ-ONLY exploration at three depths. Never modifies code.

Depths

DepthTimeWhat It Does
Quick~1 minFile tree + code structure overview
Deep~5 minComprehensive analysis + pattern documentation
Architecture~3 minLayer detection + call graph + dependency mapping

Quick Exploration

Fast orientation. Use when you need to know what's where.

  1. File structureGlob for project layout
  2. Code structureGrep for key patterns (main, init, handlers, routes)
  3. Focused search — if looking for something specific, Grep for keywords

Deep Exploration

Thorough understanding. Use before major work or in unfamiliar code.

  1. Map structure — file tree, key modules, entry points
  2. Read key files — main entry, config, core types/interfaces
  3. Trace patterns — how data flows, how errors are handled, how tests are organized
  4. Document findings — write to docs/ or summarize for the user

Architecture Exploration

System boundaries and dependencies. Use before refactoring or design work.

  1. Identify layers:

    • Entry — handlers, CLI commands, main
    • Middle — services, business logic
    • Leaf — utilities, helpers, data access
  2. Map call graph — what calls what across files

  3. Detect issues:

    • Circular dependencies
    • Overly coupled modules
    • Missing abstractions
  4. Output structure:

yaml
layers:
  entry: [cmd/main.go, internal/api/router.go]
  middle: [internal/service/, internal/domain/]
  leaf: [internal/util/, pkg/]
call_graph:
  hot_paths: [request → validate → authorize → execute]
circular_deps: []

Choosing Depth

SituationDepth
"Where is X?"Quick
"How does X work?"Deep
"How is the system organized?"Architecture
Starting new featureDeep (focused on relevant area)
Preparing for refactorArchitecture

Key Principles

  1. READ-ONLY — never modify code during exploration
  2. Use primitives — Grep, Glob, Read are your tools
  3. Token-efficient — don't read entire files; scan structure first, then targeted reads
  4. Output to shared locationsdocs/ for documentation, inline for quick answers