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.
npx agentmods add skills/blackwell-systems/agent-lsp/lsp-extract-functionnpx skills add blackwell-systems/agent-lsp --skill lsp-extract-functiongit clone --depth 1 https://github.com/blackwell-systems/agent-lspWrote 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.
[](https://agentmods.dev/skills/blackwell-systems/agent-lsp/lsp-extract-function)<a href="https://agentmods.dev/skills/blackwell-systems/agent-lsp/lsp-extract-function"><img src="https://agentmods.dev/badge/skills/blackwell-systems/agent-lsp/lsp-extract-function.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00054 | $0.01897 |
| Opus 5 | $0.00027 | $0.00949 |
| Sonnet 5 | $0.00011 | $0.00379 |
| Haiku 4.5 | $0.00005 | $0.00190 |
Grade A, and why
lsp-extract-function 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 242 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Requires the agent-lsp MCP server.
lsp-extract-function: Extract Code Block into a Named Function
This skill RESTRUCTURES existing code — it takes code that already exists
and moves it into a new function. This is distinct from /lsp-generate, which
creates NEW code that does not yet exist (stubs, mocks, interface implementations).
Use this skill when the code is already written; use /lsp-generate when you
need to generate code from scratch.
Invocation: User provides file_path (absolute path), start_line and
end_line (1-indexed range), and new_function_name (desired name for the
extracted function).
Prerequisites
If LSP is not yet initialized, call mcp__lsp__start_lsp with the workspace
root first. Auto-inference applies when file paths are provided, but an explicit
start is required when switching workspaces.
Step 1 — Get context (document symbols)
Call mcp__lsp__open_document to open the file, then call
mcp__lsp__list_symbols to understand the containing function and scope:
mcp__lsp__open_document({ "file_path": "<file_path>" })
mcp__lsp__list_symbols({ "file_path": "<file_path>" })
This establishes:
- Which function contains the selection
- Whether
new_function_namealready exists in the file (name collision check)
Mandatory name collision check: If new_function_name already exists as a
symbol in the document symbols list, report the conflict and stop immediately:
Cannot extract: function
new_function_namealready exists in this file. Choose a different name and retry.
Step 2 — Check server capabilities
Call mcp__lsp__get_server_capabilities to understand what the language server
supports:
mcp__lsp__get_server_capabilities({})
Check for codeActionProvider in the response. Note whether execute_command
is listed in executeCommandProvider.commands. This determines whether the
primary path (Step 3) is available.
Step 3 — Primary path: LSP code action
Call mcp__lsp__suggest_fixes with the selection range:
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 5d ago First seen · 242 lines · 54 tokens per session scan A 72c3dcca12f7
lsp-extract-function is a skill published in the GitHub repository blackwell-systems/agent-lsp (121 stars, last pushed today), licensed MIT. It adds 54 tokens to every session and 1,897 once invoked, about $0.0003 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-30.
Other skills, from other repositories
authoring-schemas
Author a mache projection schema (Topology→Node→Leaf) that maps structured data or source code into a filesystem/graph. Use when creating or debugging a -schema.json for a new data source (SQLite/JSON) or a new source language. Covers both dialects — tree-sitter S-expression selectors for code, and JSONPath selectors…
authoring-smell-rules
Add a findsmells rule to mache — a SQL query over the projected code graph that surfaces a code smell (duplication, complexity, dead code, drift). Use when adding or debugging a SmellRule in cmd/smellrules.go or an external $MACHESMELLRULESDIR rule. Covers the SmellRule struct, the standalone-vs-ast table capability…
mache-explore
Mount a mache FUSE filesystem inside the project directory so agents can explore structured data without per-file permission prompts.
analyze-usage
Use when asked to analyze codescout tool usage, check for error patterns, audit tool health, generate a usage report, spot anti-patterns, or clear usage statistics to start fresh.
code-intelligence
Universal, safe, and professional code modification and refactoring environment for 50+ languages. Use when editing source files to prevent syntax breakage, perform project-wide type-aware renames (LSP), or distill large command output to save context window tokens.
claude
Skill "claude" from paladini/locus-mcp, covering claude code skill (stub), when to use locus, when to use grep, mcp registration and status.