@uniswap/ai-toolkit-nx-claude 0.5.28 → 0.5.30-next.0

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 (87) hide show
  1. package/dist/cli-generator.cjs +28 -59
  2. package/dist/packages/ai-toolkit-nx-claude/src/cli-generator.d.ts +8 -10
  3. package/dist/packages/ai-toolkit-nx-claude/src/cli-generator.d.ts.map +1 -1
  4. package/dist/packages/ai-toolkit-nx-claude/src/index.d.ts +0 -1
  5. package/dist/packages/ai-toolkit-nx-claude/src/index.d.ts.map +1 -1
  6. package/generators.json +0 -15
  7. package/package.json +4 -35
  8. package/dist/content/agents/agnostic/CLAUDE.md +0 -282
  9. package/dist/content/agents/agnostic/agent-capability-analyst.md +0 -575
  10. package/dist/content/agents/agnostic/agent-optimizer.md +0 -396
  11. package/dist/content/agents/agnostic/agent-orchestrator.md +0 -475
  12. package/dist/content/agents/agnostic/cicd-agent.md +0 -301
  13. package/dist/content/agents/agnostic/claude-agent-discovery.md +0 -304
  14. package/dist/content/agents/agnostic/claude-docs-fact-checker.md +0 -435
  15. package/dist/content/agents/agnostic/claude-docs-initializer.md +0 -782
  16. package/dist/content/agents/agnostic/claude-docs-manager.md +0 -595
  17. package/dist/content/agents/agnostic/code-explainer.md +0 -269
  18. package/dist/content/agents/agnostic/code-generator.md +0 -785
  19. package/dist/content/agents/agnostic/commit-message-generator.md +0 -101
  20. package/dist/content/agents/agnostic/context-loader.md +0 -432
  21. package/dist/content/agents/agnostic/debug-assistant.md +0 -321
  22. package/dist/content/agents/agnostic/doc-writer.md +0 -536
  23. package/dist/content/agents/agnostic/feedback-collector.md +0 -165
  24. package/dist/content/agents/agnostic/infrastructure-agent.md +0 -406
  25. package/dist/content/agents/agnostic/migration-assistant.md +0 -489
  26. package/dist/content/agents/agnostic/pattern-learner.md +0 -481
  27. package/dist/content/agents/agnostic/performance-analyzer.md +0 -528
  28. package/dist/content/agents/agnostic/plan-reviewer.md +0 -173
  29. package/dist/content/agents/agnostic/planner.md +0 -235
  30. package/dist/content/agents/agnostic/pr-creator.md +0 -498
  31. package/dist/content/agents/agnostic/pr-reviewer.md +0 -142
  32. package/dist/content/agents/agnostic/prompt-engineer.md +0 -541
  33. package/dist/content/agents/agnostic/refactorer.md +0 -311
  34. package/dist/content/agents/agnostic/researcher.md +0 -349
  35. package/dist/content/agents/agnostic/security-analyzer.md +0 -1087
  36. package/dist/content/agents/agnostic/stack-splitter.md +0 -642
  37. package/dist/content/agents/agnostic/style-enforcer.md +0 -568
  38. package/dist/content/agents/agnostic/test-runner.md +0 -481
  39. package/dist/content/agents/agnostic/test-writer.md +0 -292
  40. package/dist/content/commands/agnostic/CLAUDE.md +0 -207
  41. package/dist/content/commands/agnostic/address-pr-issues.md +0 -205
  42. package/dist/content/commands/agnostic/auto-spec.md +0 -386
  43. package/dist/content/commands/agnostic/claude-docs.md +0 -409
  44. package/dist/content/commands/agnostic/claude-init-plus.md +0 -439
  45. package/dist/content/commands/agnostic/create-pr.md +0 -79
  46. package/dist/content/commands/agnostic/daily-standup.md +0 -185
  47. package/dist/content/commands/agnostic/deploy.md +0 -441
  48. package/dist/content/commands/agnostic/execute-plan.md +0 -167
  49. package/dist/content/commands/agnostic/explain-file.md +0 -303
  50. package/dist/content/commands/agnostic/explore.md +0 -82
  51. package/dist/content/commands/agnostic/fix-bug.md +0 -273
  52. package/dist/content/commands/agnostic/gen-tests.md +0 -185
  53. package/dist/content/commands/agnostic/generate-commit-message.md +0 -92
  54. package/dist/content/commands/agnostic/git-worktree-orchestrator.md +0 -647
  55. package/dist/content/commands/agnostic/implement-spec.md +0 -270
  56. package/dist/content/commands/agnostic/monitor.md +0 -581
  57. package/dist/content/commands/agnostic/perf-analyze.md +0 -214
  58. package/dist/content/commands/agnostic/plan.md +0 -453
  59. package/dist/content/commands/agnostic/refactor.md +0 -315
  60. package/dist/content/commands/agnostic/refine-linear-task.md +0 -575
  61. package/dist/content/commands/agnostic/research.md +0 -49
  62. package/dist/content/commands/agnostic/review-code.md +0 -321
  63. package/dist/content/commands/agnostic/review-plan.md +0 -109
  64. package/dist/content/commands/agnostic/review-pr.md +0 -393
  65. package/dist/content/commands/agnostic/split-stack.md +0 -705
  66. package/dist/content/commands/agnostic/update-claude-md.md +0 -401
  67. package/dist/content/commands/agnostic/work-through-pr-comments.md +0 -873
  68. package/dist/generators/add-agent/CLAUDE.md +0 -130
  69. package/dist/generators/add-agent/files/__name__.md.template +0 -37
  70. package/dist/generators/add-agent/generator.cjs +0 -640
  71. package/dist/generators/add-agent/schema.json +0 -59
  72. package/dist/generators/add-command/CLAUDE.md +0 -131
  73. package/dist/generators/add-command/files/__name__.md.template +0 -46
  74. package/dist/generators/add-command/generator.cjs +0 -643
  75. package/dist/generators/add-command/schema.json +0 -50
  76. package/dist/generators/files/src/index.ts.template +0 -1
  77. package/dist/generators/init/CLAUDE.md +0 -520
  78. package/dist/generators/init/generator.cjs +0 -3304
  79. package/dist/generators/init/schema.json +0 -180
  80. package/dist/packages/ai-toolkit-nx-claude/src/generators/add-agent/generator.d.ts +0 -5
  81. package/dist/packages/ai-toolkit-nx-claude/src/generators/add-agent/generator.d.ts.map +0 -1
  82. package/dist/packages/ai-toolkit-nx-claude/src/generators/add-command/generator.d.ts +0 -5
  83. package/dist/packages/ai-toolkit-nx-claude/src/generators/add-command/generator.d.ts.map +0 -1
  84. package/dist/packages/ai-toolkit-nx-claude/src/generators/init/generator.d.ts +0 -5
  85. package/dist/packages/ai-toolkit-nx-claude/src/generators/init/generator.d.ts.map +0 -1
  86. package/dist/packages/ai-toolkit-nx-claude/src/utils/auto-update-utils.d.ts +0 -30
  87. package/dist/packages/ai-toolkit-nx-claude/src/utils/auto-update-utils.d.ts.map +0 -1
@@ -272,36 +272,26 @@ async function applyTreeChanges(tree) {
272
272
 
273
273
  // packages/ai-toolkit-nx-claude/src/cli-generator.ts
274
274
  var import_enquirer = require("enquirer");
275
- var path2 = __toESM(require("path"));
276
- var fs2 = __toESM(require("fs"));
277
- function isInAiToolkitRepo() {
278
- const cwd = process.cwd();
279
- const scriptPath = process.argv[1];
280
- const isInAiToolkit = cwd.includes("/ai-toolkit") || scriptPath.includes("/ai-toolkit/") || fs2.existsSync(path2.join(cwd, "package.json")) && JSON.parse(fs2.readFileSync(path2.join(cwd, "package.json"), "utf-8")).name === "@ai-toolkit/source";
281
- return isInAiToolkit;
282
- }
283
275
  var GENERATORS = {
284
- default: "Recommended setup with pre-selected components",
285
- custom: "Choose exactly what to install"
276
+ hooks: "Install Claude Code notification hooks",
277
+ addons: "Install and configure Claude Code addons including MCP servers"
286
278
  };
287
- var ALL_GENERATORS = isInAiToolkitRepo() ? {
288
- ...GENERATORS,
289
- "add-command": "Add a new Claude Code command to existing or new packages",
290
- "add-agent": "Add a new Claude Code agent to existing or new packages"
291
- } : GENERATORS;
292
279
  function getGeneratorName(args) {
293
280
  if (args.length > 0 && !args[0].startsWith("-")) {
294
281
  const generatorName = args[0];
295
- if (generatorName in ALL_GENERATORS) {
282
+ if (generatorName in GENERATORS) {
296
283
  return generatorName;
297
284
  }
298
285
  console.error(`
299
286
  \u274C Unknown generator: '${generatorName}'
300
287
  `);
301
288
  console.error("Available generators:");
302
- Object.entries(ALL_GENERATORS).forEach(([name, description]) => {
289
+ Object.entries(GENERATORS).forEach(([name, description]) => {
303
290
  console.error(` \u2022 ${name}: ${description}`);
304
291
  });
292
+ console.error(
293
+ "\nNote: The init generator has been removed. Use the marketplace-based plugin architecture instead."
294
+ );
305
295
  process.exit(1);
306
296
  }
307
297
  return null;
@@ -309,11 +299,9 @@ function getGeneratorName(args) {
309
299
  async function selectGeneratorInteractively() {
310
300
  console.log("\n\u{1F3AF} AI Toolkit NX Claude Generator\n");
311
301
  console.log("Select a generator to run:\n");
312
- const availableGenerators = isInAiToolkitRepo() ? ALL_GENERATORS : GENERATORS;
313
- const choices = Object.entries(availableGenerators).map(([value, label]) => ({
314
- message: `${value.padEnd(25)} - ${label}`,
302
+ const choices = Object.entries(GENERATORS).map(([value, label]) => ({
303
+ message: `${value.padEnd(15)} - ${label}`,
315
304
  name: value
316
- // name is the actual value that gets returned
317
305
  }));
318
306
  const response = await (0, import_enquirer.prompt)({
319
307
  type: "select",
@@ -326,69 +314,50 @@ async function selectGeneratorInteractively() {
326
314
  async function main() {
327
315
  const args = process.argv.slice(2);
328
316
  let generatorName = getGeneratorName(args);
329
- const processedArgs = args.length > 0 && !args[0].startsWith("-") && args[0] in ALL_GENERATORS ? args.slice(1) : args;
317
+ const processedArgs = args.length > 0 && !args[0].startsWith("-") && args[0] in GENERATORS ? args.slice(1) : args;
330
318
  if (processedArgs.includes("--list") || processedArgs.includes("-l")) {
331
319
  console.log("Available generators:\n");
332
- Object.entries(ALL_GENERATORS).forEach(([name, description]) => {
333
- console.log(` ${name.padEnd(25)} ${description}`);
320
+ Object.entries(GENERATORS).forEach(([name, description]) => {
321
+ console.log(` ${name.padEnd(15)} ${description}`);
334
322
  });
335
323
  console.log("\nUsage:");
336
324
  console.log(" npx @uniswap/ai-toolkit-nx-claude@latest [generator]");
337
325
  console.log("\nExamples:");
338
- console.log(" npx @uniswap/ai-toolkit-nx-claude@latest default");
339
- console.log(" npx @uniswap/ai-toolkit-nx-claude@latest custom");
326
+ console.log(" npx @uniswap/ai-toolkit-nx-claude@latest hooks");
327
+ console.log(" npx @uniswap/ai-toolkit-nx-claude@latest addons");
328
+ console.log(
329
+ "\nNote: The init generator has been removed. Use the marketplace-based plugin architecture instead."
330
+ );
340
331
  process.exit(0);
341
332
  }
342
333
  if (processedArgs.includes("--help") || processedArgs.includes("-h")) {
343
334
  if (generatorName) {
344
- console.log(
345
- `Usage: npx @uniswap/ai-toolkit-nx-claude@latest ${generatorName}`
346
- );
347
- console.log(
348
- `
349
- This command runs the nx-claude ${generatorName} generator.`
350
- );
335
+ console.log(`Usage: npx @uniswap/ai-toolkit-nx-claude@latest ${generatorName}`);
336
+ console.log(`
337
+ This command runs the nx-claude ${generatorName} generator.`);
351
338
  } else {
352
- console.log(
353
- "Usage: npx @uniswap/ai-toolkit-nx-claude@latest [generator]"
354
- );
339
+ console.log("Usage: npx @uniswap/ai-toolkit-nx-claude@latest [generator]");
355
340
  console.log("\nRun without arguments for interactive mode.");
356
341
  }
357
342
  console.log("\nTo see all available generators, run with --list");
358
343
  console.log("\nTo run a specific generator:");
359
344
  console.log(" npx @uniswap/ai-toolkit-nx-claude@latest [generator]");
360
345
  console.log("\nOptions are handled interactively during execution.");
361
- console.log("\nFor more information, see the package documentation.");
346
+ console.log(
347
+ "\nNote: The init generator has been removed. Use the marketplace-based plugin architecture instead."
348
+ );
362
349
  process.exit(0);
363
350
  }
364
351
  if (!generatorName && processedArgs.length === 0) {
365
- if (isInAiToolkitRepo()) {
366
- generatorName = await selectGeneratorInteractively();
367
- console.log("");
368
- } else {
369
- generatorName = "init";
370
- }
352
+ generatorName = await selectGeneratorInteractively();
353
+ console.log("");
371
354
  }
372
355
  if (!generatorName) {
373
356
  console.error("\n\u274C No generator specified.");
374
- console.error(
375
- "\nUsage: npx @uniswap/ai-toolkit-nx-claude@latest [generator]"
376
- );
357
+ console.error("\nUsage: npx @uniswap/ai-toolkit-nx-claude@latest [generator]");
377
358
  console.error("\nRun with --list to see available generators.");
378
359
  process.exit(1);
379
360
  }
380
- if (generatorName === "default") {
381
- await handleNxExecution("init", [
382
- ...processedArgs,
383
- "--install-mode=default"
384
- ]);
385
- } else if (generatorName === "custom") {
386
- await handleNxExecution("init", [
387
- ...processedArgs,
388
- "--install-mode=custom"
389
- ]);
390
- } else {
391
- await handleNxExecution(generatorName, processedArgs);
392
- }
361
+ await handleNxExecution(generatorName, processedArgs);
393
362
  }
394
363
  main().catch(console.error);
@@ -1,19 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Unified CLI wrapper for all generators.
3
+ * Unified CLI wrapper for ai-toolkit-nx-claude generators.
4
4
  *
5
- * External Usage (npx @uniswap/ai-toolkit-nx-claude@latest):
6
- * - No arguments -> runs init generator (prompts for installMode)
7
- * - default -> runs init with --install-mode=default
8
- * - custom -> runs init with --install-mode=custom
5
+ * Available generators:
6
+ * - hooks: Install Claude Code notification hooks
7
+ * - addons: Install and configure Claude Code addons including MCP servers
9
8
  *
10
- * Internal Usage (from within ai-toolkit repo):
11
- * - No arguments -> shows interactive menu of all generators
9
+ * Usage:
10
+ * - No arguments -> shows interactive menu of generators
12
11
  * - Specific generator name -> runs that generator
13
12
  *
14
- * This design ensures external users get a streamlined experience (init generator
15
- * with its schema-driven installMode prompt) while developers get access to all
16
- * generators including internal ones (add-command, add-agent).
13
+ * Note: The init, add-command, and add-agent generators have been removed.
14
+ * For Claude Code setup, use the marketplace-based plugin architecture instead.
17
15
  */
18
16
  export {};
19
17
  //# sourceMappingURL=cli-generator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-generator.d.ts","sourceRoot":"","sources":["../../../../src/cli-generator.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;GAeG"}
1
+ {"version":3,"file":"cli-generator.d.ts","sourceRoot":"","sources":["../../../../src/cli-generator.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;GAaG"}
@@ -1,4 +1,3 @@
1
1
  export { default as hooksGenerator } from './generators/hooks/generator';
2
2
  export { default as addonsGenerator } from './generators/addons/generator';
3
- export type { InitGeneratorSchema } from './generators/init/schema';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC3E,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,+BAA+B,CAAC"}
package/generators.json CHANGED
@@ -1,20 +1,5 @@
1
1
  {
2
2
  "generators": {
3
- "init": {
4
- "factory": "./dist/generators/init/generator",
5
- "schema": "./dist/generators/init/schema.json",
6
- "description": "One-shot installer for Claude Code configs"
7
- },
8
- "add-command": {
9
- "factory": "./dist/generators/add-command/generator",
10
- "schema": "./dist/generators/add-command/schema.json",
11
- "description": "Add a new Claude Code command to existing or new packages"
12
- },
13
- "add-agent": {
14
- "factory": "./dist/generators/add-agent/generator",
15
- "schema": "./dist/generators/add-agent/schema.json",
16
- "description": "Add a new Claude Code agent to existing or new packages"
17
- },
18
3
  "hooks": {
19
4
  "factory": "./dist/generators/hooks/generator",
20
5
  "schema": "./dist/generators/hooks/schema.json",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniswap/ai-toolkit-nx-claude",
3
- "version": "0.5.28",
3
+ "version": "0.5.30-next.0",
4
4
  "private": false,
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.cjs",
@@ -47,11 +47,8 @@
47
47
  "additionalEntryPoints": [
48
48
  "packages/ai-toolkit-nx-claude/src/index.ts",
49
49
  "packages/ai-toolkit-nx-claude/src/scripts/claude-plus/index.ts",
50
- "packages/ai-toolkit-nx-claude/src/generators/add-agent/generator.ts",
51
- "packages/ai-toolkit-nx-claude/src/generators/add-command/generator.ts",
52
50
  "packages/ai-toolkit-nx-claude/src/generators/addons/generator.ts",
53
- "packages/ai-toolkit-nx-claude/src/generators/hooks/generator.ts",
54
- "packages/ai-toolkit-nx-claude/src/generators/init/generator.ts"
51
+ "packages/ai-toolkit-nx-claude/src/generators/hooks/generator.ts"
55
52
  ],
56
53
  "tsConfig": "packages/ai-toolkit-nx-claude/tsconfig.lib.json",
57
54
  "bundle": true,
@@ -81,16 +78,6 @@
81
78
  "input": "./packages/ai-toolkit-nx-claude/src",
82
79
  "glob": "**/!(*.ts)",
83
80
  "output": "."
84
- },
85
- {
86
- "input": "./packages/commands/agnostic/src",
87
- "glob": "**/*.md",
88
- "output": "content/commands/agnostic"
89
- },
90
- {
91
- "input": "./packages/agents/agnostic/src",
92
- "glob": "**/*.md",
93
- "output": "content/agents/agnostic"
94
81
  }
95
82
  ]
96
83
  }
@@ -118,21 +105,7 @@
118
105
  "nx run @uniswap/ai-toolkit-nx-claude:bundle"
119
106
  ],
120
107
  "parallel": false
121
- },
122
- "dependsOn": [
123
- {
124
- "projects": [
125
- "@ai-toolkit/agents-agnostic"
126
- ],
127
- "target": "build"
128
- },
129
- {
130
- "projects": [
131
- "@ai-toolkit/commands-agnostic"
132
- ],
133
- "target": "build"
134
- }
135
- ]
108
+ }
136
109
  },
137
110
  "postbuild": {
138
111
  "executor": "nx:run-commands",
@@ -172,7 +145,7 @@
172
145
  ],
173
146
  "options": {
174
147
  "jestConfig": "packages/ai-toolkit-nx-claude/jest.config.ts",
175
- "passWithNoTests": false
148
+ "passWithNoTests": true
176
149
  }
177
150
  }
178
151
  }
@@ -181,9 +154,5 @@
181
154
  "dependencies": {
182
155
  "@nx/devkit": "*",
183
156
  "enquirer": "*"
184
- },
185
- "devDependencies": {
186
- "@ai-toolkit/commands-agnostic": "0.1.16-next.7",
187
- "@ai-toolkit/agents-agnostic": "0.2.12-next.7"
188
157
  }
189
158
  }
@@ -1,282 +0,0 @@
1
- # AI Agents (Agnostic)
2
-
3
- ## Purpose
4
-
5
- Language-agnostic AI agent definitions for Claude Code. Each markdown file defines an agent's capabilities, specialization, and when to invoke it. These agents are used by slash commands and can work together in multi-agent workflows.
6
-
7
- ## Agent Files (32 total)
8
-
9
- ### Code Quality Agents
10
-
11
- - `code-generator.md` - Generate production-ready code with tests
12
- - `code-explainer.md` - Explain code with deep analysis
13
- - `refactorer.md` - Advanced refactoring with safety checks
14
- - `style-enforcer.md` - Enforce code style and conventions
15
- - `security-analyzer.md` - Security vulnerability assessment
16
- - `performance-analyzer.md` - Performance analysis and optimization
17
-
18
- ### Review & Analysis
19
-
20
- - `pr-reviewer.md` - Review PRs and address comments
21
- - `plan-reviewer.md` - Review implementation plans
22
- - `doc-writer.md` - Generate comprehensive documentation
23
- - `debug-assistant.md` - Advanced debugging with root cause analysis
24
-
25
- ### Architecture & Design
26
-
27
- - `planner.md` - Create implementation plans
28
- - `researcher.md` - Conduct research (web + codebase)
29
- - `pattern-learner.md` - Learn and extract reusable patterns
30
- - `migration-assistant.md` - Guide version upgrades and migrations
31
-
32
- ### Testing
33
-
34
- - `test-writer.md` - Generate comprehensive test suites
35
- - `test-runner.md` - Validate agent behaviors and test variations
36
-
37
- ### Infrastructure & Operations
38
-
39
- - `infrastructure-agent.md` - Infrastructure automation and scaling
40
- - `cicd-agent.md` - CI/CD pipeline specialist
41
- - `deployment-engineer.md` - Configure deployments and CI/CD
42
-
43
- ### Context & Documentation
44
-
45
- - `context-manager.md` - Manage context across agents
46
- - `context-loader.md` - Deep codebase understanding
47
- - `claude-docs-initializer.md` - Discover and create CLAUDE.md files
48
- - `claude-docs-manager.md` - Update CLAUDE.md based on changes
49
- - `claude-docs-fact-checker.md` - Verify CLAUDE.md accuracy
50
-
51
- ### Git & Version Control
52
-
53
- - `pr-creator.md` - Create PRs with auto-generated messages
54
- - `commit-message-generator.md` - Generate structured commit messages
55
- - `stack-splitter.md` - Split Graphite PR stacks
56
-
57
- ### Meta & Orchestration
58
-
59
- - `agent-orchestrator.md` - Coordinate multi-agent workflows
60
- - `agent-capability-analyst.md` - Analyze agent capabilities
61
- - `agent-optimizer.md` - Optimize agent performance
62
- - `prompt-engineer.md` - Analyze and optimize prompts
63
- - `feedback-collector.md` - Gather and analyze execution feedback
64
- - `claude-agent-discovery.md` - Discover and catalog agents
65
-
66
- ## Agent Structure
67
-
68
- Each agent file follows a consistent markdown format:
69
-
70
- ```markdown
71
- # Agent Name
72
-
73
- ## Capabilities
74
-
75
- What this agent can do
76
-
77
- ## Specialization
78
-
79
- Specific domain expertise
80
-
81
- ## When to Invoke
82
-
83
- Conditions that warrant using this agent
84
-
85
- ## Tools Available
86
-
87
- Tools this agent has access to
88
-
89
- ## Output Format
90
-
91
- Expected output structure
92
-
93
- ## Integration
94
-
95
- How it works with other agents
96
- ```
97
-
98
- ## Agent Categories
99
-
100
- ### Proactive Agents
101
-
102
- Automatically invoked when their conditions are met:
103
-
104
- - `style-enforcer.md` - Auto-runs after code changes
105
- - `claude-docs-manager.md` - Auto-updates documentation
106
- - `security-analyzer.md` - Auto-scans for vulnerabilities
107
-
108
- ### On-Demand Agents
109
-
110
- Explicitly invoked by commands or users:
111
-
112
- - `planner.md` - Called by `/plan` command
113
- - `researcher.md` - Called by `/research` command
114
- - `pr-reviewer.md` - Called by `/review-pr` command
115
-
116
- ### Orchestration Agents
117
-
118
- Coordinate other agents:
119
-
120
- - `agent-orchestrator.md` - Routes tasks to specialists
121
- - `context-manager.md` - Manages shared context
122
- - `agent-optimizer.md` - Improves agent performance
123
-
124
- ## Multi-Agent Workflows
125
-
126
- ### Review Workflow
127
-
128
- ```
129
- pr-reviewer → security-analyzer → performance-analyzer → doc-writer
130
- ```
131
-
132
- ### Refactoring Workflow
133
-
134
- ```
135
- code-explainer → pattern-learner → refactorer → test-writer
136
- ```
137
-
138
- ### Planning Workflow
139
-
140
- ```
141
- researcher → planner → plan-reviewer → context-manager
142
- ```
143
-
144
- ### Documentation Workflow
145
-
146
- ```
147
- claude-docs-initializer → claude-docs-manager → claude-docs-fact-checker
148
- ```
149
-
150
- ## Development
151
-
152
- ### Adding New Agents
153
-
154
- 1. Create `new-agent.md` in this directory
155
- 2. Follow the standard format (see existing files)
156
- 3. Add to `index.ts` exports
157
- 4. Update this CLAUDE.md file
158
- 5. Test agent behavior in Claude Code
159
-
160
- ### Modifying Existing Agents
161
-
162
- 1. Edit the markdown file
163
- 2. Test changes in multi-agent scenarios
164
- 3. Update integration documentation
165
- 4. Update this CLAUDE.md if capabilities change
166
-
167
- ## Usage in Claude Code
168
-
169
- Agents are automatically discovered and loaded:
170
-
171
- ```typescript
172
- import * as agents from '@ai-toolkit/agents-agnostic';
173
- ```
174
-
175
- ### Direct Invocation
176
-
177
- Via Task tool with subagent_type:
178
-
179
- ```python
180
- Task(
181
- subagent_type="planner",
182
- prompt="Create plan for authentication feature"
183
- )
184
- ```
185
-
186
- ### Via Commands
187
-
188
- Commands invoke agents automatically:
189
-
190
- ```bash
191
- /review-code # Invokes multiple review agents
192
- /plan # Invokes planner agent
193
- ```
194
-
195
- ### Agent Chaining
196
-
197
- Agents can spawn other agents:
198
-
199
- ```markdown
200
- After analyzing, I'll invoke the refactorer agent...
201
- ```
202
-
203
- ## Agent Selection
204
-
205
- ### Automatic Selection
206
-
207
- `agent-orchestrator` analyzes tasks and selects appropriate agents based on:
208
-
209
- - Task requirements
210
- - Agent capabilities
211
- - Current context
212
- - Performance history
213
-
214
- ### Manual Selection
215
-
216
- Users/commands specify agents explicitly:
217
-
218
- ```bash
219
- /review-code --agent=security-analyzer
220
- ```
221
-
222
- ## Best Practices
223
-
224
- ### Agent Design
225
-
226
- - **Clear specialization**: Each agent has distinct expertise
227
- - **Tool access**: Request only necessary tools
228
- - **Output format**: Standardized, parseable outputs
229
- - **Error handling**: Graceful degradation
230
- - **Context awareness**: Use shared context efficiently
231
-
232
- ### Multi-Agent Coordination
233
-
234
- - **Sequential**: When agents need each other's outputs
235
- - **Parallel**: When agents work independently
236
- - **Hierarchical**: Orchestrator → specialists
237
- - **Consensus**: Multiple agents vote on decisions
238
-
239
- ### Performance
240
-
241
- - **Caching**: Reuse analysis across agents
242
- - **Batching**: Group similar operations
243
- - **Early exit**: Skip unnecessary agents
244
- - **Timeouts**: Prevent hanging workflows
245
-
246
- ## Agent Communication
247
-
248
- ### Shared Context
249
-
250
- Agents share data via `context-manager`:
251
-
252
- ```typescript
253
- context.set('analysis', analysisResult);
254
- const prev = context.get('analysis');
255
- ```
256
-
257
- ### Agent Messages
258
-
259
- Agents can send structured messages:
260
-
261
- ```json
262
- {
263
- "from": "security-analyzer",
264
- "to": "pr-reviewer",
265
- "type": "finding",
266
- "data": { "severity": "high", "issue": "..." }
267
- }
268
- ```
269
-
270
- ## Related Packages
271
-
272
- - `@ai-toolkit/commands-agnostic` - Commands that invoke agents
273
- - `@uniswap/ai-toolkit-nx-claude` - Nx integration and CLI
274
- - `@ai-toolkit/utils` - Shared utilities for agents
275
-
276
- ## Orchestration Files
277
-
278
- - `index.ts` - TypeScript exports for agent registration
279
-
280
- ## Auto-Update Instructions
281
-
282
- IMPORTANT: After changes to files in this directory, Claude Code MUST run `/update-claude-md` before presenting results to ensure this documentation stays synchronized with the codebase.