You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/skills/library-insight/SKILL.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: library-insight
3
-
description: API Explorer & AI Code Advisor that indexes public APIs, visualizes dependency graphs, audits version deprecations, and extracts JVM archive signatures (JAR/AAR) or Maven coordinates for AI context.
3
+
description: JVM API Explorer & MCP Server that indexes public APIs, visualizes dependency graphs, audits version deprecations, and extracts JVM archive signatures (JAR/AAR) or Maven coordinates for AI context.
4
4
---
5
5
6
6
# Library Insight Agent Skill
@@ -16,12 +16,15 @@ This tool extracts all classes, interfaces, methods, properties, and Javadoc/KDo
16
16
> - Use **`library-insight search <query>`** to find packages or classes.
17
17
> - Use **`library-insight explain <class>`** to print the public API signature and Javadocs of a specific class.
18
18
> - Use **`library-insight diff <old> <new>`** to compare versions.
19
-
> - Use **`library-insight audit`** to check project dependency deprecations recursively.
19
+
> - Use **`library-insight audit`** to check project dependency API deprecations recursively.
20
20
> - Use **`library-insight migrate <old> <new>`** to get a migration advisor report with replacement suggestions.
21
21
> - Use **`library-insight search-central <query>`** to search Maven Central.
22
-
> - Use **`library-insight graph <coord>`** to visual dependency trees.
23
-
> - Use **`library-insight check-compat <old> <new>`** to lint Semantic Versioning API compliance.
22
+
> - Use **`library-insight dependency-graph <coord>`** to visualize dependency trees.
23
+
> - Use **`library-insight semver <old> <new>`** to lint Semantic Versioning API compliance.
24
24
> - Use **`library-insight mcp`** to communicate as a Model Context Protocol (MCP) server.
25
+
>
26
+
> **MCP Integration Rule:**
27
+
> If an MCP server is already configured and available (e.g., in Cursor, Claude Desktop, or another IDE with MCP support), **prefer the MCP server over shelling out to the CLI**. The MCP server exposes `scan_library`, `search_symbols`, and `explain_class` tools natively without subprocess overhead.
25
28
26
29
## Command Reference
27
30
@@ -199,15 +202,14 @@ Search Maven Central Solr repository indices dynamically for matching packages a
199
202
library-insight search-central retrofit
200
203
```
201
204
202
-
### 13. Dependency Graph (`graph`)
205
+
### 13. Dependency Graph (`dependency-graph`)
203
206
Renders a visual hierarchical tree of dependencies resolved recursively from `.pom` XML package descriptors:
-**MCP Server**: Connect Cursor, Claude Desktop, or any MCP-compatible IDE. They call `scan_library`, `search_symbols`, and `explain_class` directly without leaving the editor.
-**Version-Correct API Lookup**: Scans the exact artifact you point it at, so AI agents and developers see the real public API for that dependency version.
-**Format Exporters**: Converts API indices to structured **JSON** or highly readable **Markdown** reference documentation.
28
-
-**Search Engine**: Performs case-insensitive searches across packages, classes, methods, and properties.
29
-
-**Diff Engine**: Compares two versions of a library to highlight added, removed, or changed APIs, deprecations, and **binary breaking changes**(like visibility reduction, method deletion, or changing suspend modifiers).
30
-
-**AI-Context Exporter**: Generates a compact, token-efficient `ai-context.json` file optimized for LLMs (ChatGPT, Gemini, Claude, Cursor, Copilot).
-**Migration Advisor**: Compares two versions and reports removed, deprecated, and replacement APIs — great for Retrofit, OkHttp, Compose, and Kotlin upgrades.
26
+
-**Dependency API Audit**: Scans project Gradle dependencies and reports deprecated APIs found in installed bytecode.
27
+
-**Dependency Graph**: Renders a recursive visual tree of transitive dependencies from POM descriptors.
28
+
-**SemVer Checker**: Lints version bumps against actual code changes to catch unbumped breaking changes.
29
+
-**Search Maven Central**: Find coordinates and latest versions without leaving the terminal.
30
+
-**Format Exporters**: Converts API indices to structured **JSON**or readable **Markdown**reference docs.
31
+
-**AI-Context Exporter**: Generates a compact, token-efficient `ai-context/` directory for LLMs — 95%+ smaller than a raw dump.
31
32
32
33
---
33
34
@@ -172,307 +173,39 @@ This creates `.agents/skills/library-insight/SKILL.md` in the project root, enab
172
173
173
174
---
174
175
175
-
## CLI Usage & Commands
176
+
## Quick Start
176
177
177
178
> [!NOTE]
178
-
> The examples below assume the executable has been installed globally (via the installer script). You can execute it directly using:
179
-
> `library-insight <command> [options]`
180
-
181
-
> [!IMPORTANT]
182
-
> **AI Agent Accuracy Rule:**
183
-
> If you are an AI assistant, do not assume the library API from memory, latest web docs, or random examples. First scan or query the exact library version used by the project whenever possible.
184
-
>
185
-
> **AI Agent Token Optimization Rule:**
186
-
> Do **not** read the entire raw `build/library-insight-index.json` or generated `API_REFERENCE.md` files directly using file-viewing tools. Doing so will bloat your context window and exceed token limits.
187
-
> Instead, use the dedicated CLI query subcommands to lookup only the class details or signatures you need:
188
-
> - Use **`library-insight search <query>`** to locate packages or classes.
189
-
> - Use **`library-insight explain <class>`** to inspect full signatures and docs.
190
-
> - Use **`library-insight diff <old> <new>`** before upgrading or replacing deprecated APIs.
191
-
192
-
### 1. Scan Library
193
-
194
-
Scan a JAR, AAR, local directory, or Maven coordinate.
195
-
196
-
Use this first when you need to know how a dependency should be implemented in the exact version your project uses.
197
-
198
-
> [!TIP]
199
-
> **Offline-First & Smart Caching:**
200
-
> -**Gradle Cache Lookup**: Before downloading from repositories over the network, `library-insight` scans your machine's Gradle cache (`~/.gradle/caches/modules-2/files-2.1/`). If the dependency coordinate has already been downloaded by Gradle/Android Studio, it is referenced directly without performing any disk copies—saving space and enabling fully offline scanning!
201
-
> -**Local Project Cache**: If you run a scan inside a project directory containing a `build/` folder or a Gradle build file, downloaded artifacts are saved locally to `build/library-insight/cache/` instead of the global home directory, keeping your user profile clutter-free and project cleaning clean.
179
+
> These examples assume you have installed the CLI globally. Run `library-insight <command>` from any folder.
202
180
203
181
```bash
204
-
# Scan Retrofit from Maven Central (downloads jar + sources automatically)
182
+
#1. Scan a library from Maven Central (or picks it from your Gradle cache)
### 6. Export AI Context (Recommended for AI prompts)
303
-
304
-
Generate a compact, token-efficient split context folder structure (`build/ai-context/` by default) containing individual class JSON files optimized for LLM prompts.
305
-
306
-
This solves two problems at once: AI gets exact APIs from the scanned dependency version, and it avoids massive single files like `API_REFERENCE.md`. Agents can read `metadata.json` first, then load only the specific class JSON files they need, reducing token usage by over 95%.
### 11. Model Context Protocol (MCP) Server (`mcp`)
382
-
383
-
Start the Model Context Protocol (MCP) server listening on stdio. This enables AI tools (such as Cursor, Claude Desktop, Copilot, etc.) to dynamically call Library Insight tools (like scanning libraries, searching symbols, or explaining classes) directly from the IDE context.
384
-
385
-
```bash
386
-
library-insight mcp
387
-
```
388
-
389
-
### 12. Dependency API Audit (`audit`)
390
-
391
-
Scan and audit all project dependencies declared recursively inside `build.gradle.kts` and catalog libraries inside `gradle/libs.versions.toml`. It analyzes bytecode annotations inside local cached dependencies to report deprecated classes, methods, and properties.
Compare two library versions and output a structured migration report, automatically detecting replacement APIs from Kotlin `@ReplaceWith` annotation expressions and Javadoc `@deprecated` link tags.
425
-
426
-
```bash
194
+
# 5. Get a migration report with replacement API suggestions
0 commit comments