omkx 0.1.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 (41) hide show
  1. package/.kiro/agents/atlas.json +30 -0
  2. package/.kiro/agents/ghost-explorer.json +22 -0
  3. package/.kiro/agents/ghost-junior.json +21 -0
  4. package/.kiro/agents/ghost-librarian.json +23 -0
  5. package/.kiro/agents/ghost-looker.json +15 -0
  6. package/.kiro/agents/ghost-metis.json +22 -0
  7. package/.kiro/agents/ghost-momus.json +22 -0
  8. package/.kiro/agents/ghost-oracle.json +22 -0
  9. package/.kiro/agents/prometheus.json +30 -0
  10. package/.kiro/agents/sisyphus.json +26 -0
  11. package/.kiro/hooks/agent-spawn.sh +50 -0
  12. package/.kiro/hooks/pre-tool-use.sh +30 -0
  13. package/.kiro/hooks/prometheus-read-guard.sh +21 -0
  14. package/.kiro/hooks/prometheus-write-guard.sh +22 -0
  15. package/.kiro/notepads/.gitkeep +0 -0
  16. package/.kiro/plans/.gitkeep +0 -0
  17. package/.kiro/prompts/atlas.md +142 -0
  18. package/.kiro/prompts/ghost-explorer.md +105 -0
  19. package/.kiro/prompts/ghost-junior.md +116 -0
  20. package/.kiro/prompts/ghost-librarian.md +99 -0
  21. package/.kiro/prompts/ghost-looker.md +97 -0
  22. package/.kiro/prompts/ghost-metis.md +116 -0
  23. package/.kiro/prompts/ghost-momus.md +103 -0
  24. package/.kiro/prompts/ghost-oracle.md +102 -0
  25. package/.kiro/prompts/prometheus.md +136 -0
  26. package/.kiro/prompts/sisyphus.md +119 -0
  27. package/.kiro/settings/mcp.json +8 -0
  28. package/.kiro/skills/code-review/SKILL.md +59 -0
  29. package/.kiro/skills/debugging/SKILL.md +83 -0
  30. package/.kiro/skills/frontend-ux/SKILL.md +54 -0
  31. package/.kiro/skills/git-operations/SKILL.md +36 -0
  32. package/.kiro/skills/programming/SKILL.md +53 -0
  33. package/.kiro/steering/omkx/architecture.md +166 -0
  34. package/.kiro/steering/omkx/conventions.md +64 -0
  35. package/.kiro/steering/omkx/plan-format.md +97 -0
  36. package/.kiro/steering/omkx/product.md +66 -0
  37. package/LICENSE +21 -0
  38. package/README.md +337 -0
  39. package/bin/cli.mjs +360 -0
  40. package/install.sh +117 -0
  41. package/package.json +14 -0
package/README.md ADDED
@@ -0,0 +1,337 @@
1
+ # omkx — Multi-Agent Orchestration for Kiro
2
+
3
+ > omkx brings battle-tested multi-agent workflows to the Kiro IDE, adapted from [oh-my-openagent](https://github.com/code-yeongyu/oh-my-openagent).
4
+
5
+ **10 specialized agents. Plan-first development. Verified execution.**
6
+
7
+ ---
8
+
9
+ ## Architecture
10
+
11
+ omkx provides a three-tier agent system where main agents orchestrate work and specialist subagents do the heavy lifting.
12
+
13
+ ### Main Agents
14
+
15
+ | Agent | Shortcut | Role |
16
+ |-------|----------|------|
17
+ | **Prometheus** | `ctrl+p` | The Planner — gathers info, interviews users, writes structured execution plans |
18
+ | **Atlas** | `ctrl+a` | The Plan Executor — reads plans from disk, delegates to subagents, verifies everything |
19
+ | **Sisyphus** | `ctrl+e` | The Direct Executor — handles ad-hoc tasks by delegating to specialist subagents |
20
+
21
+ ### Subagents
22
+
23
+ | Agent | Role |
24
+ |-------|------|
25
+ | **ghost-oracle** | Strategic technical advisor — architecture, debugging, self-review (read-only) |
26
+ | **ghost-metis** | Pre-planning analyst — finds hidden intentions, risks, ambiguities |
27
+ | **ghost-momus** | Plan validator — reviews plans for blocking issues |
28
+ | **ghost-librarian** | Research specialist — web search, documentation, library evaluation |
29
+ | **ghost-explorer** | Codebase explorer — finds files, maps structure, identifies patterns |
30
+ | **ghost-junior** | Implementation specialist — writes code, creates files, verifies results |
31
+ | **ghost-looker** | Media analyst — analyzes images, PDFs, diagrams |
32
+
33
+ ---
34
+
35
+ ## Quick Start
36
+
37
+ ```bash
38
+ npx omkx@latest install
39
+ ```
40
+
41
+ This installs all agents, prompts, hooks, skills, and configuration into your Kiro project's `.kiro/` directory.
42
+
43
+ ---
44
+
45
+ ## Installation
46
+
47
+ ### Option 1: npx (Recommended)
48
+
49
+ ```bash
50
+ npx omkx@latest install
51
+ ```
52
+
53
+ ### Option 2: Using the install script
54
+
55
+ ```bash
56
+ curl -fsSL https://raw.githubusercontent.com/seyisulu/omkx/main/install.sh | bash
57
+ ```
58
+
59
+ ### Option 3: Local development
60
+
61
+ ```bash
62
+ git clone https://github.com/seyisulu/omkx.git
63
+ cd omkx
64
+ bash install.sh
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Usage
70
+
71
+ ### Prometheus — Planning (`ctrl+p`)
72
+
73
+ When you have a complex task, start with Prometheus:
74
+
75
+ 1. Press `ctrl+p` to activate Prometheus
76
+ 2. Describe what you want to accomplish
77
+ 3. Prometheus will:
78
+ - Analyze your request (via ghost-metis)
79
+ - Research the codebase (via ghost-explorer)
80
+ - Research external resources (via ghost-librarian)
81
+ - Interview you for clarifications
82
+ - Generate a structured plan in `.kiro/plans/`
83
+ 4. Review the plan, then switch to Atlas (`ctrl+a`)
84
+
85
+ ### Atlas — Plan Execution (`ctrl+a`)
86
+
87
+ When you have a plan ready:
88
+
89
+ 1. Press `ctrl+a` to activate Atlas
90
+ 2. Atlas automatically discovers plans in `.kiro/plans/`
91
+ 3. Select the plan to execute
92
+ 4. Atlas delegates each task to the appropriate subagent
93
+ 5. Every task output is verified
94
+ 6. Failed tasks are retried or escalated to ghost-oracle
95
+ 7. Atlas reports completion with verification results
96
+
97
+ ### Sisyphus — Direct Tasks (`ctrl+e`)
98
+
99
+ For quick, ad-hoc tasks that don't need a plan:
100
+
101
+ 1. Press `ctrl+e` to activate Sisyphus
102
+ 2. Give a direct instruction
103
+ 3. Sisyphus triages: trivial tasks done directly, complex tasks delegated
104
+ 4. Results reported immediately
105
+
106
+ ---
107
+
108
+ ## Plan File Format
109
+
110
+ Plans are markdown files in `.kiro/plans/`:
111
+
112
+ ```markdown
113
+ # Plan: Add User Authentication
114
+
115
+ **Created:** 2026-06-21
116
+ **Status:** DRAFT
117
+ **Goal:** Add email/password authentication with session management
118
+
119
+ ## Context
120
+ {Research findings and pre-analysis summary}
121
+
122
+ ## Tasks
123
+
124
+ ### Task 1: Set up auth database schema
125
+ **Agent:** ghost-junior
126
+ **Depends On:** none
127
+ **Description:** Create users table with email, password_hash, and session fields
128
+ **Verification:** Table exists with correct schema
129
+
130
+ ### Task 2: Implement auth middleware
131
+ **Agent:** ghost-junior
132
+ **Depends On:** Task 1
133
+ **Description:** Create login, register, and session validation middleware
134
+ **Verification:** Middleware protects routes and validates sessions
135
+
136
+ ## Acceptance Criteria
137
+ - [ ] Users can register with email and password
138
+ - [ ] Users can log in and receive a session
139
+ - [ ] Protected routes reject unauthenticated requests
140
+ - [ ] Passwords are hashed, never stored in plaintext
141
+
142
+ ## Risks & Mitigations
143
+ | Risk | Severity | Mitigation |
144
+ |------|----------|------------|
145
+ | Session hijacking | HIGH | Use httpOnly, secure cookies with short expiry |
146
+ ```
147
+
148
+ ---
149
+
150
+ ## Delegation Format
151
+
152
+ All main agents delegate using this 6-section format:
153
+
154
+ ```
155
+ ## TASK: {short name}
156
+ **Agent:** {subagent name}
157
+
158
+ ### Context
159
+ {What the subagent needs to know}
160
+
161
+ ### Objective
162
+ {Clear, specific goal}
163
+
164
+ ### Boundaries
165
+ {Scope limits — what NOT to do}
166
+
167
+ ### Output
168
+ {Expected deliverable format and location}
169
+
170
+ ### Success Criteria
171
+ {Verifiable completion conditions}
172
+
173
+ ### Notes
174
+ {Additional guidance}
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Configuration
180
+
181
+ ### Steering Files (`.kiro/steering/omkx/`)
182
+
183
+ | File | Purpose |
184
+ |------|---------|
185
+ | `product.md` | System overview and agent descriptions |
186
+ | `conventions.md` | Naming, file, and delegation conventions |
187
+ | `plan-format.md` | Plan template and task guidelines |
188
+ | `architecture.md` | Agent flows, notepad system, write restrictions |
189
+
190
+ ### Settings (`.kiro/settings/`)
191
+
192
+ | File | Purpose |
193
+ |------|---------|
194
+ | `mcp.json` | MCP server configuration for web research tools |
195
+
196
+ ### Hooks (`.kiro/hooks/`)
197
+
198
+ Shell scripts that enforce agent behavior:
199
+ - `agent-spawn.sh` — Injects git status and plan context on agent activation
200
+ - `pre-tool-use.sh` — Prevents destruction of `.kiro/` files
201
+ - `prometheus-read-guard.sh` — Ensures Prometheus delegates exploration
202
+ - `prometheus-write-guard.sh` — Restricts Prometheus to plan/notepad writes only
203
+
204
+ ---
205
+
206
+ ## Customization
207
+
208
+ ### Agent Behavior
209
+
210
+ Modify prompt files in `.kiro/prompts/` to customize agent behavior. Each `.md` file defines the agent's identity, workflow, and constraints.
211
+
212
+ ### Agent Configuration
213
+
214
+ Modify JSON files in `.kiro/agents/` to adjust:
215
+ - Available tools and tool settings
216
+ - Write path restrictions
217
+ - Subagent access permissions
218
+ - Keyboard shortcuts
219
+ - Hook configurations
220
+
221
+ ### Skills
222
+
223
+ Extend or modify skills in `.kiro/skills/`. Each skill directory contains a `SKILL.md` file used by agents for domain-specific guidance.
224
+
225
+ ### Steering Documents
226
+
227
+ Update files in `.kiro/steering/omkx/` to change project conventions, plan formats, and architecture rules.
228
+
229
+ ---
230
+
231
+ ## File Structure
232
+
233
+ ```
234
+ .kiro/
235
+ ├── agents/ # Agent JSON configurations (10 files)
236
+ │ ├── prometheus.json
237
+ │ ├── atlas.json
238
+ │ ├── sisyphus.json
239
+ │ └── ghost-*.json # 7 subagent configs
240
+ ├── prompts/ # Agent behavior prompts (10 markdown files)
241
+ ├── hooks/ # Lifecycle hook scripts (4 shell scripts)
242
+ ├── skills/ # Shared skill definitions (5 skills)
243
+ │ ├── git-operations/SKILL.md
244
+ │ ├── code-review/SKILL.md
245
+ │ ├── frontend-ux/SKILL.md
246
+ │ ├── debugging/SKILL.md
247
+ │ └── programming/SKILL.md
248
+ ├── steering/omkx/ # System configuration (4 markdown files)
249
+ ├── settings/ # MCP and tool configuration
250
+ ├── plans/ # Execution plans (created by Prometheus)
251
+ └── notepads/ # Agent context notepads
252
+ ```
253
+
254
+ ---
255
+
256
+ ## Troubleshooting
257
+
258
+ ### Agents not appearing in Kiro
259
+
260
+ 1. Verify omkx is installed: `npx omkx status`
261
+ 2. Ensure `.kiro/agents/` contains JSON files
262
+ 3. Restart Kiro IDE
263
+ 4. Reinstall: `npx omkx install --force`
264
+
265
+ ### Plans not executing
266
+
267
+ 1. Check plan exists in `.kiro/plans/`
268
+ 2. Verify plan format follows `.kiro/steering/omkx/plan-format.md`
269
+ 3. Use Prometheus (`ctrl+p`) to regenerate the plan
270
+ 4. Check notepad files in `.kiro/notepads/{plan-name}/` for error context
271
+
272
+ ### Subagent delegation failures
273
+
274
+ 1. Verify subagent configs exist in `.kiro/agents/`
275
+ 2. Check allowed tools in subagent JSON config
276
+ 3. Review hook scripts in `.kiro/hooks/` for permission issues
277
+ 4. Read `.kiro/steering/omkx/architecture.md` for delegation flows
278
+
279
+ ### Web research not working
280
+
281
+ 1. Check `.kiro/settings/mcp.json` for web-research server configuration
282
+ 2. Ensure MCP tools are available in your environment
283
+ 3. Verify network connectivity
284
+
285
+ ---
286
+
287
+ ## Commands
288
+
289
+ ```bash
290
+ omkx install # Install omkx agents and configuration
291
+ omkx install --force # Force reinstall
292
+ omkx install --dir <path> # Install to specific directory
293
+ omkx status # Show installation status
294
+ omkx list # List all installed agents
295
+ omkx plans # List execution plans
296
+ omkx help # Show help
297
+ ```
298
+
299
+ ---
300
+
301
+ ## Credits
302
+
303
+ omkx is based on:
304
+
305
+ - **[oh-my-openagent](https://github.com/code-yeongyu/oh-my-openagent)** — The original TypeScript multi-agent system developed by seyisulu. Agent personalities, workflows, and delegation patterns are adapted from this project.
306
+ - **[oh-my-kiro](https://github.com/NachoFLizaur/oh-my-kiro)** — The Kiro IDE agent format and conventions that omkx follows.
307
+
308
+ ### Agent Name Origins
309
+
310
+ | Agent | Origin |
311
+ |-------|--------|
312
+ | Prometheus | Titan who brought fire (foresight) to humanity |
313
+ | Atlas | Titan who bears the heavens (the entire workflow) |
314
+ | Sisyphus | King who pushes the boulder (relentless execution) |
315
+ | Oracle | Prophetic advisor (strategic guidance) |
316
+ | Metis | Titaness of wisdom and deep thought |
317
+ | Momus | God of criticism and satire |
318
+ | Librarian | Keeper of knowledge |
319
+ | Explorer | Discovers uncharted territory |
320
+ | Junior | The apprentice who does the work |
321
+ | Looker | The observer who sees what others miss |
322
+
323
+ ---
324
+
325
+ ## License
326
+
327
+ MIT © [seyisulu](https://github.com/seyisulu)
328
+
329
+ ---
330
+
331
+ ## Contributing
332
+
333
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
334
+
335
+ ---
336
+
337
+ **omkx** — Plan. Delegate. Verify. Execute.
package/bin/cli.mjs ADDED
@@ -0,0 +1,360 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { readFileSync, existsSync } from 'fs';
4
+ import { resolve, dirname } from 'path';
5
+ import { fileURLToPath } from 'url';
6
+ import { execSync } from 'child_process';
7
+
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const PKG_ROOT = resolve(__dirname, '..');
10
+
11
+ // ─── Help ────────────────────────────────────────────────────────────────
12
+
13
+ function showHelp() {
14
+ const help = `
15
+ ╔══════════════════════════════════════════════════════════╗
16
+ ║ omkx v${getVersion()} ║
17
+ ║ Multi-Agent Orchestration for Kiro ║
18
+ ╚══════════════════════════════════════════════════════════╝
19
+
20
+ Usage: omkx <command> [options]
21
+
22
+ Commands:
23
+ install Install omkx agents and configuration
24
+ status Show installation status
25
+ list List installed agents
26
+ plans List execution plans
27
+ help Show this help
28
+
29
+ Installation:
30
+ npx omkx@latest install Install to current directory
31
+ omkx install --force Force reinstall
32
+ omkx install --dir <path> Install to specific directory
33
+
34
+ Examples:
35
+ omkx install Install omkx in current directory
36
+ omkx status Check what's installed
37
+ omkx list List all agents
38
+ omkx plans List plans from .kiro/plans/
39
+
40
+ Keyboard Shortcuts (in Kiro):
41
+ ctrl+p → Prometheus (Planner)
42
+ ctrl+a → Atlas (Plan Executor)
43
+ ctrl+e → Sisyphus (Direct Executor)
44
+
45
+ Repository: https://github.com/seyisulu/omkx
46
+ `;
47
+ console.log(help);
48
+ }
49
+
50
+ // ─── Version ──────────────────────────────────────────────────────────────
51
+
52
+ function getVersion() {
53
+ try {
54
+ const pkg = JSON.parse(readFileSync(resolve(PKG_ROOT, 'package.json'), 'utf8'));
55
+ return pkg.version;
56
+ } catch {
57
+ return '0.1.0';
58
+ }
59
+ }
60
+
61
+ // ─── Install ──────────────────────────────────────────────────────────────
62
+
63
+ const MANIFEST = {
64
+ agents: [
65
+ 'prometheus.json',
66
+ 'atlas.json',
67
+ 'sisyphus.json',
68
+ 'ghost-explorer.json',
69
+ 'ghost-metis.json',
70
+ 'ghost-momus.json',
71
+ 'ghost-oracle.json',
72
+ 'ghost-librarian.json',
73
+ 'ghost-junior.json',
74
+ 'ghost-looker.json',
75
+ ],
76
+ prompts: [
77
+ 'prometheus.md',
78
+ 'atlas.md',
79
+ 'sisyphus.md',
80
+ 'ghost-explorer.md',
81
+ 'ghost-metis.md',
82
+ 'ghost-momus.md',
83
+ 'ghost-oracle.md',
84
+ 'ghost-librarian.md',
85
+ 'ghost-junior.md',
86
+ 'ghost-looker.md',
87
+ ],
88
+ hooks: [
89
+ 'agent-spawn.sh',
90
+ 'pre-tool-use.sh',
91
+ 'prometheus-read-guard.sh',
92
+ 'prometheus-write-guard.sh',
93
+ ],
94
+ steering: [
95
+ 'product.md',
96
+ 'conventions.md',
97
+ 'plan-format.md',
98
+ 'architecture.md',
99
+ ],
100
+ skills: [
101
+ 'git-operations',
102
+ 'code-review',
103
+ 'frontend-ux',
104
+ 'debugging',
105
+ 'programming',
106
+ ],
107
+ settings: [
108
+ 'mcp.json',
109
+ ],
110
+ };
111
+
112
+ function install(targetDir, force = false) {
113
+ const kiroDir = resolve(targetDir, '.kiro');
114
+
115
+ // Check if already installed
116
+ const manifestMarker = resolve(kiroDir, 'agents', 'prometheus.json');
117
+ if (existsSync(manifestMarker) && !force) {
118
+ console.log('✅ omkx is already installed.');
119
+ console.log(' Use --force to reinstall.');
120
+ return;
121
+ }
122
+
123
+ console.log(`📦 Installing omkx to ${targetDir}...\n`);
124
+
125
+ // Copy .kiro directory
126
+ copyDir(resolve(PKG_ROOT, '.kiro'), kiroDir);
127
+
128
+ // Make hooks executable
129
+ const hooksDir = resolve(kiroDir, 'hooks');
130
+ try {
131
+ execSync(`chmod +x ${hooksDir}/*.sh`, { stdio: 'pipe' });
132
+ } catch {
133
+ // Ignore if no hooks dir
134
+ }
135
+
136
+ // Create empty dirs with gitkeep
137
+ ensureDir(resolve(kiroDir, 'plans'));
138
+ ensureDir(resolve(kiroDir, 'notepads'));
139
+ touchIfMissing(resolve(kiroDir, 'plans', '.gitkeep'));
140
+ touchIfMissing(resolve(kiroDir, 'notepads', '.gitkeep'));
141
+
142
+ console.log('');
143
+ console.log('✅ omkx installed successfully!');
144
+ console.log('');
145
+ console.log('📂 Installed structure:');
146
+ console.log(` .kiro/agents/ → ${MANIFEST.agents.length} agents`);
147
+ console.log(` .kiro/prompts/ → ${MANIFEST.prompts.length} prompts`);
148
+ console.log(` .kiro/hooks/ → ${MANIFEST.hooks.length} hooks`);
149
+ console.log(` .kiro/skills/ → ${MANIFEST.skills.length} skills`);
150
+ console.log(` .kiro/steering/omkx/ → ${MANIFEST.steering.length} steering files`);
151
+ console.log(` .kiro/settings/ → ${MANIFEST.settings.length} settings`);
152
+ console.log(` .kiro/plans/ → Execution plans`);
153
+ console.log(` .kiro/notepads/ → Agent notepads`);
154
+ console.log('');
155
+ console.log('⌨️ Keyboard Shortcuts in Kiro:');
156
+ console.log(' ctrl+p → Prometheus (Planner)');
157
+ console.log(' ctrl+a → Atlas (Plan Executor)');
158
+ console.log(' ctrl+e → Sisyphus (Direct Executor)');
159
+ console.log('');
160
+ console.log('📖 Read .kiro/steering/omkx/product.md for full documentation.');
161
+ }
162
+
163
+ // ─── Status ───────────────────────────────────────────────────────────────
164
+
165
+ function status(targetDir) {
166
+ const kiroDir = resolve(targetDir, '.kiro');
167
+ const manifestMarker = resolve(kiroDir, 'agents', 'prometheus.json');
168
+
169
+ console.log('🔍 omkx Status\n');
170
+
171
+ if (!existsSync(manifestMarker)) {
172
+ console.log('❌ omkx is NOT installed.');
173
+ console.log(' Run: npx omkx install');
174
+ return;
175
+ }
176
+
177
+ console.log('✅ omkx is installed.\n');
178
+
179
+ // Count agents
180
+ const agentsDir = resolve(kiroDir, 'agents');
181
+ let agentCount = 0;
182
+ if (existsSync(agentsDir)) {
183
+ agentCount = MANIFEST.agents.filter(a => existsSync(resolve(agentsDir, a))).length;
184
+ }
185
+ console.log(` Agents: ${agentCount}/${MANIFEST.agents.length}`);
186
+
187
+ // Count prompts
188
+ const promptsDir = resolve(kiroDir, 'prompts');
189
+ let promptCount = 0;
190
+ if (existsSync(promptsDir)) {
191
+ promptCount = MANIFEST.prompts.filter(p => existsSync(resolve(promptsDir, p))).length;
192
+ }
193
+ console.log(` Prompts: ${promptCount}/${MANIFEST.prompts.length}`);
194
+
195
+ // Count plans
196
+ const plansDir = resolve(kiroDir, 'plans');
197
+ let planCount = 0;
198
+ if (existsSync(plansDir)) {
199
+ try {
200
+ planCount = execSync(`ls -1 ${plansDir}/*.md 2>/dev/null | wc -l`, { stdio: 'pipe' }).toString().trim();
201
+ } catch { planCount = 0; }
202
+ }
203
+ console.log(` Plans: ${planCount}`);
204
+
205
+ // Count notepads
206
+ const notepadsDir = resolve(kiroDir, 'notepads');
207
+ let notepadCount = 0;
208
+ if (existsSync(notepadsDir)) {
209
+ try {
210
+ notepadCount = execSync(`ls -1d ${notepadsDir}/*/ 2>/dev/null | wc -l`, { stdio: 'pipe' }).toString().trim();
211
+ } catch { notepadCount = 0; }
212
+ }
213
+ console.log(` Notepads: ${notepadCount}`);
214
+ }
215
+
216
+ // ─── List ──────────────────────────────────────────────────────────────────
217
+
218
+ function list(targetDir) {
219
+ const kiroDir = resolve(targetDir, '.kiro');
220
+ const agentsDir = resolve(kiroDir, 'agents');
221
+
222
+ console.log('🤖 omkx Agents\n');
223
+
224
+ if (!existsSync(agentsDir)) {
225
+ console.log('❌ No agents found. Run: npx omkx install');
226
+ return;
227
+ }
228
+
229
+ console.log('Main Agents:');
230
+ const mainAgents = ['prometheus', 'atlas', 'sisyphus'];
231
+ const shortcuts = { prometheus: 'ctrl+p', atlas: 'ctrl+a', sisyphus: 'ctrl+e' };
232
+ const descriptions = {
233
+ prometheus: 'Planner — creates execution plans',
234
+ atlas: 'Plan Executor — orchestrates plan execution',
235
+ sisyphus: 'Direct Executor — handles ad-hoc tasks',
236
+ };
237
+
238
+ for (const name of mainAgents) {
239
+ const file = resolve(agentsDir, `${name}.json`);
240
+ const installed = existsSync(file) ? '✅' : '❌';
241
+ console.log(` ${installed} ${name.padEnd(16)} ${shortcuts[name].padEnd(8)} ${descriptions[name]}`);
242
+ }
243
+
244
+ console.log('\nSubagents:');
245
+ const subAgents = [
246
+ { name: 'ghost-oracle', desc: 'Strategic technical advisor' },
247
+ { name: 'ghost-metis', desc: 'Pre-planning analyst' },
248
+ { name: 'ghost-momus', desc: 'Plan validator' },
249
+ { name: 'ghost-librarian', desc: 'Research specialist' },
250
+ { name: 'ghost-explorer', desc: 'Codebase explorer' },
251
+ { name: 'ghost-junior', desc: 'Implementation specialist' },
252
+ { name: 'ghost-looker', desc: 'Media analyst' },
253
+ ];
254
+
255
+ for (const agent of subAgents) {
256
+ const file = resolve(agentsDir, `${agent.name}.json`);
257
+ const installed = existsSync(file) ? '✅' : '❌';
258
+ console.log(` ${installed} ${agent.name.padEnd(20)} ${agent.desc}`);
259
+ }
260
+ }
261
+
262
+ // ─── Plans ─────────────────────────────────────────────────────────────────
263
+
264
+ function plans(targetDir) {
265
+ const plansDir = resolve(targetDir, '.kiro', 'plans');
266
+
267
+ console.log('📐 Execution Plans\n');
268
+
269
+ if (!existsSync(plansDir)) {
270
+ console.log('No plans directory found. Create plans with Prometheus (ctrl+p).');
271
+ return;
272
+ }
273
+
274
+ try {
275
+ const output = execSync(`ls -1t ${plansDir}/*.md 2>/dev/null`, { stdio: 'pipe' }).toString().trim();
276
+ if (!output) {
277
+ console.log('No plans found. Create plans with Prometheus (ctrl+p).');
278
+ return;
279
+ }
280
+ const planFiles = output.split('\n');
281
+ for (const plan of planFiles) {
282
+ const name = plan.split('/').pop();
283
+ // Try to extract title from first line
284
+ try {
285
+ const firstLine = execSync(`head -1 "${plan}"`, { stdio: 'pipe' }).toString().trim();
286
+ const title = firstLine.replace(/^#\s*(Plan:\s*)?/, '');
287
+ console.log(` 📄 ${name}`);
288
+ console.log(` ${title}`);
289
+ } catch {
290
+ console.log(` 📄 ${name}`);
291
+ }
292
+ console.log('');
293
+ }
294
+ } catch {
295
+ console.log('No plans found.');
296
+ }
297
+ }
298
+
299
+ // ─── Utilities ─────────────────────────────────────────────────────────────
300
+
301
+ import { cpSync, mkdirSync, writeFileSync } from 'fs';
302
+
303
+ function copyDir(src, dest) {
304
+ cpSync(src, dest, { recursive: true });
305
+ }
306
+
307
+ function ensureDir(dir) {
308
+ mkdirSync(dir, { recursive: true });
309
+ }
310
+
311
+ function touchIfMissing(file) {
312
+ if (!existsSync(file)) {
313
+ writeFileSync(file, '');
314
+ }
315
+ }
316
+
317
+ // ─── Main ──────────────────────────────────────────────────────────────────
318
+
319
+ function main() {
320
+ const args = process.argv.slice(2);
321
+ const command = args[0] || 'help';
322
+
323
+ let targetDir = process.cwd();
324
+ let force = false;
325
+
326
+ // Parse flags
327
+ for (let i = 1; i < args.length; i++) {
328
+ if (args[i] === '--dir' && args[i + 1]) {
329
+ targetDir = resolve(args[++i]);
330
+ } else if (args[i] === '--force') {
331
+ force = true;
332
+ }
333
+ }
334
+
335
+ switch (command) {
336
+ case 'install':
337
+ install(targetDir, force);
338
+ break;
339
+ case 'status':
340
+ status(targetDir);
341
+ break;
342
+ case 'list':
343
+ list(targetDir);
344
+ break;
345
+ case 'plans':
346
+ plans(targetDir);
347
+ break;
348
+ case 'help':
349
+ case '--help':
350
+ case '-h':
351
+ showHelp();
352
+ break;
353
+ default:
354
+ console.log(`Unknown command: ${command}`);
355
+ console.log('Run "omkx help" for usage information.');
356
+ process.exit(1);
357
+ }
358
+ }
359
+
360
+ main();