Skill站外收录 @skilllib/skill-2117939930272410842
osgrep
提供基于语义的代码检索能力,能理解开发者的自然语言提问,精准定位实现特定逻辑的代码片段,支持调用链追踪、文件骨架提取和紧凑路径输出,帮助快速掌握系统架构与关键流程。
效率工具 AI 技能
Skills.MD
## What osgrep does
Finds code by meaning. When you'd ask a colleague "where do we handle auth?", use osgrep.
- grep/ripgrep: exact string match, fast
- osgrep: concept match, finds code you couldn't grep for
## Primary command
```bash
osgrep "where do we validate user permissions"
```
Returns ~10 results with code snippets (15+ lines each). Usually enough to understand what's happening.
## Output explained
```
ORCHESTRATION src/auth/handler.ts:45
Defines: handleAuth | Calls: validate, checkRole, respond | Score: .94
export async function handleAuth(req: Request) {
const token = req.headers.get("Authorization");
const claims = await validateToken(token);
if (!claims) return unauthorized();
const allowed = await checkRole(claims.role, req.path);
...
```
- **ORCHESTRATION** = contains logic, coordinates other code
- **DEFINITION** = types, interfaces, classes
- **Score** = relevance (1 = best match)
- **Calls** = what this code calls (helps you trace flow)
## When to Read more
The snippet often has enough context. But if you need more:
```bash
# osgrep found src/auth/handler.ts:45-90 as ORCH
Read src/auth/handler.ts:45-120
```
Read the specific line range, not the whole file.
## Other commands
```bash
# Trace call graph (who calls X, what X calls)
osgrep trace handleAuth
# Skeleton of a huge file (to find which ranges to read)
osgrep skeleton src/giant-2000-line-file.ts
# Just file paths when you only need locations
osgrep "authentication" --compact
```
## Workflow: architecture questions
```bash
# 1. Find entry points
osgrep "where do requests enter the server"
# Review the ORCH results - code is shown
# 2. If you need deeper context on a specific function
Read src/server/handler.ts:45-120
# 3. Trace to understand call flow
osgrep trace handleRequest
```
## Tips
- More words = better results. "auth" is vague. "where does the server validate JWT tokens" is specific.
- ORCH results contain the logic - prioritize these
- Don't read entire files. Use the line ranges osgrep gives you.
- If results seem off, rephrase your query like you'd ask a teammate
## If Index is Building
If you see "Indexing" or "Syncing": STOP. Tell the user the index is building. Ask if they want to wait or proceed with partial results.
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「osgrep」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次