moflo 4.9.19 → 4.9.21

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.
Files changed (82) hide show
  1. package/.claude/commands/{simplify.md → flo-simplify.md} +4 -4
  2. package/.claude/guidance/shipped/moflo-agent-rules.md +172 -0
  3. package/.claude/guidance/shipped/moflo-claude-swarm-cohesion.md +73 -265
  4. package/.claude/guidance/shipped/moflo-cli-reference.md +6 -6
  5. package/.claude/guidance/shipped/moflo-core-guidance.md +66 -184
  6. package/.claude/guidance/shipped/moflo-cross-platform.md +1 -1
  7. package/.claude/guidance/shipped/moflo-error-handling.md +3 -3
  8. package/.claude/guidance/shipped/moflo-guidance-rules.md +17 -7
  9. package/.claude/guidance/shipped/moflo-memory-strategy.md +76 -182
  10. package/.claude/guidance/shipped/moflo-memorydb-maintenance.md +6 -8
  11. package/.claude/guidance/shipped/moflo-settings-injection.md +7 -9
  12. package/.claude/guidance/shipped/moflo-source-hygiene.md +5 -5
  13. package/.claude/guidance/shipped/moflo-spell-connectors.md +3 -4
  14. package/.claude/guidance/shipped/moflo-spell-custom-steps.md +3 -4
  15. package/.claude/guidance/shipped/moflo-spell-engine.md +40 -162
  16. package/.claude/guidance/shipped/moflo-spell-runner.md +134 -0
  17. package/.claude/guidance/shipped/moflo-spell-sandboxing.md +10 -57
  18. package/.claude/guidance/shipped/moflo-spell-troubleshooting.md +149 -0
  19. package/.claude/guidance/shipped/moflo-subagents.md +43 -114
  20. package/.claude/guidance/shipped/moflo-task-icons.md +4 -4
  21. package/.claude/guidance/shipped/moflo-user-facing-language.md +3 -3
  22. package/.claude/guidance/shipped/moflo-verbose-command-filtering.md +3 -3
  23. package/.claude/guidance/shipped/moflo-yaml-reference.md +4 -5
  24. package/.claude/helpers/gate.cjs +124 -14
  25. package/.claude/helpers/prompt-hook.mjs +4 -38
  26. package/.claude/helpers/simplify-classify.cjs +32 -11
  27. package/.claude/helpers/subagent-bootstrap.json +1 -1
  28. package/.claude/helpers/subagent-start.cjs +1 -1
  29. package/.claude/skills/connector-builder/SKILL.md +42 -429
  30. package/.claude/skills/connector-builder/templates/connector.md +189 -0
  31. package/.claude/skills/connector-builder/templates/step-command.md +176 -0
  32. package/.claude/skills/eldar/SKILL.md +7 -7
  33. package/.claude/skills/fl/SKILL.md +3 -3
  34. package/.claude/skills/fl/execution-modes.md +3 -3
  35. package/.claude/skills/fl/phases.md +3 -3
  36. package/.claude/skills/{simplify → flo-simplify}/SKILL.md +11 -11
  37. package/.claude/skills/guidance/SKILL.md +17 -9
  38. package/.claude/skills/memory-patterns/SKILL.md +1 -1
  39. package/.claude/skills/publish/SKILL.md +121 -36
  40. package/.claude/skills/reset-epic/SKILL.md +2 -2
  41. package/.claude/skills/spell-builder/SKILL.md +39 -226
  42. package/.claude/skills/spell-builder/architecture.md +1 -1
  43. package/.claude/skills/spell-builder/permissions.md +107 -0
  44. package/.claude/skills/spell-builder/preflight.md +101 -0
  45. package/.claude/skills/spell-schedule/SKILL.md +2 -3
  46. package/bin/gate.cjs +124 -14
  47. package/bin/prompt-hook.mjs +4 -38
  48. package/bin/session-start-launcher.mjs +66 -1
  49. package/bin/setup-project.mjs +63 -69
  50. package/bin/simplify-classify.cjs +32 -11
  51. package/dist/src/cli/commands/doctor-checks-deep.js +4 -0
  52. package/dist/src/cli/init/claudemd-generator.js +30 -33
  53. package/dist/src/cli/init/executor.js +28 -16
  54. package/dist/src/cli/init/helpers-generator.js +101 -51
  55. package/dist/src/cli/init/moflo-init.js +41 -114
  56. package/dist/src/cli/init/settings-generator.js +32 -14
  57. package/dist/src/cli/services/hook-block-hash.js +7 -2
  58. package/dist/src/cli/services/hook-wiring.js +86 -3
  59. package/dist/src/cli/services/subagent-bootstrap.js +1 -1
  60. package/dist/src/cli/version.js +1 -1
  61. package/package.json +2 -2
  62. package/scripts/post-install-bootstrap.mjs +19 -0
  63. package/.claude/guidance/shipped/moflo-session-start.md +0 -154
  64. package/.claude/guidance/shipped/moflo-spell-engine-architecture.md +0 -145
  65. package/.claude/skills/browser/SKILL.md +0 -204
  66. package/.claude/skills/github-code-review/SKILL.md +0 -1140
  67. package/.claude/skills/github-multi-repo/SKILL.md +0 -866
  68. package/.claude/skills/github-project-management/SKILL.md +0 -1272
  69. package/.claude/skills/github-release-management/SKILL.md +0 -1074
  70. package/.claude/skills/github-workflow-automation/SKILL.md +0 -1060
  71. package/.claude/skills/hive-mind-advanced/SKILL.md +0 -712
  72. package/.claude/skills/hooks-automation/SKILL.md +0 -1193
  73. package/.claude/skills/pair-programming/SKILL.md +0 -1202
  74. package/.claude/skills/performance-analysis/SKILL.md +0 -563
  75. package/.claude/skills/skill-builder/SKILL.md +0 -910
  76. package/.claude/skills/sparc-methodology/SKILL.md +0 -904
  77. package/.claude/skills/stream-chain/SKILL.md +0 -563
  78. package/.claude/skills/swarm-advanced/SKILL.md +0 -811
  79. package/.claude/skills/swarm-orchestration/SKILL.md +0 -179
  80. package/.claude/skills/verification-quality/SKILL.md +0 -649
  81. package/.claude/skills/worker-benchmarks/skill.md +0 -135
  82. package/.claude/skills/worker-integration/skill.md +0 -154
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: publish
3
3
  description: Bump version, build, test, publish to npm, and install locally
4
- arguments: "[patch|minor|major] [-rc]"
4
+ arguments: "<patch|minor|major> <-rc> <--check|-ch>"
5
5
  ---
6
6
 
7
7
  # /publish - Version Bump, Build, Test & Publish
@@ -13,30 +13,33 @@ Automated release pipeline for moflo. Bumps version, commits, builds, tests, run
13
13
  ## Usage
14
14
 
15
15
  ```
16
- /publish # patch bump (4.8.56 4.8.57)
16
+ /publish # patch bump, default mode (skips CI-covered gates)
17
17
  /publish minor # minor bump (4.8.56 → 4.9.0)
18
18
  /publish major # major bump (4.8.56 → 5.0.0)
19
- /publish -rc # patch RC bump (4.8.56 → 4.8.57-rc.1, or 4.8.57-rc.1 → 4.8.57-rc.2)
19
+ /publish -rc # patch RC bump (4.8.56 → 4.8.57-rc.1)
20
20
  /publish minor -rc # minor RC bump (4.8.56 → 4.9.0-rc.1)
21
- /publish patch # explicit patch bump
21
+ /publish --check # full pre-flight (lint + test + smoke + everything)
22
+ /publish -ch # short form of --check
23
+ /publish minor -ch # combine: full pre-flight on a minor bump
22
24
  ```
23
25
 
24
- ## Pre-Publish Gate — REQUIRED
26
+ ## --check / -ch flag (presence-only)
25
27
 
26
- **Before Step 1, walk the full pre-flight checklist in `.claude/guidance/internal/pre-publish-rules.md`.** That document is the authoritative ruleset for every publish — the seven layered gates (lint, build, tests, doctor, smoke, populated smoke, manifest sanity) plus the cross-platform and consumer-install posture checks. Do not paraphrase or shortcut the rules here; read them and confirm every item.
28
+ **Default (flag absent):** runs build + doctor + trigger-based manual checks only. Skips lint/test/smoke because those gates are covered by CI on every PR + push to main (`ci.yml`, `consumer-install-smoke.yml`).
27
29
 
28
- If you cannot confirm all ten checklist items at the bottom of `pre-publish-rules.md`, STOP. Fix the failing gate first and only then resume from Step 1 below. Skipping the gate to "just get this small change out" is the antipattern that produced the historical incidents named in the rules doc.
30
+ **With `--check` or `-ch` (any presence):** runs the full pre-flight from `pre-publish-rules.md` lint, build, test, doctor (strict), clean smoke, populated smoke, and a forced full walk of every manual gate. Use this for publishes that didn't go through a green PR, risky releases, or when you want belt-and-suspenders.
31
+
32
+ The flag is presence-only. `--check` and `-ch` both set it to true. There is no `--check=true` / `--check=false` syntax — absence means false.
29
33
 
30
34
  ---
31
35
 
32
36
  ## Step-by-Step Procedure
33
37
 
34
- Follow docs/BUILD.md exactly. Every step must succeed before proceeding to the next.
35
-
36
- ### Step 1: Parse Arguments
38
+ ### Step 0: Parse Arguments
37
39
 
38
40
  - Default bump type is `patch` if not specified
39
- - If `-rc` flag is present, produce a release candidate version
41
+ - `-rc` flag: produce a release candidate
42
+ - `--check` or `-ch` (presence): set `CHECK_MODE=true`. Otherwise `CHECK_MODE=false`.
40
43
  - Determine the new version string:
41
44
  - **Without `-rc`:** Use `npm version <patch|minor|major> --no-git-tag-version`
42
45
  - **With `-rc`:** Calculate manually:
@@ -44,33 +47,96 @@ Follow docs/BUILD.md exactly. Every step must succeed before proceeding to the n
44
47
  - Otherwise, bump the base version and append `-rc.1` (e.g., `4.8.56` → `4.8.57-rc.1`)
45
48
  - Write with: `npm version <new-version> --no-git-tag-version`
46
49
 
47
- ### Step 2: Rebuild After Version Bump
50
+ ### Step 1: Compute Manual-Check Fingerprint (always)
51
+
52
+ ```bash
53
+ bash .claude/skills/publish/fingerprint.sh
54
+ ```
55
+
56
+ The script diffs `HEAD` against the most recent `chore: install moflo@*` commit and pattern-matches the file list against the manual-gate triggers from `pre-publish-rules.md`. Output is one block:
57
+
58
+ ```
59
+ Triggered manual checks: bin-scriptfiles-sync info-loss-audit
60
+ Diff range: <last-publish-sha>..HEAD
61
+ Changed files: 7
62
+ ```
63
+
64
+ `Triggered manual checks: none` means gates 1/2/6 don't apply to this diff — skip them entirely.
65
+
66
+ This step costs ~50 tokens and is the cornerstone of token-efficient default mode.
67
+
68
+ ### Step 2: Build (always)
48
69
 
49
70
  ```bash
50
71
  npm run build
51
72
  ```
52
73
 
53
- This syncs the version to `src/cli/version.ts` via the `version` lifecycle script, then compiles all TypeScript.
74
+ Always runs regardless of `CHECK_MODE`. Syncs the version to `src/cli/version.ts` via the `version` lifecycle script, then compiles all TypeScript. Confirms the deliverables on disk are correct.
54
75
 
55
76
  **Must exit 0.** If it fails, stop and fix the build error.
56
77
 
57
- ### Step 3: Run Tests
78
+ ### Step 3: Lint (only if `CHECK_MODE=true`)
79
+
80
+ ```bash
81
+ npm run lint
82
+ ```
83
+
84
+ Skipped by default — `ci.yml` runs lint on every PR with `max-warnings 0`. Run when `--check` is set.
85
+
86
+ ### Step 4: Tests (only if `CHECK_MODE=true`)
58
87
 
59
88
  ```bash
60
89
  npm test
61
90
  ```
62
91
 
92
+ Skipped by default — `ci.yml` runs the full test suite on every PR. Run when `--check` is set.
93
+
63
94
  **Must have 0 test file failures.** If any test files fail, retest them individually to distinguish real failures from flaky ones (per broken window theory). Fix all real failures before proceeding.
64
95
 
65
- ### Step 4: Run Doctor
96
+ ### Step 5: Doctor (always)
66
97
 
98
+ Default mode:
67
99
  ```bash
68
100
  npx moflo doctor --fix
69
101
  ```
70
102
 
71
- All checks must pass (warnings are acceptable on Windows for sandbox tier). If doctor finds fixable issues, it will auto-fix them. If manual fixes are needed, stop and address them.
103
+ Check mode (`CHECK_MODE=true`):
104
+ ```bash
105
+ npx moflo doctor --strict
106
+ ```
107
+
108
+ Doctor is the only check with no CI equivalent — it inspects local state (daemon lock, embeddings hygiene, sandbox tier, vector-stats freshness) that CI cannot validate for you. Always runs.
109
+
110
+ ### Step 6: Smoke Tests (only if `CHECK_MODE=true`)
111
+
112
+ ```bash
113
+ npm run test:smoke
114
+ npm run test:smoke:populated
115
+ ```
116
+
117
+ Skipped by default — `consumer-install-smoke.yml` runs both profiles on Ubuntu/macOS/Windows on every PR + push to main. Run when `--check` is set.
118
+
119
+ ### Step 7: Manual Gate Walk (trigger-based, even in default mode)
120
+
121
+ Read the fingerprint output from Step 1.
72
122
 
73
- ### Step 5: Commit & Push
123
+ | Trigger | Manual check (gate) | What to walk |
124
+ |---------|---------------------|--------------|
125
+ | `split-newlines` | Gate 7 | Diff the changed file-reading code; verify any newline split uses `/\r?\n/` not `'\n'` |
126
+ | `homedir-tmpdir` | Gate 7 | Verify env-var literals use `os.homedir()` / `os.tmpdir()`, not raw `process.env.HOME` / `/tmp` |
127
+ | `bwrap-permissions` | Gate 7 | Spell bash steps that need network declare `permissionLevel: elevated` |
128
+ | `posix-only-spell-bash` | Gate 7 | Spell bash steps avoid `mkdir`/`rm`/`cp`; use `node -e` with `fs`/`os` for cross-platform file ops |
129
+ | `bin-scriptfiles-sync` | Gate 8 | New `bin/` script appears in all three `scriptFiles` arrays (`session-start-launcher.mjs`, `init/moflo-init.ts`, third sync site) |
130
+ | `helper-static-files` | Gate 8 | New helpers ship as static `bin/` files, not generated at runtime |
131
+ | `shipped-guidance-prefix` | Gate 8 | New shipped guidance has `moflo-` prefix and lives in `.claude/guidance/shipped/` |
132
+ | `files-glob-coverage` | Gate 9 | Run `npm pack --dry-run` and confirm new shipped files appear in the tarball listing |
133
+ | `info-loss-audit` | Gate 10 | For each deleted/renamed file, audit destinations bullet-by-bullet — every piece of removed content has a home |
134
+
135
+ If `CHECK_MODE=true`, walk **all** manual gates regardless of triggers (full audit). If `CHECK_MODE=false`, walk **only triggered** ones.
136
+
137
+ If the trigger set is `none` AND `CHECK_MODE=false`: skip Step 7 entirely.
138
+
139
+ ### Step 8: Commit & Push
74
140
 
75
141
  Commit the version bump files:
76
142
 
@@ -82,15 +148,13 @@ git push origin main
82
148
 
83
149
  Only commit version-related files. Do not stage unrelated changes.
84
150
 
85
- ### Step 6: Verify npm Authentication
86
-
87
- Before publishing, verify npm auth is valid:
151
+ ### Step 9: Verify npm Authentication
88
152
 
89
153
  ```bash
90
154
  npm whoami
91
155
  ```
92
156
 
93
- If this returns a 401 or "not logged in" error, the auth token in `~/.npmrc` is missing or expired. Ask the user to provide a valid npm publish token.
157
+ If 401 or "not logged in": auth token in `~/.npmrc` is missing or expired. Ask the user for a valid npm publish token.
94
158
 
95
159
  **How to create a token** (provide these instructions to the user if needed):
96
160
  1. Go to https://www.npmjs.com/settings/~/tokens
@@ -104,9 +168,9 @@ Once the user provides the token, write it to `~/.npmrc`:
104
168
  echo "//registry.npmjs.org/:_authToken=<token>" > ~/.npmrc
105
169
  ```
106
170
 
107
- Then verify with `npm whoami` before proceeding.
171
+ Verify with `npm whoami` before proceeding.
108
172
 
109
- ### Step 7: Publish to npm
173
+ ### Step 10: Publish to npm
110
174
 
111
175
  ```bash
112
176
  npm publish --tag <tag>
@@ -120,7 +184,7 @@ npm publish --tag <tag>
120
184
  - Then retry with: `npm publish --otp=<code> --tag <tag>`
121
185
  - Tip: Granular access tokens created on npmjs.com do NOT require OTP — prefer those over legacy tokens
122
186
 
123
- ### Step 8: Verify Publication
187
+ ### Step 11: Verify Publication
124
188
 
125
189
  ```bash
126
190
  npm view moflo version
@@ -129,7 +193,7 @@ npm view moflo dist-tags
129
193
 
130
194
  Confirm the published version matches what we just built.
131
195
 
132
- ### Step 9: Install Locally
196
+ ### Step 12: Install Locally
133
197
 
134
198
  ```bash
135
199
  npm install moflo@<new-version> --save-dev
@@ -137,7 +201,7 @@ npm install moflo@<new-version> --save-dev
137
201
 
138
202
  This updates `package.json` and `package-lock.json` to use the newly published version as a devDependency.
139
203
 
140
- ### Step 10: Final Commit
204
+ ### Step 13: Final Commit
141
205
 
142
206
  If `package.json` or `package-lock.json` changed from the install:
143
207
 
@@ -147,6 +211,8 @@ git commit -m "chore: install moflo@<new-version>"
147
211
  git push origin main
148
212
  ```
149
213
 
214
+ The `chore: install moflo@<version>` commit message is the anchor the fingerprint uses to bound future diffs — keep the prefix exact.
215
+
150
216
  ## Output
151
217
 
152
218
  Print a summary at the end:
@@ -154,13 +220,18 @@ Print a summary at the end:
154
220
  ```
155
221
  Publish Summary
156
222
  ───────────────
157
- Version: <old> <new>
158
- Tag: latest | rc
159
- Build: passed
160
- Tests: <N> files passed, <N> tests passed
161
- Doctor: <N> passed, <N> warnings
162
- Published: moflo@<new-version>
163
- Installed: moflo@<new-version> (devDependency)
223
+ Mode: default | --check
224
+ Version: <old> <new>
225
+ Tag: latest | rc
226
+ Build: passed
227
+ Tests: skipped (CI-covered) | <N> files passed, <N> tests passed
228
+ Lint: skipped (CI-covered) | passed
229
+ Doctor: <N> passed, <N> warnings
230
+ Smoke (clean): skipped (CI-covered) | passed
231
+ Smoke (popl): skipped (CI-covered) | passed
232
+ Triggered gates: <list> | none
233
+ Published: moflo@<new-version>
234
+ Installed: moflo@<new-version> (devDependency)
164
235
  ```
165
236
 
166
237
  ## Important
@@ -168,13 +239,27 @@ Installed: moflo@<new-version> (devDependency)
168
239
  - All commands run from the project root — never cd into subdirectories
169
240
  - Never use `--force` on npm publish
170
241
  - Never install moflo globally — it is always a local devDependency
171
- - If any step fails, stop and fix the issue before proceeding — do not skip steps
172
- - The `prepublishOnly` script in package.json runs `npm run build` automatically, so npm publish will fail-fast on any TypeScript or asset-bundling error
242
+ - If any step that DID run fails, stop and fix the issue before proceeding — do not skip steps
243
+ - The `prepublishOnly` script in package.json runs `npm run build` automatically, so npm publish will fail-fast on any TypeScript or asset-bundling error even if Step 2 had been skipped (it isn't — Step 2 always runs)
173
244
  - Pre-publish rules live in `.claude/guidance/internal/pre-publish-rules.md` — never duplicate or paraphrase them in this skill; reference and follow
174
245
 
246
+ ## When to use `--check`
247
+
248
+ Use `--check` / `-ch` when:
249
+
250
+ - The PR didn't go through CI (e.g., publishing from a local-only branch)
251
+ - You're publishing a risky change (broad refactor, infrastructure surface, packaging changes)
252
+ - CI was red on something orthogonal you waived, and you want belt-and-suspenders locally
253
+ - You explicitly want to re-walk gates 7/8/10 manually regardless of trigger output
254
+
255
+ For the common case — publishing right after a merged green PR — the default mode is correct and meaningfully cheaper in tokens and time.
256
+
175
257
  ## See Also
176
258
 
177
- - `.claude/guidance/internal/pre-publish-rules.md` — Mandatory cross-platform + consumer-install gates that gate every publish
259
+ - `.claude/skills/publish/fingerprint.sh` — Trigger-fingerprint script invoked by Step 1
260
+ - `.claude/guidance/internal/pre-publish-rules.md` — Authoritative gate ruleset (gates 1–10) and trigger map
178
261
  - `docs/BUILD.md` — Step-by-step build/publish process this skill mirrors
179
262
  - `.claude/guidance/internal/dogfooding.md` — Why we catch consumer-facing regressions first as our own dependency
180
263
  - `harness/consumer-smoke/README.md` — Smoke harness profiles (clean + populated) that prove a consumer install works
264
+ - `.github/workflows/ci.yml` — Lint/build/test gates this skill skips by default
265
+ - `.github/workflows/consumer-install-smoke.yml` — Smoke gates this skill skips by default
@@ -13,14 +13,14 @@ Fully resets an epic so it can be re-tested from scratch.
13
13
  ## Usage
14
14
 
15
15
  ```
16
- /reset-epic 287 # Reset epic #287 for retesting
16
+ /reset-epic <epic-number> # e.g. /reset-epic 287, to reset that epic for retesting
17
17
  ```
18
18
 
19
19
  ## What It Does
20
20
 
21
21
  Given an epic issue number, perform ALL of the following:
22
22
 
23
- 1. **Identify stories**: Parse the epic body for linked issue numbers (e.g., `#284`, `#285`, `#286`)
23
+ 1. **Identify stories**: Parse the epic body for linked issue numbers
24
24
  2. **Close open PRs**: Find all open PRs referencing any story number or the epic number. Close them.
25
25
  3. **Delete remote branches**: Find and delete any remote branches related to the epic (e.g., `epic/<number>-*`, `feat/<story>-*`, `revert/epic-<number>-*`)
26
26
  4. **Delete local branches**: Delete any local branches matching the same patterns (skip the current branch)