@jaggerxtrm/specialists 2.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/README.md ADDED
@@ -0,0 +1,144 @@
1
+ # OmniSpecialist
2
+
3
+ **One MCP Server. Many Specialists. Real AI Agents.**
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@jaggerxtrm/specialists.svg)](https://www.npmjs.com/package/@jaggerxtrm/specialists)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue.svg)](https://www.typescriptlang.org/)
8
+
9
+ OmniSpecialist is a **Model Context Protocol (MCP) server** that lets Claude (and other AI agents) discover and run specialist agents — each a full autonomous coding agent powered by [pi](https://github.com/mariozechner/pi), scoped to a specific task.
10
+
11
+ **Designed for agents, not just users.** Claude can autonomously route heavy tasks (code review, bug hunting, deep reasoning, session init) to the right specialist without user intervention. Specialists run in the background while Claude continues working.
12
+
13
+ ---
14
+
15
+ ## How it works
16
+
17
+ Specialists are `.specialist.yaml` files that define an autonomous agent: its model, system prompt, task template, and permission tier. OmniSpecialist discovers them across three scopes:
18
+
19
+ | Scope | Location | Purpose |
20
+ |-------|----------|---------|
21
+ | **project** | `./specialists/` | Per-project specialists |
22
+ | **user** | `~/.agents/specialists/` | Personal specialists |
23
+ | **system** | bundled with OmniSpecialist | Built-in defaults |
24
+
25
+ When a specialist runs, OmniSpecialist spawns a `pi` subprocess with the right model, tools, and system prompt injected. Output streams back in real time via cursor-based polling.
26
+
27
+ ---
28
+
29
+ ## MCP Tools (7)
30
+
31
+ | Tool | Description |
32
+ |------|-------------|
33
+ | `list_specialists` | Discover all available specialists across scopes |
34
+ | `use_specialist` | Run a specialist synchronously and return the result |
35
+ | `start_specialist` | Fire-and-forget: start a specialist job, returns `job_id` |
36
+ | `poll_specialist` | Poll a running job; returns delta since last cursor |
37
+ | `stop_specialist` | Cancel a running job |
38
+ | `run_parallel` | Run multiple specialists concurrently or as a pipeline |
39
+ | `specialist_status` | Circuit breaker health + job status |
40
+
41
+ ---
42
+
43
+ ## Built-in Specialists
44
+
45
+ | Specialist | Model | Purpose |
46
+ |-----------|-------|---------|
47
+ | `init-session` | Haiku | Analyze git state, recent commits, surface relevant context |
48
+ | `codebase-explorer` | Gemini Flash | Architecture analysis, directory structure, patterns |
49
+ | `overthinker` | Sonnet | 4-phase deep reasoning: analysis → critique → synthesis → output |
50
+ | `parallel-review` | Sonnet | Concurrent code review across multiple focus areas |
51
+ | `bug-hunt` | Sonnet | Autonomous bug investigation from symptoms to root cause |
52
+ | `feature-design` | Sonnet | Turn feature requests into structured implementation plans |
53
+ | `auto-remediation` | Gemini Flash | Apply fixes to identified issues automatically |
54
+ | `report-generator` | Haiku | Synthesize data/analysis results into structured markdown |
55
+ | `test-runner` | Haiku | Run tests, parse results, surface failures |
56
+
57
+ ---
58
+
59
+ ## Permission Tiers
60
+
61
+ Specialists declare their required permission level. OmniSpecialist enforces this at spawn time via `pi --tools`:
62
+
63
+ | Tier | Allowed tools | Use case |
64
+ |------|--------------|----------|
65
+ | `READ_ONLY` | read, bash (read-only), grep, find, ls | Analysis, exploration |
66
+ | `LOW` | + edit, write | Code modifications |
67
+ | `MEDIUM` | + git operations | Commits, branching |
68
+ | `HIGH` | Full autonomy | External API calls, push |
69
+
70
+ ---
71
+
72
+ ## Installation
73
+
74
+ ```bash
75
+ node <(curl -fsSL https://raw.githubusercontent.com/Jaggerxtrm/unit.ai-specialists/master/bin/install.js)
76
+ ```
77
+
78
+ Clones the repo to `~/.agents/omnispecialist/`, installs dependencies (bun if available, else npm), registers the MCP as a direct `node` call — no npx overhead on every startup. Also installs **pi** and **beads** if missing.
79
+
80
+ Then **restart Claude Code**.
81
+
82
+ ---
83
+
84
+ ## Writing a Specialist
85
+
86
+ Create a `.yaml` file in `./specialists/` (project scope) or `~/.agents/specialists/` (user scope):
87
+
88
+ ```yaml
89
+ specialist:
90
+ metadata:
91
+ name: my-specialist
92
+ version: 1.0.0
93
+ description: "What this specialist does."
94
+ category: analysis
95
+ tags: [analysis, example]
96
+ updated: "2026-03-07"
97
+
98
+ execution:
99
+ mode: tool
100
+ model: anthropic/claude-haiku-4-5
101
+ fallback_model: google-gemini-cli/gemini-3-flash-preview
102
+ timeout_ms: 120000
103
+ response_format: markdown
104
+ permission_required: READ_ONLY
105
+
106
+ prompt:
107
+ system: |
108
+ You are a specialist that does X.
109
+ Produce a structured markdown report.
110
+
111
+ task_template: |
112
+ $prompt
113
+
114
+ Working directory: $cwd
115
+
116
+ communication:
117
+ publishes: [result]
118
+ ```
119
+
120
+ **Model IDs** use the full provider/model format: `anthropic/claude-sonnet-4-6`, `google-gemini-cli/gemini-3-flash-preview`, `anthropic/claude-haiku-4-5`.
121
+
122
+ ---
123
+
124
+ ## Development
125
+
126
+ ```bash
127
+ git clone https://github.com/Jaggerxtrm/specialists.git
128
+ cd specialists
129
+ bun install
130
+ bun run build
131
+ bun test
132
+ ```
133
+
134
+ - **Build**: `bun build src/index.ts --target=node --outfile=dist/index.js`
135
+ - **Test**: `bun --bun vitest run` (40 unit tests)
136
+ - **Lint**: `tsc --noEmit`
137
+
138
+ See [CLAUDE.md](CLAUDE.md) for the full architecture guide and [ROADMAP.md](ROADMAP.md) for planned features.
139
+
140
+ ---
141
+
142
+ ## License
143
+
144
+ MIT
package/bin/install.js ADDED
@@ -0,0 +1,136 @@
1
+ #!/usr/bin/env node
2
+ // OmniSpecialist Installer
3
+ // Usage: npx --package=github:Jaggerxtrm/specialists install
4
+
5
+ import { spawnSync } from 'node:child_process';
6
+ import { existsSync, mkdirSync } from 'node:fs';
7
+ import { homedir } from 'node:os';
8
+ import { join } from 'node:path';
9
+
10
+ const HOME = homedir();
11
+ const SPECIALISTS_DIR = join(HOME, '.agents', 'specialists');
12
+ const MCP_NAME = 'specialists';
13
+ const GITHUB_PKG = '@jaggerxtrm/specialists';
14
+
15
+ // ── ANSI helpers ──────────────────────────────────────────────────────────────
16
+ const dim = (s) => `\x1b[2m${s}\x1b[0m`;
17
+ const green = (s) => `\x1b[32m${s}\x1b[0m`;
18
+ const yellow = (s) => `\x1b[33m${s}\x1b[0m`;
19
+ const bold = (s) => `\x1b[1m${s}\x1b[0m`;
20
+ const red = (s) => `\x1b[31m${s}\x1b[0m`;
21
+
22
+ function section(label) {
23
+ const line = '─'.repeat(Math.max(0, 40 - label.length));
24
+ console.log(`\n${bold(`── ${label} ${line}`)}`);
25
+ }
26
+
27
+ function ok(label) { console.log(` ${green('✓')} ${label}`); }
28
+ function skip(label) { console.log(` ${yellow('○')} ${label}`); }
29
+ function info(label) { console.log(` ${dim(label)}`); }
30
+ function fail(label) { console.log(` ${red('✗')} ${label}`); }
31
+
32
+ function isInstalled(cmd) {
33
+ const r = spawnSync('which', [cmd], { encoding: 'utf8' });
34
+ return r.status === 0 && r.stdout.trim().length > 0;
35
+ }
36
+
37
+ function npmInstallGlobal(pkg) {
38
+ const r = spawnSync('npm', ['install', '-g', pkg], { stdio: 'inherit', encoding: 'utf8' });
39
+ if (r.status !== 0) throw new Error(`npm install -g ${pkg} failed`);
40
+ }
41
+
42
+ function installDolt() {
43
+ if (process.platform === 'darwin') {
44
+ info('Installing dolt via brew...');
45
+ const r = spawnSync('brew', ['install', 'dolt'], { stdio: 'inherit', encoding: 'utf8' });
46
+ r.status === 0 ? ok('dolt installed') : fail('brew install dolt failed — install manually: brew install dolt');
47
+ } else {
48
+ info('Installing dolt (requires sudo)...');
49
+ const r = spawnSync(
50
+ 'sudo', ['bash', '-c', 'curl -L https://github.com/dolthub/dolt/releases/latest/download/install.sh | bash'],
51
+ { stdio: 'inherit', encoding: 'utf8' }
52
+ );
53
+ if (r.status === 0) {
54
+ ok('dolt installed');
55
+ } else {
56
+ fail('dolt install failed — install manually:');
57
+ info(" sudo bash -c 'curl -L https://github.com/dolthub/dolt/releases/latest/download/install.sh | bash'");
58
+ }
59
+ }
60
+ }
61
+
62
+ function registerMCP() {
63
+ const check = spawnSync('claude', ['mcp', 'get', MCP_NAME], { encoding: 'utf8' });
64
+ if (check.status === 0) return false;
65
+
66
+ npmInstallGlobal(GITHUB_PKG);
67
+
68
+ const r = spawnSync('claude', [
69
+ 'mcp', 'add', '--scope', 'user', MCP_NAME, '--', MCP_NAME,
70
+ ], { stdio: 'inherit', encoding: 'utf8' });
71
+ if (r.status !== 0) throw new Error('claude mcp add failed');
72
+ return true;
73
+ }
74
+
75
+ // ── Main ──────────────────────────────────────────────────────────────────────
76
+ console.log('\n' + bold(' OmniSpecialist — full-stack installer'));
77
+
78
+ // 1. pi
79
+ section('pi (coding agent runtime)');
80
+ if (isInstalled('pi')) {
81
+ skip('pi already installed');
82
+ } else {
83
+ info('Installing @mariozechner/pi-coding-agent...');
84
+ npmInstallGlobal('@mariozechner/pi-coding-agent');
85
+ ok('pi installed');
86
+ }
87
+
88
+ // 2. beads
89
+ section('beads (issue tracker)');
90
+ if (isInstalled('bd')) {
91
+ skip('bd already installed');
92
+ } else {
93
+ info('Installing @beads/bd...');
94
+ npmInstallGlobal('@beads/bd');
95
+ ok('bd installed');
96
+ }
97
+
98
+ // 3. dolt
99
+ section('dolt (beads sync backend)');
100
+ if (isInstalled('dolt')) {
101
+ skip('dolt already installed');
102
+ } else {
103
+ installDolt();
104
+ }
105
+
106
+ // 4. Specialists MCP
107
+ section('Specialists MCP');
108
+ const registered = registerMCP();
109
+ registered
110
+ ? ok(`MCP '${MCP_NAME}' registered at user scope`)
111
+ : skip(`MCP '${MCP_NAME}' already registered`);
112
+
113
+ // 5. Scaffold user specialists directory
114
+ section('Scaffold');
115
+ if (!existsSync(SPECIALISTS_DIR)) {
116
+ mkdirSync(SPECIALISTS_DIR, { recursive: true });
117
+ ok('~/.agents/specialists/ created');
118
+ } else {
119
+ skip('~/.agents/specialists/ already exists');
120
+ }
121
+
122
+ // 6. Health check
123
+ section('Health check');
124
+ if (isInstalled('pi')) {
125
+ const r = spawnSync('pi', ['--list-models'], { encoding: 'utf8' });
126
+ r.status === 0
127
+ ? ok('pi has at least one active provider')
128
+ : skip('No active provider — run pi config to set one up');
129
+ }
130
+
131
+ // 7. Done
132
+ console.log('\n' + bold(green(' Done!')));
133
+ console.log('\n' + bold(' Next steps:'));
134
+ console.log(` 1. ${bold('Configure pi:')} run ${yellow('pi')} then ${yellow('pi config')} to enable model providers`);
135
+ console.log(` 2. ${bold('Restart Claude Code')} to load the MCP`);
136
+ console.log(` 3. ${bold('Update later:')} re-run this installer\n`);