Community编程与开发github.com

thedotmack/smart-explore

基于 tree-sitter AST 解析的令牌优化结构代码搜索。当需要理解代码结构、查找函数或高效探索代码库时,替代完整文件阅读。

smart-explore 是什么?

该技能利用 tree-sitter 的抽象语法树(AST)解析功能,实现了令牌优化的结构代码搜索。它旨在帮助开发者或 AI 代理快速理解代码结构、定位函数、类或变量定义,而无需读取整个文件,从而显著节省令牌消耗并提升效率。支持多种编程语言,适用于 Claude Code、Cursor 或 Codex 等 AI 编码工具。通过分析代码的语法结构而非全文扫描,smart-explore 能够精确匹配模式,减少噪声,加快代码库浏览和信息检索。其核心优势在于智能上下文感知和最小化令牌使用,是进行代码审查、重构或学习新代码库时的理想选择。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/thedotmack/claude-mem/tree/main/skills/smart-explore

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

smart-explore 是做什么的?

基于 tree-sitter AST 解析的令牌优化结构代码搜索。当需要理解代码结构、查找函数或高效探索代码库时,替代完整文件阅读。

功能

  • 结构搜索:通过解析 AST 查找函数、类、变量定义等
  • 令牌优化:仅返回相关结构信息,避免加载整个文件
  • 多语言支持:利用 tree-sitter 语法,支持 Python、JavaScript、TypeScript、Go、Rust 等
  • 精确匹配:基于语法树而非文本模式匹配,减少误报

使用场景

  • 快速定位代码库中的函数定义
  • 了解模块或文件的整体结构
  • 重构时查找引用或依赖关系
  • 学习新项目时快速熟悉代码组织

平台支持

兼容 Claude Code、Cursor、Codex 等主流 AI 编码代理平台。

工作原理

使用 tree-sitter 解析源代码生成 AST,然后基于查询语法搜索特定节点类型(如函数声明、类定义)。结果以结构化格式(如 JSON)返回,包含位置、名称和签名信息,极大减少令牌消耗。

示例

# 假设在项目根目录
npm run smart-explore "function" -- --path src/

或者使用 AI 代理内置调用:

/smart-explore 查找所有数据库相关函数

配置

可通过环境变量或技能配置文件调整搜索深度、忽略目录等参数。参考 SKILL.md 获取完整文档。

许可

MIT License

Individual skills in this repo

This repo contains 11 individual skills — each has its own dedicated page.

thedotmack/babysit

Watch a pull request or review cycle until it is ready to merge. Use when asked to babysit, monitor, or keep checking PR comments, reviews, and CI until all actionable issues are resolved.

thedotmack/claude-code-plugin-release

Automated semantic versioning and release workflow for Claude Code plugins. Handles version increments across package.json, marketplace.json, plugin.json manifests, build verification, git tagging, GitHub releases, and changelog generation. NPM publishing (so `npx [email protected]` resolves) is handed off to the human maintainer, who raised npm security.

thedotmack/do

Execute a phased implementation plan using subagents. Use when asked to execute, run, or carry out a plan — especially one created by make-plan.

thedotmack/how-it-works

Explain how claude-mem captures observations, when memory injection kicks in, and where data lives. Use when the user asks "how does claude-mem work?" or "what is this thing doing?".

thedotmack/knowledge-agent

Build and query AI-powered knowledge bases from claude-mem observations. Use when users want to create focused "brains" from their observation history, ask questions about past work patterns, or compile expertise on specific topics.

thedotmack/learn-codebase

Prime a codebase by reading every source file in full. Use when starting work on a new or unfamiliar project, or when the user asks to "learn the codebase", "read the codebase", "prime", or "get up to speed".

thedotmack/make-plan

Create a detailed, phased implementation plan with documentation discovery. Use when asked to plan a feature, task, or multi-step implementation — especially before executing with do.

thedotmack/mem-search

Search claude-mem's persistent cross-session memory database. Use when user asks "did we already solve this?", "how did we do X last time?", or needs work from previous sessions.

thedotmack/pathfinder

Map a codebase into feature-grouped flowcharts, identify duplicated concerns across features, and propose a unified architecture. Use when asked to "find the ideal path," unify duplicated systems, or audit architecture before a refactor. Emits a proposed unified flowchart plus per-system /make-plan prompts.

thedotmack/timeline-report

Generate a "Journey Into [Project]" narrative report analyzing a project's entire development history from claude-mem's timeline. Use when asked for a timeline report, project history analysis, development journey, or full project report.

thedotmack/wowerpoint

Turn one document into a kawaii NotebookLM slide-deck PDF. Use for "wowerpoint this", "make a deck about <file>", "turn this report into slides", or any request to render a single document as shareable narrative slides.

相关技能