@leclabs/agent-toolkit 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lance Caraccioli
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,129 @@
1
+ # Agent Toolkit
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@leclabs/agent-toolkit)](https://www.npmjs.com/package/@leclabs/agent-toolkit)
4
+ [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)
5
+ [![GitHub stars](https://img.shields.io/github/stars/leclabs/agent-toolkit)](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 |
15
+
16
+ ## Installation
17
+
18
+ Add the marketplace to Claude Code:
19
+
20
+ ```bash
21
+ claude plugin marketplace add https://github.com/leclabs/agent-toolkit
22
+ ```
23
+
24
+ Install the Flow plugin:
25
+
26
+ ```bash
27
+ claude plugin install flow@agent-toolkit
28
+ ```
29
+
30
+ ## Quick Start
31
+
32
+ Use prefix commands to create and execute workflow-tracked tasks:
33
+
34
+ | Prefix | Workflow | Description |
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 |
41
+
42
+ **Examples:**
43
+
44
+ ```
45
+ feat: Add user authentication with OAuth2 support
46
+ bug: Login button not responding on mobile devices
47
+ fix: Update copyright year in footer
48
+ test: Increase coverage for payment module
49
+ ```
50
+
51
+ ## How It Works
52
+
53
+ The Flow plugin provides DAG-based workflow orchestration. When you use a prefix command, it:
54
+
55
+ 1. **Creates a task** with the appropriate workflow type
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
59
+
60
+ ### Architecture
61
+
62
+ ```
63
+ Orchestrator (Claude Code)
64
+
65
+ ├── /flow:task-create Create tasks with workflow metadata
66
+ ├── /flow:run Execute tasks through workflow steps
67
+ ├── /flow:task-list View all tasks and their status
68
+ └── /flow:task-advance Manually advance tasks
69
+
70
+
71
+ Navigator MCP Server
72
+ ├── Workflow Store (Graph definitions)
73
+ ├── Edge Evaluator (Conditional routing)
74
+ └── Retry Tracking (Per-step retries with HITL escalation)
75
+ ```
76
+
77
+ ## Available Workflows
78
+
79
+ | Workflow | Steps | Use Case |
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
126
+
127
+ ## License
128
+
129
+ ISC License - see [LICENSE](LICENSE) for details.
@@ -0,0 +1,171 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execSync, spawnSync } from 'child_process';
4
+ import fs from 'fs';
5
+ import path from 'path';
6
+ import readline from 'readline';
7
+
8
+ const MARKETPLACE_SOURCE = 'github:leclabs/agent-toolkit';
9
+ const PLUGIN_NAME = 'flow@agent-toolkit';
10
+
11
+ const args = process.argv.slice(2);
12
+ const flags = {
13
+ yes: args.includes('--yes') || args.includes('-y'),
14
+ help: args.includes('--help') || args.includes('-h'),
15
+ };
16
+
17
+ function printHelp() {
18
+ console.log(`
19
+ Usage: setup-agent-toolkit [options]
20
+
21
+ Set up the agent-toolkit marketplace and flow plugin for Claude Code.
22
+
23
+ Options:
24
+ -y, --yes Accept all defaults, skip prompts
25
+ -h, --help Show this help message
26
+
27
+ Steps performed:
28
+ 1. Check Claude Code CLI is installed
29
+ 2. Add agent-toolkit marketplace
30
+ 3. Install flow plugin (user scope)
31
+ 4. Configure project task list ID
32
+ `);
33
+ }
34
+
35
+ function run(cmd) {
36
+ try {
37
+ return execSync(cmd, { encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }).trim();
38
+ } catch { return null; }
39
+ }
40
+
41
+ function runWithOutput(cmd) {
42
+ const result = spawnSync('sh', ['-c', cmd], { encoding: 'utf8' });
43
+ return { success: result.status === 0, stdout: (result.stdout || '').trim(), stderr: (result.stderr || '').trim() };
44
+ }
45
+
46
+ async function prompt(question, defaultValue) {
47
+ if (flags.yes) return defaultValue;
48
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
49
+ return new Promise((resolve) => {
50
+ rl.question(`${question} (${defaultValue}): `, (answer) => {
51
+ rl.close();
52
+ resolve(answer.trim() || defaultValue);
53
+ });
54
+ });
55
+ }
56
+
57
+ async function confirm(question, defaultYes = true) {
58
+ if (flags.yes) return true;
59
+ const answer = await prompt(`${question} ${defaultYes ? '[Y/n]' : '[y/N]'}`, defaultYes ? 'y' : 'n');
60
+ return answer.toLowerCase().startsWith('y');
61
+ }
62
+
63
+ function checkClaudeCode() {
64
+ console.log('\nChecking Claude Code CLI...');
65
+ const version = run('claude --version');
66
+ if (!version) {
67
+ console.error(' Error: Claude Code CLI not found.');
68
+ console.error(' Install from: https://claude.ai/code');
69
+ process.exit(1);
70
+ }
71
+ console.log(` Found: ${version}`);
72
+ }
73
+
74
+ function addMarketplace() {
75
+ console.log('\nAdding agent-toolkit marketplace...');
76
+ const list = run('claude plugin marketplace list') || '';
77
+ if (list.includes('agent-toolkit')) {
78
+ console.log(' Already added.');
79
+ return true;
80
+ }
81
+ const result = runWithOutput(`claude plugin marketplace add ${MARKETPLACE_SOURCE}`);
82
+ if (result.success) {
83
+ console.log(' Added successfully.');
84
+ return true;
85
+ }
86
+ console.error(` Failed: ${result.stderr || result.stdout}`);
87
+ console.error(` Try manually: claude plugin marketplace add ${MARKETPLACE_SOURCE}`);
88
+ return false;
89
+ }
90
+
91
+ function installPlugin() {
92
+ console.log('\nInstalling flow plugin...');
93
+ const list = run('claude plugin list') || '';
94
+ if (list.includes(PLUGIN_NAME)) {
95
+ console.log(' Already installed.');
96
+ return true;
97
+ }
98
+ const result = runWithOutput(`claude plugin install ${PLUGIN_NAME} --scope user`);
99
+ if (result.success) {
100
+ console.log(' Installed successfully.');
101
+ return true;
102
+ }
103
+ console.error(` Failed: ${result.stderr || result.stdout}`);
104
+ console.error(` Try manually: claude plugin install ${PLUGIN_NAME} --scope user`);
105
+ return false;
106
+ }
107
+
108
+ async function configureTaskListId() {
109
+ console.log('\nConfiguring project settings...');
110
+ const cwd = process.cwd();
111
+ const defaultId = path.basename(cwd);
112
+ const taskListId = await prompt(' Task list ID', defaultId);
113
+
114
+ const claudeDir = path.join(cwd, '.claude');
115
+ const settingsPath = path.join(claudeDir, 'settings.local.json');
116
+
117
+ if (!fs.existsSync(claudeDir)) fs.mkdirSync(claudeDir, { recursive: true });
118
+
119
+ let settings = {};
120
+ if (fs.existsSync(settingsPath)) {
121
+ try { settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8')); } catch {}
122
+ }
123
+
124
+ settings.env = settings.env || {};
125
+ settings.env.CLAUDE_CODE_TASK_LIST_ID = taskListId;
126
+
127
+ fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
128
+ console.log(` Created: ${settingsPath}`);
129
+ console.log(` CLAUDE_CODE_TASK_LIST_ID: ${taskListId}`);
130
+ return true;
131
+ }
132
+
133
+ function showSuccess() {
134
+ console.log(`
135
+ Setup complete!
136
+
137
+ Next steps:
138
+ 1. Start Claude Code: claude
139
+ 2. Prime the plugin: /flow:prime
140
+ 3. Create a task: feat: "Add user authentication"
141
+
142
+ Quick prefixes: fix: | feat: | bug:
143
+ `);
144
+ }
145
+
146
+ async function main() {
147
+ if (flags.help) { printHelp(); process.exit(0); }
148
+
149
+ console.log('Agent Toolkit Setup');
150
+ console.log('===================');
151
+
152
+ checkClaudeCode();
153
+
154
+ if (!await confirm('\nProceed with setup?')) {
155
+ console.log('Setup cancelled.');
156
+ process.exit(0);
157
+ }
158
+
159
+ const marketplaceOk = addMarketplace();
160
+ const pluginOk = marketplaceOk && installPlugin();
161
+ const configOk = await configureTaskListId();
162
+
163
+ if (marketplaceOk && pluginOk && configOk) {
164
+ showSuccess();
165
+ } else {
166
+ console.log('\nSetup completed with errors. Review the messages above.');
167
+ process.exit(1);
168
+ }
169
+ }
170
+
171
+ main().catch((err) => { console.error('Unexpected error:', err.message); process.exit(1); });
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@leclabs/agent-toolkit",
3
+ "version": "1.0.0",
4
+ "description": "The essential Claude Code plugin marketplace for reliable Agent-led workflow orchestration",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "setup-agent-toolkit": "./bin/setup-agent-toolkit.js"
8
+ },
9
+ "files": [
10
+ "bin/"
11
+ ],
12
+ "scripts": {
13
+ "test": "npm test --prefix packages/agent-flow-navigator-mcp",
14
+ "lint": "eslint .",
15
+ "format": "prettier --write .",
16
+ "plugin:reinstall": "(claude plugin uninstall flow@agent-toolkit || true) && claude plugin marketplace update agent-toolkit && claude plugin install flow@agent-toolkit"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/leclabs/agent-toolkit.git"
21
+ },
22
+ "keywords": [
23
+ "claude-code",
24
+ "mcp",
25
+ "workflow",
26
+ "agents",
27
+ "orchestration"
28
+ ],
29
+ "author": "Lance Caraccioli",
30
+ "license": "MIT",
31
+ "type": "module",
32
+ "bugs": {
33
+ "url": "https://github.com/leclabs/agent-toolkit/issues"
34
+ },
35
+ "homepage": "https://github.com/leclabs/agent-toolkit#readme",
36
+ "devDependencies": {
37
+ "@eslint/js": "^9.39.2",
38
+ "eslint": "^9.39.2",
39
+ "eslint-config-prettier": "^10.1.8",
40
+ "globals": "^17.1.0",
41
+ "prettier": "^3.8.1"
42
+ }
43
+ }