Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

feat(ci): #2095 ADR-128 Phase 5 — init-bundle-invariants smoke (no orphans, no plugin-init overlap)

ruv9a66b2996bf8
diff --git a/.github/workflows/v3-ci.yml b/.github/workflows/v3-ci.yml
index 8f79e0573a..0ce0fa2901 100644
--- a/.github/workflows/v3-ci.yml
+++ b/.github/workflows/v3-ci.yml
@@ -92,6 +92,14 @@ on:
- 'scripts/smoke-deprecated-actions.mjs'
- 'scripts/smoke-attribution-opt-in.mjs'
- '.github/supply-chain/allowed-deps.json'
+ # Init-bundle invariants smoke (#2095, ADR-128) — orphan dirs, SKILLS_MAP
+ # completeness, and plugin-init agent dedup are all guarded by Phase 5.
+ - 'v3/@claude-flow/cli/.claude/**'
+ - 'v3/@claude-flow/cli/src/init/**'
+ - 'plugins/*/agents/**'
+ - 'plugins/*/skills/**'
+ - 'plugins/*/commands/**'
+ - 'scripts/smoke-init-bundle-invariants.mjs'
pull_request:
branches: [main, develop]
paths:
@@ -160,6 +168,13 @@ on:
- 'scripts/smoke-deprecated-actions.mjs'
- 'scripts/smoke-attribution-opt-in.mjs'
- '.github/supply-chain/allowed-deps.json'
+ # Init-bundle invariants smoke (#2095, ADR-128)
+ - 'v3/@claude-flow/cli/.claude/**'
+ - 'v3/@claude-flow/cli/src/init/**'
+ - 'plugins/*/agents/**'
+ - 'plugins/*/skills/**'
+ - 'plugins/*/commands/**'
+ - 'scripts/smoke-init-bundle-invariants.mjs'
# witness manifests / fix list — so witness-verify runs on PRs that
# touch them (otherwise a stale per-OS manifest only fails post-merge).
- 'verification/**'
@@ -1667,3 +1682,35 @@ jobs:
run: pnpm publish:alpha
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+
+ init-bundle-invariants-smoke:
+ # Regression guard for ruvnet/ruflo#2095 — ADR-128 Phase 5.
+ #
+ # Statically asserts three invariants of the @claude-flow/cli init bundle:
+ #
+ # 1. NO ORPHANED DIRECTORIES — every subdirectory under
+ # v3/@claude-flow/cli/.claude/{commands,agents}/ is reachable from
+ # COMMANDS_MAP or AGENTS_MAP in executor.ts.
+ #
+ # 2. SKILLS_MAP COMPLETENESS — every skill referenced in SKILLS_MAP
+ # has a SKILL.md (or README.md) inside the package's .claude/skills/.
+ #
+ # 3. NO INIT-PLUGIN AGENT COLLISION — no .md in the init-template
+ # agents/ shares a basename with any plugin agent. Enforces the
+ # "plugin is canonical" dedup rule from ADR-128 Phase 2.
+ #
+ # Zero runtime deps; pure Node.js readFileSync + readdirSync.
+ name: init-bundle invariants smoke (#2095, ADR-128 Phase 5)
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: '22'
+
+ - name: Run init-bundle invariants smoke
+ run: node scripts/smoke-init-bundle-invariants.mjs
diff --git a/scripts/smoke-init-bundle-invariants.mjs b/scripts/smoke-init-bundle-invariants.mjs
new file mode 100644
index 0000000000..da54a1ec09
--- /dev/null
+++ b/scripts/smoke-init-bundle-invariants.mjs
@@ -0,0 +1,204 @@
+#!/usr/bin/env node
+/**
+ * Init-bundle invariants smoke — ADR-128 Phase 5 (#2095).
+ *
+ * Statically asserts three properties of the @claude-flow/cli init bundle:
+ *
+ * 1. NO ORPHANED DIRECTORIES — every subdirectory under
+ * v3/@claude-flow/cli/.claude/{commands,agents}/ is reachable from
+ * COMMANDS_MAP or AGENTS_MAP in executor.ts. An "orphaned" directory is
+ * one that ships in the tarball but is never copied by any init path.
+ *
+ * 2. SKILLS_MAP COMPLETENESS — every skill name in SKILLS_MAP (all arrays)
+ * has a corresponding SKILL.md at
+ * v3/@claude-flow/cli/.claude/skills/{name}/SKILL.md. Catches Phase 1
+ * regressions where a skill dir disappears from the package.
+ *
+ * 3. NO INIT–PLUGIN AGENT BASENAME COLLISION — no .md file in
+ * v3/@claude-flow/cli/.claude/agents/(any path) shares a basename with any
+ * .md file in plugins/(any plugin)/agents/. Enforces the "plugin is canonical"
+ * dedup rule from ADR-128 Phase 2.
+ *
+ * Zero runtime dependencies — pure readFileSync + regex + readdirSync.
+ * Exit 0: all assertions pass.
+ * Exit 1: one or more assertions fail (file + details reported).
+ */
+
+import { readFileSync, readdirSync, existsSync, statSync } from 'node:fs';
+import { join } from 'node:path';
+
+const REPO_ROOT = process.cwd();
+const EXECUTOR_TS = join(REPO_ROOT, 'v3', '@claude-flow', 'cli', 'src', 'init', 'executor.ts');
+const CLI_DOT_CLAUDE = join(REPO_ROOT, 'v3', '@claude-flow', 'cli', '.claude');
+const PLUGINS_DIR = join(REPO_ROOT, 'plugins');
+
+// ---------------------------------------------------------------------------
+// Helpers
+// ---------------------------------------------------------------------------
+
+function listSubdirs(dir) {
+ if (!existsSync(dir)) return [];
+ return readdirSync(dir, { withFileTypes: true })
+ .filter(e => e.isDirectory())
+ .map(e => e.name);
+}
+
+function collectFiles(dir, ext) {
+ if (!existsSync(dir)) return [];
+ const results = [];
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
+ const full = join(dir, entry.name);
+ if (entry.isFile() && entry.name.endsWith(ext)) {
+ results.push(full);
+ } else if (entry.isDirectory()) {
+ results.push(...collectFiles(full, ext));
+ }
+ }
+ return results;
+}
+
+// Parse all string values from a Record<string, string[]> literal in source.
+// Handles multi-line blocks terminated by the closing '};'.
+function parseMapValues(src, mapName) {
+ const start = src.indexOf(`const ${mapName}:`);
+ if (start === -1) return new Set();
+ const block = src.slice(start, src.indexOf('\n};', start) + 3);
+ const values = new Set();
+ // Match single-quoted string literals
+ for (const m of block.matchAll(/'([^']+)'/g)) {
+ values.add(m[1]);
+ }
+ return values;
+}
+
+// ---------------------------------------------------------------------------
+// Load executor.ts
+// ---------------------------------------------------------------------------
+
+if (!existsSync(EXECUTOR_TS)) {
+ console.error(`ERROR: executor.ts not found at ${EXECUTOR_TS}`);
+ process.exit(1);
+}
+const executorSrc = readFileSync(EXECUTOR_TS, 'utf-8');
+
+// ---------------------------------------------------------------------------
+// Assertion 1: No orphaned command or agent subdirectories
+// ---------------------------------------------------------------------------
+
+const commandsValues = parseMapValues(executorSrc, 'COMMANDS_MAP');
+const agentsValues = parseMapValues(executorSrc, 'AGENTS_MAP');
+
+const commandsDirs = listSubdirs(join(CLI_DOT_CLAUDE, 'commands'));
+const agentsDirs = listSubdirs(join(CLI_DOT_CLAUDE, 'agents'));
+
+const orphanViolations = [];
+
+for (const dir of commandsDirs) {
+ if (!commandsValues.has(dir)) {
+ orphanViolations.push({
+ type: 'orphan-command-dir',
+ path: `v3/@claude-flow/cli/.claude/commands/${dir}`,
+ message: `commands/${dir}/ has no COMMANDS_MAP entry`,
+ });
+ }
+}
+
+for (const dir of agentsDirs) {
+ if (!agentsValues.has(dir)) {
+ orphanViolations.push({
+ type: 'orphan-agent-dir',
+ path: `v3/@claude-flow/cli/.claude/agents/${dir}`,
+ message: `agents/${dir}/ has no AGENTS_MAP entry`,
+ });
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Assertion 2: Every SKILLS_MAP skill has a SKILL.md in the package
+// ---------------------------------------------------------------------------
+
+const skillsMapValues = parseMapValues(executorSrc, 'SKILLS_MAP');
+const skillsDir = join(CLI_DOT_CLAUDE, 'skills');
+const missingSkills = [];
+
+for (const skillName of skillsMapValues) {
+ const skillDir = join(skillsDir, skillName);
+ const skillMd = join(skillDir, 'SKILL.md');
+ const readmeMd = join(skillDir, 'README.md');
+ // Skill must have a directory with at least SKILL.md or README.md
+ if (!existsSync(skillMd) && !existsSync(readmeMd)) {
+ missingSkills.push({
+ type: 'missing-skill',
+ // Report the SKILL.md path for clarity even though README.md is accepted
+ path: `v3/@claude-flow/cli/.claude/skills/${skillName}/SKILL.md`,
+ message: `SKILLS_MAP references '${skillName}' but neither SKILL.md nor README.md found in package`,
+ });
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Assertion 3: No init-template agent basename collides with a plugin agent
+// ---------------------------------------------------------------------------
+
+const initAgentFiles = collectFiles(join(CLI_DOT_CLAUDE, 'agents'), '.md');
+const initBasenames = new Set(initAgentFiles.map(f => f.split('/').pop()));
+
+const pluginAgentFiles = existsSync(PLUGINS_DIR)
+ ? readdirSync(PLUGINS_DIR, { withFileTypes: true })
+ .filter(e => e.isDirectory())
+ .flatMap(e => collectFiles(join(PLUGINS_DIR, e.name, 'agents'), '.md'))
+ : [];
+
+const collisionViolations = [];
+
+for (const pluginFile of pluginAgentFiles) {
+ const basename = pluginFile.split('/').pop();
+ if (initBasenames.has(basename)) {
+ // Find the init copy for the error message
+ const initCopy = initAgentFiles.find(f => f.split('/').pop() === basename);
+ collisionViolations.push({
+ type: 'agent-collision',
+ init: initCopy.replace(REPO_ROOT + '/', ''),
+ plugin: pluginFile.replace(REPO_ROOT + '/', ''),
+ message: `'${basename}' exists in both init template and plugin (plugin must be canonical)`,
+ });
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Report results
+// ---------------------------------------------------------------------------
+
+const allViolations = [...orphanViolations, ...missingSkills, ...collisionViolations];
+
+if (allViolations.length === 0) {
+ console.log('ok: init-bundle invariants pass (no orphans, all skills present, no plugin-init overlap)');
+ console.log(` commands dirs checked: ${commandsDirs.length}`);
+ console.log(` agents dirs checked: ${agentsDirs.length}`);
+ console.log(` skills checked: ${skillsMapValues.size}`);
+ console.log(` plugin agent basenames checked: ${pluginAgentFiles.length}`);
+ process.exit(0);
+}
+
+console.error(`\n${allViolations.length} init-bundle invariant violation(s):\n`);
+
+for (const v of allViolations) {
+ if (v.type === 'orphan-command-dir' || v.type === 'orphan-agent-dir') {
+ console.error(` [ORPHAN] ${v.path}`);
+ console.error(` ${v.message}`);
+ console.error(` Fix: add a COMMANDS_MAP or AGENTS_MAP entry for this directory,`);
+ console.error(` or delete the directory if it belongs to a plugin.`);
+ } else if (v.type === 'missing-skill') {
+ console.error(` [MISSING-SKILL] ${v.path}`);
+ console.error(` ${v.message}`);
+ console.error(` Fix: copy the skill from .claude/skills/${v.path.split('/').at(-2)}/ into the package.`);
+ } else if (v.type === 'agent-collision') {
+ console.error(` [COLLISION] ${v.message}`);
+ console.error(` init: ${v.init}`);
+ console.error(` plugin: ${v.plugin}`);
+ console.error(` Fix: delete the init-template copy; the plugin version is canonical (ADR-128 §Phase 2).`);
+ }
+}
+
+console.error('\nADR-128: https://github.com/ruvnet/ruflo/blob/main/v3/docs/adr/ADR-128-init-bundle-reduce-refactor.md\n');
+process.exit(1);
diff --git a/v3/@claude-flow/cli/.claude/skills/browser/SKILL.md b/v3/@claude-flow/cli/.claude/skills/browser/SKILL.md
new file mode 100644
index 0000000000..4f0b216e5a
--- /dev/null
+++ b/v3/@claude-flow/cli/.claude/skills/browser/SKILL.md
@@ -0,0 +1,204 @@
+---
+name: browser
+description: Web browser automation with AI-optimized snapshots for claude-flow agents
+version: 1.0.0
+triggers:
+ - /browser
+ - browse
+ - web automation
+ - scrape
+ - navigate
+ - screenshot
+tools:
+ - browser/open
+ - browser/snapshot
+ - browser/click
+ - browser/fill
+ - browser/screenshot
+ - browser/close
+---
+
+# Browser Automation Skill
+
+Web browser automation using agent-browser with AI-optimized snapshots. Reduces context by 93% using element refs (@e1, @e2) instead of full DOM.
+
+## Core Workflow
+
+```bash
+# 1. Navigate to page
+agent-browser open <url>
+
+# 2. Get accessibility tree with element refs
+agent-browser snapshot -i # -i = interactive elements only
+
+# 3. Interact using refs from snapshot
+agent-browser click @e2
+agent-browser fill @e3 "text"
+
+# 4. Re-snapshot after page changes
+agent-browser snapshot -i
+```
+
+## Quick Reference
+
+### Navigation
+| Command | Description |
+|---------|-------------|
+| `open <url>` | Navigate to URL |
+| `back` | Go back |
+| `forward` | Go forward |
+| `reload` | Reload page |
+| `close` | Close browser |
+
+### Snapshots (AI-Optimized)
+| Command | Description |
+|---------|-------------|
+| `snapshot` | Full accessibility tree |
+| `snapshot -i` | Interactive elements only (buttons, links, inputs) |
+| `snapshot -c` | Compact (remove empty elements) |
+| `snapshot -d 3` | Limit depth to 3 levels |
+| `screenshot [path]` | Capture screenshot (base64 if no path) |
+
+### Interaction
+| Command | Description |
+|---------|-------------|
+| `click <sel>` | Click element |
+| `fill <sel> <text>` | Clear and fill input |
+| `type <sel> <text>` | Type with key events |
+| `press <key>` | Press key (Enter, Tab, etc.) |
+| `hover <sel>` | Hover element |
+| `select <sel> <val>` | Select dropdown option |
+| `check/uncheck <sel>` | Toggle checkbox |
+| `scroll <dir> [px]` | Scroll page |
+
+### Get Info
+| Command | Description |
+|---------|-------------|
+| `get text <sel>` | Get text content |
+| `get html <sel>` | Get innerHTML |
+| `get value <sel>` | Get input value |
+| `get attr <sel> <attr>` | Get attribute |
+| `get title` | Get page title |
+| `get url` | Get current URL |
+
+### Wait
+| Command | Description |
+|---------|-------------|
+| `wait <selector>` | Wait for element |
+| `wait <ms>` | Wait milliseconds |
+| `wait --text "text"` | Wait for text |
+| `wait --url "pattern"` | Wait for URL |
+| `wait --load networkidle` | Wait for load state |
+
+### Sessions
+| Command | Description |
+|---------|-------------|
+| `--session <name>` | Use isolated session |
+| `session list` | List active sessions |
+
+## Selectors
+
+### Element Refs (Recommended)
+```bash
+# Get refs from snapshot
+agent-browser snapshot -i
+# Output: button "Submit" [ref=e2]
+
+# Use ref to interact
+agent-browser click @e2
+```
+
+### CSS Selectors
+```bash
+agent-browser click "#submit"
+agent-browser fill ".email-input" "[email protected]"
+```
+
+### Semantic Locators
+```bash
+agent-browser find role button click --name "Submit"
+agent-browser find label "Email" fill "[email protected]"
+agent-browser find testid "login-btn" click
+```
+
+## Examples
+
+### Login Flow
+```bash
+agent-browser open https://example.com/login
+agent-browser snapshot -i
+agent-browser fill @e2 "[email protected]"
+agent-browser fill @e3 "password123"
+agent-browser click @e4
+agent-browser wait --url "**/dashboard"
+```
+
+### Form Submission
+```bash
+agent-browser open https://example.com/contact
+agent-browser snapshot -i
+agent-browser fill @e1 "John Doe"
+agent-browser fill @e2 "[email protected]"
+agent-browser fill @e3 "Hello, this is my message"
+agent-browser click @e4
+agent-browser wait --text "Thank you"
+```
+
+### Data Extraction
+```bash
+agent-browser open https://example.com/products
+agent-browser snapshot -i
+# Iterate through product refs
+agent-browser get text @e1 # Product name
+agent-browser get text @e2 # Price
+agent-browser get attr @e3 href # Link
+```
+
+### Multi-Session (Swarm)
+```bash
+# Session 1: Navigator
+agent-browser --session nav open https://example.com
+agent-browser --session nav state save auth.json
+
+# Session 2: Scraper (uses same auth)
+agent-browser --session scrape state load auth.json
+agent-browser --session scrape open https://example.com/data
+agent-browser --session scrape snapshot -i
+```
+
+## Integration with Claude Flow
+
+### MCP Tools
+All browser operations are available as MCP tools with `browser/` prefix:
+- `browser/open`
+- `browser/snapshot`
+- `browser/click`
+- `browser/fill`
+- `browser/screenshot`
+- etc.
+
+### Memory Integration
+```bash
+# Store successful patterns
+npx @claude-flow/cli memory store --namespace browser-patterns --key "login-flow" --value "snapshot->fill->click->wait"
+
+# Retrieve before similar task
+npx @claude-flow/cli memory search --query "login automation"
+```
+
+### Hooks
+```bash
+# Pre-browse hook (get context)
+npx @claude-flow/cli hooks pre-edit --file "browser-task.ts"
+
+# Post-browse hook (record success)
+npx @claude-flow/cli hooks post-task --task-id "browse-1" --success true
+```
+
+## Tips
+
+1. **Always use snapshots** - They're optimized for AI with refs
+2. **Prefer `-i` flag** - Gets only interactive elements, smaller output
+3. **Use refs, not selectors** - More reliable, deterministic
+4. **Re-snapshot after navigation** - Page state changes
+5. **Use sessions for parallel work** - Each session is isolated
diff --git a/v3/@claude-flow/cli/.claude/skills/dual-mode/README.md b/v3/@claude-flow/cli/.claude/skills/dual-mode/README.md
new file mode 100644
index 0000000000..26cf79b5e4
--- /dev/null
+++ b/v3/@claude-flow/cli/.claude/skills/dual-mode/README.md
@@ -0,0 +1,71 @@
+# Dual-Mode Skills (Claude Code + Codex)
+
+Optional skills for orchestrating Claude Code and headless Codex workers together.
+
+## Available Skills
+
+| Skill | File | Purpose |
+|-------|------|---------|
+| `/dual-spawn` | dual-spawn.md | Spawn headless Codex workers from Claude Code |
+| `/dual-coordinate` | dual-coordinate.md | Coordinate hybrid Claude+Codex workflows |
+| `/dual-collect` | dual-collect.md | Collect results from headless workers |
+
+## Quick Start
+
+### Spawn Parallel Workers
+```
+/dual-spawn "Implement auth module" --workers 3
+```
+
+This spawns 3 headless Codex workers in background.
+
+### Collect Results
+```
+/dual-collect --namespace results
+```
+
+### Full Hybrid Workflow
+```
+/dual-coordinate --workflow hybrid_development --task "Build user API"
+```
+
+## Workflow Examples
+
+### Feature Implementation
+```bash
+# 1. Spawn implementation workers
+/dual-spawn "Implement user CRUD API" --workers 2 --type coder
+
+# 2. Spawn test writer
+/dual-spawn "Write tests for user API" --workers 1 --type tester
+
+# 3. Collect all results
+/dual-collect --format detailed
+```
+
+### Documentation Sprint
+```bash
+/dual-spawn "Document all API endpoints" --workers 4 --type docs
+/dual-collect --namespace results
+```
+
+## Related Agents
+
+See `.claude/agents/dual-mode/` for agent definitions:
+- `dual-orchestrator` - Hybrid workflow orchestration
+- `codex-coordinator` - Parallel worker coordination
+- `codex-worker` - Headless execution worker
+
+## How It Works
+
+1. **Skills** define the command interface (what you type)
+2. **Agents** define the behavior and capabilities
+3. **Memory** provides coordination between workers
+4. **MCP tools** handle the underlying operations
+
+All workers share memory via claude-flow MCP tools for seamless coordination.
+
+## Installation
+
+Skills are pre-installed in `.claude/skills/dual-mode/`.
+Invoke with `/skill-name` in Claude Code.
diff --git a/v3/@claude-flow/cli/.claude/skills/dual-mode/dual-collect.md b/v3/@claude-flow/cli/.claude/skills/dual-mode/dual-collect.md
new file mode 100644
index 0000000000..12d51e1e11
--- /dev/null
+++ b/v3/@claude-flow/cli/.claude/skills/dual-mode/dual-collect.md
@@ -0,0 +1,103 @@
+---
+name: dual-collect
+description: Collect results from headless Codex workers
+---
+
+# Dual Collect Skill
+
+Collect and aggregate results from headless Codex workers stored in shared memory.
+
+## Usage
+
+```
+/dual-collect [--namespace <namespace>] [--format <format>]
+```
+
+## Parameters
+
+| Parameter | Default | Description |
+|-----------|---------|-------------|
+| `--namespace` | results | Memory namespace to search |
+| `--format` | summary | Output format: summary, detailed, json |
+| `--filter` | none | Filter by key pattern |
+
+## Examples
+
+### Collect All Results
+```
+/dual-collect
+```
+
+### Collect from Specific Namespace
+```
+/dual-collect --namespace patterns
+```
+
+### Detailed Output
+```
+/dual-collect --format detailed
+```
+
+### Filter by Worker
+```
+/dual-collect --filter "worker-auth-*"
+```
+
+## How It Works
+
+1. Queries the memory system for entries in specified namespace
+2. Aggregates results from all workers
+3. Formats output according to specified format
+4. Displays summary of completed/failed workers
+
+## Generated Commands
+
+```bash
+# List all results
+npx claude-flow@v3alpha memory list --namespace {{namespace}}
+
+# Search for specific patterns
+npx claude-flow@v3alpha memory search -q "{{filter}}" -n {{namespace}}
+
+# Get detailed entries
+{{#each results}}
+npx claude-flow@v3alpha memory get -k "{{this.key}}" -n {{namespace}}
+{{/each}}
+```
+
+## Output Formats
+
+### Summary (default)
+```
+Workers Completed: 4/4
+├─ worker-auth-core: ✅ Complete (auth.service.ts)
+├─ worker-auth-api: ✅ Complete (auth.controller.ts)
+├─ worker-tests: ✅ Complete (15 tests passing)
+└─ worker-docs: ✅ Complete (API.md updated)
+```
+
+### Detailed
+```
+┌─────────────────────────────────────────────────┐
+│ Worker: worker-auth-core │
+│ Status: Complete │
+│ Duration: 45s │
+│ Files: auth.service.ts, auth.types.ts │
+│ Result: Implemented JWT authentication │
+└─────────────────────────────────────────────────┘
+```
+
+### JSON
+```json
+{
+ "workers": [
+ {"id": "worker-auth-core", "status": "complete", "result": "..."}
+ ],
+ "summary": {"total": 4, "completed": 4, "failed": 0}
+}
+```
+
+## Related Skills
+
+- `/dual-spawn` - Spawn headless workers
+- `/dual-coordinate` - Full hybrid workflow
diff --git a/v3/@claude-flow/cli/.claude/skills/dual-mode/dual-coordinate.md b/v3/@claude-flow/cli/.claude/skills/dual-mode/dual-coordinate.md
new file mode 100644
index 0000000000..f44ced202b
--- /dev/null
+++ b/v3/@claude-flow/cli/.claude/skills/dual-mode/dual-coordinate.md
@@ -0,0 +1,85 @@
+---
+name: dual-coordinate
+description: Coordinate hybrid Claude Code + Codex workflows
+---
+
+# Dual Coordinate Skill
+
+Coordinate hybrid workflows that use Claude Code for interactive reasoning and Codex for parallel background execution.
+
+## Usage
+
+```
+/dual-coordinate --workflow <workflow-name> --task "<task-description>"
+```
+
+## Parameters
+
+| Parameter | Default | Description |
+|-----------|---------|-------------|
+| `--workflow` | hybrid_development | Workflow template to use |
+| `--task` | required | Task description |
+| `--interactive-first` | true | Start with interactive phase |
+
+## Available Workflows
+
+### hybrid_development
+Design interactively, implement in parallel, review interactively.
+
+```
+/dual-coordinate --workflow hybrid_development --task "Build user authentication"
+```
+
+### parallel_feature
+Spawn multiple Codex workers for parallel implementation.
+
+```
+/dual-coordinate --workflow parallel_feature --task "Implement REST API"
+```
+
+### design_and_execute
+Interactive design phase, then batch execution.
+
+```
+/dual-coordinate --workflow design_and_execute --task "Refactor auth module"
+```
+
+## How It Works
+
+1. **Routing Decision**: Analyzes task to determine optimal platform split
+2. **Interactive Phase**: Complex reasoning in Claude Code
+3. **Parallel Phase**: Spawns Codex workers for execution
+4. **Review Phase**: Returns to Claude Code for quality review
+5. **Result Collection**: Aggregates worker results from memory
+
+## Generated Commands
+
+```bash
+# Phase 1: Interactive (Claude Code)
+# [Current session handles design/planning]
+
+# Phase 2: Parallel (Codex)
+{{#each workers}}
+claude -p "{{this.task}}" --session-id {{this.id}} &
+{{/each}}
+wait
+
+# Phase 3: Review (Claude Code)
+npx claude-flow@v3alpha memory list --namespace results
+```
+
+## Example: Full Hybrid Workflow
+
+```
+/dual-coordinate --workflow hybrid_development --task "Build user profile API"
+```
+
+This will:
+1. **Design Phase** (Interactive): Discuss requirements, design endpoints, plan implementation
+2. **Implement Phase** (Headless): Spawn coders, testers, docs writers in parallel
+3. **Review Phase** (Interactive): Review implementation, discuss improvements
+
+## Related Skills
+
+- `/dual-spawn` - Spawn headless workers only
+- `/dual-collect` - Collect results from workers
diff --git a/v3/@claude-flow/cli/.claude/skills/dual-mode/dual-spawn.md b/v3/@claude-flow/cli/.claude/skills/dual-mode/dual-spawn.md
new file mode 100644
index 0000000000..38424c1061
--- /dev/null
+++ b/v3/@claude-flow/cli/.claude/skills/dual-mode/dual-spawn.md
@@ -0,0 +1,81 @@
+---
+name: dual-spawn
+description: Spawn headless Codex workers from Claude Code for parallel execution
+---
+
+# Dual Spawn Skill
+
+Spawn multiple headless Codex workers to run tasks in parallel while you continue working interactively.
+
+## Usage
+
+```
+/dual-spawn "<task>" --workers <count> [--type <worker-type>]
+```
+
+## Parameters
+
+| Parameter | Default | Description |
+|-----------|---------|-------------|
+| `task` | required | Task description for workers |
+| `--workers` | 3 | Number of parallel workers |
+| `--type` | coder | Worker type: coder, tester, docs, reviewer |
+| `--wait` | false | Wait for completion |
+
+## Examples
+
+### Spawn Implementation Workers
+```
+/dual-spawn "Implement user authentication" --workers 2 --type coder
+```
+
+### Spawn Test Writers
+```
+/dual-spawn "Write comprehensive tests for auth module" --workers 2 --type tester
+```
+
+### Spawn Documentation Workers
+```
+/dual-spawn "Document all API endpoints" --workers 1 --type docs
+```
+
+## How It Works
+
+1. Initializes shared swarm coordination
+2. Spawns headless Codex workers with `claude -p`
+3. Each worker searches memory for relevant patterns
+4. Workers execute in parallel
+5. Results stored in shared memory
+
+## Generated Commands
+
+```bash
+# Initialize coordination
+npx claude-flow swarm init --topology hierarchical --max-agents {{workers}}
+
+# Spawn workers
+{{#each workers}}
+claude -p "
+You are worker-{{@index}}.
+TASK: {{task}}
+
+1. Search: memory_search(query='{{task_keywords}}')
+2. Execute your assigned work
+3. Store: memory_store(key='result-{{@index}}', namespace='results', upsert=true)
+" --session-id task-{{@index}} &
+{{/each}}
+
+echo "Spawned {{workers}} headless workers"
+```
+
+## After Spawning
+
+Use `/dual-collect` to gather results:
+```
+/dual-collect --namespace results
+```
+
+Or check manually:
+```bash
+npx claude-flow memory list --namespace results
+```
diff --git a/v3/@claude-flow/cli/.claude/skills/flow-nexus-neural/SKILL.md b/v3/@claude-flow/cli/.claude/skills/flow-nexus-neural/SKILL.md
new file mode 100644
index 0000000000..c76b6ca12c
--- /dev/null
+++ b/v3/@claude-flow/cli/.claude/skills/flow-nexus-neural/SKILL.md
@@ -0,0 +1,727 @@
+---
+name: flow-nexus-neural
+description: Train and deploy neural networks in distributed E2B sandboxes with Flow Nexus
+---
+
+# Flow Nexus Neural Networks
+
+Deploy, train, and manage neural networks in distributed E2B sandbox environments. Train custom models with multiple architectures (feedforward, LSTM, GAN, transformer) or use pre-built templates from the marketplace.
+
+## Prerequisites
+
+```bash
+# Add Flow Nexus MCP server
+claude mcp add flow-nexus npx flow-nexus@latest mcp start
+
+# Register and login
+npx flow-nexus@latest register
+npx flow-nexus@latest login
+```
+
+## Core Capabilities
+
+### 1. Single-Node Neural Training
+
+Train neural networks with custom architectures and configurations.
+
+**Available Architectures:**
+- `feedforward` - Standard fully-connected networks
+- `lstm` - Long Short-Term Memory for sequences
+- `gan` - Generative Adversarial Networks
+- `autoencoder` - Dimensionality reduction
+- `transformer` - Attention-based models
+
+**Training Tiers:**
+- `nano` - Minimal resources (fast, limited)
+- `mini` - Small models
+- `small` - Standard models
+- `medium` - Complex models
+- `large` - Large-scale training
+
+#### Example: Train Custom Classifier
+
+```javascript
+mcp__flow-nexus__neural_train({
+ config: {
+ architecture: {
+ type: "feedforward",
+ layers: [
+ { type: "dense", units: 256, activation: "relu" },
+ { type: "dropout", rate: 0.3 },
+ { type: "dense", units: 128, activation: "relu" },
+ { type: "dropout", rate: 0.2 },
+ { type: "dense", units: 64, activation: "relu" },
+ { type: "dense", units: 10, activation: "softmax" }
+ ]
+ },
+ training: {
+ epochs: 100,
+ batch_size: 32,
+ learning_rate: 0.001,
+ optimizer: "adam"
+ },
+ divergent: {
+ enabled: true,
+ pattern: "lateral", // quantum, chaotic, associative, evolutionary
+ factor: 0.5
+ }
+ },
+ tier: "small",
+ user_id: "your_user_id"
+})
+```
+
+#### Example: LSTM for Time Series
+
+```javascript
+mcp__flow-nexus__neural_train({
+ config: {
+ architecture: {
+ type: "lstm",
+ layers: [
+ { type: "lstm", units: 128, return_sequences: true },
+ { type: "dropout", rate: 0.2 },
+ { type: "lstm", units: 64 },
+ { type: "dense", units: 1, activation: "linear" }
+ ]
+ },
+ training: {
+ epochs: 150,
+ batch_size: 64,
+ learning_rate: 0.01,
+ optimizer: "adam"
+ }
+ },
+ tier: "medium"
+})
+```
+
+#### Example: Transformer Architecture
+
+```javascript
+mcp__flow-nexus__neural_train({
+ config: {
+ architecture: {
+ type: "transformer",
+ layers: [
+ { type: "embedding", vocab_size: 10000, embedding_dim: 512 },
+ { type: "transformer_encoder", num_heads: 8, ff_dim: 2048 },
+ { type: "global_average_pooling" },
+ { type: "dense", units: 128, activation: "relu" },
+ { type: "dense", units: 2, activation: "softmax" }
+ ]
+ },
+ training: {
+ epochs: 50,
+ batch_size: 16,
+ learning_rate: 0.0001,
+ optimizer: "adam"
+ }
+ },
+ tier: "large"
+})
+```
+
+### 2. Model Inference
+
+Run predictions on trained models.
+
+```javascript
+mcp__flow-nexus__neural_predict({
+ model_id: "model_abc123",
+ input: [
+ [0.5, 0.3, 0.2, 0.1],
+ [0.8, 0.1, 0.05, 0.05],
+ [0.2, 0.6, 0.15, 0.05]
+ ],
+ user_id: "your_user_id"
+})
+```
+
+**Response:**
+```json
+{
+ "predictions": [
+ [0.12, 0.85, 0.03],
+ [0.89, 0.08, 0.03],
+ [0.05, 0.92, 0.03]
+ ],
+ "inference_time_ms": 45,
+ "model_version": "1.0.0"
+}
+```
+
+### 3. Template Marketplace
+
+Browse and deploy pre-trained models from the marketplace.
+
+#### List Available Templates
+
+```javascript
+mcp__flow-nexus__neural_list_templates({
+ category: "classification", // timeseries, regression, nlp, vision, anomaly, generative
+ tier: "free", // or "paid"
+ search: "sentiment",
+ limit: 20
+})
+```
+
+**Response:**
+```json
+{
+ "templates": [
+ {
+ "id": "sentiment-analysis-v2",
+ "name": "Sentiment Analysis Classifier",
+ "description": "Pre-trained BERT model for sentiment analysis",
+ "category": "nlp",
+ "accuracy": 0.94,
+ "downloads": 1523,
+ "tier": "free"
+ },
+ {
+ "id": "image-classifier-resnet",
+ "name": "ResNet Image Classifier",
+ "description": "ResNet-50 for image classification",
+ "category": "vision",
+ "accuracy": 0.96,
+ "downloads": 2341,
+ "tier": "paid"
+ }
+ ]
+}
+```
+
+#### Deploy Template
+
+```javascript
+mcp__flow-nexus__neural_deploy_template({
+ template_id: "sentiment-analysis-v2",
+ custom_config: {
+ training: {
+ epochs: 50,
+ learning_rate: 0.0001
+ }
+ },
+ user_id: "your_user_id"
+})
+```
+
+### 4. Distributed Training Clusters
+
+Train large models across multiple E2B sandboxes with distributed computing.
+
+#### Initialize Cluster
+
+```javascript
+mcp__flow-nexus__neural_cluster_init({
+ name: "large-model-cluster",
+ architecture: "transformer", // transformer, cnn, rnn, gnn, hybrid
+ topology: "mesh", // mesh, ring, star, hierarchical
+ consensus: "proof-of-learning", // byzantine, raft, gossip
+ daaEnabled: true, // Decentralized Autonomous Agents
+ wasmOptimization: true
+})
+```
+
+**Response:**
+```json
+{
+ "cluster_id": "cluster_xyz789",
+ "name": "large-model-cluster",
+ "status": "initializing",
+ "topology": "mesh",
+ "max_nodes": 100,
+ "created_at": "2025-10-19T10:30:00Z"
+}
+```
+
+#### Deploy Worker Nodes
+
+```javascript
+// Deploy parameter server
+mcp__flow-nexus__neural_node_deploy({
+ cluster_id: "cluster_xyz789",
+ node_type: "parameter_server",
+ model: "large",
+ template: "nodejs",
+ capabilities: ["parameter_management", "gradient_aggregation"],
+ autonomy: 0.8
+})
+
+// Deploy worker nodes
+mcp__flow-nexus__neural_node_deploy({
+ cluster_id: "cluster_xyz789",
+ node_type: "worker",
+ model: "xl",
+ role: "worker",
+ capabilities: ["training", "inference"],
+ layers: [
+ { type: "transformer_encoder", num_heads: 16 },
+ { type: "feed_forward", units: 4096 }
+ ],
+ autonomy: 0.9
+})
+
+// Deploy aggregator
+mcp__flow-nexus__neural_node_deploy({
+ cluster_id: "cluster_xyz789",
+ node_type: "aggregator",
+ model: "large",
+ capabilities: ["gradient_aggregation", "model_synchronization"]
+})
+```
+
+#### Connect Cluster Topology
+
+```javascript
+mcp__flow-nexus__neural_cluster_connect({
+ cluster_id: "cluster_xyz789",
+ topology: "mesh" // Override default if needed
+})
+```
+
+#### Start Distributed Training
+
+```javascript
+mcp__flow-nexus__neural_train_distributed({
+ cluster_id: "cluster_xyz789",
+ dataset: "imagenet", // or custom dataset identifier
+ epochs: 100,
+ batch_size: 128,
+ learning_rate: 0.001,
+ optimizer: "adam", // sgd, rmsprop, adagrad
+ federated: true // Enable federated learning
+})
+```
+
+**Federated Learning Example:**
+```javascript
+mcp__flow-nexus__neural_train_distributed({
+ cluster_id: "cluster_xyz789",
+ dataset: "medical_images_distributed",
+ epochs: 200,
+ batch_size: 64,
+ learning_rate: 0.0001,
+ optimizer: "adam",
+ federated: true, // Data stays on local nodes
+ aggregation_rounds: 50,
+ min_nodes_per_round: 5
+})
+```
+
+#### Monitor Cluster Status
+
+```javascript
+mcp__flow-nexus__neural_cluster_status({
+ cluster_id: "cluster_xyz789"
+})
+```
+
+**Response:**
+```json
+{
+ "cluster_id": "cluster_xyz789",
+ "status": "training",
+ "nodes": [
+ {
+ "node_id": "node_001",
+ "type": "parameter_server",
+ "status": "active",
+ "cpu_usage": 0.75,
+ "memory_usage": 0.82
+ },
+ {
+ "node_id": "node_002",
+ "type": "worker",
+ "status": "active",
+ "training_progress": 0.45
+ }
+ ],
+ "training_metrics": {
+ "current_epoch": 45,
+ "total_epochs": 100,
+ "loss": 0.234,
+ "accuracy": 0.891
+ }
+}
+```
+
+#### Run Distributed Inference
+
+```javascript
+mcp__flow-nexus__neural_predict_distributed({
+ cluster_id: "cluster_xyz789",
+ input_data: JSON.stringify([
+ [0.1, 0.2, 0.3],
+ [0.4, 0.5, 0.6]
+ ]),
+ aggregation: "ensemble" // mean, majority, weighted, ensemble
+})
+```
+
+#### Terminate Cluster
+
+```javascript
+mcp__flow-nexus__neural_cluster_terminate({
+ cluster_id: "cluster_xyz789"
+})
+```
+
+### 5. Model Management
+
+#### List Your Models
+
+```javascript
+mcp__flow-nexus__neural_list_models({
+ user_id: "your_user_id",
+ include_public: true
+})
+```
+
+**Response:**
+```json
+{
+ "models": [
+ {
+ "model_id": "model_abc123",
+ "name": "Custom Classifier v1",
+ "architecture": "feedforward",
+ "accuracy": 0.92,
+ "created_at": "2025-10-15T14:20:00Z",
+ "status": "trained"
+ },
+ {
+ "model_id": "model_def456",
+ "name": "LSTM Forecaster",
+ "architecture": "lstm",
+ "mse": 0.0045,
+ "created_at": "2025-10-18T09:15:00Z",
+ "status": "training"
+ }
+ ]
+}
+```
+
+#### Check Training Status
+
+```javascript
+mcp__flow-nexus__neural_training_status({
+ job_id: "job_training_xyz"
+})
+```
+
+**Response:**
+```json
+{
+ "job_id": "job_training_xyz",
+ "status": "training",
+ "progress": 0.67,
+ "current_epoch": 67,
+ "total_epochs": 100,
+ "current_loss": 0.234,
+ "estimated_completion": "2025-10-19T12:45:00Z"
+}
+```
+
+#### Performance Benchmarking
+
+```javascript
+mcp__flow-nexus__neural_performance_benchmark({
+ model_id: "model_abc123",
+ benchmark_type: "comprehensive" // inference, throughput, memory, comprehensive
+})
+```
+
+**Response:**
+```json
+{
+ "model_id": "model_abc123",
+ "benchmarks": {
+ "inference_latency_ms": 12.5,
+ "throughput_qps": 8000,
+ "memory_usage_mb": 245,
+ "gpu_utilization": 0.78,
+ "accuracy": 0.92,
+ "f1_score": 0.89
+ },
+ "timestamp": "2025-10-19T11:00:00Z"
+}
+```
+
+#### Create Validation Workflow
+
+```javascript
+mcp__flow-nexus__neural_validation_workflow({
+ model_id: "model_abc123",
+ user_id: "your_user_id",
+ validation_type: "comprehensive" // performance, accuracy, robustness, comprehensive
+})
+```
+
+### 6. Publishing and Marketplace
+
+#### Publish Model as Template
+
+```javascript
+mcp__flow-nexus__neural_publish_template({
+ model_id: "model_abc123",
+ name: "High-Accuracy Sentiment Classifier",
+ description: "Fine-tuned BERT model for sentiment analysis with 94% accuracy",
+ category: "nlp",
+ price: 0, // 0 for free, or credits amount
+ user_id: "your_user_id"
+})
+```
+
+#### Rate a Template
+
+```javascript
+mcp__flow-nexus__neural_rate_template({
+ template_id: "sentiment-analysis-v2",
+ rating: 5,
+ review: "Excellent model! Achieved 95% accuracy on my dataset.",
+ user_id: "your_user_id"
+})
+```
+
+## Common Use Cases
+
+### Image Classification with CNN
+
+```javascript
+// Initialize cluster for large-scale image training
+const cluster = await mcp__flow-nexus__neural_cluster_init({
+ name: "image-classification-cluster",
+ architecture: "cnn",
+ topology: "hierarchical",
+ wasmOptimization: true
+})
+
+// Deploy worker nodes
+await mcp__flow-nexus__neural_node_deploy({
+ cluster_id: cluster.cluster_id,
+ node_type: "worker",
+ model: "large",
+ capabilities: ["training", "data_augmentation"]
+})
+
+// Start training
+await mcp__flow-nexus__neural_train_distributed({
+ cluster_id: cluster.cluster_id,
+ dataset: "custom_images",
+ epochs: 100,
+ batch_size: 64,
+ learning_rate: 0.001,
+ optimizer: "adam"
+})
+```
+
+### NLP Sentiment Analysis
+
+```javascript
+// Use pre-built template
+const deployment = await mcp__flow-nexus__neural_deploy_template({
+ template_id: "sentiment-analysis-v2",
+ custom_config: {
+ training: {
+ epochs: 30,
+ batch_size: 16
+ }
+ }
+})
+
+// Run inference
+const result = await mcp__flow-nexus__neural_predict({
+ model_id: deployment.model_id,
+ input: ["This product is amazing!", "Terrible experience."]
+})
+```
+
+### Time Series Forecasting
+
+```javascript
+// Train LSTM model
+const training = await mcp__flow-nexus__neural_train({
+ config: {
+ architecture: {
+ type: "lstm",
+ layers: [
+ { type: "lstm", units: 128, return_sequences: true },
+ { type: "dropout", rate: 0.2 },
+ { type: "lstm", units: 64 },
+ { type: "dense", units: 1 }
+ ]
+ },
+ training: {
+ epochs: 150,
+ batch_size: 64,
+ learning_rate: 0.01,
+ optimizer: "adam"
+ }
+ },
+ tier: "medium"
+})
+
+// Monitor progress
+const status = await mcp__flow-nexus__neural_training_status({
+ job_id: training.job_id
+})
+```
+
+### Federated Learning for Privacy
+
+```javascript
+// Initialize federated cluster
+const cluster = await mcp__flow-nexus__neural_cluster_init({
+ name: "federated-medical-cluster",
+ architecture: "transformer",
+ topology: "mesh",
+ consensus: "proof-of-learning",
+ daaEnabled: true
+})
+
+// Deploy nodes across different locations
+for (let i = 0; i < 5; i++) {
+ await mcp__flow-nexus__neural_node_deploy({
+ cluster_id: cluster.cluster_id,
+ node_type: "worker",
+ model: "large",
+ autonomy: 0.9
+ })
+}
+
+// Train with federated learning (data never leaves nodes)
+await mcp__flow-nexus__neural_train_distributed({
+ cluster_id: cluster.cluster_id,
+ dataset: "medical_records_distributed",
+ epochs: 200,
+ federated: true,
+ aggregation_rounds: 100
+})
+```
+
+## Architecture Patterns
+
+### Feedforward Networks
+Best for: Classification, regression, simple pattern recognition
+```javascript
+{
+ type: "feedforward",
+ layers: [
+ { type: "dense", units: 256, activation: "relu" },
+ { type: "dropout", rate: 0.3 },
+ { type: "dense", units: 128, activation: "relu" },
+ { type: "dense", units: 10, activation: "softmax" }
+ ]
+}
+```
+
+### LSTM Networks
+Best for: Time series, sequences, forecasting
+```javascript
+{
+ type: "lstm",
+ layers: [
+ { type: "lstm", units: 128, return_sequences: true },
+ { type: "lstm", units: 64 },
+ { type: "dense", units: 1 }
+ ]
+}
+```
+
+### Transformers
+Best for: NLP, attention mechanisms, large-scale text
+```javascript
+{
+ type: "transformer",
+ layers: [
+ { type: "embedding", vocab_size: 10000, embedding_dim: 512 },
+ { type: "transformer_encoder", num_heads: 8, ff_dim: 2048 },
+ { type: "global_average_pooling" },
+ { type: "dense", units: 2, activation: "softmax" }
+ ]
+}
+```
+
+### GANs
+Best for: Generative tasks, image synthesis
+```javascript
+{
+ type: "gan",
+ generator_layers: [...],
+ discriminator_layers: [...]
+}
+```
+
+### Autoencoders
+Best for: Dimensionality reduction, anomaly detection
+```javascript
+{
+ type: "autoencoder",
+ encoder_layers: [
+ { type: "dense", units: 128, activation: "relu" },
+ { type: "dense", units: 64, activation: "relu" }
+ ],
+ decoder_layers: [
+ { type: "dense", units: 128, activation: "relu" },
+ { type: "dense", units: input_dim, activation: "sigmoid" }
+ ]
+}
+```
+
+## Best Practices
+
+1. **Start Small**: Begin with `nano` or `mini` tiers for experimentation
+2. **Use Templates**: Leverage marketplace templates for common tasks
+3. **Monitor Training**: Check status regularly to catch issues early
+4. **Benchmark Models**: Always benchmark before production deployment
+5. **Distributed Training**: Use clusters for large models (>1B parameters)
+6. **Federated Learning**: Use for privacy-sensitive data
+7. **Version Models**: Publish successful models as templates for reuse
+8. **Validate Thoroughly**: Use validation workflows before deployment
+
+## Troubleshooting
+
+### Training Stalled
+```javascript
+// Check cluster status
+const status = await mcp__flow-nexus__neural_cluster_status({
+ cluster_id: "cluster_id"
+})
+
+// Terminate and restart if needed
+await mcp__flow-nexus__neural_cluster_terminate({
+ cluster_id: "cluster_id"
+})
+```
+
+### Low Accuracy
+- Increase epochs
+- Adjust learning rate
+- Add regularization (dropout)
+- Try different optimizer
+- Use data augmentation
+
+### Out of Memory
+- Reduce batch size
+- Use smaller model tier
+- Enable gradient accumulation
+- Use distributed training
+
+## Related Skills
+
+- `flow-nexus-sandbox` - E2B sandbox management
+- `flow-nexus-swarm` - AI swarm orchestration
+- `flow-nexus-workflow` - Workflow automation
+
+## Resources
+
+- Flow Nexus Docs: https://flow-nexus.ruv.io/docs
+- Neural Network Guide: https://flow-nexus.ruv.io/docs/neural
+- Template Marketplace: https://flow-nexus.ruv.io/templates
+- API Reference: https://flow-nexus.ruv.io/api
+
+---
+
+**Note**: Distributed training requires authentication. Register at https://flow-nexus.ruv.io or use `npx flow-nexus@latest register`.
diff --git a/v3/@claude-flow/cli/.claude/skills/flow-nexus-platform/SKILL.md b/v3/@claude-flow/cli/.claude/skills/flow-nexus-platform/SKILL.md
new file mode 100644
index 0000000000..a1e43a6328
--- /dev/null
+++ b/v3/@claude-flow/cli/.claude/skills/flow-nexus-platform/SKILL.md
@@ -0,0 +1,1154 @@
+---
+name: flow-nexus-platform
+description: |
+ Comprehensive Flow Nexus platform management - authentication, sandboxes, app deployment, payments, and challenges
+---
+
+# Flow Nexus Platform Management
+
+Comprehensive platform management for Flow Nexus - covering authentication, sandbox execution, app deployment, credit management, and coding challenges.
+
+## Table of Contents
+1. [Authentication & User Management](#authentication--user-management)
+2. [Sandbox Management](#sandbox-management)
+3. [App Store & Deployment](#app-store--deployment)
+4. [Payments & Credits](#payments--credits)
+5. [Challenges & Achievements](#challenges--achievements)
+6. [Storage & Real-time](#storage--real-time)
+7. [System Utilities](#system-utilities)
+
+---
+
+## Authentication & User Management
+
+### Registration & Login
+
+**Register New Account**
+```javascript
+mcp__flow-nexus__user_register({
+ email: "[email protected]",
+ password: "secure_password",
+ full_name: "Your Name",
+ username: "unique_username" // optional
+})
+```
+
+**Login**
+```javascript
+mcp__flow-nexus__user_login({
+ email: "[email protected]",
+ password: "your_password"
+})
+```
+
+**Check Authentication Status**
+```javascript
+mcp__flow-nexus__auth_status({ detailed: true })
+```
+
+**Logout**
+```javascript
+mcp__flow-nexus__user_logout()
+```
+
+### Password Management
+
+**Request Password Reset**
+```javascript
+mcp__flow-nexus__user_reset_password({
+})
+```
+
+**Update Password with Token**
+```javascript
+mcp__flow-nexus__user_update_password({
+ token: "reset_token_from_email",
+ new_password: "new_secure_password"
+})
+```
+
+**Verify Email**
+```javascript
+mcp__flow-nexus__user_verify_email({
+ token: "verification_token_from_email"
+})
+```
+
+### Profile Management
+
+**Get User Profile**
+```javascript
+mcp__flow-nexus__user_profile({
+ user_id: "your_user_id"
+})
+```
+
+**Update Profile**
+```javascript
+mcp__flow-nexus__user_update_profile({
+ user_id: "your_user_id",
+ updates: {
+ full_name: "Updated Name",
+ bio: "AI Developer and researcher",
+ github_username: "yourusername",
+ twitter_handle: "@yourhandle"
+ }
+})
+```
+
+**Get User Statistics**
+```javascript
+mcp__flow-nexus__user_stats({
+ user_id: "your_user_id"
+})
+```
+
+**Upgrade User Tier**
+```javascript
+mcp__flow-nexus__user_upgrade({
+ user_id: "your_user_id",
+ tier: "pro" // pro, enterprise
+})
+```
+
+---
+
+## Sandbox Management
+
+### Create & Configure Sandboxes
+
+**Create Sandbox**
+```javascript
+mcp__flow-nexus__sandbox_create({
+ template: "node", // node, python, react, nextjs, vanilla, base, claude-code
+ name: "my-sandbox",
+ env_vars: {
+ API_KEY: "your_api_key",
+ NODE_ENV: "development",
+ DATABASE_URL: "postgres://..."
+ },
+ install_packages: ["express", "cors", "dotenv"],
+ startup_script: "npm run dev",
+ timeout: 3600, // seconds
+ metadata: {
+ project: "my-project",
+ environment: "staging"
+ }
+})
+```
+
+**Configure Existing Sandbox**
+```javascript
+mcp__flow-nexus__sandbox_configure({
+ sandbox_id: "sandbox_id",
+ env_vars: {
+ NEW_VAR: "value"
+ },
+ install_packages: ["axios", "lodash"],
+ run_commands: ["npm run migrate", "npm run seed"],
+ anthropic_key: "sk-ant-..." // For Claude Code integration
+})
+```
+
+### Execute Code
+
+**Run Code in Sandbox**
+```javascript
+mcp__flow-nexus__sandbox_execute({
+ sandbox_id: "sandbox_id",
+ code: `
+ console.log('Hello from sandbox!');
+ const result = await fetch('https://api.example.com/data');
+ const data = await result.json();
+ return data;
+ `,
+ language: "javascript",
+ capture_output: true,
+ timeout: 60, // seconds
+ working_dir: "/app",
+ env_vars: {
+ TEMP_VAR: "override"
+ }
+})
+```
+
+### Manage Sandboxes
+
+**List Sandboxes**
+```javascript
+mcp__flow-nexus__sandbox_list({
+ status: "running" // running, stopped, all
+})
+```
+
+**Get Sandbox Status**
+```javascript
+mcp__flow-nexus__sandbox_status({
+ sandbox_id: "sandbox_id"
+})
+```
+
+**Upload File to Sandbox**
+```javascript
+mcp__flow-nexus__sandbox_upload({
+ sandbox_id: "sandbox_id",
+ file_path: "/app/config/database.json",
+ content: JSON.stringify(databaseConfig, null, 2)
+})
+```
+
+**Get Sandbox Logs**
+```javascript
+mcp__flow-nexus__sandbox_logs({
+ sandbox_id: "sandbox_id",
+ lines: 100 // max 1000
+})
+```
+
+**Stop Sandbox**
+```javascript
+mcp__flow-nexus__sandbox_stop({
+ sandbox_id: "sandbox_id"
+})
+```
+
+**Delete Sandbox**
+```javascript
+mcp__flow-nexus__sandbox_delete({
+ sandbox_id: "sandbox_id"
+})
+```
+
+### Sandbox Templates
+
+- **node**: Node.js environment with npm
+- **python**: Python 3.x with pip
+- **react**: React development setup
+- **nextjs**: Next.js full-stack framework
+- **vanilla**: Basic HTML/CSS/JS
+- **base**: Minimal Linux environment
+- **claude-code**: Claude Code integrated environment
+
+### Common Sandbox Patterns
+
+**API Development Sandbox**
+```javascript
+mcp__flow-nexus__sandbox_create({
+ template: "node",
+ name: "api-development",
+ install_packages: [
+ "express",
+ "cors",
+ "helmet",
+ "dotenv",
+ "jsonwebtoken",
+ "bcrypt"
+ ],
+ env_vars: {
+ PORT: "3000",
+ NODE_ENV: "development"
+ },
+ startup_script: "npm run dev"
+})
+```
+
+**Machine Learning Sandbox**
+```javascript
+mcp__flow-nexus__sandbox_create({
+ template: "python",
+ name: "ml-training",
+ install_packages: [
+ "numpy",
+ "pandas",
+ "scikit-learn",
+ "matplotlib",
+ "tensorflow"
+ ],
+ env_vars: {
+ CUDA_VISIBLE_DEVICES: "0"
+ }
+})
+```
+
+**Full-Stack Development**
+```javascript
+mcp__flow-nexus__sandbox_create({
+ template: "nextjs",
+ name: "fullstack-app",
+ install_packages: [
+ "prisma",
+ "@prisma/client",
+ "next-auth",
+ "zod"
+ ],
+ env_vars: {
+ DATABASE_URL: "postgresql://...",
+ NEXTAUTH_SECRET: "secret"
+ }
+})
+```
+
+---
+
+## App Store & Deployment
+
+### Browse & Search
+
+**Search Applications**
+```javascript
+mcp__flow-nexus__app_search({
+ search: "authentication api",
+ category: "backend",
+ featured: true,
+ limit: 20
+})
+```
+
+**Get App Details**
+```javascript
+mcp__flow-nexus__app_get({
+ app_id: "app_id"
+})
+```
+
+**List Templates**
+```javascript
+mcp__flow-nexus__app_store_list_templates({
+ category: "web-api",
+ tags: ["express", "jwt", "typescript"],
+ limit: 20
+})
+```
+
+**Get Template Details**
+```javascript
+mcp__flow-nexus__template_get({
+ template_name: "express-api-starter",
+ template_id: "template_id" // alternative
+})
+```
+
+**List All Available Templates**
+```javascript
+mcp__flow-nexus__template_list({
+ category: "backend",
+ template_type: "starter",
+ featured: true,
+ limit: 50
+})
+```
+
+### Publish Applications
+
+**Publish App to Store**
+```javascript
+mcp__flow-nexus__app_store_publish_app({
+ name: "JWT Authentication Service",
+ description: "Production-ready JWT authentication microservice with refresh tokens",
+ category: "backend",
+ version: "1.0.0",
+ source_code: sourceCodeString,
+ tags: ["auth", "jwt", "express", "typescript", "security"],
+ metadata: {
+ author: "Your Name",
+ license: "MIT",
+ repository: "github.com/username/repo",
+ homepage: "https://yourapp.com",
+ documentation: "https://docs.yourapp.com"
+ }
+})
+```
+
+**Update Application**
+```javascript
+mcp__flow-nexus__app_update({
+ app_id: "app_id",
+ updates: {
+ version: "1.1.0",
+ description: "Added OAuth2 support",
+ tags: ["auth", "jwt", "oauth2", "express"],
+ source_code: updatedSourceCode
+ }
+})
+```
+
+### Deploy Templates
+
+**Deploy Template**
+```javascript
+mcp__flow-nexus__template_deploy({
+ template_name: "express-api-starter",
+ deployment_name: "my-production-api",
+ variables: {
+ api_key: "your_api_key",
+ database_url: "postgres://user:pass@host:5432/db",
+ redis_url: "redis://localhost:6379"
+ },
+ env_vars: {
+ NODE_ENV: "production",
+ PORT: "8080",
+ LOG_LEVEL: "info"
+ }
+})
+```
+
+### Analytics & Management
+
+**Get App Analytics**
+```javascript
+mcp__flow-nexus__app_analytics({
+ app_id: "your_app_id",
+ timeframe: "30d" // 24h, 7d, 30d, 90d
+})
+```
+
+**View Installed Apps**
+```javascript
+mcp__flow-nexus__app_installed({
+ user_id: "your_user_id"
+})
+```
+
+**Get Market Statistics**
+```javascript
+mcp__flow-nexus__market_data()
+```
+
+### App Categories
+
+- **web-api**: RESTful APIs and microservices
+- **frontend**: React, Vue, Angular applications
+- **full-stack**: Complete end-to-end applications
+- **cli-tools**: Command-line utilities
+- **data-processing**: ETL pipelines and analytics
+- **ml-models**: Pre-trained machine learning models
+- **blockchain**: Web3 and blockchain applications
+- **mobile**: React Native and mobile apps
+
+### Publishing Best Practices
+
+1. **Documentation**: Include comprehensive README with setup instructions
+2. **Examples**: Provide usage examples and sample configurations
+3. **Testing**: Include test suite and CI/CD configuration
+4. **Versioning**: Use semantic versioning (MAJOR.MINOR.PATCH)
+5. **Licensing**: Add clear license information (MIT, Apache, etc.)
+6. **Deployment**: Include Docker/docker-compose configurations
+7. **Migrations**: Provide upgrade guides for version updates
+8. **Security**: Document security considerations and best practices
+
+### Revenue Sharing
+
+- Earn rUv credits when others deploy your templates
+- Set pricing (0 for free, or credits for premium)
+- Track usage and earnings via analytics
+- Withdraw credits or use for Flow Nexus services
+
+---
+
+## Payments & Credits
+
+### Balance & Credits
+
+**Check Credit Balance**
+```javascript
+mcp__flow-nexus__check_balance()
+```
+
+**Check rUv Balance**
+```javascript
+mcp__flow-nexus__ruv_balance({
+ user_id: "your_user_id"
+})
+```
+
+**View Transaction History**
+```javascript
+mcp__flow-nexus__ruv_history({
+ user_id: "your_user_id",
+ limit: 100
+})
+```
+
+**Get Payment History**
+```javascript
+mcp__flow-nexus__get_payment_history({
+ limit: 50
+})
+```
+
+### Purchase Credits
+
+**Create Payment Link**
+```javascript
+mcp__flow-nexus__create_payment_link({
+ amount: 50 // USD, minimum $10
+})
+// Returns secure Stripe payment URL
+```
+
+### Auto-Refill Configuration
+
+**Enable Auto-Refill**
+```javascript
+mcp__flow-nexus__configure_auto_refill({
+ enabled: true,
+ threshold: 100, // Refill when credits drop below 100
+ amount: 50 // Purchase $50 worth of credits
+})
+```
+
+**Disable Auto-Refill**
+```javascript
+mcp__flow-nexus__configure_auto_refill({
+ enabled: false
+})
+```
+
+### Credit Pricing
+
+**Service Costs:**
+- **Swarm Operations**: 1-10 credits/hour
+- **Sandbox Execution**: 0.5-5 credits/hour
+- **Neural Training**: 5-50 credits/job
+- **Workflow Runs**: 0.1-1 credit/execution
+- **Storage**: 0.01 credits/GB/day
+- **API Calls**: 0.001-0.01 credits/request
+
+### Earning Credits
+
+**Ways to Earn:**
+1. **Complete Challenges**: 10-500 credits per challenge
+2. **Publish Templates**: Earn when others deploy (you set pricing)
+3. **Referral Program**: Bonus credits for user invites
+4. **Daily Login**: Small daily bonus (5-10 credits)
+5. **Achievements**: Unlock milestone rewards (50-1000 credits)
+6. **App Store Sales**: Revenue share from paid templates
+
+**Earn Credits Programmatically**
+```javascript
+mcp__flow-nexus__app_store_earn_ruv({
+ user_id: "your_user_id",
+ amount: 100,
+ reason: "Completed expert algorithm challenge",
+ source: "challenge" // challenge, app_usage, referral, etc.
+})
+```
+
+### Subscription Tiers
+
+**Free Tier**
+- 100 free credits monthly
+- Basic sandbox access (2 concurrent)
+- Limited swarm agents (3 max)
+- Community support
+- 1GB storage
+
+**Pro Tier ($29/month)**
+- 1000 credits monthly
+- Priority sandbox access (10 concurrent)
+- Unlimited swarm agents
+- Advanced workflows
+- Email support
+- 10GB storage
+- Early access to features
+
+**Enterprise Tier (Custom Pricing)**
+- Unlimited credits
+- Dedicated compute resources
+- Custom neural models
+- 99.9% SLA guarantee
+- Priority 24/7 support
+- Unlimited storage
+- White-label options
+- On-premise deployment
+
+### Cost Optimization Tips
+
+1. **Use Smaller Sandboxes**: Choose appropriate templates (base vs full-stack)
+2. **Optimize Neural Training**: Tune hyperparameters, reduce epochs
+3. **Batch Operations**: Group workflow executions together
+4. **Clean Up Resources**: Delete unused sandboxes and storage
+5. **Monitor Usage**: Check `user_stats` regularly
+6. **Use Free Templates**: Leverage community templates
+7. **Schedule Off-Peak**: Run heavy jobs during low-cost periods
+
+---
+
+## Challenges & Achievements
+
+### Browse Challenges
+
+**List Available Challenges**
+```javascript
+mcp__flow-nexus__challenges_list({
+ difficulty: "intermediate", // beginner, intermediate, advanced, expert
+ category: "algorithms",
+ status: "active", // active, completed, locked
+ limit: 20
+})
+```
+
+**Get Challenge Details**
+```javascript
+mcp__flow-nexus__challenge_get({
+ challenge_id: "two-sum-problem"
+})
+```
+
+### Submit Solutions
+
+**Submit Challenge Solution**
+```javascript
+mcp__flow-nexus__challenge_submit({
+ challenge_id: "challenge_id",
+ user_id: "your_user_id",
+ solution_code: `
+ function twoSum(nums, target) {
+ const map = new Map();
+ for (let i = 0; i < nums.length; i++) {
+ const complement = target - nums[i];
+ if (map.has(complement)) {
+ return [map.get(complement), i];
+ }
+ map.set(nums[i], i);
+ }
+ return [];
+ }
+ `,
+ language: "javascript",
+ execution_time: 45 // milliseconds (optional)
+})
+```
+
+**Mark Challenge as Complete**
+```javascript
+mcp__flow-nexus__app_store_complete_challenge({
+ challenge_id: "challenge_id",
+ user_id: "your_user_id",
+ submission_data: {
+ passed_tests: 10,
+ total_tests: 10,
+ execution_time: 45,
+ memory_usage: 2048 // KB
+ }
+})
+```
+
+### Leaderboards
+
+**Global Leaderboard**
+```javascript
+mcp__flow-nexus__leaderboard_get({
+ type: "global", // global, weekly, monthly, challenge
+ limit: 100
+})
+```
+
+**Challenge-Specific Leaderboard**
+```javascript
+mcp__flow-nexus__leaderboard_get({
+ type: "challenge",
+ challenge_id: "specific_challenge_id",
+ limit: 50
+})
+```
+
+### Achievements & Badges
+
+**List User Achievements**
+```javascript
+mcp__flow-nexus__achievements_list({
+ user_id: "your_user_id",
+ category: "speed_demon" // Optional filter
+})
+```
+
+### Challenge Categories
+
+- **algorithms**: Classic algorithm problems (sorting, searching, graphs)
+- **data-structures**: DS implementation (trees, heaps, tries)
+- **system-design**: Architecture and scalability challenges
+- **optimization**: Performance and efficiency problems
+- **security**: Security-focused vulnerabilities and fixes
+- **ml-basics**: Machine learning fundamentals
+- **distributed-systems**: Concurrency and distributed computing
+- **databases**: Query optimization and schema design
+
+### Challenge Difficulty Rewards
+
+- **Beginner**: 10-25 credits
+- **Intermediate**: 50-100 credits
+- **Advanced**: 150-300 credits
+- **Expert**: 400-500 credits
+- **Master**: 600-1000 credits
+
+### Achievement Types
+
+- **Speed Demon**: Complete challenges in record time
+- **Code Golf**: Minimize code length
+- **Perfect Score**: 100% test pass rate
+- **Streak Master**: Complete challenges N days in a row
+- **Polyglot**: Solve in multiple languages
+- **Debugger**: Fix broken code challenges
+- **Optimizer**: Achieve top performance benchmarks
+
+### Tips for Success
+
+1. **Start Simple**: Begin with beginner challenges to build confidence
+2. **Review Solutions**: Study top solutions after completing
+3. **Optimize**: Aim for both correctness and performance
+4. **Daily Practice**: Complete daily challenges for bonus credits
+5. **Community**: Engage with discussions and learn from others
+6. **Track Progress**: Monitor achievements and leaderboard position
+7. **Experiment**: Try multiple approaches to problems
+
+---
+
+## Storage & Real-time
+
+### File Storage
+
+**Upload File**
+```javascript
+mcp__flow-nexus__storage_upload({
+ bucket: "my-bucket", // public, private, shared, temp
+ path: "data/users.json",
+ content: JSON.stringify(userData, null, 2),
+ content_type: "application/json"
+})
+```
+
+**List Files**
+```javascript
+mcp__flow-nexus__storage_list({
+ bucket: "my-bucket",
+ path: "data/", // prefix filter
+ limit: 100
+})
+```
+
+**Get Public URL**
+```javascript
+mcp__flow-nexus__storage_get_url({
+ bucket: "my-bucket",
+ path: "data/report.pdf",
+ expires_in: 3600 // seconds (default: 1 hour)
+})
+```
+
+**Delete File**
+```javascript
+mcp__flow-nexus__storage_delete({
+ bucket: "my-bucket",
+ path: "data/old-file.json"
+})
+```
+
+### Storage Buckets
+
+- **public**: Publicly accessible files (CDN-backed)
+- **private**: User-only access with authentication
+- **shared**: Team collaboration with ACL
+- **temp**: Auto-deleted after 24 hours
+
+### Real-time Subscriptions
+
+**Subscribe to Database Changes**
+```javascript
+mcp__flow-nexus__realtime_subscribe({
+ table: "tasks",
+ event: "INSERT", // INSERT, UPDATE, DELETE, *
+ filter: "status=eq.pending AND priority=eq.high"
+})
+```
+
+**List Active Subscriptions**
+```javascript
+mcp__flow-nexus__realtime_list()
+```
+
+**Unsubscribe**
+```javascript
+mcp__flow-nexus__realtime_unsubscribe({
+ subscription_id: "subscription_id"
+})
+```
+
+### Execution Monitoring
+
+**Subscribe to Execution Stream**
+```javascript
+mcp__flow-nexus__execution_stream_subscribe({
+ stream_type: "claude-flow-swarm", // claude-code, claude-flow-swarm, claude-flow-hive-mind, github-integration
+ deployment_id: "deployment_id",
+ sandbox_id: "sandbox_id" // alternative
+})
+```
+
+**Get Stream Status**
+```javascript
+mcp__flow-nexus__execution_stream_status({
+ stream_id: "stream_id"
+})
+```
+
+**List Generated Files**
+```javascript
+mcp__flow-nexus__execution_files_list({
+ stream_id: "stream_id",
+ created_by: "claude-flow", // claude-code, claude-flow, git-clone, user
+ file_type: "javascript" // filter by extension
+})
+```
+
+**Get File Content from Execution**
+```javascript
+mcp__flow-nexus__execution_file_get({
+ file_id: "file_id",
+ file_path: "/path/to/file.js" // alternative
+})
+```
+
+---
+
+## System Utilities
+
+### Queen Seraphina AI Assistant
+
+**Seek Guidance from Seraphina**
+```javascript
+mcp__flow-nexus__seraphina_chat({
+ message: "How should I architect a distributed microservices system?",
+ enable_tools: true, // Allow her to create swarms, deploy code, etc.
+ conversation_history: [
+ { role: "user", content: "I need help with system architecture" },
+ { role: "assistant", content: "I can help you design that. What are your requirements?" }
+ ]
+})
+```
+
+Queen Seraphina is an advanced AI assistant with:
+- Deep expertise in distributed systems
+- Ability to create swarms and orchestrate agents
+- Code deployment and architecture design
+- Multi-turn conversation with context retention
+- Tool usage for hands-on assistance
+
+### System Health & Monitoring
+
+**Check System Health**
+```javascript
+mcp__flow-nexus__system_health()
+```
+
+**View Audit Logs**
+```javascript
+mcp__flow-nexus__audit_log({
+ user_id: "your_user_id", // optional filter
+ limit: 100
+})
+```
+
+### Authentication Management
+
+**Initialize Authentication**
+```javascript
+mcp__flow-nexus__auth_init({
+ mode: "user" // user, service
+})
+```
+
+---
+
+## Quick Start Guide
+
+### Step 1: Register & Login
+
+```javascript
+// Register
+mcp__flow-nexus__user_register({
+ email: "[email protected]",
+ password: "SecurePass123!",
+ full_name: "Developer Name"
+})
+
+// Login
+mcp__flow-nexus__user_login({
+ email: "[email protected]",
+ password: "SecurePass123!"
+})
+
+// Check auth status
+mcp__flow-nexus__auth_status({ detailed: true })
+```
+
+### Step 2: Configure Billing
+
+```javascript
+// Check current balance
+mcp__flow-nexus__check_balance()
+
+// Add credits
+const paymentLink = mcp__flow-nexus__create_payment_link({
+ amount: 50 // $50
+})
+
+// Setup auto-refill
+mcp__flow-nexus__configure_auto_refill({
+ enabled: true,
+ threshold: 100,
+ amount: 50
+})
+```
+
+### Step 3: Create Your First Sandbox
+
+```javascript
+// Create development sandbox
+const sandbox = mcp__flow-nexus__sandbox_create({
+ template: "node",
+ name: "dev-environment",
+ install_packages: ["express", "dotenv"],
+ env_vars: {
+ NODE_ENV: "development"
+ }
+})
+
+// Execute code
+mcp__flow-nexus__sandbox_execute({
+ sandbox_id: sandbox.id,
+ code: 'console.log("Hello Flow Nexus!")',
+ language: "javascript"
+})
+```
+
+### Step 4: Deploy an App
+
+```javascript
+// Browse templates
+mcp__flow-nexus__template_list({
+ category: "backend",
+ featured: true
+})
+
+// Deploy template
+mcp__flow-nexus__template_deploy({
+ template_name: "express-api-starter",
+ deployment_name: "my-api",
+ variables: {
+ database_url: "postgres://..."
+ }
+})
+```
+
+### Step 5: Complete a Challenge
+
+```javascript
+// Find challenges
+mcp__flow-nexus__challenges_list({
+ difficulty: "beginner",
+ category: "algorithms"
+})
+
+// Submit solution
+mcp__flow-nexus__challenge_submit({
+ challenge_id: "fizzbuzz",
+ user_id: "your_id",
+ solution_code: "...",
+ language: "javascript"
+})
+```
+
+---
+
+## Best Practices
+
+### Security
+1. Never hardcode API keys - use environment variables
+2. Enable 2FA when available
+3. Regularly rotate passwords and tokens
+4. Use private buckets for sensitive data
+5. Review audit logs periodically
+6. Set appropriate file expiration times
+
+### Performance
+1. Clean up unused sandboxes to save credits
+2. Use smaller sandbox templates when possible
+3. Optimize storage by deleting old files
+4. Batch operations to reduce API calls
+5. Monitor usage via `user_stats`
+6. Use temp buckets for transient data
+
+### Development
+1. Start with sandbox testing before deployment
+2. Version your applications semantically
+3. Document all templates thoroughly
+4. Include tests in published apps
+5. Use execution monitoring for debugging
+6. Leverage real-time subscriptions for live updates
+
+### Cost Management
+1. Set auto-refill thresholds carefully
+2. Monitor credit usage regularly
+3. Complete daily challenges for bonus credits
+4. Publish templates to earn passive credits
+5. Use free-tier resources when appropriate
+6. Schedule heavy jobs during off-peak times
+
+---
+
+## Troubleshooting
+
+### Authentication Issues
+- **Login Failed**: Check email/password, verify email first
+- **Token Expired**: Re-login to get fresh tokens
+- **Permission Denied**: Check tier limits, upgrade if needed
+
+### Sandbox Issues
+- **Sandbox Won't Start**: Check template compatibility, verify credits
+- **Execution Timeout**: Increase timeout parameter or optimize code
+- **Out of Memory**: Use larger template or optimize memory usage
+- **Package Install Failed**: Check package name, verify npm/pip availability
+
+### Payment Issues
+- **Payment Failed**: Check payment method, sufficient funds
+- **Credits Not Applied**: Allow 5-10 minutes for processing
+- **Auto-refill Not Working**: Verify payment method on file
+
+### Challenge Issues
+- **Submission Rejected**: Check code syntax, ensure all tests pass
+- **Wrong Answer**: Review test cases, check edge cases
+- **Performance Too Slow**: Optimize algorithm complexity
+
+---
+
+## Support & Resources
+
+- **Documentation**: https://docs.flow-nexus.ruv.io
+- **API Reference**: https://api.flow-nexus.ruv.io/docs
+- **Status Page**: https://status.flow-nexus.ruv.io
+- **Community Forum**: https://community.flow-nexus.ruv.io
+- **GitHub Issues**: https://github.com/ruvnet/flow-nexus/issues
+- **Discord**: https://discord.gg/flow-nexus
+- **Email Support**: [email protected] (Pro/Enterprise only)
+
+---
+
+## Progressive Disclosure
+
+<details>
+<summary><strong>Advanced Sandbox Configuration</strong></summary>
+
+### Custom Docker Images
+```javascript
+mcp__flow-nexus__sandbox_create({
+ template: "base",
+ name: "custom-environment",
+ startup_script: `
+ apt-get update
+ apt-get install -y custom-package
+ git clone https://github.com/user/repo
+ cd repo && npm install
+ `
+})
+```
+
+### Multi-Stage Execution
+```javascript
+// Stage 1: Setup
+mcp__flow-nexus__sandbox_execute({
+ sandbox_id: "id",
+ code: "npm install && npm run build"
+})
+
+// Stage 2: Run
+mcp__flow-nexus__sandbox_execute({
+ sandbox_id: "id",
+ code: "npm start",
+ working_dir: "/app/dist"
+})
+```
+
+</details>
+
+<details>
+<summary><strong>Advanced Storage Patterns</strong></summary>
+
+### Large File Upload (Chunked)
+```javascript
+const chunkSize = 5 * 1024 * 1024 // 5MB chunks
+for (let i = 0; i < chunks.length; i++) {
+ await mcp__flow-nexus__storage_upload({
+ bucket: "private",
+ path: `large-file.bin.part${i}`,
+ content: chunks[i]
+ })
+}
+```
+
+### Storage Lifecycle
+```javascript
+// Upload to temp for processing
+mcp__flow-nexus__storage_upload({
+ bucket: "temp",
+ path: "processing/data.json",
+ content: data
+})
+
+// Move to permanent storage after processing
+mcp__flow-nexus__storage_upload({
+ bucket: "private",
+ path: "archive/processed-data.json",
+ content: processedData
+})
+```
+
+</details>
+
+<details>
+<summary><strong>Advanced Real-time Patterns</strong></summary>
+
+### Multi-Table Sync
+```javascript
+const tables = ["users", "tasks", "notifications"]
+tables.forEach(table => {
+ mcp__flow-nexus__realtime_subscribe({
+ table,
+ event: "*",
+ filter: `user_id=eq.${userId}`
+ })
+})
+```
+
+### Event-Driven Workflows
+```javascript
+// Subscribe to task completion
+mcp__flow-nexus__realtime_subscribe({
+ table: "tasks",
+ event: "UPDATE",
+ filter: "status=eq.completed"
+})
+
+// Trigger notification workflow on event
+// (handled by your application logic)
+```
+
+</details>
+
+---
+
+## Version History
+
+- **v1.0.0** (2025-10-19): Initial comprehensive platform skill
+ - Authentication & user management
+ - Sandbox creation and execution
+ - App store and deployment
+ - Payments and credits
+ - Challenges and achievements
+ - Storage and real-time features
+ - System utilities and Queen Seraphina integration
+
+---
+
+*This skill consolidates 6 Flow Nexus command modules into a single comprehensive platform management interface.*
diff --git a/v3/@claude-flow/cli/.claude/skills/flow-nexus-swarm/SKILL.md b/v3/@claude-flow/cli/.claude/skills/flow-nexus-swarm/SKILL.md
new file mode 100644
index 0000000000..f7b9b6ff64
--- /dev/null
+++ b/v3/@claude-flow/cli/.claude/skills/flow-nexus-swarm/SKILL.md
@@ -0,0 +1,604 @@
+---
+name: flow-nexus-swarm
+description: Cloud-based AI swarm deployment and event-driven workflow automation with Flow Nexus platform
+---
+
+# Flow Nexus Swarm & Workflow Orchestration
+
+Deploy and manage cloud-based AI agent swarms with event-driven workflow automation, message queue processing, and intelligent agent coordination.
+
+## 📋 Table of Contents
+
+1. [Overview](#overview)
+2. [Swarm Management](#swarm-management)
+3. [Workflow Automation](#workflow-automation)
+4. [Agent Orchestration](#agent-orchestration)
+5. [Templates & Patterns](#templates--patterns)
+6. [Advanced Features](#advanced-features)
+7. [Best Practices](#best-practices)
+
+## Overview
+
+Flow Nexus provides cloud-based orchestration for AI agent swarms with:
+
+- **Multi-topology Support**: Hierarchical, mesh, ring, and star architectures
+- **Event-driven Workflows**: Message queue processing with async execution
+- **Template Library**: Pre-built swarm configurations for common use cases
+- **Intelligent Agent Assignment**: Vector similarity matching for optimal agent selection
+- **Real-time Monitoring**: Comprehensive metrics and audit trails
+- **Scalable Infrastructure**: Cloud-based execution with auto-scaling
+
+## Swarm Management
+
+### Initialize Swarm
+
+Create a new swarm with specified topology and configuration:
+
+```javascript
+mcp__flow-nexus__swarm_init({
+ topology: "hierarchical", // Options: mesh, ring, star, hierarchical
+ maxAgents: 8,
+ strategy: "balanced" // Options: balanced, specialized, adaptive
+})
+```
+
+**Topology Guide:**
+- **Hierarchical**: Tree structure with coordinator nodes (best for complex projects)
+- **Mesh**: Peer-to-peer collaboration (best for research and analysis)
+- **Ring**: Circular coordination (best for sequential workflows)
+- **Star**: Centralized hub (best for simple delegation)
+
+**Strategy Guide:**
+- **Balanced**: Equal distribution of workload across agents
+- **Specialized**: Agents focus on specific expertise areas
+- **Adaptive**: Dynamic adjustment based on task complexity
+
+### Spawn Agents
+
+Add specialized agents to the swarm:
+
+```javascript
+mcp__flow-nexus__agent_spawn({
+ type: "researcher", // Options: researcher, coder, analyst, optimizer, coordinator
+ name: "Lead Researcher",
+ capabilities: ["web_search", "analysis", "summarization"]
+})
+```
+
+**Agent Types:**
+- **Researcher**: Information gathering, web search, analysis
+- **Coder**: Code generation, refactoring, implementation
+- **Analyst**: Data analysis, pattern recognition, insights
+- **Optimizer**: Performance tuning, resource optimization
+- **Coordinator**: Task delegation, progress tracking, integration
+
+### Orchestrate Tasks
+
+Distribute tasks across the swarm:
+
+```javascript
+mcp__flow-nexus__task_orchestrate({
+ task: "Build a REST API with authentication and database integration",
+ strategy: "parallel", // Options: parallel, sequential, adaptive
+ maxAgents: 5,
+ priority: "high" // Options: low, medium, high, critical
+})
+```
+
+**Execution Strategies:**
+- **Parallel**: Maximum concurrency for independent subtasks
+- **Sequential**: Step-by-step execution with dependencies
+- **Adaptive**: AI-powered strategy selection based on task analysis
+
+### Monitor & Scale Swarms
+
+```javascript
+// Get detailed swarm status
+mcp__flow-nexus__swarm_status({
+ swarm_id: "optional-id" // Uses active swarm if not provided
+})
+
+// List all active swarms
+mcp__flow-nexus__swarm_list({
+ status: "active" // Options: active, destroyed, all
+})
+
+// Scale swarm up or down
+mcp__flow-nexus__swarm_scale({
+ target_agents: 10,
+ swarm_id: "optional-id"
+})
+
+// Gracefully destroy swarm
+mcp__flow-nexus__swarm_destroy({
+ swarm_id: "optional-id"
+})
+```
+
+## Workflow Automation
+
+### Create Workflow
+
+Define event-driven workflows with message queue processing:
+
+```javascript
+mcp__flow-nexus__workflow_create({
+ name: "CI/CD Pipeline",
+ description: "Automated testing, building, and deployment",
+ steps: [
+ {
+ id: "test",
+ action: "run_tests",
+ agent: "tester",
+ parallel: true
+ },
+ {
+ id: "build",
+ action: "build_app",
+ agent: "builder",
+ depends_on: ["test"]
+ },
+ {
+ id: "deploy",
+ action: "deploy_prod",
+ agent: "deployer",
+ depends_on: ["build"]
+ }
+ ],
+ triggers: ["push_to_main", "manual_trigger"],
+ metadata: {
+ priority: 10,
+ retry_policy: "exponential_backoff"
+ }
+})
+```
+
+**Workflow Features:**
+- **Dependency Management**: Define step dependencies with `depends_on`
+- **Parallel Execution**: Set `parallel: true` for concurrent steps
+- **Event Triggers**: GitHub events, schedules, manual triggers
+- **Retry Policies**: Automatic retry on transient failures
+- **Priority Queuing**: High-priority workflows execute first
+
+### Execute Workflow
+
+Run workflows synchronously or asynchronously:
+
+```javascript
+mcp__flow-nexus__workflow_execute({
+ workflow_id: "workflow_id",
+ input_data: {
+ branch: "main",
+ commit: "abc123",
+ environment: "production"
+ },
+ async: true // Queue-based execution for long-running workflows
+})
+```
+
+**Execution Modes:**
+- **Sync (async: false)**: Immediate execution, wait for completion
+- **Async (async: true)**: Message queue processing, non-blocking
+
+### Monitor Workflows
+
+```javascript
+// Get workflow status and metrics
+mcp__flow-nexus__workflow_status({
+ workflow_id: "id",
+ execution_id: "specific-run-id", // Optional
+ include_metrics: true
+})
+
+// List workflows with filters
+mcp__flow-nexus__workflow_list({
+ status: "running", // Options: running, completed, failed, pending
+ limit: 10,
+ offset: 0
+})
+
+// Get complete audit trail
+mcp__flow-nexus__workflow_audit_trail({
+ workflow_id: "id",
+ limit: 50,
+ start_time: "2025-01-01T00:00:00Z"
+})
+```
+
+### Agent Assignment
+
+Intelligently assign agents to workflow tasks:
+
+```javascript
+mcp__flow-nexus__workflow_agent_assign({
+ task_id: "task_id",
+ agent_type: "coder", // Preferred agent type
+ use_vector_similarity: true // AI-powered capability matching
+})
+```
+
+**Vector Similarity Matching:**
+- Analyzes task requirements and agent capabilities
+- Finds optimal agent based on past performance
+- Considers workload and availability
+
+### Queue Management
+
+Monitor and manage message queues:
+
+```javascript
+mcp__flow-nexus__workflow_queue_status({
+ queue_name: "optional-specific-queue",
+ include_messages: true // Show pending messages
+})
+```
+
+## Agent Orchestration
+
+### Full-Stack Development Pattern
+
+```javascript
+// 1. Initialize swarm with hierarchical topology
+mcp__flow-nexus__swarm_init({
+ topology: "hierarchical",
+ maxAgents: 8,
+ strategy: "specialized"
+})
+
+// 2. Spawn specialized agents
+mcp__flow-nexus__agent_spawn({ type: "coordinator", name: "Project Manager" })
+mcp__flow-nexus__agent_spawn({ type: "coder", name: "Backend Developer" })
+mcp__flow-nexus__agent_spawn({ type: "coder", name: "Frontend Developer" })
+mcp__flow-nexus__agent_spawn({ type: "coder", name: "Database Architect" })
+mcp__flow-nexus__agent_spawn({ type: "analyst", name: "QA Engineer" })
+
+// 3. Create development workflow
+mcp__flow-nexus__workflow_create({
+ name: "Full-Stack Development",
+ steps: [
+ { id: "requirements", action: "analyze_requirements", agent: "coordinator" },
+ { id: "db_design", action: "design_schema", agent: "Database Architect" },
+ { id: "backend", action: "build_api", agent: "Backend Developer", depends_on: ["db_design"] },
+ { id: "frontend", action: "build_ui", agent: "Frontend Developer", depends_on: ["requirements"] },
+ { id: "integration", action: "integrate", agent: "Backend Developer", depends_on: ["backend", "frontend"] },
+ { id: "testing", action: "qa_testing", agent: "QA Engineer", depends_on: ["integration"] }
+ ]
+})
+
+// 4. Execute workflow
+mcp__flow-nexus__workflow_execute({
+ workflow_id: "workflow_id",
+ input_data: {
+ project: "E-commerce Platform",
+ tech_stack: ["Node.js", "React", "PostgreSQL"]
+ }
+})
+```
+
+### Research & Analysis Pattern
+
+```javascript
+// 1. Initialize mesh topology for collaborative research
+mcp__flow-nexus__swarm_init({
+ topology: "mesh",
+ maxAgents: 5,
+ strategy: "balanced"
+})
+
+// 2. Spawn research agents
+mcp__flow-nexus__agent_spawn({ type: "researcher", name: "Primary Researcher" })
+mcp__flow-nexus__agent_spawn({ type: "researcher", name: "Secondary Researcher" })
+mcp__flow-nexus__agent_spawn({ type: "analyst", name: "Data Analyst" })
+mcp__flow-nexus__agent_spawn({ type: "analyst", name: "Insights Analyst" })
+
+// 3. Orchestrate research task
+mcp__flow-nexus__task_orchestrate({
+ task: "Research machine learning trends for 2025 and analyze market opportunities",
+ strategy: "parallel",
+ maxAgents: 4,
+ priority: "high"
+})
+```
+
+### CI/CD Pipeline Pattern
+
+```javascript
+mcp__flow-nexus__workflow_create({
+ name: "Deployment Pipeline",
+ description: "Automated testing, building, and multi-environment deployment",
+ steps: [
+ { id: "lint", action: "lint_code", agent: "code_quality", parallel: true },
+ { id: "unit_test", action: "unit_tests", agent: "test_runner", parallel: true },
+ { id: "integration_test", action: "integration_tests", agent: "test_runner", parallel: true },
+ { id: "build", action: "build_artifacts", agent: "builder", depends_on: ["lint", "unit_test", "integration_test"] },
+ { id: "security_scan", action: "security_scan", agent: "security", depends_on: ["build"] },
+ { id: "deploy_staging", action: "deploy", agent: "deployer", depends_on: ["security_scan"] },
+ { id: "smoke_test", action: "smoke_tests", agent: "test_runner", depends_on: ["deploy_staging"] },
+ { id: "deploy_prod", action: "deploy", agent: "deployer", depends_on: ["smoke_test"] }
+ ],
+ triggers: ["github_push", "github_pr_merged"],
+ metadata: {
+ priority: 10,
+ auto_rollback: true
+ }
+})
+```
+
+### Data Processing Pipeline Pattern
+
+```javascript
+mcp__flow-nexus__workflow_create({
+ name: "ETL Pipeline",
+ description: "Extract, Transform, Load data processing",
+ steps: [
+ { id: "extract", action: "extract_data", agent: "data_extractor" },
+ { id: "validate_raw", action: "validate_data", agent: "validator", depends_on: ["extract"] },
+ { id: "transform", action: "transform_data", agent: "transformer", depends_on: ["validate_raw"] },
+ { id: "enrich", action: "enrich_data", agent: "enricher", depends_on: ["transform"] },
+ { id: "load", action: "load_data", agent: "loader", depends_on: ["enrich"] },
+ { id: "validate_final", action: "validate_data", agent: "validator", depends_on: ["load"] }
+ ],
+ triggers: ["schedule:0 2 * * *"], // Daily at 2 AM
+ metadata: {
+ retry_policy: "exponential_backoff",
+ max_retries: 3
+ }
+})
+```
+
+## Templates & Patterns
+
+### Use Pre-built Templates
+
+```javascript
+// Create swarm from template
+mcp__flow-nexus__swarm_create_from_template({
+ template_name: "full-stack-dev",
+ overrides: {
+ maxAgents: 6,
+ strategy: "specialized"
+ }
+})
+
+// List available templates
+mcp__flow-nexus__swarm_templates_list({
+ category: "quickstart", // Options: quickstart, specialized, enterprise, custom, all
+ includeStore: true
+})
+```
+
+**Available Template Categories:**
+
+**Quickstart Templates:**
+- `full-stack-dev`: Complete web development swarm
+- `research-team`: Research and analysis swarm
+- `code-review`: Automated code review swarm
+- `data-pipeline`: ETL and data processing
+
+**Specialized Templates:**
+- `ml-development`: Machine learning project swarm
+- `mobile-dev`: Mobile app development
+- `devops-automation`: Infrastructure and deployment
+- `security-audit`: Security analysis and testing
+
+**Enterprise Templates:**
+- `enterprise-migration`: Large-scale system migration
+- `multi-repo-sync`: Multi-repository coordination
+- `compliance-review`: Regulatory compliance workflows
+- `incident-response`: Automated incident management
+
+### Custom Template Creation
+
+Save successful swarm configurations as reusable templates for future projects.
+
+## Advanced Features
+
+### Real-time Monitoring
+
+```javascript
+// Subscribe to execution streams
+mcp__flow-nexus__execution_stream_subscribe({
+ stream_type: "claude-flow-swarm",
+ deployment_id: "deployment_id"
+})
+
+// Get execution status
+mcp__flow-nexus__execution_stream_status({
+ stream_id: "stream_id"
+})
+
+// List files created during execution
+mcp__flow-nexus__execution_files_list({
+ stream_id: "stream_id",
+ created_by: "claude-flow"
+})
+```
+
+### Swarm Metrics & Analytics
+
+```javascript
+// Get swarm performance metrics
+mcp__flow-nexus__swarm_status({
+ swarm_id: "id"
+})
+
+// Analyze workflow efficiency
+mcp__flow-nexus__workflow_status({
+ workflow_id: "id",
+ include_metrics: true
+})
+```
+
+### Multi-Swarm Coordination
+
+Coordinate multiple swarms for complex, multi-phase projects:
+
+```javascript
+// Phase 1: Research swarm
+const researchSwarm = await mcp__flow-nexus__swarm_init({
+ topology: "mesh",
+ maxAgents: 4
+})
+
+// Phase 2: Development swarm
+const devSwarm = await mcp__flow-nexus__swarm_init({
+ topology: "hierarchical",
+ maxAgents: 8
+})
+
+// Phase 3: Testing swarm
+const testSwarm = await mcp__flow-nexus__swarm_init({
+ topology: "star",
+ maxAgents: 5
+})
+```
+
+## Best Practices
+
+### 1. Choose the Right Topology
+
+```javascript
+// Simple projects: Star
+mcp__flow-nexus__swarm_init({ topology: "star", maxAgents: 3 })
+
+// Collaborative work: Mesh
+mcp__flow-nexus__swarm_init({ topology: "mesh", maxAgents: 5 })
+
+// Complex projects: Hierarchical
+mcp__flow-nexus__swarm_init({ topology: "hierarchical", maxAgents: 10 })
+
+// Sequential workflows: Ring
+mcp__flow-nexus__swarm_init({ topology: "ring", maxAgents: 4 })
+```
+
+### 2. Optimize Agent Assignment
+
+```javascript
+// Use vector similarity for optimal matching
+mcp__flow-nexus__workflow_agent_assign({
+ task_id: "complex-task",
+ use_vector_similarity: true
+})
+```
+
+### 3. Implement Proper Error Handling
+
+```javascript
+mcp__flow-nexus__workflow_create({
+ name: "Resilient Workflow",
+ steps: [...],
+ metadata: {
+ retry_policy: "exponential_backoff",
+ max_retries: 3,
+ timeout: 300000, // 5 minutes
+ on_failure: "notify_and_rollback"
+ }
+})
+```
+
+### 4. Monitor and Scale
+
+```javascript
+// Regular monitoring
+const status = await mcp__flow-nexus__swarm_status()
+
+// Scale based on workload
+if (status.workload > 0.8) {
+ await mcp__flow-nexus__swarm_scale({ target_agents: status.agents + 2 })
+}
+```
+
+### 5. Use Async Execution for Long-Running Workflows
+
+```javascript
+// Long-running workflows should use message queues
+mcp__flow-nexus__workflow_execute({
+ workflow_id: "data-pipeline",
+ async: true // Non-blocking execution
+})
+
+// Monitor progress
+mcp__flow-nexus__workflow_queue_status({ include_messages: true })
+```
+
+### 6. Clean Up Resources
+
+```javascript
+// Destroy swarm when complete
+mcp__flow-nexus__swarm_destroy({ swarm_id: "id" })
+```
+
+### 7. Leverage Templates
+
+```javascript
+// Use proven templates instead of building from scratch
+mcp__flow-nexus__swarm_create_from_template({
+ template_name: "code-review",
+ overrides: { maxAgents: 4 }
+})
+```
+
+## Integration with Claude Flow
+
+Flow Nexus swarms integrate seamlessly with Claude Flow hooks:
+
+```bash
+# Pre-task coordination setup
+npx claude-flow@alpha hooks pre-task --description "Initialize swarm"
+
+# Post-task metrics export
+npx claude-flow@alpha hooks post-task --task-id "swarm-execution"
+```
+
+## Common Use Cases
+
+### 1. Multi-Repo Development
+- Coordinate development across multiple repositories
+- Synchronized testing and deployment
+- Cross-repo dependency management
+
+### 2. Research Projects
+- Distributed information gathering
+- Parallel analysis of different data sources
+- Collaborative synthesis and reporting
+
+### 3. DevOps Automation
+- Infrastructure as Code deployment
+- Multi-environment testing
+- Automated rollback and recovery
+
+### 4. Code Quality Workflows
+- Automated code review
+- Security scanning
+- Performance benchmarking
+
+### 5. Data Processing
+- Large-scale ETL pipelines
+- Real-time data transformation
+- Data validation and quality checks
+
+## Authentication & Setup
+
+```bash
+# Install Flow Nexus
+npm install -g flow-nexus@latest
+
+# Register account
+npx flow-nexus@latest register
+
+# Login
+npx flow-nexus@latest login
+
+# Add MCP server to Claude Code
+claude mcp add flow-nexus npx flow-nexus@latest mcp start
+```
+
+## Support & Resources
+
+- **Platform**: https://flow-nexus.ruv.io
+- **Documentation**: https://github.com/ruvnet/flow-nexus
+- **Issues**: https://github.com/ruvnet/flow-nexus/issues
+
+---
+
+**Remember**: Flow Nexus provides cloud-based orchestration infrastructure. For local execution and coordination, use the core `claude-flow` MCP server alongside Flow Nexus for maximum flexibility.