@leclabs/agent-toolkit 1.0.0 → 1.2.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.
- package/README.md +64 -103
- package/bin/setup-agent-toolkit.js +52 -40
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -1,129 +1,90 @@
|
|
|
1
1
|
# Agent Toolkit
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://opensource.org/licenses/ISC)
|
|
5
|
-
[](https://github.com/leclabs/agent-toolkit/stargazers)
|
|
6
|
-
|
|
7
|
-
The essential Claude Code plugin marketplace for reliable Agent-led workflow orchestration.
|
|
8
|
-
|
|
9
|
-
## What's Included
|
|
10
|
-
|
|
11
|
-
| Component | Description |
|
|
12
|
-
|-----------|-------------|
|
|
13
|
-
| **[Flow Plugin](plugins/flow/)** | DAG-based workflow orchestration for Claude Code |
|
|
14
|
-
| **[Navigator MCP](packages/agent-flow-navigator-mcp/)** | Workflow state machine that navigates agents through DAG-based workflows |
|
|
3
|
+
A Claude Code plugin marketplace for AI agent tools. The flagship plugin is **Flow** -- DAG-based workflow orchestration that guides agents through structured, multi-step tasks.
|
|
15
4
|
|
|
16
5
|
## Installation
|
|
17
6
|
|
|
18
|
-
Add the marketplace to Claude Code:
|
|
19
|
-
|
|
20
7
|
```bash
|
|
21
|
-
|
|
8
|
+
# Add the toolkit to Claude Code
|
|
9
|
+
claude plugin:add github:leclabs/agent-toolkit
|
|
22
10
|
```
|
|
23
11
|
|
|
24
|
-
|
|
12
|
+
## Quick Start
|
|
25
13
|
|
|
26
14
|
```bash
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
# Load the orchestrator at session start
|
|
16
|
+
/flow:prime
|
|
29
17
|
|
|
30
|
-
|
|
18
|
+
# Create a task using any command
|
|
19
|
+
/flow:feat "add user authentication"
|
|
20
|
+
/flow:bug "fix login redirect loop"
|
|
21
|
+
/flow:task "refactor the settings module"
|
|
31
22
|
|
|
32
|
-
|
|
23
|
+
# Execute all pending tasks
|
|
24
|
+
/flow:go
|
|
25
|
+
```
|
|
33
26
|
|
|
34
|
-
|
|
35
|
-
|--------|----------|-------------|
|
|
36
|
-
| `feat:` | feature-development | Full lifecycle: requirements, planning, implementation, testing |
|
|
37
|
-
| `bug:` | bug-fix | Bug workflow: reproduce, investigate, fix, verify |
|
|
38
|
-
| `fix:` | quick-task | Minimal: understand, execute, verify |
|
|
39
|
-
| `test:` | test-coverage | Analyze coverage gaps and write tests |
|
|
40
|
-
| `ctx:` | context-optimization | Optimize agent context and instructions |
|
|
27
|
+
## Commands
|
|
41
28
|
|
|
42
|
-
|
|
29
|
+
Commands are the primary human interface. Type a command to create a task with the right workflow:
|
|
43
30
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
31
|
+
| Command | Workflow | Description |
|
|
32
|
+
| ------------- | -------------------- | ---------------------------------- |
|
|
33
|
+
| `/flow:feat` | feature-development | New feature with planning + review |
|
|
34
|
+
| `/flow:bug` | bug-fix | Bug investigation and fix |
|
|
35
|
+
| `/flow:task` | agile-task | General development task |
|
|
36
|
+
| `/flow:fix` | quick-task | Quick fix, minimal ceremony |
|
|
37
|
+
| `/flow:spec` | test-coverage | Analyze and improve test coverage |
|
|
38
|
+
| `/flow:ctx` | context-optimization | Optimize agent context and prompts |
|
|
39
|
+
| `/flow:ui` | ui-reconstruction | Reconstruct UI from reference |
|
|
40
|
+
| `/flow:go` | _(runs task queue)_ | Execute all pending tasks |
|
|
41
|
+
| `/flow:recon` | _(exploration)_ | Deep project reconnaissance |
|
|
42
|
+
|
|
43
|
+
## Workflows
|
|
50
44
|
|
|
51
|
-
|
|
45
|
+
10 workflow templates ship in the catalog:
|
|
52
46
|
|
|
53
|
-
|
|
47
|
+
| Workflow | Steps | Description |
|
|
48
|
+
| ------------------------- | ----- | ------------------------------------------------------ |
|
|
49
|
+
| feature-development | 15 | Full lifecycle: plan, implement, test, review, PR |
|
|
50
|
+
| bug-fix | 11 | Reproduce, investigate, fix, regression test |
|
|
51
|
+
| agile-task | 9 | General task: analyze, implement, test, review |
|
|
52
|
+
| quick-task | 8 | Minimal: understand, execute, verify |
|
|
53
|
+
| test-coverage | 10 | Analyze gaps, write tests, review |
|
|
54
|
+
| context-optimization | 9 | Map connections, identify pathologies, improve |
|
|
55
|
+
| ui-reconstruction | 17 | Extract semantic IR, rebuild UI, blind review |
|
|
56
|
+
| refactor | 16 | Functional core / imperative shell restructuring |
|
|
57
|
+
| build-review-murder-board | 7 | Build-review loop, level 5 scrutiny, blind-shot review |
|
|
58
|
+
| build-review-quick | 7 | Build-review loop, basic sanity check |
|
|
54
59
|
|
|
55
|
-
|
|
56
|
-
2. **Navigates** through workflow steps using the Navigator MCP
|
|
57
|
-
3. **Delegates** to specialized subagents (@flow:Planner, @flow:Developer, @flow:Tester)
|
|
58
|
-
4. **Tracks progress** with retry logic and HITL escalation
|
|
60
|
+
Customize workflows for your project with `/flow:init`.
|
|
59
61
|
|
|
60
|
-
|
|
62
|
+
## Architecture
|
|
61
63
|
|
|
62
64
|
```
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
65
|
+
/flow:feat "add dark mode" ← human types a command
|
|
66
|
+
│
|
|
67
|
+
▼
|
|
68
|
+
┌──────────────────┐ ┌──────────────────┐
|
|
69
|
+
│ Orchestrator │ ◄─MCP─► │ Navigator │
|
|
70
|
+
│ (flow:prime) │ │ (state machine) │
|
|
71
|
+
└──────────────────┘ └──────────────────┘
|
|
72
|
+
│ │
|
|
73
|
+
▼ ▼
|
|
74
|
+
┌──────────────────┐ ┌──────────────────┐
|
|
75
|
+
│ Subagents │ │ Workflows │
|
|
76
|
+
│ @flow:Planner │ │ (DAGs) │
|
|
77
|
+
│ @flow:Developer │ └──────────────────┘
|
|
78
|
+
│ @flow:Tester │
|
|
79
|
+
│ @flow:Reviewer │
|
|
80
|
+
└──────────────────┘
|
|
75
81
|
```
|
|
76
82
|
|
|
77
|
-
##
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
| **feature-development** | requirements → planning → implementation → testing → review | New features with full lifecycle |
|
|
82
|
-
| **bug-fix** | reproduce → investigate → fix → verify | Bug fixes with root cause analysis |
|
|
83
|
-
| **agile-task** | understand → implement → verify | Standard development tasks |
|
|
84
|
-
| **quick-task** | understand → execute → verify | Fast, minimal overhead tasks |
|
|
85
|
-
| **test-coverage** | analyze → write-tests → verify | Improving test coverage |
|
|
86
|
-
| **context-optimization** | audit → optimize → validate | Improving agent context |
|
|
87
|
-
| **ui-reconstruction** | analyze → reconstruct → verify | UI/component rebuilding |
|
|
88
|
-
|
|
89
|
-
## Skills Reference
|
|
90
|
-
|
|
91
|
-
| Skill | Description |
|
|
92
|
-
|-------|-------------|
|
|
93
|
-
| `/flow:prime` | Load orchestrator context (invoke at session start) |
|
|
94
|
-
| `/flow:task-create` | Create a new workflow task |
|
|
95
|
-
| `/flow:run` | Execute tasks autonomously with subagent delegation |
|
|
96
|
-
| `/flow:task-list` | List all tasks with status |
|
|
97
|
-
| `/flow:task-get` | Get task details with workflow diagram |
|
|
98
|
-
| `/flow:task-advance` | Manually advance a task to next step |
|
|
99
|
-
| `/flow:init` | Copy workflows to project `.flow/workflows/` |
|
|
100
|
-
| `/flow:diagram` | Generate mermaid diagram for a workflow |
|
|
101
|
-
|
|
102
|
-
## Feature Highlights
|
|
103
|
-
|
|
104
|
-
- **DAG-Based Workflows**: Define complex workflows as directed acyclic graphs with conditional edges
|
|
105
|
-
- **Subagent Delegation**: Specialized agents handle specific workflow steps (@flow:Planner, @flow:Developer, @flow:Tester)
|
|
106
|
-
- **Retry Logic**: Per-step retry tracking with configurable limits
|
|
107
|
-
- **HITL Escalation**: Automatic human-in-the-loop escalation when retries are exhausted
|
|
108
|
-
- **Progress Tracking**: Visual progress through workflow stages
|
|
109
|
-
- **Workflow Catalog**: Pre-built workflows for common development patterns
|
|
110
|
-
|
|
111
|
-
## Documentation
|
|
112
|
-
|
|
113
|
-
- [Flow Plugin Documentation](plugins/flow/) - Detailed plugin usage and customization
|
|
114
|
-
- [Navigator MCP Reference](packages/agent-flow-navigator-mcp/) - MCP server API and workflow schema
|
|
115
|
-
- [Workflow Schema](packages/agent-flow-navigator-mcp/README.md#workflow-definition-schema) - Node types, edge properties, task schema
|
|
116
|
-
|
|
117
|
-
## Contributing
|
|
118
|
-
|
|
119
|
-
1. Fork the repository
|
|
120
|
-
2. Create a feature branch (`git checkout -b feat/amazing-feature`)
|
|
121
|
-
3. Make your changes
|
|
122
|
-
4. Run tests (`npm test`)
|
|
123
|
-
5. Commit with conventional commits (`git commit -m 'feat: add amazing feature'`)
|
|
124
|
-
6. Push to your fork (`git push origin feat/amazing-feature`)
|
|
125
|
-
7. Open a Pull Request
|
|
83
|
+
## Links
|
|
84
|
+
|
|
85
|
+
- [Flow Plugin](plugins/flow/README.md) -- commands, skills, workflows, and customization
|
|
86
|
+
- [Navigator MCP Server](packages/agent-flow-navigator-mcp/README.md) -- workflow state machine
|
|
126
87
|
|
|
127
88
|
## License
|
|
128
89
|
|
|
129
|
-
ISC
|
|
90
|
+
ISC
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { execSync, spawnSync } from
|
|
4
|
-
import fs from
|
|
5
|
-
import path from
|
|
6
|
-
import readline from
|
|
3
|
+
import { execSync, spawnSync } from "child_process";
|
|
4
|
+
import fs from "fs";
|
|
5
|
+
import path from "path";
|
|
6
|
+
import readline from "readline";
|
|
7
7
|
|
|
8
|
-
const MARKETPLACE_SOURCE =
|
|
9
|
-
const PLUGIN_NAME =
|
|
8
|
+
const MARKETPLACE_SOURCE = "leclabs/agent-toolkit";
|
|
9
|
+
const PLUGIN_NAME = "flow@agent-toolkit";
|
|
10
10
|
|
|
11
11
|
const args = process.argv.slice(2);
|
|
12
12
|
const flags = {
|
|
13
|
-
yes: args.includes(
|
|
14
|
-
help: args.includes(
|
|
13
|
+
yes: args.includes("--yes") || args.includes("-y"),
|
|
14
|
+
help: args.includes("--help") || args.includes("-h"),
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
function printHelp() {
|
|
@@ -34,13 +34,15 @@ Steps performed:
|
|
|
34
34
|
|
|
35
35
|
function run(cmd) {
|
|
36
36
|
try {
|
|
37
|
-
return execSync(cmd, { encoding:
|
|
38
|
-
} catch {
|
|
37
|
+
return execSync(cmd, { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
38
|
+
} catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
function runWithOutput(cmd) {
|
|
42
|
-
const result = spawnSync(
|
|
43
|
-
return { success: result.status === 0, stdout: (result.stdout ||
|
|
44
|
+
const result = spawnSync("sh", ["-c", cmd], { encoding: "utf8" });
|
|
45
|
+
return { success: result.status === 0, stdout: (result.stdout || "").trim(), stderr: (result.stderr || "").trim() };
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
async function prompt(question, defaultValue) {
|
|
@@ -56,31 +58,31 @@ async function prompt(question, defaultValue) {
|
|
|
56
58
|
|
|
57
59
|
async function confirm(question, defaultYes = true) {
|
|
58
60
|
if (flags.yes) return true;
|
|
59
|
-
const answer = await prompt(`${question} ${defaultYes ?
|
|
60
|
-
return answer.toLowerCase().startsWith(
|
|
61
|
+
const answer = await prompt(`${question} ${defaultYes ? "[Y/n]" : "[y/N]"}`, defaultYes ? "y" : "n");
|
|
62
|
+
return answer.toLowerCase().startsWith("y");
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
function checkClaudeCode() {
|
|
64
|
-
console.log(
|
|
65
|
-
const version = run(
|
|
66
|
+
console.log("\nChecking Claude Code CLI...");
|
|
67
|
+
const version = run("claude --version");
|
|
66
68
|
if (!version) {
|
|
67
|
-
console.error(
|
|
68
|
-
console.error(
|
|
69
|
+
console.error(" Error: Claude Code CLI not found.");
|
|
70
|
+
console.error(" Install from: https://claude.ai/code");
|
|
69
71
|
process.exit(1);
|
|
70
72
|
}
|
|
71
73
|
console.log(` Found: ${version}`);
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
function addMarketplace() {
|
|
75
|
-
console.log(
|
|
76
|
-
const list = run(
|
|
77
|
-
if (list.includes(
|
|
78
|
-
console.log(
|
|
77
|
+
console.log("\nAdding agent-toolkit marketplace...");
|
|
78
|
+
const list = run("claude plugin marketplace list") || "";
|
|
79
|
+
if (list.includes("agent-toolkit")) {
|
|
80
|
+
console.log(" Already added.");
|
|
79
81
|
return true;
|
|
80
82
|
}
|
|
81
83
|
const result = runWithOutput(`claude plugin marketplace add ${MARKETPLACE_SOURCE}`);
|
|
82
84
|
if (result.success) {
|
|
83
|
-
console.log(
|
|
85
|
+
console.log(" Added successfully.");
|
|
84
86
|
return true;
|
|
85
87
|
}
|
|
86
88
|
console.error(` Failed: ${result.stderr || result.stdout}`);
|
|
@@ -89,15 +91,15 @@ function addMarketplace() {
|
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
function installPlugin() {
|
|
92
|
-
console.log(
|
|
93
|
-
const list = run(
|
|
94
|
+
console.log("\nInstalling flow plugin...");
|
|
95
|
+
const list = run("claude plugin list") || "";
|
|
94
96
|
if (list.includes(PLUGIN_NAME)) {
|
|
95
|
-
console.log(
|
|
97
|
+
console.log(" Already installed.");
|
|
96
98
|
return true;
|
|
97
99
|
}
|
|
98
100
|
const result = runWithOutput(`claude plugin install ${PLUGIN_NAME} --scope user`);
|
|
99
101
|
if (result.success) {
|
|
100
|
-
console.log(
|
|
102
|
+
console.log(" Installed successfully.");
|
|
101
103
|
return true;
|
|
102
104
|
}
|
|
103
105
|
console.error(` Failed: ${result.stderr || result.stdout}`);
|
|
@@ -106,25 +108,29 @@ function installPlugin() {
|
|
|
106
108
|
}
|
|
107
109
|
|
|
108
110
|
async function configureTaskListId() {
|
|
109
|
-
console.log(
|
|
111
|
+
console.log("\nConfiguring project settings...");
|
|
110
112
|
const cwd = process.cwd();
|
|
111
113
|
const defaultId = path.basename(cwd);
|
|
112
|
-
const taskListId = await prompt(
|
|
114
|
+
const taskListId = await prompt(" Task list ID", defaultId);
|
|
113
115
|
|
|
114
|
-
const claudeDir = path.join(cwd,
|
|
115
|
-
const settingsPath = path.join(claudeDir,
|
|
116
|
+
const claudeDir = path.join(cwd, ".claude");
|
|
117
|
+
const settingsPath = path.join(claudeDir, "settings.local.json");
|
|
116
118
|
|
|
117
119
|
if (!fs.existsSync(claudeDir)) fs.mkdirSync(claudeDir, { recursive: true });
|
|
118
120
|
|
|
119
121
|
let settings = {};
|
|
120
122
|
if (fs.existsSync(settingsPath)) {
|
|
121
|
-
try {
|
|
123
|
+
try {
|
|
124
|
+
settings = JSON.parse(fs.readFileSync(settingsPath, "utf8"));
|
|
125
|
+
} catch {
|
|
126
|
+
// Ignore parse errors, start fresh
|
|
127
|
+
}
|
|
122
128
|
}
|
|
123
129
|
|
|
124
130
|
settings.env = settings.env || {};
|
|
125
131
|
settings.env.CLAUDE_CODE_TASK_LIST_ID = taskListId;
|
|
126
132
|
|
|
127
|
-
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) +
|
|
133
|
+
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
|
|
128
134
|
console.log(` Created: ${settingsPath}`);
|
|
129
135
|
console.log(` CLAUDE_CODE_TASK_LIST_ID: ${taskListId}`);
|
|
130
136
|
return true;
|
|
@@ -144,15 +150,18 @@ Quick prefixes: fix: | feat: | bug:
|
|
|
144
150
|
}
|
|
145
151
|
|
|
146
152
|
async function main() {
|
|
147
|
-
if (flags.help) {
|
|
153
|
+
if (flags.help) {
|
|
154
|
+
printHelp();
|
|
155
|
+
process.exit(0);
|
|
156
|
+
}
|
|
148
157
|
|
|
149
|
-
console.log(
|
|
150
|
-
console.log(
|
|
158
|
+
console.log("Agent Toolkit Setup");
|
|
159
|
+
console.log("===================");
|
|
151
160
|
|
|
152
161
|
checkClaudeCode();
|
|
153
162
|
|
|
154
|
-
if (!await confirm(
|
|
155
|
-
console.log(
|
|
163
|
+
if (!(await confirm("\nProceed with setup?"))) {
|
|
164
|
+
console.log("Setup cancelled.");
|
|
156
165
|
process.exit(0);
|
|
157
166
|
}
|
|
158
167
|
|
|
@@ -163,9 +172,12 @@ async function main() {
|
|
|
163
172
|
if (marketplaceOk && pluginOk && configOk) {
|
|
164
173
|
showSuccess();
|
|
165
174
|
} else {
|
|
166
|
-
console.log(
|
|
175
|
+
console.log("\nSetup completed with errors. Review the messages above.");
|
|
167
176
|
process.exit(1);
|
|
168
177
|
}
|
|
169
178
|
}
|
|
170
179
|
|
|
171
|
-
main().catch((err) => {
|
|
180
|
+
main().catch((err) => {
|
|
181
|
+
console.error("Unexpected error:", err.message);
|
|
182
|
+
process.exit(1);
|
|
183
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leclabs/agent-toolkit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "The essential Claude Code plugin marketplace for reliable Agent-led workflow orchestration",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
"test": "npm test --prefix packages/agent-flow-navigator-mcp",
|
|
14
14
|
"lint": "eslint .",
|
|
15
15
|
"format": "prettier --write .",
|
|
16
|
+
"changeset": "changeset",
|
|
17
|
+
"version": "changeset version && node scripts/sync-versions.js",
|
|
18
|
+
"publish:all": "npm publish --access public && cd packages/agent-flow-navigator-mcp && npm publish --access public",
|
|
16
19
|
"plugin:reinstall": "(claude plugin uninstall flow@agent-toolkit || true) && claude plugin marketplace update agent-toolkit && claude plugin install flow@agent-toolkit"
|
|
17
20
|
},
|
|
18
21
|
"repository": {
|
|
@@ -34,6 +37,7 @@
|
|
|
34
37
|
},
|
|
35
38
|
"homepage": "https://github.com/leclabs/agent-toolkit#readme",
|
|
36
39
|
"devDependencies": {
|
|
40
|
+
"@changesets/cli": "^2.29.8",
|
|
37
41
|
"@eslint/js": "^9.39.2",
|
|
38
42
|
"eslint": "^9.39.2",
|
|
39
43
|
"eslint-config-prettier": "^10.1.8",
|