commit 6823d09952a645bd5d180f456b461cbafc31a20f Author: Zhongwei Li Date: Sat Nov 29 17:52:06 2025 +0800 Initial commit diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..2f78878 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "development-skills", + "description": "Collection of development and coding skills", + "version": "0.0.0-2025.11.28", + "author": { + "name": "Alex Holmes", + "email": "alex@sed.dev" + }, + "skills": [ + "./skills/version" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..2d5d8d8 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# development-skills + +Collection of development and coding skills diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..f9efac4 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,52 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:alexhholmes/skills:development-skills", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "dfd8be8bcd6f0d5c7c3f0b1efbe5e573bafd92f5", + "treeHash": "516515b5b6835807b72ed45ebe492ab4ae9b2d9c44f7085034155a084fa614d4", + "generatedAt": "2025-11-28T10:13:09.078662Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "development-skills", + "description": "Collection of development and coding skills" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "d02aedab59b918c20c9047cc914a9fa2e8bc1efcb9bd1a32f2353754c5d20af5" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "91a24d3245fc7ac07534aab40863914285a51fac98d53f698cf7e96e36f7fe40" + }, + { + "path": "skills/version/SKILL.md", + "sha256": "1928aa7da4a10c8ef301e8a15075a34522c14e579fbf807cf03d3f1c27a5331f" + }, + { + "path": "skills/version/scripts/go-version.sh", + "sha256": "c466c5d5e0bd74ec7b82e0bc787e1fd90e43f5de843421c0fdb8193013950a46" + }, + { + "path": "skills/version/scripts/python-version.sh", + "sha256": "812a4e0a3dcd201de84fbde55829d91ae73a4d2b409af150de81ad4366903423" + } + ], + "dirSha256": "516515b5b6835807b72ed45ebe492ab4ae9b2d9c44f7085034155a084fa614d4" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skills/version/SKILL.md b/skills/version/SKILL.md new file mode 100644 index 0000000..e2b2369 --- /dev/null +++ b/skills/version/SKILL.md @@ -0,0 +1,42 @@ +--- +name: version +description: Search and fetch the latest version of a Go or Python package. +license: Complete terms in LICENSE.txt +--- + +# Version Fetcher Skill + +Fetch latest package versions for Go and Python packages. + +## Tools + +### get_go_version +Fetch the latest version of a Go package/module. + +**Example:** `get_go_version github.com/gin-gonic/gin` + +```bash +bash scripts/go-version.sh "$PACKAGE" +``` + +**Parameters:** +- `PACKAGE` (required): Go module path (e.g., github.com/gin-gonic/gin) + +#### Alternative + +Get the latest version of all the go mod files using `go list -m -u all` + +--- + +### get_python_version +Fetch the latest version of a Python package from PyPI. + +**Example:** `get_python_version requests` + +```bash +bash scripts/python-version.sh "$PACKAGE" +``` + +**Parameters:** +- `PACKAGE` (required): Python package name (e.g., requests, numpy) + diff --git a/skills/version/scripts/go-version.sh b/skills/version/scripts/go-version.sh new file mode 100755 index 0000000..4a1f9c7 --- /dev/null +++ b/skills/version/scripts/go-version.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -euo pipefail + +PACKAGE="$1" + +# Query Go proxy for latest version +URL="https://proxy.golang.org/${PACKAGE}/@latest" +RESPONSE=$(curl -sf "$URL" 2>/dev/null || echo "") + +if [ -z "$RESPONSE" ]; then + echo "Error: Package '$PACKAGE' not found or unreachable" >&2 + exit 1 +fi + +# Extract version from JSON response +VERSION=$(echo "$RESPONSE" | grep -o '"Version":"[^"]*"' | cut -d'"' -f4) + +if [ -z "$VERSION" ]; then + echo "Error: Could not parse version from response" >&2 + exit 1 +fi + +echo "$VERSION" diff --git a/skills/version/scripts/python-version.sh b/skills/version/scripts/python-version.sh new file mode 100755 index 0000000..c8bd55b --- /dev/null +++ b/skills/version/scripts/python-version.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -euo pipefail + +PACKAGE="$1" + +# Query PyPI API for package info +URL="https://pypi.org/pypi/${PACKAGE}/json" +RESPONSE=$(curl -sf "$URL" 2>/dev/null || echo "") + +if [ -z "$RESPONSE" ]; then + echo "Error: Package '$PACKAGE' not found on PyPI" >&2 + exit 1 +fi + +# Extract latest version from JSON response +VERSION=$(echo "$RESPONSE" | grep -o '"version":"[^"]*"' | head -1 | cut -d'"' -f4) + +if [ -z "$VERSION" ]; then + echo "Error: Could not parse version from response" >&2 + exit 1 +fi + +echo "$VERSION"