From bc03d0592232246484edc01aa19b1afe022220e1 Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sun, 30 Nov 2025 08:45:58 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 11 ++++++ README.md | 3 ++ commands/echo.md | 75 ++++++++++++++++++++++++++++++++++++++ plugin.lock.json | 45 +++++++++++++++++++++++ 4 files changed, 134 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 commands/echo.md create mode 100644 plugin.lock.json diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..b1bbfe0 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,11 @@ +{ + "name": "hello-world", + "description": "A hello world plugin", + "version": "1.0.0", + "author": { + "name": "Developer" + }, + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..2d2c97c --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# hello-world + +A hello world plugin diff --git a/commands/echo.md b/commands/echo.md new file mode 100644 index 0000000..4d090c7 --- /dev/null +++ b/commands/echo.md @@ -0,0 +1,75 @@ +--- +description: Hello world plugin implementation +argument-hint: [name] +--- + +## Name +hello-world:echo + +## Synopsis +``` +/hello-world:echo [name] +``` + +## Description +The `hello-world:echo` command prints a greeting message to the console. By default, it prints "Hello world", but when provided with a name argument `hello-world:echo $1`, it prints "Hello ${1}". This command serves as a basic example of a Claude Code plugin implementation, demonstrating the minimal structure required for a functional plugin command. + +It provides a reference implementation for plugin developers. It demonstrates: +- Basic command structure +- Shell command execution within a plugin +- Handling arguments +- Minimal configuration requirements + +The spec sections is inspired by https://man7.org/linux/man-pages/man7/man-pages.7.html#top_of_page + +## Implementation +- The command executes a simple bash `echo` statement +- Accepts an optional name argument (`$1`) +- If `$1` is provided, outputs "Hello $1" +- If no argument is provided, outputs "Hello world" +- Output is sent directly to standard output +- The command is stateless and has no side effects + +Implementation logic: +```bash +if [ -n "$1" ]; then + echo "Hello $1" +else + echo "Hello world" +fi +``` + +## Return Value +- **Claude agent text**: "Hello world" (default) or "Hello $1" (when name is provided) + +## Examples + +1. **Basic usage (no arguments)**: + ``` + /hello-world:echo + ``` + Output: + ``` + Hello world + ``` + +2. **With a name argument**: + ``` + /hello-world:echo Alice + ``` + Output: + ``` + Hello Alice + ``` + +3. **With multiple words as name**: + ``` + /hello-world:echo "John Doe" + ``` + Output: + ``` + Hello John Doe + ``` + +## Arguments: +- $1: The name to be printed "Hello ${1}" \ No newline at end of file diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..d2f3578 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,45 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:openshift-eng/ai-helpers:plugins/hello-world", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "f15328bcc343593011bf59baa61cec14c83a6734", + "treeHash": "42b9db6657df30e5f61472126c4e8f5fe4e844c9d3bbb314d83fb84ae9b31fb4", + "generatedAt": "2025-11-28T10:27:27.726635Z", + "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": "hello-world", + "description": "A hello world plugin", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "ffd2961880d675e88971d4c2a1d03dc06f76654023da3ffe74bf5d06b242fe8b" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "762804ac41f603eaa26be4e38cf88c0d38892ed21ae2b425195523760ba90a74" + }, + { + "path": "commands/echo.md", + "sha256": "a86fc1328b2f49dacdaf14bcf5e01d75b7b2e8aac30061945ffb4797e421a6ef" + } + ], + "dirSha256": "42b9db6657df30e5f61472126c4e8f5fe4e844c9d3bbb314d83fb84ae9b31fb4" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file