From f00d78ffe83fbea9338dbd64faf06cceabd657a6 Mon Sep 17 00:00:00 2001 From: ruvnet Date: Wed, 15 Jul 2026 12:43:49 -0400 Subject: [PATCH] fix(init): skip skills.sh re-registration if .agents/skills/ruflo already exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 3.31.1's `maybeInstallSkillsSh` fired unconditionally on every `ruflo init`, including `--force` reinits and `init upgrade`. Each call clones the ~50MB ruvnet/ruflo repo (skills CLI clones internally) and sends a fresh install telemetry event to skills.sh — silently inflating our own GitHub unique-cloners metric (rough estimate: +20-80%/day) and our skills.sh leaderboard rank, plus wasting user bandwidth. Add an idempotency check: if `.agents/skills/ruflo` already exists in cwd, log a dim skip note and return. First init on a project → real registration + real signal; every subsequent init → no-op. PATCH — behavior change corrects the over-firing, no API surface change. Co-Authored-By: RuFlo --- package.json | 2 +- ruflo/package.json | 2 +- v3/@claude-flow/cli/package-lock.json | 4 ++-- v3/@claude-flow/cli/package.json | 2 +- v3/@claude-flow/cli/src/commands/init.ts | 16 ++++++++++++++++ 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index e5a72380e6..86f4b117db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "claude-flow", - "version": "3.31.1", + "version": "3.31.2", "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", "main": "dist/index.js", "type": "module", diff --git a/ruflo/package.json b/ruflo/package.json index cab90f0ab1..fefc9cc292 100644 --- a/ruflo/package.json +++ b/ruflo/package.json @@ -1,6 +1,6 @@ { "name": "ruflo", - "version": "3.31.1", + "version": "3.31.2", "description": "Ruflo - Enterprise AI agent orchestration platform. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration", "main": "bin/ruflo.js", "type": "module", diff --git a/v3/@claude-flow/cli/package-lock.json b/v3/@claude-flow/cli/package-lock.json index fc88703de8..7dc98c5ffd 100644 --- a/v3/@claude-flow/cli/package-lock.json +++ b/v3/@claude-flow/cli/package-lock.json @@ -1,12 +1,12 @@ { "name": "@claude-flow/cli", - "version": "3.31.1", + "version": "3.31.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@claude-flow/cli", - "version": "3.31.1", + "version": "3.31.2", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/v3/@claude-flow/cli/package.json b/v3/@claude-flow/cli/package.json index 648887319e..e5bc66f4c4 100644 --- a/v3/@claude-flow/cli/package.json +++ b/v3/@claude-flow/cli/package.json @@ -1,6 +1,6 @@ { "name": "@claude-flow/cli", - "version": "3.31.1", + "version": "3.31.2", "type": "module", "description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code", "main": "dist/src/index.js", diff --git a/v3/@claude-flow/cli/src/commands/init.ts b/v3/@claude-flow/cli/src/commands/init.ts index ed5d5d8ec3..7519afe85a 100644 --- a/v3/@claude-flow/cli/src/commands/init.ts +++ b/v3/@claude-flow/cli/src/commands/init.ts @@ -173,6 +173,22 @@ async function maybeInstallSkillsSh(ctx: CommandContext): Promise { if (ctx.flags.format === 'json') return; if (/^(1|true|on|yes)$/i.test(String(process.env.RUFLO_NO_SKILLS_SH || ''))) return; + // Idempotency gate: if this project has already registered ruflo with + // skills.sh, don't re-clone the repo + re-fire a fresh install telemetry + // event on every `ruflo init --force` / `init upgrade` / etc. Each install + // pings skills.sh's leaderboard AND clones the whole ruvnet/ruflo repo + // (~50MB) — re-running per-init would silently inflate our own metrics + // (GitHub unique-cloners, skills.sh rank) and waste user bandwidth. This + // check makes the registration once-per-project, matching the intent. + const nodePath = await import('path'); + const nodeFs = await import('fs'); + const marker = nodePath.join(ctx.cwd, '.agents', 'skills', 'ruflo'); + if (nodeFs.existsSync(marker)) { + output.writeln(); + output.writeln(output.dim(' skills.sh registration already present at .agents/skills/ruflo — skipping')); + return; + } + const npxCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx'; if (!commandExists('npx')) return;