using-leankg

using-leankg is a skill for Claude Code, Codex from Bilal140202/the-lord-of-the-skills. It costs 47 tokens per session (1,114 once invoked), scanned A, original, MIT.

A required process for searching and navigating code with LeanKG, a code knowledge tool. It defines fallback steps that use the LeanKG command line, then other search tools if LeanKG is unavailable.

In plain words
What is it for?
Use it to locate code, find functions, understand behavior, and analyze dependencies or the impact of a change.
Why use it?
It gives code searches a consistent order and helps find where logic lives, how it works, and what changes may affect. The process avoids relying on plain text search unless earlier options fail.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to locate code, find functions, understand behavior, and analyze dependencies or the impact of a change.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bilal140202/the-lord-of-the-skills/freepeak__leankg
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Bilal140202/the-lord-of-the-skills --skill freepeak__leankg
Clone the repo
git clone --depth 1 https://github.com/Bilal140202/the-lord-of-the-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for using-leankg

README.md
[![agentmods](https://agentmods.dev/badge/skills/bilal140202/the-lord-of-the-skills/freepeak__leankg/github.svg)](https://agentmods.dev/skills/bilal140202/the-lord-of-the-skills/freepeak__leankg)
Your own site
<a href="https://agentmods.dev/skills/bilal140202/the-lord-of-the-skills/freepeak__leankg"><img src="https://agentmods.dev/badge/skills/bilal140202/the-lord-of-the-skills/freepeak__leankg/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for using-leankg

Your own site · 80×15
<a href="https://agentmods.dev/skills/bilal140202/the-lord-of-the-skills/freepeak__leankg"><img src="https://agentmods.dev/badge/skills/bilal140202/the-lord-of-the-skills/freepeak__leankg.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,114 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00047 $0.01114
Opus 5 $0.00023 $0.00557
Sonnet 5 $0.00009 $0.00223
Haiku 4.5 $0.00005 $0.00111

Measured 12d ago against content hash 78679ef51070, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

using-leankg scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/fangorn/cursor/FreePeak__LeanKG/SKILL.md · 120 lines

How it starts

The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.

<EXTREMELY_IMPORTANT> STRICT ENFORCEMENT: You MUST follow the 4-Tier Search Fallback Chain EXACTLY.

  1. ALWAYS start with mcp_status to check LeanKG readiness
  2. If NOT ready, invoke mcp_init or mcp_index to initialize
  3. Use LeanKG MCP tools for ALL searches (Tier 1)
  4. ONLY fall back to leankg CLI if MCP fails (Tier 2)
  5. ONLY fall back to rtk if CLI fails (Tier 3)
  6. ONLY fall back to grep/rg as ABSOLUTE LAST RESORT (Tier 4)

NO EXCEPTIONS. NO RATIONALIZATION. Follow the chain. </EXTREMELY_IMPORTANT>

MANDATORY 4-Tier Search Fallback Chain

When user asks "where is X", "find logic Y", "how does Z work", etc:
           |
           v
TIER 1: LeanKG MCP Server (leankg_mcp_* tools)
           |
           mcp_status (ALWAYS check first)
           search_code("X") or find_function("X") or query_file("X")
           |
           +-- Results found --> get_context(file) to read content --> DONE
           +-- MCP down/error --> TIER 2
           |
           v
TIER 2: leankg CLI command
           |
           leankg query "X" --kind name
           |
           +-- Results found --> DONE
           +-- Empty/error --> TIER 3
           |
           v
TIER 3: rtk (rich toolkit grep)
           |
           rtk grep "X" --path .
           rtk file "pattern" --path .
           |
           +-- Results found --> DONE
           +-- Empty --> TIER 4
           |
           v
TIER 4: grep/rg (ABSOLUTE LAST RESORT)
           |
           rg "X"
           grep -rn "X" --include="*.ext"

ABSOLUTE BANS

  • NEVER skip directly to grep/rg when LeanKG is available
  • NEVER use Glob to find code files before checking LeanKG
  • NEVER use Grep tool before exhausting Tiers 1-3
  • The ONLY exception: searching non-code files (config, docs, data files)

Tier 1: LeanKG MCP Tools (Use in this order)

Step Tool When to Use
1 mcp_status ALWAYS check first
2 search_code("X") Find code by name/type
3 find_function("X") Locate function definitions
4 query_file("*X*") Find files by name
5 get_impact_radius(file) Blast radius for changes
6 get_context(file) READ file content (token-optimized)
7 get_dependencies(file) Get imports
8 get_dependents(file) Get reverse dependencies
9 get_tested_by(file) Find tests
10 get_callers("func") Find who calls a function
11 get_call_graph("func") Full call graph

Read the full file on GitHub · 120 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 120 lines · 47 tokens per session scan A 78679ef51070

Subscribe to this mod's changes

using-leankg is a skill published in the GitHub repository Bilal140202/the-lord-of-the-skills (4 stars, last pushed 6d ago), licensed MIT. It adds 47 tokens to every session and 1,114 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

tool-calling-tutor

Use when a tool-calling agent does not call a tool, sends wrong arguments, loops without stopping, or needs a function schema. Guides a four-branch diagnosis and five-step schema repair. Do not use for framework-specific, MCP-server, or production-observability questions.

WenyuChiou/awesome-agentic-ai-zh · 62 tokens

detecting-process-injection-techniques

Detects and analyzes process injection techniques used by malware including classic DLL injection, process hollowing, APC injection, thread hijacking, and reflective loading. Uses memory forensics, API monitoring, and behavioral analysis to identify injection artifacts. Activates for requests involving process…

adriannoes/awesome-agentic-ai · 78 tokens

ainb-fleet:daemon

Long-running watcher that scans every claude session every 5s and auto-sends continue to any session whose recent tmux pane buffer matches a known API-error regex (ratelimited, overloadederror, internalservererror, requesttimeout, sockethangup, fetchfailed, ECONNRESET). Use this when you want unattended recovery from…

stevengonsalvez/agents-in-a-box · 89 tokens

investigating-ransomware-attack-artifacts

Identify, collect, and analyze ransomware attack artifacts to determine the variant, initial access vector, encryption scope, and recovery options.

adriannoes/awesome-agentic-ai · 36 tokens

cline-fix-volatile-msg

Ladder-aware Cline Anthropic caching — verify the rolling read/write ladder on the wire, then add the tools breakpoint and tune TTL. Updated for the 2026-08 AI-SDK monorepo.

OnlyTerp/prompt-cache-skills · 50 tokens

opencode-detect-openai-compat

OpenCode's caching detection misses OpenAI-compatible proxies routing to Anthropic/Bedrock. Broaden the predicate.

OnlyTerp/prompt-cache-skills · 32 tokens