@mfjjs/ruflo-setup 0.1.6 → 0.1.8

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,15 @@
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.8](https://gitlab.mfj.local:8022/mario/ruflo-setup/compare/v0.1.7...v0.1.8) (2026-03-13)
6
+
7
+ ### [0.1.7](https://gitlab.mfj.local:8022/mario/ruflo-setup/compare/v0.1.6...v0.1.7) (2026-03-13)
8
+
9
+
10
+ ### Features
11
+
12
+ * **setup:** sync global command template and enhance dry-run feedback ([18e8b1d](https://gitlab.mfj.local:8022/mario/ruflo-setup/commit/18e8b1d3111eb2dbe067e0aba6349872bc59a236))
13
+
5
14
  ### [0.1.6](https://gitlab.mfj.local:8022/mario/ruflo-setup/compare/v0.1.5...v0.1.6) (2026-03-11)
6
15
 
7
16
  ### [0.1.5](https://gitlab.mfj.local:8022/mario/ruflo-setup/compare/v0.1.4...v0.1.5) (2026-03-11)
package/README.md CHANGED
@@ -9,8 +9,9 @@ Cross-platform npm CLI to bootstrap a project with Ruflo on Windows and Linux.
9
9
  - Package name: `@mfjjs/ruflo-setup`
10
10
  - Command name: `ruflo-setup`
11
11
  - Platform support: Windows and Linux (plus macOS by default)
12
-
13
12
  ## Requirements
13
+ <details>
14
+ <summary>Click to toggle visibility</summary>
14
15
 
15
16
  - Node.js 20+
16
17
  - pnpm available on PATH
@@ -34,6 +35,47 @@ Alternative (all platforms with recent Node.js):
34
35
  corepack enable
35
36
  corepack prepare pnpm@latest --activate
36
37
  ```
38
+ </details>
39
+
40
+ ## Installation
41
+
42
+ ```powershell
43
+ pnpm -i -g @mfjjs/ruflo-setup
44
+ ```
45
+
46
+ ## Usage
47
+
48
+ ### Bootstrap
49
+ Use this once if you want Claude Code to expose the `/ruflo-setup` command globally.
50
+
51
+ ```bash
52
+ ruflo-setup hooks init
53
+ ```
54
+
55
+ After that, when you open Claude Code in a project that does not already have Ruflo configured, you can run [**/ruflo-setup**](noop:) to start the setup flow.
56
+
57
+ ### Setup
58
+ Use these commands when you want to run the setup directly from a shell.
59
+
60
+ From the target project directory, run one of the following:
61
+
62
+ ```bash
63
+ # full setup
64
+ ruflo-setup
65
+
66
+ # non-interactive
67
+ ruflo-setup --yes
68
+
69
+ # preview only
70
+ ruflo-setup --dry-run --skip-init
71
+
72
+ # skip global hook install
73
+ ruflo-setup --no-hooks
74
+
75
+ # hook operations
76
+ ruflo-setup hooks install
77
+ ruflo-setup hooks status
78
+ ```
37
79
 
38
80
  ## Project structure
39
81
 
@@ -75,26 +117,6 @@ Flow:
75
117
  - copies `templates/CLAUDE.md`
76
118
  - installs global SessionStart hook (unless skipped)
77
119
 
78
- ## Usage
79
-
80
- ```bash
81
- # full setup
82
- ruflo-setup
83
-
84
- # non-interactive
85
- ruflo-setup --yes
86
-
87
- # preview only
88
- ruflo-setup --dry-run --skip-init
89
-
90
- # skip global hook install
91
- ruflo-setup --no-hooks
92
-
93
- # hook operations
94
- ruflo-setup hooks install
95
- ruflo-setup hooks status
96
- ```
97
-
98
120
  ## Local development with pnpm
99
121
 
100
122
  From this repository root (`setup-ruflo/`):
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.8",
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