|
| 1 | +--- |
| 2 | +name: library-insight |
| 3 | +description: Indexes public APIs and extracts source code comments from Java/Kotlin compiled archives (JAR/AAR) or Maven coordinates, generating compact context JSON layouts for AI agents. |
| 4 | +--- |
| 5 | + |
| 6 | +# Library Insight Agent Skill |
| 7 | + |
| 8 | +Use this skill when you need to understand, inspect, or build AI prompts for external JVM libraries (Java/Kotlin JAR or AAR files) or public Maven dependency coordinates. |
| 9 | + |
| 10 | +This tool extracts all classes, interfaces, methods, properties, and Javadoc/KDoc comments from bytecode and sources, creating an indexed database and a split AI-friendly directory structure. |
| 11 | + |
| 12 | +## Command Reference |
| 13 | + |
| 14 | +The command line executable is `library-insight` (located at `~/.library-insight/bin/library-insight` or linked globally as `library-insight`). |
| 15 | + |
| 16 | +### 1. Scan Dependencies (`scan`) |
| 17 | +Scans a local JAR/AAR file, a directory of JARs, or resolves a Maven coordinate over HTTP, downloading it and its corresponding `-sources.jar` automatically from repositories (Maven Central, Google Maven, SoftBank). |
| 18 | +* **Scan Local JAR/AAR**: |
| 19 | + ```bash |
| 20 | + library-insight scan path/to/library.aar --sources path/to/library-sources.jar |
| 21 | + ``` |
| 22 | +* **Scan Maven Coordinate**: |
| 23 | + ```bash |
| 24 | + library-insight scan groupId:artifactId:version |
| 25 | + ``` |
| 26 | +* **Scan with Custom Repositories**: |
| 27 | + ```bash |
| 28 | + library-insight scan groupId:artifactId:version --repo https://jitpack.io |
| 29 | + ``` |
| 30 | + |
| 31 | +*Default Database Output*: `build/library-insight-index.json`. |
| 32 | + |
| 33 | +### 2. Search Symbols (`search`) |
| 34 | +Search for classes, packages, methods, or properties in the saved index. |
| 35 | +```bash |
| 36 | +library-insight search ClassNameOrMethod |
| 37 | +``` |
| 38 | + |
| 39 | +### 3. Explain Class (`explain`) |
| 40 | +Print detailed structural details (modifiers, superclasses, constructors, properties, and methods) with their documentation. |
| 41 | +```bash |
| 42 | +library-insight explain FullOrSimpleClassName |
| 43 | +``` |
| 44 | + |
| 45 | +### 4. Export Index (`export`) |
| 46 | +Export the index database to pretty JSON or structured Markdown reference sheets. |
| 47 | +```bash |
| 48 | +library-insight export markdown > API_REFERENCE.md |
| 49 | +library-insight export json output.json |
| 50 | +``` |
| 51 | + |
| 52 | +### 5. Diff Library Versions (`diff`) |
| 53 | +Compare two library versions to check for changes and potential breaking changes. |
| 54 | +```bash |
| 55 | +library-insight diff old-library.jar new-library.jar |
| 56 | +``` |
| 57 | + |
| 58 | +### 6. Export AI Context (`ai-export`) |
| 59 | +Restructures the scanned index database into a split folder structure under `build/ai-context/` containing: |
| 60 | +- `metadata.json` (describing library name, version, and packages). |
| 61 | +- Subfolders for packages mapped as `group-artifact-package` (dots replaced with hyphens) and subpackages nested as real subdirectories. |
| 62 | +- Individual class-specific JSON files containing compact signatures and Javadocs. |
| 63 | +```bash |
| 64 | +library-insight ai-export |
| 65 | +``` |
| 66 | + |
| 67 | +### 7. Clear Cache (`clear-cache`) |
| 68 | +Clears all downloaded cached Maven binaries and sources from local storage. |
| 69 | +```bash |
| 70 | +library-insight clear-cache |
| 71 | +``` |
0 commit comments