← 返回
未分类 中文

Skill

Semantic git history search and code archaeology. Use when asked why code exists, who owns a file, what introduced a regression, what changed in a commit ran...
语义化的 Git 历史搜索与代码考古。用于回答代码为何存在、文件所有者、回归原因、提交中更改了什么等问题。
venki0552 venki0552 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 1
Stars
📥 478
下载
💾 1
安装
1
版本
#latest

概述

SLG — Semantic Git Search

slg is a local-first CLI that builds a semantic index of your git history (embeddings + BM25) so you can ask natural-language questions about who changed what, why, and when. No API keys required — everything runs offline via ONNX Runtime.

Installation

npm install -g slg-cli
# or run without installing
npx slg-cli <command>

When to Use This Skill

Use slg when the user:

  • Asks why a piece of code exists or was written a certain way
  • Wants to know who is responsible for a file or function
  • Is tracking down what introduced a bug across many commits
  • Needs to understand what changed between two refs or in a range
  • Wants to assess how risky reverting a commit would be
  • Asks about recent activity on a file or directory

Setup

Index must be built once before searching. Run this in the repo root:

slg init

Re-index after significant new commits:

slg reindex

Check index health:

slg doctor

Core Commands

Why does this code exist?

slg why "why does the retry logic use exponential backoff"
slg why "what is the purpose of the connection pool size limit"

Returns ranked commit results explaining the reasoning behind code decisions.

Who owns a file?

slg blame src/auth/middleware.ts
slg blame --top 3 src/payments/

Returns contributors ranked by semantic commit weight for the given path.

Find what introduced a regression

slg bisect "authentication stopped working after the refactor"

Narrows down the range of commits most likely to have introduced an issue using semantic search over the message + diff corpus.

Search commit history semantically

slg log "database schema migrations"
slg log --since 2024-01-01 "API rate limiting changes"
slg log --limit 20 "performance optimizations"

Returns commits ranked by semantic + BM25 relevance. Supports --since, --until, --limit, and --path filters.

Summarize a diff

slg diff HEAD~5..HEAD
slg diff v1.2.0..v1.3.0
slg diff --path src/api/ main~10..main

Generates a semantic summary of what changed across a commit range.

Assess revert risk

slg revert-risk abc1234
slg revert-risk HEAD~3

Scores how risky it would be to revert a given commit based on downstream dependency analysis.

See recent activity

slg status
slg status --path src/

Shows recent indexed commits and index freshness.

MCP Server

slg ships an MCP (Model Context Protocol) server, letting AI agents query git history directly:

slg serve
# or
slg mcp

Configure in your agent:

{
  "mcpServers": {
    "slg": {
      "command": "slg",
      "args": ["serve"]
    }
  }
}

Available MCP tools: slg_why, slg_blame, slg_bisect, slg_log, slg_diff, slg_revert_risk, slg_status.

Tips

  • slg why works best with full-sentence natural language questions
  • slg bisect is most effective when given a behavioral description rather than error text
  • Prefix path filters with --path to narrow any command to a directory or file
  • Run slg doctor if search results seem stale — it reports index coverage and age
  • For large repos (10K+ commits) the initial slg init may take several minutes; subsequent slg reindex calls are incremental and fast

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-03 11:05 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,229 📥 268,119
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,085 📥 813,241
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 677 📥 325,708