Ver código fonte

chore(project): maven-search

- 实现从 https://repo1.maven.org/maven2/ 检索 Maven 组件的技能
wandl-6A72h 7 meses atrás
pai
commit
c6bc109d0d

+ 202 - 0
skills/maven-search/LICENSE.txt

@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

+ 215 - 0
skills/maven-search/SKILL.md

@@ -0,0 +1,215 @@
+---
+name: maven-search
+description: Provides comprehensive guidance for searching and retrieving Maven components from Maven Central Repository (https://repo1.maven.org/maven2/). This skill enables searching by groupId, artifactId, version, and other coordinates, retrieving component metadata (POM files, JARs, sources, Javadoc), querying version history, and analyzing dependencies. Use when the user needs to find, verify, or retrieve Maven dependencies, check component versions, analyze dependency trees, or work with Maven coordinates.
+license: Complete terms in LICENSE.txt
+---
+
+## When to use this skill
+
+**ALWAYS use this skill when the user mentions:**
+- Searching for Maven dependencies or components
+- Finding Maven coordinates (groupId, artifactId, version)
+- Checking component versions or version history
+- Retrieving Maven artifacts (JAR, POM, sources, Javadoc)
+- Verifying Maven dependency coordinates
+- Analyzing dependency trees or transitive dependencies
+- Working with Maven Central Repository
+- Any request related to Maven components, libraries, or dependencies
+
+**Trigger phrases include:**
+- "查找 Maven 依赖" (find Maven dependency), "搜索 Maven 组件" (search Maven component)
+- "Maven 坐标" (Maven coordinates), "groupId" (groupId), "artifactId" (artifactId)
+- "Maven 版本" (Maven version), "最新版本" (latest version), "版本历史" (version history)
+- "Maven Central" (Maven Central), "Maven 仓库" (Maven repository)
+- "下载 Maven 依赖" (download Maven dependency), "获取 POM 文件" (get POM file)
+- "依赖树" (dependency tree), "传递依赖" (transitive dependencies)
+- Any mention of "Maven", "dependency", "artifact", "repository", "coordinates"
+
+## How to use this skill
+
+**CRITICAL: This skill should be triggered when the user needs to search, retrieve, or work with Maven components from Maven Central Repository.**
+
+**Trigger this skill when you see:**
+- User says "查找 Maven 依赖" (find Maven dependency), "搜索 Maven 组件" (search Maven component)
+- User needs Maven coordinates (groupId, artifactId, version)
+- User wants to check component versions or retrieve artifacts
+- User mentions Maven Central Repository or Maven dependencies
+- User needs to analyze dependencies or verify coordinates
+
+To search for Maven components:
+
+1. **Identify the search type** from the user's request:
+   - Search by name → Use Maven Central Search API
+   - Get specific version → Use direct repository URL
+   - Check latest version → Query maven-metadata.xml
+   - Analyze dependencies → Parse POM file
+   - Download artifact → Use direct download URL
+
+2. **Load the appropriate example file** from the `examples/` directory:
+   - `examples/search-by-name.md` - Search components by name or keywords
+   - `examples/search-by-coordinates.md` - Search by groupId and artifactId
+   - `examples/get-version-info.md` - Get version information and history
+   - `examples/download-artifact.md` - Download JAR, POM, sources, or Javadoc
+   - `examples/analyze-dependencies.md` - Analyze dependency tree
+   - `examples/verify-coordinates.md` - Verify Maven coordinates validity
+
+3. **Follow the specific instructions** in that example file for API endpoints, parameters, and best practices
+
+4. **Use Maven Central Repository API**:
+   
+   **Search API** (https://search.maven.org/solrsearch/select):
+   - Query parameter: `q` - Search query (e.g., `g:com.google.guava AND a:guava`)
+   - Rows parameter: `rows` - Number of results (default: 20, max: 200)
+   - Start parameter: `start` - Pagination offset
+   - Core parameter: `core` - Search core (default: `gav`)
+   
+   **Direct Repository Access** (https://repo1.maven.org/maven2/):
+   - Path format: `{groupId}/{artifactId}/{version}/{artifactId}-{version}.{extension}`
+   - GroupId path: Replace dots with slashes (e.g., `com.google.guava` → `com/google/guava`)
+   - Metadata: `maven-metadata.xml` for version information
+   - POM file: `{artifactId}-{version}.pom`
+   - JAR file: `{artifactId}-{version}.jar`
+   - Sources: `{artifactId}-{version}-sources.jar`
+   - Javadoc: `{artifactId}-{version}-javadoc.jar`
+
+5. **Construct the appropriate URL**:
+   
+   **Search Example**:
+   ```
+   https://search.maven.org/solrsearch/select?q=g:com.google.guava+AND+a:guava&rows=20&wt=json
+   ```
+   
+   **Direct Access Example**:
+   ```
+   https://repo1.maven.org/maven2/com/google/guava/guava/maven-metadata.xml
+   https://repo1.maven.org/maven2/com/google/guava/guava/33.0.0/guava-33.0.0.pom
+   https://repo1.maven.org/maven2/com/google/guava/guava/33.0.0/guava-33.0.0.jar
+   ```
+
+6. **Parse and format the results**:
+   - Extract relevant information (groupId, artifactId, version, description)
+   - Format coordinates in standard Maven format: `groupId:artifactId:version`
+   - Present results in a clear, structured format
+   - Include download links and metadata when relevant
+
+7. **Validate coordinates**:
+   - Verify groupId format (should be reverse domain notation)
+   - Check artifactId format (should be lowercase, hyphen-separated)
+   - Validate version format (semantic versioning preferred)
+   - Confirm artifact exists before providing download links
+
+**Output Format Requirements**:
+- Always provide Maven coordinates in standard format: `groupId:artifactId:version`
+- Include direct download URLs when relevant
+- Format search results in a clear, structured table or list
+- Provide metadata information (description, repository, last updated) when available
+- Include version information and release dates when querying versions
+
+## Maven Central Repository Structure
+
+### Repository Base URL
+- **Primary**: https://repo1.maven.org/maven2/
+- **Search API**: https://search.maven.org/solrsearch/select
+- **Alternative mirrors**: Available for different regions
+
+### Path Structure
+```
+{groupId}/{artifactId}/{version}/{artifactId}-{version}.{extension}
+```
+
+**Example**:
+```
+com/google/guava/guava/33.0.0/guava-33.0.0.jar
+```
+
+### Available Artifacts
+- **POM**: `{artifactId}-{version}.pom` - Project Object Model file
+- **JAR**: `{artifactId}-{version}.jar` - Compiled Java classes
+- **Sources**: `{artifactId}-{version}-sources.jar` - Source code
+- **Javadoc**: `{artifactId}-{version}-javadoc.jar` - API documentation
+- **Metadata**: `maven-metadata.xml` - Version and release information
+
+## Search API Parameters
+
+### Query Syntax
+- **GroupId search**: `g:com.google.guava`
+- **ArtifactId search**: `a:guava`
+- **Version search**: `v:33.0.0`
+- **Combined search**: `g:com.google.guava AND a:guava`
+- **Text search**: `guava` (searches in groupId, artifactId, and description)
+
+### Response Format
+- **JSON**: `wt=json` (default)
+- **XML**: `wt=xml`
+- **Java properties**: `wt=javabin`
+
+### Pagination
+- **rows**: Number of results per page (default: 20, max: 200)
+- **start**: Offset for pagination (default: 0)
+
+## Best Practices
+
+1. **Always verify coordinates**: Check that groupId, artifactId, and version exist before use
+2. **Use latest stable versions**: Prefer RELEASE versions over SNAPSHOT versions
+3. **Check version metadata**: Query `maven-metadata.xml` for latest version information
+4. **Validate before download**: Verify artifact exists before providing download links
+5. **Include checksums**: When available, provide SHA-1 and MD5 checksums for verification
+6. **Format coordinates correctly**: Always use standard Maven format `groupId:artifactId:version`
+7. **Provide context**: Include description, repository information, and last updated date when available
+
+## Common Tasks
+
+### Task 1: Search by Name
+Use the Search API with text query to find components by name or keywords.
+
+**Example**:
+```
+GET https://search.maven.org/solrsearch/select?q=guava&rows=20&wt=json
+```
+
+### Task 2: Search by Coordinates
+Use the Search API with groupId and artifactId to find specific components.
+
+**Example**:
+```
+GET https://search.maven.org/solrsearch/select?q=g:com.google.guava+AND+a:guava&rows=20&wt=json
+```
+
+### Task 3: Get Version Information
+Query `maven-metadata.xml` to get all available versions and latest version.
+
+**Example**:
+```
+GET https://repo1.maven.org/maven2/com/google/guava/guava/maven-metadata.xml
+```
+
+### Task 4: Download Artifact
+Construct direct download URL for specific artifact.
+
+**Example**:
+```
+GET https://repo1.maven.org/maven2/com/google/guava/guava/33.0.0/guava-33.0.0.jar
+```
+
+### Task 5: Analyze Dependencies
+Download and parse POM file to extract dependency information.
+
+**Example**:
+```
+GET https://repo1.maven.org/maven2/com/google/guava/guava/33.0.0/guava-33.0.0.pom
+```
+
+## Keywords
+
+**English keywords:**
+maven, maven central, maven repository, maven dependency, maven artifact, maven component, groupId, artifactId, version, coordinates, pom, jar, dependency, repository, search, retrieve, download, metadata, transitive dependencies, dependency tree, maven coordinates, maven search
+
+**Chinese keywords (中文关键词):**
+Maven, Maven 中央仓库, Maven 仓库, Maven 依赖, Maven 组件, Maven 坐标, groupId, artifactId, version, 版本, 坐标, POM, JAR, 依赖, 仓库, 搜索, 检索, 下载, 元数据, 传递依赖, 依赖树, 查找依赖, 搜索组件, 获取版本, 下载依赖
+
+## Resources
+
+- **Maven Central Repository**: https://repo1.maven.org/maven2/
+- **Maven Central Search**: https://search.maven.org/
+- **Maven Central Search API Documentation**: https://central.sonatype.com/search-api/
+- **Maven Coordinates Guide**: https://maven.apache.org/guides/mini/guide-naming-conventions.html

+ 86 - 0
skills/maven-search/api/maven-central-api.md

@@ -0,0 +1,86 @@
+# Maven Central Repository API Reference
+
+## Base URLs
+
+- **Repository**: https://repo1.maven.org/maven2/
+- **Search API**: https://search.maven.org/solrsearch/select
+
+## Search API
+
+### Endpoint
+```
+GET https://search.maven.org/solrsearch/select
+```
+
+### Query Parameters
+
+| Parameter | Type | Description | Default |
+|-----------|------|-------------|---------|
+| `q` | string | Search query | Required |
+| `rows` | integer | Number of results | 20 (max: 200) |
+| `start` | integer | Pagination offset | 0 |
+| `wt` | string | Response format (json, xml, javabin) | json |
+| `core` | string | Search core (gav) | gav |
+
+### Query Syntax
+
+- **Text Search**: `guava` (searches in groupId, artifactId, description)
+- **GroupId**: `g:com.google.guava`
+- **ArtifactId**: `a:guava`
+- **Version**: `v:33.0.0`
+- **Combined**: `g:com.google.guava AND a:guava`
+- **OR Operator**: `g:com.google.guava OR g:com.google.collections`
+
+### Response Format (JSON)
+
+```json
+{
+  "responseHeader": {
+    "status": 0,
+    "QTime": 10
+  },
+  "response": {
+    "numFound": 100,
+    "start": 0,
+    "docs": [
+      {
+        "id": "com.google.guava:guava:33.0.0",
+        "g": "com.google.guava",
+        "a": "guava",
+        "v": "33.0.0",
+        "p": "jar",
+        "timestamp": 1234567890000,
+        "ec": ["-sources.jar", "-javadoc.jar", ".jar", ".pom"]
+      }
+    ]
+  }
+}
+```
+
+## Direct Repository Access
+
+### Path Structure
+```
+{groupId}/{artifactId}/{version}/{artifactId}-{version}.{extension}
+```
+
+### GroupId Path Conversion
+Replace dots (`.`) with slashes (`/`)
+
+**Example**:
+- GroupId: `com.google.guava`
+- Path: `com/google/guava`
+
+### Available Files
+
+- **POM**: `{artifactId}-{version}.pom`
+- **JAR**: `{artifactId}-{version}.jar`
+- **Sources**: `{artifactId}-{version}-sources.jar`
+- **Javadoc**: `{artifactId}-{version}-javadoc.jar`
+- **Metadata**: `maven-metadata.xml`
+
+## Official Documentation
+
+- **Maven Central Search**: https://search.maven.org/
+- **Search API Documentation**: https://central.sonatype.com/search-api/
+- **Maven Central Repository**: https://repo1.maven.org/maven2/

+ 67 - 0
skills/maven-search/examples/analyze-dependencies.md

@@ -0,0 +1,67 @@
+# Analyze Maven Dependencies
+
+## Instructions
+
+This example demonstrates how to analyze dependencies by downloading and parsing POM files.
+
+## Key Concepts
+
+- **POM File**: Project Object Model contains dependency information
+- **Dependency Tree**: Parse POM to extract direct and transitive dependencies
+- **Dependency Coordinates**: Extract groupId, artifactId, version from POM
+- **Scope Information**: Dependencies have scopes (compile, test, provided, runtime)
+- **Transitive Dependencies**: Dependencies of dependencies
+
+## Example
+
+### Download and Parse POM
+
+**Step 1: Download POM File**
+
+**Request**:
+```
+GET https://repo1.maven.org/maven2/com/google/guava/guava/33.0.0/guava-33.0.0.pom
+```
+
+**Step 2: Parse Dependencies**
+
+**POM Structure**:
+```xml
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <groupId>com.google.guava</groupId>
+  <artifactId>guava</artifactId>
+  <version>33.0.0</version>
+  <dependencies>
+    <dependency>
+      <groupId>com.google.code.findbugs</groupId>
+      <artifactId>jsr305</artifactId>
+      <version>3.0.2</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+</project>
+```
+
+### Extract Dependency Information
+
+**Dependency Format**: `groupId:artifactId:version:scope`
+
+**Example Output**:
+```
+Direct Dependencies:
+- com.google.code.findbugs:jsr305:3.0.2:provided
+```
+
+## Key Points
+
+1. **POM Location**: `{groupId}/{artifactId}/{version}/{artifactId}-{version}.pom`
+2. **XML Parsing**: Parse XML to extract dependency information
+3. **Scope Handling**: Include scope information (compile, test, provided, runtime)
+4. **Optional Dependencies**: Check for optional dependencies
+5. **Version Ranges**: Handle version ranges in dependency declarations
+
+## Official Documentation
+
+- **Maven POM Reference**: https://maven.apache.org/pom.html
+- **Maven Dependency Mechanism**: https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

+ 64 - 0
skills/maven-search/examples/download-artifact.md

@@ -0,0 +1,64 @@
+# Download Maven Artifacts
+
+## Instructions
+
+This example demonstrates how to construct download URLs for Maven artifacts (JAR, POM, sources, Javadoc).
+
+## Key Concepts
+
+- **Repository Base URL**: `https://repo1.maven.org/maven2/`
+- **Path Structure**: `{groupId}/{artifactId}/{version}/{artifactId}-{version}.{extension}`
+- **GroupId Path**: Replace dots with slashes
+- **Artifact Types**: JAR, POM, sources, Javadoc
+- **Direct Download**: Construct direct URL for artifact download
+
+## Example
+
+### Download JAR File
+
+**Coordinates**: `com.google.guava:guava:33.0.0`
+
+**URL Construction**:
+- GroupId path: `com/google/guava`
+- ArtifactId: `guava`
+- Version: `33.0.0`
+- Extension: `jar`
+
+**Download URL**:
+```
+https://repo1.maven.org/maven2/com/google/guava/guava/33.0.0/guava-33.0.0.jar
+```
+
+### Download POM File
+
+**Download URL**:
+```
+https://repo1.maven.org/maven2/com/google/guava/guava/33.0.0/guava-33.0.0.pom
+```
+
+### Download Sources
+
+**Download URL**:
+```
+https://repo1.maven.org/maven2/com/google/guava/guava/33.0.0/guava-33.0.0-sources.jar
+```
+
+### Download Javadoc
+
+**Download URL**:
+```
+https://repo1.maven.org/maven2/com/google/guava/guava/33.0.0/guava-33.0.0-javadoc.jar
+```
+
+## Key Points
+
+1. **Path Format**: `{groupId}/{artifactId}/{version}/{artifactId}-{version}.{extension}`
+2. **GroupId Conversion**: Replace dots (`.`) with slashes (`/`)
+3. **Artifact Naming**: Follows Maven naming conventions
+4. **Classifier Support**: Sources and Javadoc use classifiers (`-sources`, `-javadoc`)
+5. **URL Validation**: Verify artifact exists before providing download link
+
+## Official Documentation
+
+- **Maven Central Repository**: https://repo1.maven.org/maven2/
+- **Maven Repository Layout**: https://maven.apache.org/repository/layout.html

+ 61 - 0
skills/maven-search/examples/get-version-info.md

@@ -0,0 +1,61 @@
+# Get Maven Component Version Information
+
+## Instructions
+
+This example demonstrates how to retrieve version information and version history for a Maven component.
+
+## Key Concepts
+
+- **Metadata File**: `maven-metadata.xml` contains version information
+- **Latest Version**: Query metadata to get latest release version
+- **Version History**: Metadata includes all available versions
+- **Release Dates**: Timestamp information available in search results
+- **Version Sorting**: Versions are typically sorted by release date
+
+## Example
+
+### Get Version Metadata
+
+**Request**:
+```
+GET https://repo1.maven.org/maven2/com/google/guava/guava/maven-metadata.xml
+```
+
+**Response**:
+```xml
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+  <groupId>com.google.guava</groupId>
+  <artifactId>guava</artifactId>
+  <versioning>
+    <latest>33.0.0</latest>
+    <release>33.0.0</release>
+    <versions>
+      <version>33.0.0</version>
+      <version>32.1.3</version>
+      <version>32.1.2</version>
+    </versions>
+    <lastUpdated>20240101120000</lastUpdated>
+  </versioning>
+</metadata>
+```
+
+### Get Latest Version via Search API
+
+**Request**:
+```
+GET https://search.maven.org/solrsearch/select?q=g:com.google.guava+AND+a:guava&rows=1&sort=timestamp+desc&wt=json
+```
+
+## Key Points
+
+1. **Metadata Location**: `{groupId}/{artifactId}/maven-metadata.xml`
+2. **Path Conversion**: Replace dots in groupId with slashes
+3. **Latest Version**: Check `latest` or `release` tag in metadata
+4. **Version List**: All versions listed in `versions` section
+5. **Last Updated**: Timestamp indicates last update time
+
+## Official Documentation
+
+- **Maven Central Repository**: https://repo1.maven.org/maven2/
+- **Maven Metadata Guide**: https://maven.apache.org/ref/current/maven-repository-metadata/

+ 69 - 0
skills/maven-search/examples/search-by-coordinates.md

@@ -0,0 +1,69 @@
+# Search Maven Components by Coordinates
+
+## Instructions
+
+This example demonstrates how to search for Maven components using groupId and artifactId coordinates.
+
+## Key Concepts
+
+- **Maven Coordinates**: `groupId:artifactId:version` format
+- **GroupId Search**: Use `g:` prefix in query
+- **ArtifactId Search**: Use `a:` prefix in query
+- **Combined Search**: Use `AND` operator to combine groupId and artifactId
+- **Exact Match**: More precise than text search
+
+## Example
+
+### Search by GroupId and ArtifactId
+
+**Request**:
+```
+GET https://search.maven.org/solrsearch/select?q=g:com.google.guava+AND+a:guava&rows=20&wt=json
+```
+
+**Response**:
+```json
+{
+  "response": {
+    "numFound": 50,
+    "start": 0,
+    "docs": [
+      {
+        "id": "com.google.guava:guava:33.0.0",
+        "g": "com.google.guava",
+        "a": "guava",
+        "v": "33.0.0",
+        "p": "jar",
+        "timestamp": 1234567890000
+      }
+    ]
+  }
+}
+```
+
+### Search by GroupId Only
+
+**Request**:
+```
+GET https://search.maven.org/solrsearch/select?q=g:org.springframework&rows=50&wt=json
+```
+
+### Search by ArtifactId Only
+
+**Request**:
+```
+GET https://search.maven.org/solrsearch/select?q=a:spring-boot-starter-web&rows=20&wt=json
+```
+
+## Key Points
+
+1. **Coordinate Format**: Always use `groupId:artifactId:version` format
+2. **URL Encoding**: Replace spaces with `+` in query parameters
+3. **Exact Matching**: Coordinate search provides exact matches
+4. **Multiple Versions**: Results include all available versions
+5. **Latest Version**: Sort by timestamp descending to get latest version
+
+## Official Documentation
+
+- **Maven Central Search**: https://search.maven.org/
+- **Maven Coordinates Guide**: https://maven.apache.org/guides/mini/guide-naming-conventions.html

+ 70 - 0
skills/maven-search/examples/search-by-name.md

@@ -0,0 +1,70 @@
+# Search Maven Components by Name
+
+## Instructions
+
+This example demonstrates how to search for Maven components by name or keywords using the Maven Central Search API.
+
+## Key Concepts
+
+- **Search API Endpoint**: `https://search.maven.org/solrsearch/select`
+- **Query Parameter**: Use `q` parameter for search query
+- **Text Search**: Searches in groupId, artifactId, and description fields
+- **Response Format**: JSON (default) or XML
+- **Pagination**: Use `rows` and `start` parameters
+
+## Example
+
+### Search by Component Name
+
+**Request**:
+```
+GET https://search.maven.org/solrsearch/select?q=guava&rows=20&wt=json
+```
+
+**Response Structure**:
+```json
+{
+  "response": {
+    "numFound": 100,
+    "start": 0,
+    "docs": [
+      {
+        "id": "com.google.guava:guava:33.0.0",
+        "g": "com.google.guava",
+        "a": "guava",
+        "v": "33.0.0",
+        "p": "jar",
+        "timestamp": 1234567890000,
+        "ec": ["-sources.jar", "-javadoc.jar", ".jar", ".pom"]
+      }
+    ]
+  }
+}
+```
+
+### Search with Multiple Keywords
+
+**Request**:
+```
+GET https://search.maven.org/solrsearch/select?q=spring+boot&rows=20&wt=json
+```
+
+### Search with Filters
+
+**Request** (search in specific field):
+```
+GET https://search.maven.org/solrsearch/select?q=a:guava&rows=20&wt=json
+```
+
+## Key Points
+
+1. **Text Search**: Simple text query searches across groupId, artifactId, and description
+2. **Field-Specific Search**: Use `g:` for groupId, `a:` for artifactId, `v:` for version
+3. **Combined Search**: Use `AND` and `OR` operators for complex queries
+4. **Result Formatting**: Extract `g` (groupId), `a` (artifactId), `v` (version) from response
+5. **Pagination**: Use `rows` (max 200) and `start` for pagination
+
+## Official Documentation
+
+- **Maven Central Search**: https://search.maven.org/
+- **Search API Documentation**: https://central.sonatype.com/search-api/

+ 61 - 0
skills/maven-search/examples/verify-coordinates.md

@@ -0,0 +1,61 @@
+# Verify Maven Coordinates
+
+## Instructions
+
+This example demonstrates how to verify that Maven coordinates (groupId, artifactId, version) are valid and the artifact exists.
+
+## Key Concepts
+
+- **Coordinate Validation**: Check format and existence
+- **GroupId Format**: Reverse domain notation (e.g., `com.google.guava`)
+- **ArtifactId Format**: Lowercase, hyphen-separated (e.g., `guava`, `spring-boot`)
+- **Version Format**: Semantic versioning preferred
+- **Existence Check**: Verify artifact exists in repository
+
+## Example
+
+### Verify Coordinates Format
+
+**Valid Coordinates**:
+- `com.google.guava:guava:33.0.0` ✓
+- `org.springframework.boot:spring-boot-starter-web:3.2.0` ✓
+
+**Invalid Coordinates**:
+- `com.google.guava:guava` ✗ (missing version)
+- `guava:33.0.0` ✗ (missing groupId)
+- `com.google.guava::33.0.0` ✗ (missing artifactId)
+
+### Verify Artifact Existence
+
+**Method 1: Check Metadata**
+
+**Request**:
+```
+GET https://repo1.maven.org/maven2/com/google/guava/guava/maven-metadata.xml
+```
+
+**If 404**: Artifact does not exist
+**If 200**: Artifact exists, check version in metadata
+
+**Method 2: Check Specific Version**
+
+**Request**:
+```
+GET https://repo1.maven.org/maven2/com/google/guava/guava/33.0.0/guava-33.0.0.pom
+```
+
+**If 404**: Version does not exist
+**If 200**: Version exists
+
+## Key Points
+
+1. **Format Validation**: Check coordinate format before querying
+2. **GroupId Rules**: Should follow reverse domain notation
+3. **ArtifactId Rules**: Should be lowercase, hyphen-separated
+4. **Version Rules**: Should follow semantic versioning
+5. **Existence Check**: Always verify artifact exists before use
+
+## Official Documentation
+
+- **Maven Naming Conventions**: https://maven.apache.org/guides/mini/guide-naming-conventions.html
+- **Maven Central Repository**: https://repo1.maven.org/maven2/

+ 57 - 0
skills/maven-search/reference/maven-coordinates.md

@@ -0,0 +1,57 @@
+# Maven Coordinates Reference
+
+## Coordinate Format
+
+Maven coordinates follow the format:
+```
+groupId:artifactId:version
+```
+
+## GroupId
+
+- **Format**: Reverse domain notation
+- **Examples**: 
+  - `com.google.guava`
+  - `org.springframework.boot`
+  - `io.github.projectlombok`
+- **Rules**:
+  - Should follow reverse domain notation
+  - Use lowercase letters
+  - Separate segments with dots (`.`)
+  - Should be unique across organizations
+
+## ArtifactId
+
+- **Format**: Lowercase, hyphen-separated
+- **Examples**:
+  - `guava`
+  - `spring-boot-starter-web`
+  - `lombok`
+- **Rules**:
+  - Use lowercase letters
+  - Separate words with hyphens (`-`)
+  - Should be descriptive of the component
+
+## Version
+
+- **Format**: Semantic versioning preferred
+- **Examples**:
+  - `33.0.0` (release version)
+  - `1.0.0-SNAPSHOT` (snapshot version)
+  - `2.5.0-RELEASE` (release version)
+- **Rules**:
+  - Follow semantic versioning (major.minor.patch)
+  - Avoid snapshot versions in production
+  - Use release versions for stability
+
+## Complete Coordinate Examples
+
+```
+com.google.guava:guava:33.0.0
+org.springframework.boot:spring-boot-starter-web:3.2.0
+io.projectreactor:reactor-core:3.6.0
+```
+
+## Official Documentation
+
+- **Maven Naming Conventions**: https://maven.apache.org/guides/mini/guide-naming-conventions.html