Skip to content

Commit a2e8046

Browse files
committed
Add CI/CD main workflow, global installer, custom workspace Skill, and website
1 parent 7379e55 commit a2e8046

6 files changed

Lines changed: 845 additions & 0 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
```

‎.github/workflows/ci.yml‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI Build & Test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
name: Build and Test
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '17'
22+
distribution: 'zulu'
23+
24+
- name: Setup Gradle
25+
uses: gradle/actions/setup-gradle@v3
26+
27+
- name: Verify build and run tests
28+
run: ./gradlew check test
29+
30+
- name: Build distributions
31+
run: ./gradlew assemble installDist

‎install.sh‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "=================================================="
5+
echo " Building Library Insight CLI Distribution..."
6+
echo "=================================================="
7+
./gradlew :library-insight-cli:installDist
8+
9+
INSTALL_DIR="$HOME/.library-insight"
10+
echo "Installing binaries into $INSTALL_DIR..."
11+
mkdir -p "$INSTALL_DIR"
12+
cp -R library-insight-cli/build/install/library-insight/* "$INSTALL_DIR/"
13+
14+
echo "Configuring executable permissions..."
15+
chmod +x "$INSTALL_DIR/bin/library-insight"
16+
17+
echo "Creating global symlink..."
18+
if [ -d "/usr/local/bin" ]; then
19+
echo "Creating symlink in /usr/local/bin/library-insight (may request password for sudo)..."
20+
sudo ln -sf "$INSTALL_DIR/bin/library-insight" /usr/local/bin/library-insight
21+
echo "=================================================="
22+
echo " SUCCESS: Library Insight installed globally!"
23+
echo " You can now run the 'library-insight' command."
24+
echo "=================================================="
25+
else
26+
echo "WARNING: /usr/local/bin does not exist on your system."
27+
echo "Please add the following to your shell configuration (.zshrc or .bashrc):"
28+
echo " export PATH=\"\$PATH:$INSTALL_DIR/bin\""
29+
fi

0 commit comments

Comments
 (0)