Skip to content

Commit 049f443

Browse files
authored
Merge pull request #1 from Coding-Meet/feature/advanced-cli-commands
Add centralized logging for new commands and bump version to 1.1.0
2 parents 5327bcb + aa9c7b3 commit 049f443

21 files changed

Lines changed: 1568 additions & 92 deletions

File tree

‎.agents/skills/library-insight/SKILL.md‎

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
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.
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.
44
---
55

66
# Library Insight Agent Skill
@@ -16,6 +16,12 @@ This tool extracts all classes, interfaces, methods, properties, and Javadoc/KDo
1616
> - Use **`library-insight search <query>`** to find packages or classes.
1717
> - Use **`library-insight explain <class>`** to print the public API signature and Javadocs of a specific class.
1818
> - Use **`library-insight diff <old> <new>`** to compare versions.
19+
> - Use **`library-insight audit`** to check project dependency deprecations recursively.
20+
> - Use **`library-insight migrate <old> <new>`** to get a migration advisor report with replacement suggestions.
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.
24+
> - Use **`library-insight mcp`** to communicate as a Model Context Protocol (MCP) server.
1925
2026
## Command Reference
2127

@@ -136,7 +142,7 @@ Cache cleared successfully. Deleted 2.45 MB.
136142
```
137143

138144
### 8. Diagnostics & Doctor (`doctor`)
139-
Run diagnostic checks for the Java runtime, Node.js, and verify all global AI Agent skill configurations.
145+
Run diagnostic checks for the Java runtime, local cache directory, and verify all global AI Agent skill configurations.
140146
```bash
141147
library-insight doctor
142148
```
@@ -148,13 +154,60 @@ library-insight doctor
148154
- Path: /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/bin/java
149155
- Version: 17.0.7
150156
- Status: OK (Java 17+ verified)
151-
2. Node.js Environment:
152-
- Version: v18.16.0
153-
- Status: OK
154-
3. Local Cache Directory:
157+
2. Local Cache Directory:
155158
- Path: /Users/meet/AndroidStudioProjects/Library-Insight/build/library-insight/cache
156159
- Status: OK
157-
4. AI Agent Skill Registrations:
160+
3. AI Agent Skill Registrations:
158161
- Gemini Config Skill: ACTIVE (registered)
159162
- Cursor Skill: ACTIVE (registered)
160163
```
164+
165+
### 9. Model Context Protocol Server (`mcp`)
166+
Start the Model Context Protocol (MCP) server listening on stdio. Allows external AI clients (like Cursor or Claude Desktop) to invoke `scan_library`, `search_symbols`, and `explain_class` tools directly.
167+
```bash
168+
library-insight mcp
169+
```
170+
171+
### 10. Dependency API Audit (`audit`)
172+
Scan and audit all Gradle build file dependencies recursively to find deprecated classes, methods, and properties inside active versions.
173+
```bash
174+
library-insight audit
175+
```
176+
177+
**Example Output:**
178+
```text
179+
==================================================
180+
Library Insight Dependency Audit
181+
==================================================
182+
Detected Gradle Version Catalog at gradle/libs.versions.toml
183+
Scanning 11 Gradle build file(s)...
184+
Found 10 dependencies to audit.
185+
...
186+
Audit Summary: Scanned 10 libraries successfully.
187+
Total Deprecated APIs found: 1819
188+
==================================================
189+
190+
### 11. API Migration Advisor (`migrate`)
191+
Compare two library versions and output a migration advisor report showing removed, deprecated, and replacement APIs.
192+
```bash
193+
library-insight migrate com.squareup.retrofit2:retrofit:2.9.0 com.squareup.retrofit2:retrofit:2.11.0
194+
```
195+
196+
### 12. Search Maven Central (`search-central`)
197+
Search Maven Central Solr repository indices dynamically for matching packages and versions:
198+
```bash
199+
library-insight search-central retrofit
200+
```
201+
202+
### 13. Dependency Graph (`graph`)
203+
Renders a visual hierarchical tree of dependencies resolved recursively from `.pom` XML package descriptors:
204+
```bash
205+
library-insight graph com.github.ajalt.clikt:clikt-jvm:4.4.0
206+
```
207+
208+
### 14. API Compatibility Checker (`check-compat`)
209+
Lints version bumps against actual bytecode modifications to enforce Semantic Versioning (SemVer) compliance:
210+
```bash
211+
library-insight check-compat com.squareup.retrofit2:retrofit:2.9.0 com.squareup.retrofit2:retrofit:2.11.0
212+
```
213+
```

‎README.md‎

Lines changed: 102 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ SUCCESS: AI Agent Skill added to workspace at: .agents/skills/library-insight/SK
357357

358358
### 10. CLI Diagnostics & Doctor (`doctor`)
359359

360-
Run diagnostic checks for Java version, Node.js installation, local caches, and active global AI Agent skill configurations.
360+
Run diagnostic checks for Java version, local caches, and active global AI Agent skill configurations.
361361

362362
```bash
363363
library-insight doctor
@@ -370,17 +370,107 @@ library-insight doctor
370370
- Path: /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/bin/java
371371
- Version: 17.0.7
372372
- Status: OK (Java 17+ verified)
373-
2. Node.js Environment:
374-
- Version: v18.16.0
375-
- Status: OK
376-
3. Local Cache Directory:
373+
2. Local Cache Directory:
377374
- Path: /Users/meet/AndroidStudioProjects/Library-Insight/build/library-insight/cache
378375
- Status: OK
379-
4. AI Agent Skill Registrations:
376+
3. AI Agent Skill Registrations:
380377
- Gemini Config Skill: ACTIVE (registered)
381378
- Cursor Skill: ACTIVE (registered)
382379
```
383380

381+
### 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.
392+
393+
```bash
394+
library-insight audit
395+
```
396+
397+
**Example Output:**
398+
```text
399+
==================================================
400+
Library Insight Dependency Audit
401+
==================================================
402+
Detected Gradle Version Catalog at gradle/libs.versions.toml
403+
Scanning 11 Gradle build file(s)...
404+
405+
Found 10 dependencies to audit:
406+
- org.ow2.asm:asm:9.7
407+
...
408+
409+
--------------------------------------------------
410+
Auditing org.ow2.asm:asm:9.7...
411+
- Total classes: 39
412+
- Status: ⚠️ Deprecations detected
413+
* Deprecated Classes : 0
414+
* Deprecated Methods : 2
415+
* Deprecated Properties : 2
416+
==================================================
417+
Audit Summary: Scanned 10 libraries successfully.
418+
Total Deprecated APIs found: 1819
419+
==================================================
420+
```
421+
422+
### 13. API Migration Advisor (`migrate`)
423+
424+
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
427+
library-insight migrate com.squareup.retrofit2:retrofit:2.9.0 com.squareup.retrofit2:retrofit:2.11.0
428+
```
429+
430+
**Example Output:**
431+
```text
432+
==================================================
433+
Library Insight Migration Report
434+
==================================================
435+
Old Version : com.squareup.retrofit2:retrofit:2.9.0
436+
New Version : com.squareup.retrofit2:retrofit:2.11.0
437+
==================================================
438+
439+
❌ Removed Classes
440+
-----------------
441+
- retrofit2.Platform$Android
442+
- retrofit2.Platform$Android$MainThreadExecutor
443+
444+
❌ Removed Methods
445+
-----------------
446+
- fun retrofit2.Platform.defaultCallbackExecutor(): java.util.concurrent.Executor
447+
448+
--------------------------------------------------
449+
Binary Compatibility: ❌ BREAKING CHANGES DETECTED
450+
==================================================
451+
```
452+
453+
### 14. Search Maven Central (`search-central`)
454+
455+
Search Maven Central Solr repository indices dynamically for matching packages and versions.
456+
```bash
457+
library-insight search-central clikt
458+
```
459+
460+
### 15. Dependency Graph (`graph`)
461+
462+
Renders a visual hierarchical tree of dependencies resolved recursively from `.pom` XML package descriptors.
463+
```bash
464+
library-insight graph com.github.ajalt.clikt:clikt-jvm:4.4.0
465+
```
466+
467+
### 16. API Compatibility Checker (`check-compat`)
468+
469+
Lints version bumps against actual bytecode modifications to enforce Semantic Versioning (SemVer) compliance.
470+
```bash
471+
library-insight check-compat com.squareup.retrofit2:retrofit:2.9.0 com.squareup.retrofit2:retrofit:2.11.0
472+
```
473+
384474
---
385475

386476
## Repository Directory Structure
@@ -417,14 +507,20 @@ Library-Insight/
417507
│ │ ├── Main.kt
418508
│ │ └── commands/
419509
│ │ ├── AiExportCommand.kt
510+
│ │ ├── AuditCommand.kt
511+
│ │ ├── CheckCompatCommand.kt
420512
│ │ ├── ClearCacheCommand.kt
421513
│ │ ├── DiffCommand.kt
422514
│ │ ├── DoctorCommand.kt
423515
│ │ ├── ExplainCommand.kt
424516
│ │ ├── ExportCommand.kt
517+
│ │ ├── GraphCommand.kt
425518
│ │ ├── InitCommand.kt
519+
│ │ ├── McpCommand.kt
520+
│ │ ├── MigrateCommand.kt
426521
│ │ ├── ScanCommand.kt
427522
│ │ ├── SearchCommand.kt
523+
│ │ ├── SearchCentralCommand.kt
428524
│ │ └── SkillsCommand.kt
429525
│ └── build.gradle.kts
430526
├── library-insight-common/

‎build.gradle.kts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55

66
allprojects {
77
group = "com.meet.libraryinsight"
8-
version = "1.0.0"
8+
version = "1.1.0"
99

1010
repositories {
1111
mavenCentral()

0 commit comments

Comments
 (0)