moflo 4.10.17 → 4.10.19

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.
@@ -1,21 +1,31 @@
1
1
  ---
2
2
  name: guidance
3
- description: Add, edit, or audit guidance docs in this project's .claude/guidance/ directory following moflo's universal guidance rules. Default mode walks the user through one doc (creating or improving it); the -a flag audits every doc in the directory and offers per-file improvements.
4
- arguments: "[-a] <topic-or-path>"
3
+ description: Add, edit, or audit guidance docs. Default writes guidance for Claude (.claude/guidance/, Markdown, moflo universal rules). -h writes for human readers (docs/, lighter ruleset). --html emits HTML with a minimal default stylesheet instead of Markdown. -a audits the .claude/guidance/ directory.
4
+ arguments: "[-a] [-h] [--html] <topic-or-path>"
5
5
  ---
6
6
 
7
7
  # /guidance — Author and audit project guidance
8
8
 
9
- Help the user write, edit, or audit guidance files in their `.claude/guidance/` directory so Claude actually follows the rules they wrote. The skill applies the universal rules from `.claude/guidance/moflo-guidance-rules.md` — that doc is the single source of truth, do not paraphrase or duplicate it here.
9
+ Help the user write, edit, or audit guidance docs. By default the skill writes guidance **for Claude** into `.claude/guidance/` as Markdown and enforces the universal rules from `.claude/guidance/moflo-guidance-rules.md` (the single source of truth do not paraphrase or duplicate). Flags switch the **audience** (`-h` → humans) and the **output format** (`--html` → HTML).
10
10
 
11
11
  **Arguments:** $ARGUMENTS
12
12
 
13
- ## Modes
13
+ ## Modes and flags
14
14
 
15
- | Mode | Trigger | What it does |
16
- |------|---------|--------------|
17
- | Single-doc | no flag, optional `<topic-or-path>` arg | Walk the user through creating one new doc OR improving one existing doc |
18
- | Audit | `-a` flag | Two passes over `.claude/guidance/`: (1) **structural audit** scoring each existing doc against the universal rules, (2) **gap analysis** scanning the codebase to identify high-leverage topics that *should* have a guidance doc but don't. Both feed one combined triage report. |
15
+ | Flag | Effect |
16
+ |------|--------|
17
+ | (none) | Single-doc mode for **Claude** Markdown, full universal rules, destination `.claude/guidance/<kebab-topic>.md` |
18
+ | `-h` | Switch audience to **humans** Markdown, lighter human ruleset, destination `docs/<kebab-topic>.md` |
19
+ | `--html` | Emit **HTML** (with the minimal default stylesheet from Step 2.5) instead of Markdown. Composes with `-h`. |
20
+ | `-a` | **Audit** mode — two-pass triage of `.claude/guidance/` (Claude only). Cannot combine with `-h` or `--html`. |
21
+ | `<topic-or-path>` | Topic name (kebab-cased into the default destination) or an explicit file path that overrides the default destination. |
22
+
23
+ Combos:
24
+
25
+ - `-h --html` → HTML for humans, default destination `docs/<kebab-topic>.html`
26
+ - `--html` alone → HTML for Claude. Unusual: Claude reads Markdown, not HTML. Warn the user and offer to add `-h` (write to `docs/` instead).
27
+ - An explicit `<path>` always wins over the default destination. If the path's directory contradicts the audience flag (e.g. `-h .claude/guidance/foo.md`), warn but honor the path.
28
+ - `-a -h` / `-a --html` → reject; audit mode targets `.claude/guidance/` (Claude) and emits a triage report, not a doc.
19
29
 
20
30
  ## Step 0 — Memory First
21
31
 
@@ -27,22 +37,39 @@ mcp__moflo__memory_search { query: "guidance rules writing project conventions",
27
37
 
28
38
  This pulls the user's project-specific guidance conventions (if any) plus the moflo universal rules into context. The memory-first gate will block file reads otherwise.
29
39
 
30
- ## Step 1 — Pick the Mode and Target
40
+ ## Step 1 — Parse Flags, Audience, Format, and Target
41
+
42
+ Parse `$ARGUMENTS` into four values: **mode** (single-doc or audit), **audience** (claude or human), **format** (md or html), and **target path**.
43
+
44
+ **Mode** is `audit` if `-a` is present, otherwise `single-doc`.
31
45
 
32
- Parse the argument:
46
+ **Audience and format:**
33
47
 
34
- | Input | Mode | Target |
35
- |-------|------|--------|
36
- | empty | single-doc | Ask the user for a topic; default destination is `.claude/guidance/<kebab-topic>.md` |
37
- | `<topic>` (no slash) | single-doc | Use `.claude/guidance/<kebab-topic>.md`; if it exists, edit; else create |
38
- | `<path>` (has `.claude/guidance/`) | single-doc | Edit that exact file; if it doesn't exist, create at that path |
39
- | `-a` | audit | All `.md` files under `.claude/guidance/` recursively |
40
- | `-a <subdir>` | audit | All `.md` files under `.claude/guidance/<subdir>/` recursively |
48
+ | Flag combo | Audience | Format | Default destination |
49
+ |------------|----------|--------|---------------------|
50
+ | (none) | claude | md | `.claude/guidance/<kebab-topic>.md` |
51
+ | `-h` | human | md | `docs/<kebab-topic>.md` |
52
+ | `--html` | claude | html | `.claude/guidance/<kebab-topic>.html` **warn**: Claude reads MD; suggest adding `-h` |
53
+ | `-h --html` | human | html | `docs/<kebab-topic>.html` |
54
+
55
+ **Target path resolution:**
56
+
57
+ | Remaining positional arg | Single-doc behavior | Audit behavior |
58
+ |---|---|---|
59
+ | empty | Ask user for a topic; use default destination from the audience+format table above | Audit all `.md` files under `.claude/guidance/` recursively |
60
+ | `<topic>` (no slash) | Kebab-case and append to the default destination | Audit all `.md` files under `.claude/guidance/<topic>/` recursively |
61
+ | `<path>` (contains a slash) | Use that exact path; if the path's directory contradicts the audience flag, warn but honor the path | n/a — audit ignores explicit paths |
62
+
63
+ **Reject combos** that don't make sense and tell the user why: `-a -h`, `-a --html` (audit emits a triage report, not a doc; it's Claude-targeted by design).
41
64
 
42
65
  If single-doc and the file already exists, briefly summarize what it contains (one sentence) before walking the user through edits — confirm you have the right file.
43
66
 
44
67
  ## Step 2 — Single-Doc Mode
45
68
 
69
+ The rules applied depend on the audience. Confirm audience + format with the user in one line before writing — e.g. *"Writing human-readable MD into `docs/auth-overview.md` — apply lighter human ruleset?"*
70
+
71
+ ### Audience: Claude (default) — full universal rules
72
+
46
73
  Apply the universal rules from `.claude/guidance/moflo-guidance-rules.md`. The rules cover (do not paraphrase — read the source):
47
74
 
48
75
  1. Lead with `**Purpose:**` line after the H1
@@ -55,6 +82,22 @@ Apply the universal rules from `.claude/guidance/moflo-guidance-rules.md`. The r
55
82
  8. Optimize for RAG chunking
56
83
  9. End with a `## See Also` section
57
84
 
85
+ ### Audience: Humans (`-h` flag) — lighter human ruleset
86
+
87
+ Drop the rules that serve Claude's RAG retrieval and imperative-mood enforcement; keep the rules that serve readability for any reader.
88
+
89
+ | # | Universal rule | For humans | Why the change |
90
+ |---|----------------|------------|----------------|
91
+ | 1 | `**Purpose:**` line after H1 | **Keep** | Helps any reader orient quickly |
92
+ | 2 | Imperative voice (must/always/never) | **Drop** | Humans tolerate narrative prose; rigid imperative reads cold |
93
+ | 3 | Tables for decision logic | Keep when applicable | Tables aid scanning regardless of audience |
94
+ | 4 | Concrete examples (no `[placeholder]`) | **Keep** | Always |
95
+ | 5 | Under 500 lines | **Keep** | Readability cap |
96
+ | 6 | Specific H2 headings (not "Overview") | **Keep** | Discoverability + TOC quality |
97
+ | 7 | Avoid anti-patterns | **Modified** | Short prose preambles ARE allowed for humans; code-comments-as-rules still bad |
98
+ | 8 | Optimize for RAG chunking | **Drop** | Humans don't query a vector index |
99
+ | 9 | `## See Also` section at end | **Keep** | Helps human readers traverse to related docs |
100
+
58
101
  ### Creating a new doc — scaffold this shape
59
102
 
60
103
  ```markdown
@@ -99,6 +142,87 @@ For the loaded file, evaluate against the universal rules and report findings as
99
142
 
100
143
  Then propose edits as concrete diffs — never rewrite the whole file unless the user asks.
101
144
 
145
+ ## Step 2.5 — HTML Output (`--html` flag)
146
+
147
+ When `--html` is set, write the doc as a standalone HTML file with the minimal default stylesheet below. Author the content first as Markdown (so the audience-appropriate ruleset still drives structure and voice), then render it to HTML.
148
+
149
+ ### Conversion rules
150
+
151
+ - `# H1` → `<h1>` (one per file — the title)
152
+ - `## H2` → `<h2>` (section headings; emit a blank `<hr/>` between sections for readability parity with the MD `---` separators)
153
+ - `### H3` → `<h3>`
154
+ - `**Purpose:** …` → `<p class="purpose"><strong>Purpose:</strong> …</p>` (styled to stand out — see CSS below)
155
+ - Paragraphs → `<p>`
156
+ - Inline `code` → `<code>`; fenced ``` blocks → `<pre><code>` with no syntax highlighting (zero dependencies)
157
+ - `**bold**` → `<strong>`, `*italic*` → `<em>`
158
+ - Bulleted lists → `<ul><li>`; numbered lists → `<ol><li>`
159
+ - Markdown tables → real `<table><thead><tr><th>` / `<tbody><tr><td>`
160
+ - Relative `.md` links in `See Also` → rewrite to `.html` (so a `docs/` tree of `--html` docs cross-links correctly)
161
+ - HTML-escape `<`, `>`, `&` in body text; do not escape inside `<pre><code>` beyond the standard three
162
+
163
+ ### Minimal default stylesheet
164
+
165
+ Embed inline in `<style>` inside `<head>`. No external CSS, no JS, no web fonts. The goal is **readable standalone** on any browser without polish — restyle downstream if needed.
166
+
167
+ ```html
168
+ <!doctype html>
169
+ <html lang="en">
170
+ <head>
171
+ <meta charset="utf-8" />
172
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
173
+ <title><!-- doc H1 here --></title>
174
+ <style>
175
+ :root { color-scheme: light dark; }
176
+ body {
177
+ font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
178
+ line-height: 1.6;
179
+ max-width: 48rem;
180
+ margin: 2rem auto;
181
+ padding: 0 1.25rem;
182
+ color: #222;
183
+ background: #fff;
184
+ }
185
+ @media (prefers-color-scheme: dark) {
186
+ body { color: #e6e6e6; background: #14171a; }
187
+ a { color: #6fa8ff; }
188
+ code, pre { background: #1f2429; }
189
+ th { background: #1f2429; }
190
+ hr { border-color: #2a3038; }
191
+ }
192
+ h1 { font-size: 1.9rem; margin-top: 0; }
193
+ h2 { font-size: 1.4rem; margin-top: 2rem; border-bottom: 1px solid #ddd; padding-bottom: 0.25rem; }
194
+ h3 { font-size: 1.15rem; margin-top: 1.5rem; }
195
+ p.purpose {
196
+ border-left: 3px solid #6fa8ff;
197
+ padding: 0.5rem 0.75rem;
198
+ background: rgba(111, 168, 255, 0.08);
199
+ margin: 1rem 0;
200
+ }
201
+ code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; background: #f4f4f4; padding: 0.1rem 0.3rem; border-radius: 3px; font-size: 0.9em; }
202
+ pre { background: #f4f4f4; padding: 0.75rem 1rem; border-radius: 4px; overflow-x: auto; }
203
+ pre code { background: transparent; padding: 0; }
204
+ table { border-collapse: collapse; margin: 1rem 0; width: 100%; }
205
+ th, td { border: 1px solid #ddd; padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
206
+ th { background: #f4f4f4; font-weight: 600; }
207
+ hr { border: none; border-top: 1px solid #ddd; margin: 2rem 0; }
208
+ a { color: #0a58ca; text-decoration: none; }
209
+ a:hover { text-decoration: underline; }
210
+ </style>
211
+ </head>
212
+ <body>
213
+ <!-- rendered content here -->
214
+ </body>
215
+ </html>
216
+ ```
217
+
218
+ ### Workflow
219
+
220
+ 1. Author the Markdown body in memory exactly as Step 2 would, applying the audience-appropriate ruleset.
221
+ 2. **Show the rendered Markdown to the user first** and get sign-off on content (cheaper to iterate on MD than HTML).
222
+ 3. Render to HTML using the conversion rules and embed the stylesheet.
223
+ 4. Write the `.html` file to the resolved destination.
224
+ 5. Offer to also save the Markdown source alongside (e.g. `docs/foo.html` + `docs/foo.md`) so the doc remains editable as MD — recommend yes when the audience is humans.
225
+
102
226
  ## Step 3 — Audit Mode (`-a`)
103
227
 
104
228
  Audit mode runs **two passes**, then merges them into one triage report. Both passes are mandatory — never skip one to save tokens. The user typed `-a` because they want both signals.
@@ -174,7 +298,7 @@ Once the user confirms the doc looks right:
174
298
 
175
299
  1. Save the file via `Write` (new) or `Edit` (existing).
176
300
  2. If you added a new doc, ask the user which existing doc should link to it via See Also (rule #9 needs bidirectional links to work).
177
- 3. Suggest re-indexing if the user runs moflo: `node bin/index-guidance.mjs` (or just wait for next session-start auto-reindex).
301
+ 3. Suggest re-indexing if the user runs moflo: `node bin/index-guidance.mjs` (or just wait for next session-start auto-reindex). **Only Claude-audience MD docs in `.claude/guidance/` are indexed** — human docs in `docs/` and any `.html` output sit outside the RAG index by design.
178
302
 
179
303
  ## Cheatsheet — Universal Rules Recap
180
304
 
@@ -199,6 +323,8 @@ The full rules live in `.claude/guidance/moflo-guidance-rules.md`. Quick recap:
199
323
  - **Never auto-write opinionated content.** Guidance is the user's project policy; ask before injecting your own opinions.
200
324
  - **Confirm per file in audit mode.** Bulk edits to the user's guidance directory are high-blast-radius — confirm each one.
201
325
  - **The `moflo-` filename prefix is moflo-only.** Consumer projects writing their own guidance do not need it; it exists to avoid collisions when moflo's shipped guidance syncs into a consumer's directory.
326
+ - **`-h` does not change Step 0.** Memory search is still mandatory — only the ruleset and destination change. Audit mode (`-a`) remains Claude-only and ignores `-h` / `--html`.
327
+ - **`--html`: sign off on the Markdown first.** Render to HTML only after the user has approved the rendered Markdown — iterating on the HTML directly is slower and obscures content issues behind markup.
202
328
 
203
329
  ## See Also
204
330
 
package/README.md CHANGED
@@ -21,13 +21,13 @@ Restart Claude Code. That's it — memory, indexing, gates, and routing are all
21
21
 
22
22
  Or — just ask Claude to install MoFlo into your project and initialize it!
23
23
 
24
- To verify everything is running, ask Claude to run `flo healer` with full diagnostics after restarting. If anything fails, ask Claude to fix it with `flo healer --fix`. (`flo doctor` is still accepted as an alias.)
24
+ To verify everything is running, run the **`/healer`** skill inside Claude Code (or `flo healer` from the CLI) after restarting — it runs full diagnostics. If anything fails, run **`/healer --fix`** to automatically fix issues.
25
25
 
26
26
  ## Next Step: Consult the Eldar
27
27
 
28
28
  After installing moflo, the single highest-leverage thing you can do for the best experience is run **`/eldar`** inside a Claude Code session.
29
29
 
30
- Where `flo healer` verifies that *moflo itself* is wired up correctly, **`/eldar` audits how Claude is set up to actually use your project** — guidance docs, CLAUDE.md, memory namespaces, hook/MCP wiring, model routing, and whether every technology in your stack (TypeScript, Python, Rust, Go, etc.) has matching guidance for Claude to lean on. The stack → guidance cross-reference alone is often the difference between *"Claude feels lost in this codebase"* and *"Claude knows this codebase"*.
30
+ Where `/healer` (or `flo healer` from the CLI) verifies that *moflo itself* is wired up correctly, **`/eldar` audits how Claude is set up to actually use your project** — guidance docs, CLAUDE.md, memory namespaces, hook/MCP wiring, model routing, and whether every technology in your stack (TypeScript, Python, Rust, Go, etc.) has matching guidance for Claude to lean on. The stack → guidance cross-reference alone is often the difference between *"Claude feels lost in this codebase"* and *"Claude knows this codebase"*.
31
31
 
32
32
  ```
33
33
  /eldar # Read-only audit; categorized findings, severity-ranked
@@ -110,7 +110,7 @@ In interactive mode (`flo init` without `--yes`), it shows what it found and let
110
110
  If `flo init` detects an existing `.claude/settings.json` or `.claude-flow/` directory (from a prior Claude Flow or Ruflo installation), it treats the project as already initialized and runs in **update mode** — merging MoFlo's hooks and configuration into your existing setup without overwriting your data. Specifically:
111
111
 
112
112
  - **Hooks** — If your `.claude/settings.json` already has MoFlo-style gate hooks (`flo gate`), the hooks step is skipped. Otherwise, MoFlo's hooks are written into the file (existing non-MoFlo hooks are not removed).
113
- - **MCP servers** — MoFlo registers itself as the `moflo` server in `.mcp.json`. If you had `claude-flow` or `ruflo` MCP servers configured previously, those entries remain untouched — you can remove them manually once you've verified MoFlo is working. The `flo healer` command checks for the `moflo` server specifically.
113
+ - **MCP servers** — MoFlo registers itself as the `moflo` server in `.mcp.json`. If you had `claude-flow` or `ruflo` MCP servers configured previously, those entries remain untouched — you can remove them manually once you've verified MoFlo is working. The `/healer` skill (or `flo healer` from the CLI) checks for the `moflo` server specifically.
114
114
  - **Config files** — `moflo.yaml`, `CLAUDE.md`, and `.claude/skills/flo/` follow the same skip-if-exists logic. Use `--force` to regenerate them.
115
115
 
116
116
  To force a clean re-initialization over an existing setup:
@@ -450,7 +450,7 @@ Beyond `/flo`, `/spell-builder`, and `/eldar`, MoFlo ships a handful of focused
450
450
 
451
451
  | Skill | Purpose |
452
452
  |-------|---------|
453
- | `/guidance` | Author and audit guidance docs in `.claude/guidance/`. Default mode walks you through one doc; `/guidance -a` audits every doc against the universal guidance rules (Purpose lines, See Also, line counts, hedged language). |
453
+ | `/guidance` | Author and audit guidance docs. Default writes guidance for Claude into `.claude/guidance/` as Markdown applying moflo's universal rules. `-h` switches the audience to humans (lighter ruleset, writes into `docs/`). `--html` emits HTML with a minimal default stylesheet instead of Markdown. `-a` audits every doc in `.claude/guidance/` against the universal rules. |
454
454
  | `/simplify` | Adaptive code review on the current diff. Tier-based fan-out — trivial edits get a self-review, small diffs get one routed agent, cross-cutting refactors get three parallel agents. Routes through the moflo model router for cost-aware execution. |
455
455
  | `/spell-schedule` | Schedule a spell on the local moflo daemon (cron, interval, or one-time) without leaving the chat. For remote Anthropic-cloud agents on a schedule, use Claude Code's built-in `/schedule` instead. |
456
456
 
@@ -2,5 +2,5 @@
2
2
  * Auto-generated by build. Do not edit manually.
3
3
  * Source of truth: root package.json → scripts/sync-version.mjs
4
4
  */
5
- export const VERSION = '4.10.17';
5
+ export const VERSION = '4.10.19';
6
6
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moflo",
3
- "version": "4.10.17",
3
+ "version": "4.10.19",
4
4
  "description": "MoFlo — AI agent orchestration for Claude Code. A standalone, opinionated toolkit with semantic memory, learned routing, gates, spells, and the /flo issue-execution skill.",
5
5
  "main": "dist/src/cli/index.js",
6
6
  "type": "module",
@@ -95,7 +95,7 @@
95
95
  "@typescript-eslint/eslint-plugin": "^7.18.0",
96
96
  "@typescript-eslint/parser": "^7.18.0",
97
97
  "eslint": "^8.0.0",
98
- "moflo": "^4.10.16",
98
+ "moflo": "^4.10.18",
99
99
  "tsx": "^4.21.0",
100
100
  "typescript": "^5.9.3",
101
101
  "vitest": "^4.0.0"