ai-builder 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +216 -0
  2. package/dist/index.js +22 -4
  3. package/package.json +15 -4
package/README.md ADDED
@@ -0,0 +1,216 @@
1
+ <div align="center">
2
+ <img src="https://aibuilder.sh/icon.svg" width="100"/>
3
+ <h1>ai-builder</h1>
4
+
5
+ <p>Composable building blocks for Claude Code</p>
6
+ <h3>CLI for installing skills, agents, and commands from the aibuilder.sh registry</h3>
7
+
8
+ [![npm version](https://img.shields.io/npm/v/ai-builder.svg?color=blue&logo=npm)](https://www.npmjs.com/package/ai-builder)
9
+ [![Downloads](https://img.shields.io/npm/dm/ai-builder.svg?color=green)](https://www.npmjs.com/package/ai-builder)
10
+
11
+ </div>
12
+
13
+ ---
14
+
15
+ ## Overview
16
+
17
+ **ai-builder** is a package manager for Claude Code artifacts. Install community-built skills, agents, and commands directly into your `.claude/` directory with a single command.
18
+
19
+ ## Features
20
+
21
+ - **Install artifacts** - Add skills, agents, and commands from the registry
22
+ - **Install stacks** - Bundle multiple artifacts together for specific workflows
23
+ - **Search the registry** - Find artifacts by name, description, or task category
24
+ - **Manage installed artifacts** - List and remove artifacts from your project
25
+
26
+ ---
27
+
28
+ ## Installation
29
+
30
+ ```bash
31
+ npm install -g ai-builder
32
+ ```
33
+
34
+ Or use directly with npx:
35
+
36
+ ```bash
37
+ npx ai-builder add agent git-town/code_reviewer
38
+ ```
39
+
40
+ ---
41
+
42
+ ## QuickStart
43
+
44
+ ```bash
45
+ # Install an agent
46
+ npx ai-builder add agent git-town/code_reviewer
47
+
48
+ # Install a command
49
+ npx ai-builder add command truffle-ai/quality-checks
50
+
51
+ # Install a skill
52
+ npx ai-builder add skill anthropic/pdf
53
+
54
+ # Search for artifacts
55
+ npx ai-builder search "test"
56
+
57
+ # List installed artifacts
58
+ npx ai-builder list
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Usage
64
+
65
+ ### Add
66
+
67
+ Install an artifact from the registry:
68
+
69
+ ```bash
70
+ npx ai-builder add <type> <author/slug>
71
+ ```
72
+
73
+ **Types:** `skill`, `agent`, `command`, `stack`
74
+
75
+ **Examples:**
76
+
77
+ ```bash
78
+ # Install an agent
79
+ npx ai-builder add agent git-town/code_reviewer
80
+
81
+ # Install a command
82
+ npx ai-builder add command truffle-ai/quality-checks
83
+
84
+ # Install a skill
85
+ npx ai-builder add skill anthropic/mcp-builder
86
+
87
+ # Force reinstall (overwrite existing)
88
+ npx ai-builder add agent git-town/code_reviewer --force
89
+ ```
90
+
91
+ **Stacks** bundle multiple artifacts together:
92
+
93
+ ```bash
94
+ # Install a stack (prompts for confirmation)
95
+ npx ai-builder add stack my-stack
96
+
97
+ # Skip confirmation
98
+ npx ai-builder add stack my-stack --yes
99
+ ```
100
+
101
+ ### Remove
102
+
103
+ Remove an installed artifact:
104
+
105
+ ```bash
106
+ npx ai-builder remove <type> <author/slug>
107
+ npx ai-builder rm <type> <author/slug> # alias
108
+ ```
109
+
110
+ **Examples:**
111
+
112
+ ```bash
113
+ # Remove an agent
114
+ npx ai-builder remove agent git-town/code_reviewer
115
+
116
+ # Skip confirmation
117
+ npx ai-builder rm agent git-town/code_reviewer --yes
118
+ ```
119
+
120
+ ### List
121
+
122
+ List all installed artifacts:
123
+
124
+ ```bash
125
+ npx ai-builder list
126
+ npx ai-builder ls # alias
127
+ ```
128
+
129
+ **Options:**
130
+
131
+ ```bash
132
+ # Filter by type
133
+ npx ai-builder list --type agent
134
+ npx ai-builder list --type skill
135
+ npx ai-builder list --type command
136
+ ```
137
+
138
+ ### Search
139
+
140
+ Search the registry for artifacts:
141
+
142
+ ```bash
143
+ npx ai-builder search <query>
144
+ ```
145
+
146
+ **Options:**
147
+
148
+ ```bash
149
+ # Filter by type
150
+ npx ai-builder search "review" --type agent
151
+
152
+ # Filter by task category
153
+ npx ai-builder search "nextjs" --task frontend
154
+
155
+ # Limit results
156
+ npx ai-builder search "database" --limit 5
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Artifact Types
162
+
163
+ | Type | Description | Install Location |
164
+ |------|-------------|------------------|
165
+ | **skill** | Background capabilities that enhance Claude's abilities | `.claude/skills/{name}/` |
166
+ | **agent** | Specialized agents invoked with `@agent-name` | `.claude/agents/{name}.md` |
167
+ | **command** | Slash commands invoked with `/command-name` | `.claude/commands/{name}.md` |
168
+ | **stack** | Bundles of artifacts for specific workflows | Various locations |
169
+
170
+ ---
171
+
172
+ ## Using Installed Artifacts
173
+
174
+ ### Agents
175
+
176
+ Invoke agents by mentioning them with `@`:
177
+
178
+ ```
179
+ @reviewer review my latest changes
180
+ ```
181
+
182
+ ### Commands
183
+
184
+ Run commands with `/`:
185
+
186
+ ```
187
+ /deps
188
+ ```
189
+
190
+ ### Skills
191
+
192
+ Skills are automatically available to Claude Code - no invocation needed.
193
+
194
+ ---
195
+
196
+ ## Browse
197
+
198
+ Find artifacts at [aibuilder.sh](https://aibuilder.sh)
199
+
200
+ - Browse by task category (testing, code review, documentation, etc.)
201
+ - View artifact details and source code
202
+ - See install counts and community activity
203
+
204
+ ---
205
+
206
+ ## Links
207
+
208
+ - [Registry](https://aibuilder.sh)
209
+ - [npm package](https://www.npmjs.com/package/ai-builder)
210
+ - [GitHub](https://github.com/BrainGridAI/ai-builder)
211
+
212
+ ---
213
+
214
+ ## License
215
+
216
+ MIT
package/dist/index.js CHANGED
@@ -10,28 +10,40 @@ import chalk from "chalk";
10
10
  import ora from "ora";
11
11
 
12
12
  // src/services/api.ts
13
+ import { createCliLogger } from "@aibuilder/logger/adapters/cli";
13
14
  var API_BASE = process.env.AI_BUILDER_API_URL || "https://aibuilder.sh/api";
15
+ var logger = createCliLogger({ base: { module: "cli:api" } });
14
16
  async function resolveArtifact(type, slug) {
15
17
  const url = `${API_BASE}/resolve?type=${encodeURIComponent(type)}&slug=${encodeURIComponent(slug)}`;
18
+ logger.debug({ type, slug, url }, "Resolving artifact");
16
19
  const response = await fetch(url);
17
20
  if (!response.ok) {
18
21
  const errorBody = await response.json().catch(() => ({ error: "Unknown error" }));
22
+ logger.error({ type, slug, status: response.status }, "Failed to resolve artifact");
19
23
  throw new Error(errorBody.error || `Failed to resolve artifact: ${response.status}`);
20
24
  }
25
+ logger.debug({ type, slug }, "Artifact resolved successfully");
21
26
  return response.json();
22
27
  }
23
28
  async function searchArtifacts(options) {
24
29
  const params = new URLSearchParams();
25
- if (options.query) params.set("q", options.query);
30
+ if (options.query) {
31
+ params.set("q", options.query);
32
+ params.set("sort", "relevance");
33
+ }
26
34
  if (options.type) params.set("type", options.type);
27
35
  if (options.task) params.set("task", options.task);
28
36
  if (options.limit) params.set("limit", options.limit.toString());
29
37
  const url = `${API_BASE}/artifacts?${params.toString()}`;
38
+ logger.debug({ options, url }, "Searching artifacts");
30
39
  const response = await fetch(url);
31
40
  if (!response.ok) {
41
+ logger.error({ status: response.status, options }, "Search failed");
32
42
  throw new Error(`Failed to search artifacts: ${response.status}`);
33
43
  }
34
- return response.json();
44
+ const result = await response.json();
45
+ logger.debug({ resultCount: result.artifacts.length, total: result.total }, "Search completed");
46
+ return result;
35
47
  }
36
48
  async function trackInstall(type, slug, cliVersion) {
37
49
  try {
@@ -40,17 +52,23 @@ async function trackInstall(type, slug, cliVersion) {
40
52
  headers: { "Content-Type": "application/json" },
41
53
  body: JSON.stringify({ type, slug, cliVersion })
42
54
  });
43
- } catch {
55
+ logger.debug({ type, slug, cliVersion }, "Install tracked");
56
+ } catch (error) {
57
+ logger.debug({ err: error, type, slug }, "Install tracking failed (non-critical)");
44
58
  }
45
59
  }
46
60
  async function resolveStack(slug) {
47
61
  const url = `${API_BASE}/stacks/${encodeURIComponent(slug)}`;
62
+ logger.debug({ slug, url }, "Resolving stack");
48
63
  const response = await fetch(url);
49
64
  if (!response.ok) {
50
65
  const errorBody = await response.json().catch(() => ({ error: "Unknown error" }));
66
+ logger.error({ slug, status: response.status }, "Failed to resolve stack");
51
67
  throw new Error(errorBody.error || `Failed to resolve stack: ${response.status}`);
52
68
  }
53
- return response.json();
69
+ const result = await response.json();
70
+ logger.debug({ slug, artifactCount: result.artifactCount }, "Stack resolved successfully");
71
+ return result;
54
72
  }
55
73
 
56
74
  // src/services/installer.ts
package/package.json CHANGED
@@ -1,17 +1,18 @@
1
1
  {
2
2
  "name": "ai-builder",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "CLI for installing Claude Code artifacts from aibuilder.sh",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "ai-builder": "./dist/index.js"
8
8
  },
9
- "files": ["dist"],
9
+ "files": [
10
+ "dist"
11
+ ],
10
12
  "scripts": {
11
13
  "build": "tsup src/index.ts --format esm --dts --clean",
12
14
  "dev": "tsx src/index.ts",
13
15
  "type-check": "tsc --noEmit",
14
- "prepublishOnly": "pnpm run build",
15
16
  "preversion": "pnpm run type-check",
16
17
  "release:patch": "npm version patch -m 'chore(cli): release v%s'",
17
18
  "release:minor": "npm version minor -m 'chore(cli): release v%s'",
@@ -21,6 +22,7 @@
21
22
  "access": "public"
22
23
  },
23
24
  "dependencies": {
25
+ "@aibuilder/logger": "workspace:*",
24
26
  "chalk": "^5.3.0",
25
27
  "commander": "^12.1.0",
26
28
  "ora": "^8.1.0"
@@ -34,7 +36,16 @@
34
36
  "engines": {
35
37
  "node": ">=18"
36
38
  },
37
- "keywords": ["claude", "claude-code", "ai", "cli", "artifacts", "skills", "agents", "commands"],
39
+ "keywords": [
40
+ "claude",
41
+ "claude-code",
42
+ "ai",
43
+ "cli",
44
+ "artifacts",
45
+ "skills",
46
+ "agents",
47
+ "commands"
48
+ ],
38
49
  "author": "",
39
50
  "license": "MIT",
40
51
  "homepage": "https://aibuilder.sh",