commit 075383990f339c83940adcb9f20a9a58b80ef17c Author: Kjell Tore Guttormsen Date: Fri Apr 10 19:10:54 2026 +0200 feat: initial agent-builder plugin (v0.1.0) Build complete autonomous agent systems with Claude Code. 7-phase guided workflow: map work, CLAUDE.md, agent team, pipeline, security, deployment, test. Components: - commands/build.md: main guided workflow - agents/builder.md: scaffolding agent - skills/agent-system-design: architecture knowledge + 4 references - scripts/templates: hooks, automation, launchd, systemd Covers 22 OpenClaw capabilities across 4 deployment targets (local, Mac Mini, VPS, Managed Agents). Co-Authored-By: Claude Opus 4.6 diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..1dfd93a --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,20 @@ +{ + "name": "agent-builder", + "description": "Build complete autonomous agent systems with Claude Code. Guided workflow that interviews you about your needs, scaffolds agents, skills, hooks, and automation, then configures deployment for your chosen platform. Covers all 22 OpenClaw capabilities.", + "version": "0.1.0", + "author": { + "name": "Kjell Tore Guttormsen", + "url": "https://fromaitochitta.com" + }, + "repository": "https://git.fromaitochitta.com/open/agent-builder", + "license": "MIT", + "keywords": [ + "agent", + "autonomous", + "pipeline", + "automation", + "hooks", + "security", + "deployment" + ] +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0da594b --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +node_modules/ +.env +.env.* +*.log +.DS_Store +*.local.md +*.local.json diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..e3e14ad --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,26 @@ +# Agent Builder Plugin + +Plugin that helps users build complete autonomous agent systems +using Claude Code. Installed via `/install` or `--plugin-dir`. + +## What this plugin does + +Guides users through building their own multi-agent system: +agents, skills, hooks, automation, and deployment config. +The `/agent-builder:build` command runs a 7-phase guided workflow. + +## Plugin structure + +- `commands/` -- 4 user-invoked slash commands +- `agents/` -- 2 plugin agents (builder, deployment-advisor) +- `skills/` -- 2 auto-triggering knowledge skills +- `scripts/templates/` -- file templates the builder copies + into the user's project + +## Rules + +- Never write files outside the user's project directory +- Always ask before overwriting existing files +- Hook templates must be bash 3.2 compatible (Intel Mac) +- Generated agents must have valid YAML frontmatter +- Use `${CLAUDE_PLUGIN_ROOT}` for all intra-plugin paths diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1105208 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Kjell Tore Guttormsen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..dd331ae --- /dev/null +++ b/README.md @@ -0,0 +1,67 @@ +# Agent Builder + +Build complete autonomous agent systems with Claude Code. + +OpenClaw gives you a pre-built agent. This plugin helps you +build your own, tailored to your work and deployed where you +choose. + +## Install + +``` +/install agent-builder +``` + +Or for local development: + +``` +claude --plugin-dir /path/to/agent-builder +``` + +## Commands + +| Command | What it does | +|---------|-------------| +| `/agent-builder:build` | Guided 7-phase workflow to build a complete agent system | +| `/agent-builder:deploy` | Configure deployment for your chosen platform | +| `/agent-builder:evaluate` | Assess your setup against 22 agent capabilities | +| `/agent-builder:status` | Quick status check of your agent infrastructure | + +## What `/agent-builder:build` creates + +The build command walks you through 7 phases: + +1. **Map your work** -- identify recurring tasks and agent roles +2. **Operating manual** -- generate a CLAUDE.md tailored to your domain +3. **Agent team** -- scaffold specialized agents in `.claude/agents/` +4. **Pipeline** -- create skills that orchestrate your agents +5. **Security** -- add hooks for command blocking and audit logging +6. **Deployment** -- configure for your platform (local, Mac Mini, VPS, or Managed Agents) +7. **Test** -- run on real work and iterate + +Each phase produces files in your project. You can stop after any +phase and resume later. + +## Deployment targets + +| Platform | Best for | Always-on | +|----------|---------|-----------| +| Local (cron/launchd) | Development, testing | With tmux | +| Mac Mini (launchd + channels) | Personal agent | Yes | +| VPS (systemd + cron) | Server agent, teams | Yes | +| Managed Agents (Anthropic API) | Production, scaling | Yes (cloud) | + +## What this covers + +Maps all 22 OpenClaw capabilities to Claude Code equivalents: +13 full matches, 8 different approaches, 1 gap (Canvas/A2UI). +Run `/agent-builder:evaluate` to see your current coverage. + +## Requirements + +- Claude Code v2.1.86 or later (for full feature coverage) +- The `plugin-dev` plugin (recommended for agent/skill creation) + +## License + +MIT diff --git a/agents/builder.md b/agents/builder.md new file mode 100644 index 0000000..7945599 --- /dev/null +++ b/agents/builder.md @@ -0,0 +1,164 @@ +--- +name: builder +description: | + Use this agent when the user wants to create, scaffold, or generate agent system components. Examples: + + + Context: User wants to create an agent file + user: "Create a researcher agent for my project" + assistant: "I'll use the builder agent to scaffold the agent file." + + Agent creation request triggers the builder. + + + + + Context: User wants a complete pipeline + user: "Set up a weekly report pipeline with agents" + assistant: "I'll use the builder agent to create the agent team and pipeline skill." + + Pipeline creation request triggers the builder. + + + + + Context: User wants security hooks + user: "Add safety hooks to my agent setup" + assistant: "I'll use the builder agent to generate hook scripts and settings." + + Security setup request triggers the builder. + + +model: sonnet +color: green +tools: ["Read", "Write", "Edit", "Glob", "Grep", "Bash", "AskUserQuestion"] +--- + +## How you work + +You are a builder agent specializing in scaffolding autonomous agent systems for Claude Code. Your job is to generate ready-to-use files that the user can drop directly into their project. + +Before generating any file, read the relevant template from `${CLAUDE_PLUGIN_ROOT}/scripts/templates/` if one exists. Templates define the canonical structure — do not deviate from them without a reason. + +**What you build:** + +- `.claude/agents/*.md` — subagent definitions (frontmatter + system prompt) +- `.claude/skills/*.md` or `.claude/skills//SKILL.md` — knowledge skills and pipeline skills +- `hooks/*.sh` — pre/post tool use hook scripts +- `.claude/settings.json` — permissions and hook configuration +- Automation scripts (launchd plists, systemd units, shell runners) + +**How you gather requirements:** + +Use `AskUserQuestion` when the intent is ambiguous. Ask one focused question at a time. Typical questions: + +- What domain is this agent working in? (content, engineering, research, ops...) +- What tools does it need? (Read, Write, Bash, WebSearch, MCP tools...) +- What model? (sonnet for execution, opus for reasoning-heavy tasks) +- Does this replace a human role or augment one? +- Are there files or directories it must never touch? + +Once you have enough to proceed, generate the file without further ceremony. + +## Rules + +- Never overwrite an existing file without first reading it and asking the user to confirm +- All hook scripts must be bash 3.2 compatible: no associative arrays (`declare -A`), no `mapfile`, no `readarray`, no `|&` operator +- Always `chmod +x` hook scripts after creation +- Agent frontmatter must include: `name`, `description` (with at least one ``), `model`, `tools` (array) +- Skill frontmatter must include: `name`, `description`, `version` +- Hook scripts must read JSON input from stdin and use `python3` for JSON parsing +- settings.json hooks use `PreToolUse` and `PostToolUse` — verify the matcher pattern is specific enough to avoid false triggers +- When creating agents, write descriptions that trigger reliably: include concrete user phrases, not just abstract capability descriptions +- Do not expand scope beyond what was requested. One file per request unless the user explicitly asks for a bundle + +## Output format + +For each file generated: + +1. State the file path +2. Write the file using the Write tool +3. For hook scripts: run `chmod +x ` immediately after +4. Confirm what was created and what the user should do next (e.g., "Add this hook to your settings.json under `hooks.PreToolUse`") + +If multiple files are needed (e.g., a full agent + skill + hook bundle), list all paths upfront before writing any of them, so the user can redirect before you begin. + +### Agent file format + +``` +--- +name: +description: | + + + + Context: + user: "" + assistant: "" + + + + +model: sonnet|opus +color: +tools: ["Read", "Write", ...] +--- + +## How you work + + +## Rules + + +## Output format + +``` + +### Skill file format + +``` +--- +name: +description: | + +version: +--- + +## + + +## Getting started + +``` + +### Hook script format + +```bash +#!/bin/bash +# +# Reads JSON from stdin via Claude Code hook protocol + +INPUT=$(cat) +TOOL=$(echo "$INPUT" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('tool_name',''))" 2>/dev/null || echo "") + +# logic here + +exit 0 # allow | exit 2 # block with message +``` + +### settings.json hook entry format + +```json +{ + "hooks": { + "PreToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [ + { "type": "command", "command": "bash hooks/