diff --git a/.claude/commands/save.md b/.claude/commands/save.md index 2384240..9fb0084 100644 --- a/.claude/commands/save.md +++ b/.claude/commands/save.md @@ -59,7 +59,30 @@ When in doubt, include MORE detail — future sessions search these logs to reco --- -## Phase 3 — Sync +## Phase 3 — Wiki Refresh (before sync) + +Keep the worked-on wiki article current so it ships in the **same commit** as the session log. This runs before sync. **Refresh only** — it never re-synthesizes narrative (that is `/wiki-compile --full`, run on demand). + +1. Derive the slug from the session-log path written in Phase 2: + - `clients//session-logs/...` → client `` + - `projects//session-logs/...` → project article slug (e.g. `guru-rmm`, `guru-connect`) + - Root `session-logs/...` → **skip this phase entirely** (no single article is implied) + +2. **Article exists** (`wiki/clients/.md` or `wiki/projects/.md`) → apply the surgical refresh from `/wiki-compile` Phase 4 "Refresh Mode": + - Frontmatter: set `last_compiled` (today) and `compiled_by` (`/claude-main`); append the new session-log path to `sources:` (dedupe). + - **Clients only:** refresh "Hours remaining" and the "Active Work" ticket list from live Syncro (read-only GET; customer id from the article frontmatter). Softfail if Syncro is unreachable — still bump `last_compiled` + `sources`. + - **Never** touch Patterns, History, or Summary — those require `--full` or human review. + +3. **No article yet** → do not auto-seed here (seeding is a full Ollama synthesis, too heavy for every save). Emit: + ``` + [INFO] No wiki article for '' yet. Run /wiki-compile client: to seed it. + ``` + +**Softfail:** a wiki-refresh failure must NEVER block the save. Log it and continue to sync. The refreshed article + `wiki/index.md` are picked up by `sync.sh`'s `git add -A` and committed alongside the session log. + +--- + +## Phase 4 — Sync ```bash bash .claude/scripts/sync.sh @@ -81,27 +104,6 @@ Wiki updates (if any): articles updated (clients/projects/systems/patter --- -## Phase 4 — Unseeded Wiki Check - -After sync completes, check whether the session log was written for a client or project that has no wiki article yet. - -**Logic:** -- Determine the slug from the session log path (e.g., `clients/kittle/session-logs/...` → slug = `kittle`) -- Check: does `wiki/clients/.md` (or `wiki/projects/.md`) exist? -- If YES → no action needed -- If NO → emit after the post-commit summary: - -``` -[INFO] No wiki article for '' yet. - Session log saved to clients//session-logs/. - Run /wiki-compile client: to seed the wiki article. -``` - -For general (root) session logs, skip this check — no specific client/project is implied. - -This check is informational only — do not block the save or prompt for confirmation. - ---- ## Cross-user note handling (CRITICAL)