diff --git a/Makefile b/Makefile index 8c75263..04bbb33 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,8 @@ MANIFESTS := \ plugins/zero/.claude-plugin/plugin.json \ plugins/zero/.codex-plugin/plugin.json \ plugins/zero/.factory-plugin/plugin.json \ - plugins/zero-gemini/gemini-extension.json + plugins/zero-gemini/gemini-extension.json \ + plugins/zero-kiro/manifest.json # The manifest read for the current version (all of MANIFESTS stay in lockstep). VERSION_SOURCE := plugins/zero/.claude-plugin/plugin.json diff --git a/README.md b/README.md index 3c553b6..93cfff8 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ installation, use the guides below. Pick your agent: - **[Codex app](guides/codex-app.md)** - **[Droid](guides/droid.md)** - **[Gemini CLI](guides/gemini-cli.md)** +- **[Kiro](guides/kiro.md)** - **[Anything else (standalone installer)](guides/generic.md)** — works in any agent with a shell (and for humans at a terminal): @@ -73,7 +74,9 @@ plugins/zero/ # the shared plugin: skill + hooks (+ Claude's ├── .codex-plugin/ # Codex manifest └── .factory-plugin/ # Droid manifest plugins/zero-gemini/ # thin Gemini-only overlay (manifest + hook wiring) +plugins/zero-kiro/ # thin Kiro overlay (Power + skill/MCP/hook templates) scripts/build-gemini.sh # assembles the installable Gemini extension into dist/ +scripts/build-kiro.sh # assembles the installable Kiro package into dist/ guides/ # per-host install guides + the agent install runbook ``` @@ -83,5 +86,5 @@ mechanics — live in the per-host guides. ## Status This repo is built up iteratively, one carefully reviewed PR at a time. Today -it ships the **Claude Code**, **Codex**, **Droid**, and **Gemini CLI** plugins; -additional hosts (Cursor) will land in subsequent PRs. +it ships the **Claude Code**, **Codex**, **Droid**, **Gemini CLI**, and +**Kiro** plugins; additional hosts (Cursor) will land in subsequent PRs. diff --git a/guides/kiro.md b/guides/kiro.md new file mode 100644 index 0000000..c9e91fd --- /dev/null +++ b/guides/kiro.md @@ -0,0 +1,102 @@ +# Zero for Kiro + +How to install Zero in Kiro and keep it up to date. + +## Install + +### Inside Kiro IDE + +Install the Zero Power from a local checkout: + +1. Clone this repository and build the Kiro package: + + ```bash + git clone https://github.com/officialzeroxyz/zero-plugins.git + cd zero-plugins + ./scripts/build-kiro.sh + ``` + +2. In Kiro, open the Powers panel. +3. Choose **Add Custom Power**. +4. Choose **Import power from a folder**. +5. Select `dist/zero-kiro/power`. +6. Finish the install prompt. + +Install the Zero skill so it is available as `/zero`: + +```bash +mkdir -p ~/.kiro/skills +rm -rf ~/.kiro/skills/zero +cp -R dist/zero-kiro/skills/zero ~/.kiro/skills/zero +``` + +Install the Zero runner: + +```bash +curl -fsSL https://zero.xyz/install.sh | bash +``` + +Restart Kiro, then ask: *"Help me set up and test Zero."* + +### From the terminal + +Build the Kiro package and copy the skill: + +```bash +git clone https://github.com/officialzeroxyz/zero-plugins.git +cd zero-plugins +./scripts/build-kiro.sh +mkdir -p ~/.kiro/skills +rm -rf ~/.kiro/skills/zero +cp -R dist/zero-kiro/skills/zero ~/.kiro/skills/zero +``` + +Add the Zero MCP server: + +```bash +kiro-cli mcp add --name zero --scope global --url https://mcp.zero.xyz --force +``` + +Optional: install the Kiro CLI custom-agent template with Zero prompt hooks: + +```bash +mkdir -p ~/.kiro/agents ~/.kiro/zero/hooks +cp dist/zero-kiro/agents/zero.json ~/.kiro/agents/zero.json +cp dist/zero-kiro/hooks/*.sh ~/.kiro/zero/hooks/ +chmod +x ~/.kiro/zero/hooks/*.sh +``` + +Start Kiro with that template: + +```bash +kiro-cli chat --agent zero +``` + +Then ask: *"Help me set up and test Zero."* + +## Staying up to date + +- Kiro CLI updates itself automatically. +- The optional `zero` Kiro CLI agent provisions and refreshes the Zero runner + with its `agentSpawn` hook. +- If you only installed the Kiro IDE Power, rerun the standalone installer to + refresh the runner: + + ```bash + curl -fsSL https://zero.xyz/install.sh | bash + ``` + +- To update the Zero Kiro files: + + ```bash + cd zero-plugins + git pull + ./scripts/build-kiro.sh + rm -rf ~/.kiro/skills/zero + cp -R dist/zero-kiro/skills/zero ~/.kiro/skills/zero + cp dist/zero-kiro/agents/zero.json ~/.kiro/agents/zero.json + cp dist/zero-kiro/hooks/*.sh ~/.kiro/zero/hooks/ + ``` + +If you installed the Power in Kiro IDE, open the Powers panel and use the +Power's update action, or re-import `dist/zero-kiro/power`. diff --git a/plugins/zero-gemini/gemini-extension.json b/plugins/zero-gemini/gemini-extension.json index 69ea920..ac48f52 100644 --- a/plugins/zero-gemini/gemini-extension.json +++ b/plugins/zero-gemini/gemini-extension.json @@ -1,6 +1,6 @@ { "name": "zero", - "version": "1.3.3", + "version": "1.4.0", "description": "Discover and call paid AI capabilities (x402 / MPP) with automatic, wallet-backed payment. Search a live index of external services — image/video/audio generation, web scraping, data enrichment, real-time data, messaging — then call them and pay per use. Bundles the 'zero' skill and the Zero MCP connector.", "mcpServers": { "zero": { diff --git a/plugins/zero-kiro/POWER.md b/plugins/zero-kiro/POWER.md new file mode 100644 index 0000000..57a6575 --- /dev/null +++ b/plugins/zero-kiro/POWER.md @@ -0,0 +1,33 @@ +--- +name: "zero" +displayName: "Zero" +description: "Discover and call paid external capabilities from Kiro when native tools are not enough." +keywords: ["zero", "x402", "mpp", "capability search", "paid tools", "web scraping", "image generation", "video generation", "audio generation", "translation", "weather", "messaging", "crypto"] +author: "Zero" +--- + +# Zero + +Zero is a search engine and payment layer for AI agents. Use it when a request +needs a capability Kiro does not have natively, such as image, video, or audio +generation, transcription, web scraping, data enrichment, real-time data, +messaging, or on-chain actions. + +## Onboarding + +1. Confirm the Zero skill is installed at `~/.kiro/skills/zero/SKILL.md` or + `/.kiro/skills/zero/SKILL.md`. +2. If `zero` is not on `PATH`, ask the user to run the standalone Zero + installer from the Kiro guide. Do not create a wallet yourself. +3. Follow the Zero skill for the full workflow: search, inspect, call, review. +4. Use the bundled `zero` MCP server for account and authorization tasks. + +## Tool Use + +- Prefer Kiro's native abilities for coding, local files, shell commands, and + analysis it can already perform. +- Use Zero before telling the user to sign up for a service, get an API key, or + use an external tool themselves. +- Capability calls may cost real money. Inspect the capability and cap spend + before calling it. +- Always review paid runs using the instructions in the Zero skill. diff --git a/plugins/zero-kiro/README.md b/plugins/zero-kiro/README.md new file mode 100644 index 0000000..85bffbd --- /dev/null +++ b/plugins/zero-kiro/README.md @@ -0,0 +1,40 @@ +# zero-kiro (overlay - not directly installable) + +This directory holds Kiro-specific packaging for Zero: + +- `POWER.md` - Kiro IDE Power entry point +- `mcp.json` - Kiro Power MCP server configuration for `https://mcp.zero.xyz` +- `steering/` - Power steering instructions +- `agents/zero.json` - optional Kiro CLI custom-agent template with hooks +- `hooks/ensure-runner.sh` - Kiro CLI hook wrapper around the shared runner provisioner +- `hooks/zero-context.sh` - Kiro CLI hook helper that prints plain context +- `manifest.json` - repo version metadata kept in lockstep with the other hosts + +The canonical Zero skill lives once in [`../zero/`](../zero/) and is copied into +the build output by `scripts/build-kiro.sh`. User-facing install instructions +are in the [Kiro guide](../../guides/kiro.md). + +## How the package is built + +```text +plugins/zero-kiro/ # this overlay + ├── POWER.md # Kiro IDE Power metadata and instructions + ├── mcp.json # Kiro Power MCP config + ├── agents/zero.json # optional CLI agent template + ├── hooks/ensure-runner.sh # Kiro hook runner provisioning helper + ├── hooks/zero-context.sh # Kiro hook context helper + └── steering/zero.md # Power steering + +scripts/build-kiro.sh # assembles overlay + shared files -> dist/zero-kiro/ + +dist/zero-kiro/ + ├── power/ # folder to import as a Kiro Power + ├── skills/zero/SKILL.md # copy to ~/.kiro/skills/zero + ├── agents/zero.json # optional copy to ~/.kiro/agents/zero.json + └── hooks/*.sh # optional copy to ~/.kiro/zero/hooks/ +``` + +Kiro Powers do not currently bundle Agent Skills into `.kiro/skills`, so the +standalone guide includes a separate skill-copy step. Kiro CLI hooks are part +of custom agent JSON, not the Power package, so `agents/zero.json` is shipped as +a template for users who want the hook-driven CLI path. diff --git a/plugins/zero-kiro/agents/zero.json b/plugins/zero-kiro/agents/zero.json new file mode 100644 index 0000000..7f4963c --- /dev/null +++ b/plugins/zero-kiro/agents/zero.json @@ -0,0 +1,30 @@ +{ + "name": "zero", + "description": "Kiro CLI agent template with Zero context and MCP configuration", + "prompt": "Use Zero when a request needs external capabilities Kiro does not have natively. Prefer native Kiro abilities for local coding and analysis. Follow the installed zero skill for authentication, search, inspect, call, and review.", + "tools": ["*"], + "allowedTools": ["read"], + "mcpServers": { + "zero": { + "url": "https://mcp.zero.xyz", + "autoApprove": ["*"] + } + }, + "hooks": { + "agentSpawn": [ + { + "command": "bash ~/.kiro/zero/hooks/ensure-runner.sh", + "timeout_ms": 120000, + "cache_ttl_seconds": 86400 + } + ], + "userPromptSubmit": [ + { + "command": "bash ~/.kiro/zero/hooks/zero-context.sh", + "timeout_ms": 5000 + } + ] + }, + "includeMcpJson": true, + "welcomeMessage": "Zero is available for external capabilities when native Kiro tools are not enough." +} diff --git a/plugins/zero-kiro/hooks/ensure-runner.sh b/plugins/zero-kiro/hooks/ensure-runner.sh new file mode 100755 index 0000000..447d796 --- /dev/null +++ b/plugins/zero-kiro/hooks/ensure-runner.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# Kiro CLI AgentSpawn hook wrapper. +# +# Runs the shared Zero runner provisioner, then emits Kiro-friendly plain text. +# Kiro adds successful agentSpawn stdout to context, unlike Claude/Gemini which +# expect a JSON hook envelope. + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +SHARED="$SCRIPT_DIR/ensure-runner-shared.sh" + +out="$(bash "$SHARED" 2> >(cat >&2) || true)" + +case "$out" in + *"Zero runner ready"*) + cat <<'EOF' +Zero runner ready. Prefer invoking it as `zero`; if that is not on PATH in this shell, use `~/.zero/runtime/bin/zero`. Follow the zero skill for authentication, search, inspect, call, and review. +EOF + ;; + *"Zero runner unavailable"*) + cat <<'EOF' +Zero runner unavailable in this environment. Tell the user Zero is not available here instead of improvising authentication or creating a wallet. +EOF + ;; + *) + printf '%s\n' "$out" + ;; +esac diff --git a/plugins/zero-kiro/hooks/zero-context.sh b/plugins/zero-kiro/hooks/zero-context.sh new file mode 100755 index 0000000..1448177 --- /dev/null +++ b/plugins/zero-kiro/hooks/zero-context.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# +# Kiro CLI UserPromptSubmit / AgentSpawn hook helper. +# +# Kiro CLI adds stdout from successful agentSpawn and userPromptSubmit hooks to +# the agent context, so emit plain text rather than Claude/Gemini hook JSON. + +set -euo pipefail + +cat <<'EOF' +Zero is available when installed for Kiro: use the zero skill before saying a requested external capability is unavailable or telling the user to sign up for a third-party service. Resolve the runner as `zero` or `~/.zero/runtime/bin/zero`, then follow the zero skill for search, inspect, call, and review. Do not create a wallet yourself. +EOF diff --git a/plugins/zero-kiro/manifest.json b/plugins/zero-kiro/manifest.json new file mode 100644 index 0000000..a312666 --- /dev/null +++ b/plugins/zero-kiro/manifest.json @@ -0,0 +1,5 @@ +{ + "name": "zero-kiro", + "version": "1.4.0", + "description": "Zero Kiro Power, skill drop, MCP config, and CLI hook template" +} diff --git a/plugins/zero-kiro/mcp.json b/plugins/zero-kiro/mcp.json new file mode 100644 index 0000000..5357b44 --- /dev/null +++ b/plugins/zero-kiro/mcp.json @@ -0,0 +1,9 @@ +{ + "mcpServers": { + "zero": { + "url": "https://mcp.zero.xyz", + "disabled": false, + "autoApprove": ["*"] + } + } +} diff --git a/plugins/zero-kiro/steering/zero.md b/plugins/zero-kiro/steering/zero.md new file mode 100644 index 0000000..75ab6da --- /dev/null +++ b/plugins/zero-kiro/steering/zero.md @@ -0,0 +1,14 @@ +# Zero Steering + +Use Zero when Kiro lacks a requested external capability. Typical examples +include image, video, audio, voice, transcription, translation, web scraping, +data enrichment, real-time data, messaging, and on-chain actions. + +Resolve the runner as `zero` first, then fall back to +`~/.zero/runtime/bin/zero`. If neither exists, ask the user to install Zero +from the Kiro guide. Do not improvise authentication and do not create a wallet. + +Follow the installed `zero` skill for the exact workflow and authentication +rules. The flow is search, inspect, call, review. Capability calls can spend +the user's funds, so inspect capability details and use spend caps before +fetching. diff --git a/plugins/zero/.claude-plugin/plugin.json b/plugins/zero/.claude-plugin/plugin.json index 6b83198..59e52a7 100644 --- a/plugins/zero/.claude-plugin/plugin.json +++ b/plugins/zero/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "zero", - "version": "1.3.3", + "version": "1.4.0", "description": "Discover and call paid AI capabilities (x402 / MPP) with automatic, wallet-backed payment. Search a live index of external services — image/video/audio generation, web scraping, data enrichment, real-time data, messaging — then call them and pay per use. Bundles the 'zero' skill and the Zero MCP connector.", "author": { "name": "Zero", "url": "https://zero.xyz" }, "homepage": "https://zero.xyz", diff --git a/plugins/zero/.codex-plugin/plugin.json b/plugins/zero/.codex-plugin/plugin.json index e90630a..3a8d304 100644 --- a/plugins/zero/.codex-plugin/plugin.json +++ b/plugins/zero/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "zero", - "version": "1.3.3", + "version": "1.4.0", "description": "Discover and call paid AI capabilities (x402 / MPP) with automatic, wallet-backed payment. Search a live index of external services — image/video/audio generation, web scraping, data enrichment, real-time data, messaging — then call them and pay per use. Bundles the 'zero' skill.", "author": { "name": "Zero", "url": "https://zero.xyz" }, "homepage": "https://zero.xyz", diff --git a/plugins/zero/.factory-plugin/plugin.json b/plugins/zero/.factory-plugin/plugin.json index 6b83198..59e52a7 100644 --- a/plugins/zero/.factory-plugin/plugin.json +++ b/plugins/zero/.factory-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "zero", - "version": "1.3.3", + "version": "1.4.0", "description": "Discover and call paid AI capabilities (x402 / MPP) with automatic, wallet-backed payment. Search a live index of external services — image/video/audio generation, web scraping, data enrichment, real-time data, messaging — then call them and pay per use. Bundles the 'zero' skill and the Zero MCP connector.", "author": { "name": "Zero", "url": "https://zero.xyz" }, "homepage": "https://zero.xyz", diff --git a/scripts/build-kiro.sh b/scripts/build-kiro.sh new file mode 100755 index 0000000..2151096 --- /dev/null +++ b/scripts/build-kiro.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +# +# Assemble the Kiro package into dist/zero-kiro/. +# +# Kiro has two relevant install surfaces: +# - Kiro IDE Powers: POWER.md + optional mcp.json + steering/ +# - Kiro CLI / IDE skills: ~/.kiro/skills//SKILL.md +# +# Powers do not currently install skills into ~/.kiro/skills, so the build +# output keeps those surfaces separate and the guide tells users where each one +# goes. +# +# Usage: +# scripts/build-kiro.sh # assemble dist/zero-kiro/ +# scripts/build-kiro.sh --tar OUT.tgz # also write a tarball + +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +SHARED="$ROOT/plugins/zero" +OVERLAY="$ROOT/plugins/zero-kiro" +OUT="$ROOT/dist/zero-kiro" + +TARBALL="" +if [ "${1:-}" = "--tar" ]; then + TARBALL="${2:?--tar requires an output path}" +fi + +for f in \ + "$OVERLAY/POWER.md" \ + "$OVERLAY/mcp.json" \ + "$OVERLAY/manifest.json" \ + "$OVERLAY/agents/zero.json" \ + "$OVERLAY/hooks/ensure-runner.sh" \ + "$OVERLAY/hooks/zero-context.sh" \ + "$OVERLAY/steering/zero.md" \ + "$SHARED/hooks/ensure-runner.sh" \ + "$SHARED/skills/zero/SKILL.md"; do + [ -f "$f" ] || { echo "build-kiro: missing required input: $f" >&2; exit 1; } +done + +rm -rf "$OUT" +mkdir -p "$OUT/power" "$OUT/agents" "$OUT/hooks" + +cp "$OVERLAY/POWER.md" "$OUT/power/POWER.md" +cp "$OVERLAY/mcp.json" "$OUT/power/mcp.json" +cp "$OVERLAY/manifest.json" "$OUT/manifest.json" +cp -R "$OVERLAY/steering" "$OUT/power/steering" + +cp "$OVERLAY/agents/zero.json" "$OUT/agents/zero.json" +cp "$OVERLAY/hooks/ensure-runner.sh" "$OUT/hooks/ensure-runner.sh" +cp "$SHARED/hooks/ensure-runner.sh" "$OUT/hooks/ensure-runner-shared.sh" +cp "$OVERLAY/hooks/zero-context.sh" "$OUT/hooks/zero-context.sh" +cp -R "$SHARED/skills" "$OUT/skills" +chmod +x "$OUT/hooks/ensure-runner.sh" "$OUT/hooks/ensure-runner-shared.sh" "$OUT/hooks/zero-context.sh" + +echo "build-kiro: assembled $OUT" +find "$OUT" -type f | sed "s#^$ROOT/##" | sort + +if [ -n "$TARBALL" ]; then + mkdir -p "$(dirname "$TARBALL")" + tar -czf "$TARBALL" -C "$OUT" . + echo "build-kiro: wrote $TARBALL" +fi