fix(init): skip skills.sh re-registration if .agents/skills/ruflo already exists

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 <ruv@ruv.net>
This commit is contained in:
ruvnet committed 2026-07-15 12:43:49 -04:00
1 parent 23abe26b9b
commit f00d78ffe8
5 files changed
+21 -5

No files matched your search

+1 -1
View File
@@ -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",
+1 -1
View File
@@ -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",
+2 -2
View File
@@ -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": {
+1 -1
View File
@@ -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",
+16
View File
@@ -173,6 +173,22 @@ async function maybeInstallSkillsSh(ctx: CommandContext): Promise<void> {
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;