AGENT SKILL

lsp-navigation

Use when searching for where a function/class/variable is defined or referenced, before using grep on the codebase. Triggers on: 'where is X defined', 'find all uses of Y', 'what calls Z', 'go to definition', 'find references', searching for a symbol name across files.

License 许可
Apache-2.0
最近更新
2026-11-14
Stars
★ 13
Forks
2

01 前言 Front Matter

name
lsp-navigation
description
Use when searching for where a function/class/variable is defined or referenced, before using grep on the codebase. Triggers on: 'where is X defined', 'find all uses of Y', 'what calls Z', 'go to definition', 'find references', searching for a symbol name across files.

03 SKILL.md 正文

LSP Navigation Skill

Khi LSP available, tìm symbol/reference bằng LSP nhanh hơn grep và không đốt context.

Vấn đề của grep khi tìm symbol

# Grep tìm function name → hàng nghìn match không liên quan
grep -r "handleAuth" .
# Kết quả: comments, strings, variable names, test mocks, log messages
# → Agent phải đọc từng file → đốt context

LSP hiểu ngữ nghĩa: nó biết handleAuth ở dòng 42 của auth.ts là declaration, còn ở login.ts dòng 87 là call site — và phân biệt được.

Khi nào dùng LSP vs grep

Tình huống Dùng gì
Tìm nơi function được định nghĩa LSP: go-to-definition
Tìm tất cả nơi function được gọi LSP: find-references
Tìm text tự do (comment, string, log) grep
Tìm pattern regex trong file grep
Tìm tên file find
Symbol rename — impact analysis LSP: find-references trước

Workflow khi LSP available

Step 1 — Kiểm tra LSP có available không

# Claude Code tự động dùng LSP nếu project có language server configured
# Kiểm tra có tsconfig/pyproject/go.mod không
ls tsconfig.json pyproject.toml go.mod Cargo.toml 2>/dev/null

Nếu có → LSP likely available. Dùng Claude Code's built-in symbol navigation.

Step 2 — Tìm definition

Thay vì:

grep -r "functionName" . --include="*.ts"

Dùng Claude Code's go-to-definition trên symbol cụ thể. Nó trả về: file + line number + context — không có noise.

Step 3 — Tìm references

Thay vì:

grep -rn "functionName" . --include="*.ts" | head -50

Dùng find-references. Kết quả là danh sách call sites thật, không phải tất cả chỗ có chuỗi ký tự đó.

Step 4 — Fallback về grep khi cần

LSP không available hoặc project không có language server:

# Grep có scope — chỉ tìm trong thư mục liên quan
grep -rn "functionName" src/auth/ --include="*.ts" | head -20

# Không grep toàn repo một phát
# grep -r "functionName" .   ← tránh cái này

Nguyên tắc grep tiết kiệm context

Khi phải dùng grep:

  1. Scope xuống directory nhỏ nhất có thể chứa kết quả
  2. Dùng --include để chỉ tìm đúng file type
  3. | head -20 — không dump vô hạn
  4. Tìm từ cụ thể hơn: handleAuthToken thay vì auth
  5. Đọc kết quả trước khi mở file — nhiều khi grep output đủ để hiểu

Context budget reminder

Mỗi lần grep dump 500 dòng vào context = ~2000 token bị chiếm. Với project lớn, 3–4 lần grep rộng = hết context budget cho actual work.

LSP navigation không chiếm context theo kiểu đó — nó trả về danh sách file:line ngắn gọn, agent đọc file cụ thể khi cần.

04 同仓库更多 Skills

Horonomos-laps
Horonomos-laps/Yana-AI

openai--sentry--sentry

Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

ito-basket-compare

Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

implementing-network-traffic-baselining

Build network traffic baselines from NetFlow/IPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly/daily traffic pattern profiling

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

detecting-evasion-techniques-in-endpoint-logs

Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

implementing-microsegmentation-with-guardicore

Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

ramdisk-tmpfs-patterns

暂无简介

★ 13