claude-flow 3.6.28 → 3.6.30

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.
@@ -7,6 +7,17 @@ description: Implementation specialist for writing clean, efficient code
7
7
 
8
8
  You are a senior software engineer specialized in writing clean, maintainable, and efficient code following best practices and design patterns.
9
9
 
10
+ ## Authoritative project documents — read before implementing
11
+
12
+ Before writing code that affects architecture, scope, or behavior, read **both**:
13
+
14
+ 1. **`docs/SPEC.md`** (and any sibling files under `docs/`) — describes **what** the system should do. Functional requirements, scope, acceptance criteria.
15
+ 2. **`docs/adr/*.md`** (Architecture Decision Records) — describes **how** decisions have been made. Tech stack choices, framework selection, auth strategy, integration patterns. Treat these as **binding** unless explicitly superseded by a newer ADR with `status: Accepted`.
16
+
17
+ If both exist and conflict, the ADR wins on architectural decisions; SPEC wins on requirements scope. If an ADR contradicts your planned implementation, surface the conflict and propose either following the ADR or drafting a successor ADR — do not silently diverge.
18
+
19
+ When neither file exists (greenfield work), you can proceed without — but if a sibling Architect agent generated ADRs in this session, those ADRs are authoritative for your work even before they land in `docs/adr/`. In multi-agent parallel development, ADRs are the contract that prevents drift between agents working on different bounded contexts.
20
+
10
21
  ## Core Responsibilities
11
22
 
12
23
  1. **Code Implementation**: Write production-quality code that meets requirements
@@ -8,6 +8,18 @@ description: Transform specifications into working code with TDD practices
8
8
  ## Purpose
9
9
  This agent specializes in the implementation phases of SPARC methodology, focusing on transforming specifications and designs into high-quality, tested code.
10
10
 
11
+ ## Authoritative inputs
12
+
13
+ The Refinement and Completion phases consume work from earlier SPARC phases. Read **all** of the following before implementing:
14
+
15
+ 1. **`docs/SPEC.md`** — Specification phase output (what to build)
16
+ 2. **`docs/pseudocode/*.md`** if present — Pseudocode phase output (algorithm shape)
17
+ 3. **`docs/adr/*.md`** — Architecture Decision Records from the Architecture phase (tech stack, framework choices, auth strategy, deployment shape). **Treat ADRs as binding** unless explicitly superseded by a newer `status: Accepted` ADR.
18
+
19
+ ADRs describe **how** decisions were made; SPEC describes **what** the system does. In multi-agent parallel implementation, ADRs are the cross-agent contract — backend coders, frontend coders, and testers must all read the same ADRs or the bounded contexts will drift apart.
20
+
21
+ If your planned implementation contradicts an ADR, surface the conflict and propose either following the ADR or drafting a successor — do not silently diverge.
22
+
11
23
  ## Core Implementation Principles
12
24
 
13
25
  ### 1. Test-Driven Development (TDD)
package/README.md CHANGED
@@ -156,8 +156,11 @@ This adds slash commands and agent definitions only. The Ruflo MCP server is NOT
156
156
  # One-line install
157
157
  curl -fsSL https://cdn.jsdelivr.net/gh/ruvnet/ruflo@main/scripts/install.sh | bash
158
158
 
159
- # Or via npx
160
- npx ruflo@latest init --wizard
159
+ # Or via npx (interactive setup)
160
+ npx ruflo@latest init wizard
161
+
162
+ # Quick non-interactive init
163
+ # npx ruflo@latest init
161
164
 
162
165
  # Or install globally
163
166
  npm install -g ruflo@latest
@@ -166,8 +169,8 @@ npm install -g ruflo@latest
166
169
  ### MCP Server
167
170
 
168
171
  ```bash
169
- # Add Ruflo as an MCP server in Claude Code
170
- claude mcp add ruflo -- npx -y @claude-flow/cli@latest
172
+ # Add Ruflo as an MCP server in Claude Code (canonical form, matches USERGUIDE.md)
173
+ claude mcp add ruflo -- npx ruflo@latest mcp start
171
174
  ```
172
175
 
173
176
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-flow",
3
- "version": "3.6.28",
3
+ "version": "3.6.30",
4
4
  "description": "Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -156,8 +156,11 @@ This adds slash commands and agent definitions only. The Ruflo MCP server is NOT
156
156
  # One-line install
157
157
  curl -fsSL https://cdn.jsdelivr.net/gh/ruvnet/ruflo@main/scripts/install.sh | bash
158
158
 
159
- # Or via npx
160
- npx ruflo@latest init --wizard
159
+ # Or via npx (interactive setup)
160
+ npx ruflo@latest init wizard
161
+
162
+ # Quick non-interactive init
163
+ # npx ruflo@latest init
161
164
 
162
165
  # Or install globally
163
166
  npm install -g ruflo@latest
@@ -166,8 +169,8 @@ npm install -g ruflo@latest
166
169
  ### MCP Server
167
170
 
168
171
  ```bash
169
- # Add Ruflo as an MCP server in Claude Code
170
- claude mcp add ruflo -- npx -y @claude-flow/cli@latest
172
+ # Add Ruflo as an MCP server in Claude Code (canonical form, matches USERGUIDE.md)
173
+ claude mcp add ruflo -- npx ruflo@latest mcp start
171
174
  ```
172
175
 
173
176
  ---
@@ -10,6 +10,7 @@ import { select, confirm, input } from '../prompt.js';
10
10
  import { callMCPTool, MCPClientError } from '../mcp-client.js';
11
11
  import { spawn as childSpawn, execSync } from 'child_process';
12
12
  import { mkdir, writeFile } from 'fs/promises';
13
+ import { existsSync } from 'fs';
13
14
  import { join } from 'path';
14
15
  // Hive topologies
15
16
  const TOPOLOGIES = [
@@ -200,6 +201,40 @@ async function spawnClaudeCodeInstance(swarmId, swarmName, objective, workers, f
200
201
  if (claudeAvailable && !dryRun) {
201
202
  // Build arguments - flags first, then prompt
202
203
  const claudeArgs = [];
204
+ // #1748 Issue 2 — pass --mcp-config so the spawned worker actually has
205
+ // mcp__ruflo__* tools registered. Before this, the coordination prompt
206
+ // referenced tools the worker didn't know about and exited silently.
207
+ // Resolution order:
208
+ // 1. explicit --mcp-config <path> flag passed by the caller
209
+ // 2. ./.mcp.json in cwd (project-local Ruflo MCP config)
210
+ // 3. ~/.claude.json or ~/.claude/mcp.json (user-global)
211
+ // If none found, we still spawn but warn — that's the pre-fix behavior
212
+ // and the user's debug log will surface the missing tools.
213
+ const explicitMcpConfig = flags['mcp-config'];
214
+ let mcpConfigPath = explicitMcpConfig;
215
+ if (!mcpConfigPath) {
216
+ const candidates = [
217
+ join(process.cwd(), '.mcp.json'),
218
+ join(process.env.HOME || process.env.USERPROFILE || '', '.claude.json'),
219
+ join(process.env.HOME || process.env.USERPROFILE || '', '.claude', 'mcp.json'),
220
+ ];
221
+ for (const c of candidates) {
222
+ try {
223
+ if (c && existsSync(c)) {
224
+ mcpConfigPath = c;
225
+ break;
226
+ }
227
+ }
228
+ catch { /* continue */ }
229
+ }
230
+ }
231
+ if (mcpConfigPath) {
232
+ claudeArgs.push('--mcp-config', mcpConfigPath);
233
+ output.printInfo(`Spawned worker MCP config: ${mcpConfigPath}`);
234
+ }
235
+ else {
236
+ output.printWarning('No .mcp.json or ~/.claude.json found — spawned worker will not have mcp__ruflo__* tools (#1748 Issue 2). Pass --mcp-config <path> or run "ruflo init" to generate one.');
237
+ }
203
238
  // Check for non-interactive mode
204
239
  const isNonInteractive = flags['non-interactive'] || flags.nonInteractive;
205
240
  if (isNonInteractive) {
@@ -492,6 +527,11 @@ const spawnCommand = {
492
527
  description: 'Run Claude Code in non-interactive mode',
493
528
  type: 'boolean',
494
529
  default: false
530
+ },
531
+ {
532
+ name: 'mcp-config',
533
+ description: 'Path to .mcp.json for the spawned worker (auto-detects ./.mcp.json or ~/.claude.json if omitted) — fixes #1748 Issue 2',
534
+ type: 'string'
495
535
  }
496
536
  ],
497
537
  examples: [
@@ -135,7 +135,7 @@ async function determineAgentModel(agentType, config, task) {
135
135
  export const agentTools = [
136
136
  {
137
137
  name: 'agent_spawn',
138
- description: 'Spawn a new agent with intelligent model selection',
138
+ description: 'Spawn a Ruflo-tracked agent with cost attribution + memory persistence + swarm coordination. Use when native Task tool is wrong because you need (a) cost tracking per agent in the cost-tracking namespace, (b) cross-session learning via the patterns namespace, or (c) coordination with other agents in a swarm topology (hierarchical / mesh / consensus). For one-shot subtasks with no learning loop, native Task is fine. Pair with hooks_route to pick the right model first.',
139
139
  category: 'agent',
140
140
  inputSchema: {
141
141
  type: 'object',
@@ -759,7 +759,7 @@ export const hooksPostCommand = {
759
759
  };
760
760
  export const hooksRoute = {
761
761
  name: 'hooks_route',
762
- description: 'Route task to optimal agent using semantic similarity (native HNSW or pure JS)',
762
+ description: 'Get a 3-tier routing recommendation for a task: Tier 1 (Agent Booster, 0ms / $0 — for var-to-const, add-types, etc.), Tier 2 (Haiku — simple), Tier 3 (Sonnet/Opus complex). Use this BEFORE spawning an agent to avoid sending simple transforms to Sonnet. Native tools have no equivalent — Claude Code does not introspect its own model-selection cost. Returns the recommended model + a `[AGENT_BOOSTER_AVAILABLE]` literal when the WASM bypass applies.',
763
763
  inputSchema: {
764
764
  type: 'object',
765
765
  properties: {
@@ -153,7 +153,7 @@ async function ensureInitialized() {
153
153
  export const memoryTools = [
154
154
  {
155
155
  name: 'memory_store',
156
- description: 'Store a value in memory with vector embedding for semantic search (sql.js + HNSW backend). Use upsert=true to update existing keys.',
156
+ description: 'Persistent key-value store with vector embedding survives across sessions and is searchable by meaning, not just by file path. Use when native Write is wrong because the data is not a file (e.g. a learned pattern, a decision, a budget config) AND you need to recall it later by semantic query, not by path. Defaults to namespace="default"; pass --upsert=true to update an existing key.',
157
157
  category: 'memory',
158
158
  inputSchema: {
159
159
  type: 'object',
@@ -227,7 +227,7 @@ export const memoryTools = [
227
227
  },
228
228
  {
229
229
  name: 'memory_retrieve',
230
- description: 'Retrieve a value from memory by key',
230
+ description: 'Read back a value previously stored via memory_store, by exact (namespace, key) — lossless, includes metadata. Use when native Read is wrong because the value is not a file (it lives in the .swarm/memory.db SQLite store) AND you know the exact key. For semantic lookup by meaning, use memory_search.',
231
231
  category: 'memory',
232
232
  inputSchema: {
233
233
  type: 'object',
@@ -287,7 +287,7 @@ export const memoryTools = [
287
287
  },
288
288
  {
289
289
  name: 'memory_search',
290
- description: 'Semantic vector search using HNSW index (150x-12,500x faster than keyword search)',
290
+ description: 'Find stored memories by meaning (vector similarity), not by literal text — finds "JWT auth pattern" when you query "token-based login flow". Use when native Grep is wrong because Grep matches characters and you need to find conceptually-related entries across past sessions. Backed by HNSW index over ONNX embeddings; returns top-k with similarity scores. Pair with smart=true for query expansion + MMR diversity.',
291
291
  category: 'memory',
292
292
  inputSchema: {
293
293
  type: 'object',
@@ -404,7 +404,7 @@ export const memoryTools = [
404
404
  },
405
405
  {
406
406
  name: 'memory_delete',
407
- description: 'Delete a memory entry by key',
407
+ description: 'Remove a stored memory entry by exact (namespace, key). Use when a previously stored decision is invalidated or contains stale data. No native equivalent — Write to a file does not affect the .swarm/memory.db SQLite store.',
408
408
  category: 'memory',
409
409
  inputSchema: {
410
410
  type: 'object',
@@ -444,7 +444,7 @@ export const memoryTools = [
444
444
  },
445
445
  {
446
446
  name: 'memory_list',
447
- description: 'List memory entries with optional filtering',
447
+ description: 'Enumerate stored memory entries (optionally filtered by namespace/tags) without semantic search. Use when native Glob is wrong because the entries are not files (they live in .swarm/memory.db). For inspection / audit / "what is in my memory" — pair with memory_search for retrieval-by-meaning.',
448
448
  category: 'memory',
449
449
  inputSchema: {
450
450
  type: 'object',
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-flow/cli",
3
- "version": "3.6.28",
3
+ "version": "3.6.30",
4
4
  "type": "module",
5
5
  "description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
6
6
  "main": "dist/src/index.js",