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-format-codenpx skills add blackwell-systems/agent-lsp --skill lsp-format-codegit 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-format-code)<a href="https://agentmods.dev/skills/blackwell-systems/agent-lsp/lsp-format-code"><img src="https://agentmods.dev/badge/skills/blackwell-systems/agent-lsp/lsp-format-code.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 | $0.00044 | $0.01243 |
| Opus 5 | $0.00022 | $0.00622 |
| Sonnet 5 | $0.00009 | $0.00249 |
| Haiku 4.5 | $0.00004 | $0.00124 |
Grade A, and why
lsp-format-code 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 4d 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 — 164 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Requires the agent-lsp MCP server.
lsp-format-code
Format a file or selection using the language server's formatter — the same formatting engine your IDE uses. Applies language-specific rules (gofmt, prettier, rustfmt, black) without requiring those tools to be on PATH separately.
When to use
- Before committing: ensure consistent style across edited files
- After generating code: clean up AI-generated indentation and spacing
- After a refactor that shifted indentation levels
- When a linter flags style violations fixable by the formatter
Use /lsp-safe-edit instead when you are making a logic change and want
before/after diagnostic comparison alongside the edit.
Workflow
Step 1 — Check formatting is supported (optional)
If unsure whether the language server supports formatting for this file, check capabilities first:
mcp__lsp__get_server_capabilities({ "file_path": "<file>" })
Look for documentFormattingProvider (full-file) and
documentRangeFormattingProvider (range). If neither is present, the server
does not support formatting — stop and report.
Skip this step if you know the language supports formatting (Go, TypeScript, Rust, Python all do via their standard servers).
Step 2 — Open the file
mcp__lsp__open_document({ "file_path": "/abs/path/to/file.go", "language_id": "go" })
Step 3 — Request formatting edits
Full file:
mcp__lsp__format_document({ "file_path": "/abs/path/to/file.go" })
Selection only:
mcp__lsp__format_range({
"file_path": "/abs/path/to/file.go",
"start_line": <N>,
"end_line": <M>
})
Both return TextEdit[] — a list of replacements to apply. They do not
write to disk. If the list is empty, the file is already correctly formatted.
Step 4 — Apply the edits
Pass the TextEdit[] from Step 3 to apply_edit:
mcp__lsp__apply_edit({ "workspace_edit": <TextEdit[] from Step 3> })
This writes the formatting changes to disk.
Step 5 — Verify (optional but recommended)
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.
- 4d ago First seen · 164 lines · 44 tokens per session scan A 4b042a42fcb5
lsp-format-code is a skill published in the GitHub repository blackwell-systems/agent-lsp (117 stars, last pushed 4d ago), licensed MIT. It adds 44 tokens to every session and 1,243 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-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.