@mfjjs/ruflo-setup 0.1.6 → 0.1.7

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.7](https://gitlab.mfj.local:8022/mario/ruflo-setup/compare/v0.1.6...v0.1.7) (2026-03-13)
6
+
7
+
8
+ ### Features
9
+
10
+ * **setup:** sync global command template and enhance dry-run feedback ([18e8b1d](https://gitlab.mfj.local:8022/mario/ruflo-setup/commit/18e8b1d3111eb2dbe067e0aba6349872bc59a236))
11
+
5
12
  ### [0.1.6](https://gitlab.mfj.local:8022/mario/ruflo-setup/compare/v0.1.5...v0.1.6) (2026-03-11)
6
13
 
7
14
  ### [0.1.5](https://gitlab.mfj.local:8022/mario/ruflo-setup/compare/v0.1.4...v0.1.5) (2026-03-11)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mfjjs/ruflo-setup",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Cross-platform setup CLI for Ruflo + Claude Flow projects",
5
5
  "type": "module",
6
6
  "bin": {
package/src/setup.js CHANGED
@@ -1,3 +1,4 @@
1
+ import fs from 'node:fs';
1
2
  import path from 'node:path';
2
3
  import os from 'node:os';
3
4
  import { spawnSync } from 'node:child_process';
@@ -107,17 +108,20 @@ function writeMcpJson({ cwd, dryRun }) {
107
108
  logLine(' .mcp.json written for this platform.');
108
109
  }
109
110
 
110
- function installGlobalCommand({ packageRoot, dryRun }) {
111
+ function syncGlobalCommandTemplate({ packageRoot, dryRun }) {
111
112
  const src = path.join(packageRoot, 'templates', 'ruflo-setup.md');
112
113
  const dest = path.join(os.homedir(), '.claude', 'commands', 'ruflo-setup.md');
114
+ const exists = pathExists(dest);
115
+ const operation = exists ? 'update' : 'install';
116
+ const srcContent = fs.readFileSync(src, 'utf8');
117
+ const changed = !exists || fs.readFileSync(dest, 'utf8') !== srcContent;
113
118
 
114
- if (dryRun) {
115
- logLine(` [DRY RUN] Would write: ${dest}`);
116
- return { dest };
119
+ if (dryRun || !changed) {
120
+ return { dest, changed, operation };
117
121
  }
118
122
 
119
123
  copyFileSync(src, dest);
120
- return { dest };
124
+ return { dest, changed, operation };
121
125
  }
122
126
 
123
127
  function isAlreadyConfigured(cwd) {
@@ -142,6 +146,21 @@ export async function runSetup({
142
146
  }
143
147
  logLine('');
144
148
 
149
+ logLine('Preflight: Syncing global /ruflo-setup command template ...');
150
+ const preflightCommandResult = syncGlobalCommandTemplate({ packageRoot, dryRun });
151
+ if (preflightCommandResult.changed) {
152
+ if (dryRun) {
153
+ logLine(` [DRY RUN] Would ${preflightCommandResult.operation}: ${preflightCommandResult.dest}`);
154
+ } else if (preflightCommandResult.operation === 'install') {
155
+ logLine(` Installed command template at: ${preflightCommandResult.dest}`);
156
+ } else {
157
+ logLine(` Updated command template at: ${preflightCommandResult.dest}`);
158
+ }
159
+ } else {
160
+ logLine(` Command template already up to date: ${preflightCommandResult.dest}`);
161
+ }
162
+ logLine('');
163
+
145
164
  if (isAlreadyConfigured(cwd) && !force && !yes) {
146
165
  logLine('WARNING: This project already has Ruflo configuration.');
147
166
  const shouldOverwrite = await confirm('Overwrite existing configuration? [y/N] ');
@@ -185,9 +204,20 @@ export async function runSetup({
185
204
  }
186
205
 
187
206
  logLine('Step 4: Installing global /ruflo-setup command ...');
188
- const commandResult = installGlobalCommand({ packageRoot, dryRun });
189
- if (!dryRun) {
190
- logLine(` Command installed at: ${commandResult.dest}`);
207
+ if (dryRun) {
208
+ if (preflightCommandResult.changed) {
209
+ logLine(` [DRY RUN] Would ${preflightCommandResult.operation}: ${preflightCommandResult.dest}`);
210
+ } else {
211
+ logLine(` [DRY RUN] Command already up to date: ${preflightCommandResult.dest}`);
212
+ }
213
+ } else if (preflightCommandResult.changed) {
214
+ if (preflightCommandResult.operation === 'install') {
215
+ logLine(` Command installed at: ${preflightCommandResult.dest}`);
216
+ } else {
217
+ logLine(` Command updated at: ${preflightCommandResult.dest}`);
218
+ }
219
+ } else {
220
+ logLine(` Command already up to date: ${preflightCommandResult.dest}`);
191
221
  }
192
222
  logLine('');
193
223
 
@@ -39,6 +39,7 @@ Runs `pnpm add -g @mfjjs/ruflo-setup` then `ruflo-setup` which:
39
39
  - `.claude/commands/` — slash commands
40
40
  2. Writes a platform-aware `.mcp.json` (MCP server registration for claude-flow, ruv-swarm, flow-nexus)
41
41
  3. Installs a global `SessionStart` hook in `~/.claude/settings.json` that warns when Ruflo is not configured
42
+ 4. May refresh `~/.claude/commands/ruflo-setup.md` from the latest packaged template when differences are detected
42
43
 
43
44
  ## Instructions for Claude
44
45