diff --git a/docs/superpowers/plans/2026-05-15-ruflo-big-bang-integration.md b/docs/superpowers/plans/2026-05-15-ruflo-big-bang-integration.md new file mode 100644 index 00000000..f25319d1 --- /dev/null +++ b/docs/superpowers/plans/2026-05-15-ruflo-big-bang-integration.md @@ -0,0 +1,1203 @@ +# Ruflo Big-Bang Integration Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Установить `ruflo@latest` (CLI + MCP server + daemon, все 32 plugins) как новый верхний уровень оркестрации Лидерра CRM; переписать 4 normative files под «чистый верх» архитектуру (Pravila/PSR_v1/CLAUDE.md/Tooling — все становятся sub-policies); создать форк карты `docs/automation-graph-ruflo.html`; принять cost-benefit + risks в Section 10 spec'а как deliverable «что получим». + +**Architecture:** ruflo Queen-led routing — entry-point для всех задач; SONA neural pattern classifier → swarm dispatch / sub-policy delegate. Existing 8-level hierarchy (Pravila §12 → … → memory) становится 9-level где ruflo на уровне −1. Существующие hard rules переезжают в `CLAUDE.local.md` (gitignored) как ruflo sub-policies. + +**Tech Stack:** ruflo v3.7.0-alpha.33 (MIT, ruvnet/ruflo, Node.js + Rust WASM kernels), PM2 + pm2-windows-service (Windows daemon), HNSW vector store в `~/.ruflo-cache/`, vis-network 9.1.9 (карта-форк), lefthook pre-commit gauntlet (gitleaks/markdownlint/cspell/pint/larastan/squawk/eslint), Pest 4 + Vitest регрессионные test runners. + +**Spec reference:** [docs/superpowers/specs/2026-05-15-ruflo-integration-design.md](../specs/2026-05-15-ruflo-integration-design.md) (commit `e55572e`). + +--- + +## File Structure + +**Created:** + +- `CLAUDE.md.pre-ruflo.bak` — Day 2 backup before ruflo init (gitignored) +- `CLAUDE.local.md` — ruflo Queen routing config + 4 sub-policies из старых hard rules (gitignored) +- `.claude-flow/` — ruflo scaffold (gitignored) +- `~/.ruflo-cache/` — HNSW vector store (outside repo, ~1-5 GB) +- `docs/automation-graph-ruflo.html` — форк iter3 карты с ruflo overlay (~1700-1800 lines) +- `docs/superpowers/plans/2026-05-15-ruflo-big-bang-integration.md` — этот план + +**Modified:** + +- `CLAUDE.md` — §1 priority chain +уровень −1; §5 п.10 sub-policy; §3 +ruflo chapter; version v1.93 → **v2.0** +- `docs/Pravila_raboty_Claude_v1_1.md` — §12 → sub-policy; §5 ПДн +note; v1.13 → **v1.14** +- `docs/Plugin_stack_rules_v1.md` — R0 → sub-policy; v2.1 → **v3.0** +- `docs/Tooling_v8_3.md` — §0 35 → ~67; +§4.10; v1.17 → **v2.0** +- `docs/CHANGELOG_claude_md.md` — entries для v1.14/v3.0/v2.0/v2.0 +- `.mcp.json` — +ruflo entry +- `~/.claude/settings.json` — enabledPlugins.ruflo-* (32) + watchdog hook +- `.gitignore` — +.claude-flow/, +CLAUDE.local.md, +.env.local, +CLAUDE.md.pre-ruflo.bak, +.ruflo-cache/ +- `lefthook.yml` — +cost-watchdog job (опционально) +- `cspell-words.txt` — добавлены ruflo/ruvnet/hnsw/sona/ruvllm/многоагентный/форк/форка/bak (уже в commit `e55572e`) + +--- + +## Phase 1: Pre-flight Task 0 (Day 1, ~15 min) + +Цель: верифицировать реальные параметры ruflo на этой машине **до** деструктивных действий. Любой Q1-Q10 из §12 спеки получает конкретный ответ. + +### Task 1.1: Verify ruflo package on npm + +**Files:** none (read-only npm queries) + +- [ ] **Step 1.1.1: Run npm view** + +```powershell +npm view ruflo version dist-tags +``` + +Expected output: версия (`X.Y.Z-alpha.NN`) + список dist-tags (latest, alpha, beta). Записать конкретное значение в [docs/superpowers/specs/2026-05-15-ruflo-integration-design.md](../specs/2026-05-15-ruflo-integration-design.md) §12 Q1 в Task 1.7. + +Если ошибка `npm ERR! 404` — ruflo не существует на npm под этим именем. STOP plan. Fall back: проверить `@ruvnet/ruflo` scoped name через `npm view @ruvnet/ruflo`. Если оба 404 — ruflo установка через npm невозможна на момент 2026-05-15; план не выполним, эскалировать заказчику. + +- [ ] **Step 1.1.2: Verify package metadata** + +```powershell +npm view ruflo description repository.url license +``` + +Expected: description упоминает «agent orchestration» / «Claude», repository URL = `https://github.com/ruvnet/ruflo`, license = MIT. Любое несовпадение — possibly wrong package, STOP plan. + +### Task 1.2: Verify ruflo CLI invocation + +**Files:** none + +- [ ] **Step 1.2.1: Test CLI exists** + +```powershell +npx ruflo@latest --version +``` + +Expected: prints version. Stderr может содержать download messages — игнорировать. + +Если ошибка `bash: npx: command not found` — npm/node не в PATH. STOP plan, fix Node.js installation. Если ошибка `Error: Cannot find module 'ruflo'` — пакет не публикуется на npm, см. Task 1.1. + +- [ ] **Step 1.2.2: List CLI commands** + +```powershell +npx ruflo@latest --help +``` + +Expected: список subcommands (`init`, `mcp`, `plugins`, `daemon`, `doctor`, `config`, `cost`, и т. д.). Скопировать output в spec §12 Q10 в Task 1.7. Verify конкретно: `init`, `mcp`, `plugins`, `daemon` subcommands есть. + +### Task 1.3: Enumerate 32 plugins + +**Files:** none + +- [ ] **Step 1.3.1: List plugins** + +```powershell +npx ruflo@latest plugins list +``` + +Expected: array из ~32 plugin entries с именами (e.g., `ruflo-core`, `ruflo-intelligence`, `ruflo-memory`, …). + +Записать **точный список** в spec §12 Q1 в Task 1.7 как substitution для `[~19-20]` row в §3 таблице. + +Если команда не существует или возвращает 0 plugins — план переходит в degraded mode: устанавливаем только то что есть по `npx ruflo plugins available`, документируем в spec как known limitation. + +- [ ] **Step 1.3.2: Categorize plugins** + +Прочитать output Step 1.3.1, скласифицировать по 10 категориям из spec §3 (Core, Agents, Memory/RAG, DevTools, Loop-workers, LLM routing, Federation, Web scraping, MCP, Остальные). Если новые категории, не указанные в spec — добавить в spec §3 в Task 1.7. + +### Task 1.4: Disk space + path checks + +**Files:** none + +- [ ] **Step 1.4.1: Check user home disk space** + +```powershell +Get-PSDrive C | Format-List Used,Free +``` + +Expected: Free ≥ 5 GB (для `~/.ruflo-cache/` HNSW vector store). + +Если Free < 5 GB — план переходит в degraded mode: устанавливаем ruflo, но HNSW размер capped через ruflo config (если поддерживается). Документируем риск. + +- [ ] **Step 1.4.2: Get ruflo cache-dir path** + +```powershell +npx ruflo@latest config get cache-dir +``` + +Expected: путь вида `C:\Users\\.ruflo-cache` или подобный. Записать в spec §12 Q2. + +Если команда не существует — пропустить шаг, использовать `~/.ruflo-cache/` по конвенции (POSIX-style home expansion на Windows работает через npm `path.homedir()`). + +### Task 1.5: PM2 install — elevation check + +**Files:** none + +- [ ] **Step 1.5.1: Check current PowerShell elevation** + +```powershell +([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) +``` + +Expected: `True` (elevated) или `False` (not elevated). + +Записать в spec §12 Q4. Если `False` — Day 2 step 2.8 (pm2-service-install) либо требует ручного elevation от заказчика, либо fallback на foreground `pm2 start` без service wrapping. + +- [ ] **Step 1.5.2: Check pm2 + pm2-windows-service availability** + +```powershell +npm ls -g pm2 pm2-windows-service 2>$null +``` + +Expected: либо оба установлены (skip install), либо «empty» — install needed Day 2. + +### Task 1.6: ruflo MCP server smoke test + +**Files:** none + +- [ ] **Step 1.6.1: Try MCP start (foreground)** + +```powershell +$proc = Start-Process -FilePath "npx" -ArgumentList "ruflo@latest","mcp","start" -PassThru -NoNewWindow +Start-Sleep -Seconds 8 +if ($proc.HasExited) { + Write-Host "FAIL: ruflo mcp exited with code $($proc.ExitCode)" +} else { + Write-Host "OK: ruflo mcp running pid=$($proc.Id)" + Stop-Process -Id $proc.Id -Force +} +``` + +Expected: «OK: ruflo mcp running pid=…» после 8 секунд (стартует фоном без exit). + +Если «FAIL» — log в spec §12 Q5; план переходит в degraded mode (MCP не интегрируется, только CLI/daemon). Если порт-конфликт с существующими MCP entries (.mcp.json playwright/github/laravel-boost/sentry/redis) — попробовать `npx ruflo@latest mcp start --port ` (alt: 5500-5599 range). + +### Task 1.7: Update spec §12 with concrete answers + commit + +**Files:** + +- Modify: `docs/superpowers/specs/2026-05-15-ruflo-integration-design.md` + +- [ ] **Step 1.7.1: Edit spec §12 Open questions** + +Заменить **каждый** Q1-Q10 placeholder ответом из Task 1.1-1.6: + +| Q | Замена | +|---|---| +| Q1 | Точный список plugins из Task 1.3.1 | +| Q2 | cache-dir path из Task 1.4.2 | +| Q3 | Из Task 1.2.2 + (если есть) `npx ruflo auth status` | +| Q4 | True/False из Task 1.5.1 | +| Q5 | OK/FAIL из Task 1.6.1 | +| Q6 | «Verify on Day 6 regression» (без изменений) | +| Q7 | «Push direct main per settings rule Bash(git push origin main:*)» (без изменений) | +| Q8 | «Day 2 step 2.1: cp + commit baseline e55572e» (без изменений) | +| Q9 | «TBD Day 2 после ruflo memory reindex выполнения» (без изменений) | +| Q10 | «From Task 1.2.2 output» | + +- [ ] **Step 1.7.2: Commit spec updates** + +```powershell +git add docs/superpowers/specs/2026-05-15-ruflo-integration-design.md +git commit -m "chore(spec): Day 1 pre-flight Task 0 results — concrete answers for §12 Q1-Q10" +``` + +Expected: pre-commit gauntlet ✅ (gitleaks/markdownlint/cspell). Commit hash записать. + +**Decision gate:** Если Task 1.1 → 1.6 имеют **критические fails** (Task 1.1 404, Task 1.2 npx broken, Task 1.6 mcp FAIL и нет fallback) — STOP plan, эскалировать заказчику. Иначе → Phase 2. + +--- + +## Phase 2: Install ruflo (Day 2, ~20 min) + +### Task 2.1: Backup CLAUDE.md + commit baseline + +**Files:** + +- Create: `CLAUDE.md.pre-ruflo.bak` (gitignored) +- Modify: `.gitignore` + +- [ ] **Step 2.1.1: Copy CLAUDE.md to backup** + +```powershell +Copy-Item -Path "CLAUDE.md" -Destination "CLAUDE.md.pre-ruflo.bak" -Force +Get-Item "CLAUDE.md.pre-ruflo.bak" | Select-Object Length +``` + +Expected: Length ≈ 51000-55000 bytes (must match `Get-Item CLAUDE.md | Select Length`). + +- [ ] **Step 2.1.2: Add bak to .gitignore** + +```powershell +$gitignore = Get-Content .gitignore -Raw +if ($gitignore -notmatch "CLAUDE\.md\.pre-ruflo\.bak") { + Add-Content .gitignore "`nCLAUDE.md.pre-ruflo.bak`n" +} +``` + +Verify with `Get-Content .gitignore -Tail 3` — последняя строка должна быть `CLAUDE.md.pre-ruflo.bak`. + +- [ ] **Step 2.1.3: Verify baseline state — HEAD is e55572e + спека** + +```powershell +git log --oneline -1 +git status --short +``` + +Expected: HEAD = `e55572e` (spec commit). Status может иметь modified `app/dev-indices.json` — игнорируем (unrelated to plan). + +### Task 2.2: Run ruflo init + +**Files:** various scaffolded by ruflo + +- [ ] **Step 2.2.1: Inspect init flags** + +```powershell +npx ruflo@latest init --help +``` + +Expected: list of flags (e.g., `--skip-claude-md`, `--config-only`, `--dry-run`, `--force`). Записать flags в notes для Step 2.2.2. + +- [ ] **Step 2.2.2: Run init with safe scaffold** + +```powershell +# Используем --dry-run если флаг присутствует, чтобы увидеть что будет создано +npx ruflo@latest init --dry-run 2>&1 | Tee-Object -FilePath ruflo-init-dryrun.log +``` + +Expected: список файлов, которые **будут** созданы / модифицированы. Прочитать log: если ruflo planning to write/overwrite `CLAUDE.md` — STOP, добавить `--skip-claude-md` или удалить `CLAUDE.md` from init scope. + +- [ ] **Step 2.2.3: Actual init** + +```powershell +npx ruflo@latest init 2>&1 | Tee-Object -FilePath ruflo-init.log +``` + +Expected: created `.claude-flow/`, `CLAUDE.local.md`. Должно быть напечатано «Setup complete» или подобное. + +- [ ] **Step 2.2.4: Verify CLAUDE.md NOT modified** + +```powershell +git diff CLAUDE.md +``` + +Expected: **empty diff** (CLAUDE.md untouched). Если diff не пустой — CRITICAL: восстановить из backup: + +```powershell +Copy-Item -Path "CLAUDE.md.pre-ruflo.bak" -Destination "CLAUDE.md" -Force +``` + +И эскалировать к заказчику: «ruflo init перезаписывает CLAUDE.md несмотря на флаги — нужен совместимый scaffold mode». + +### Task 2.3: Add .gitignore entries for ruflo runtime + +**Files:** + +- Modify: `.gitignore` + +- [ ] **Step 2.3.1: Append ruflo entries** + +```powershell +$additions = @" + +# Ruflo big-bang integration (2026-05-15) +.claude-flow/ +CLAUDE.local.md +.env.local +~/.ruflo-cache/ +ruflo-init.log +ruflo-init-dryrun.log +"@ +Add-Content .gitignore $additions +``` + +- [ ] **Step 2.3.2: Verify gitignore matches scaffold** + +```powershell +git check-ignore -v .claude-flow/ CLAUDE.local.md +``` + +Expected: оба пути returned as ignored. Если нет — Edit `.gitignore` вручную. + +### Task 2.4: Add ruflo to .mcp.json + +**Files:** + +- Modify: `.mcp.json` + +- [ ] **Step 2.4.1: Read current .mcp.json** + +```powershell +Get-Content .mcp.json -Raw +``` + +Записать существующие entries (playwright/github/laravel-boost/sentry/redis). + +- [ ] **Step 2.4.2: Add ruflo entry** + +Edit `.mcp.json`, добавить под `mcpServers`: + +```json +"ruflo": { + "command": "npx", + "args": ["-y", "ruflo@latest", "mcp", "start"], + "comment": "Ruflo orchestration MCP server — exposes ~210 tools (Core/Intelligence/Agents/Memory/DevTools). v3.7.0-alpha.33+ MIT. Pending sync в Tooling §4.10 (Day 3 Task 3.4)." +} +``` + +- [ ] **Step 2.4.3: Validate JSON** + +```powershell +Get-Content .mcp.json -Raw | ConvertFrom-Json | Out-Null +if ($?) { Write-Host "JSON valid" } else { Write-Host "JSON BROKEN" } +``` + +Expected: `JSON valid`. + +### Task 2.5: Enable ruflo plugins в settings.json + +**Files:** + +- Modify: `~/.claude/settings.json` + +- [ ] **Step 2.5.1: Read current settings.json** + +```powershell +Get-Content $env:USERPROFILE\.claude\settings.json -Raw +``` + +Найти existing `enabledPlugins`. + +- [ ] **Step 2.5.2: Generate enabledPlugins entries from Task 1.3.1** + +Для каждого plugin из Task 1.3.1 listing, добавить `"@": true` в `enabledPlugins` object. Если ruflo marketplace = `ruvnet/ruflo` — `"ruflo-core@ruvnet-ruflo": true` и т.п. + +- [ ] **Step 2.5.3: Validate settings JSON** + +```powershell +Get-Content $env:USERPROFILE\.claude\settings.json -Raw | ConvertFrom-Json | Out-Null +if ($?) { Write-Host "settings.json valid" } +``` + +### Task 2.6: Verify ruflo MCP can be reached + +**Files:** none + +- [ ] **Step 2.6.1: Smoke test MCP after .mcp.json edit** + +В Claude Code session: после restart Claude (либо отметить «требуется restart»), проверить что `ruflo` tools доступны через `ToolSearch query="select:mcp__ruflo__*"`. + +Альтернатива (без Claude restart) — пробежать MCP server вручную: + +```powershell +$proc = Start-Process -FilePath "npx" -ArgumentList "ruflo@latest","mcp","start" -PassThru -NoNewWindow +Start-Sleep -Seconds 8 +if (-not $proc.HasExited) { + Write-Host "MCP server alive" + Stop-Process -Id $proc.Id -Force +} +``` + +### Task 2.7: Commit ruflo install (scaffold + .mcp.json + .gitignore + settings.json) + +**Files:** все из Tasks 2.1-2.5 + +- [ ] **Step 2.7.1: Stage files** + +```powershell +git add .gitignore .mcp.json +# Note: settings.json в ~/.claude/ — outside repo, не коммитим +# .claude-flow/, CLAUDE.local.md — gitignored, не появляются в git status +git status --short +``` + +Expected: `M .gitignore` и `M .mcp.json` staged. + +- [ ] **Step 2.7.2: Commit** + +```powershell +git commit -m "feat(ruflo): init scaffold + .mcp.json + .gitignore — Day 2 part 1" +``` + +Expected: pre-commit gauntlet ✅. Записать commit hash. + +### Task 2.8: PM2 daemon setup (conditional на Task 1.5.1) + +**Files:** none (system-level install) + +- [ ] **Step 2.8.1: If elevation = True (Task 1.5.1)** + +```powershell +# Elevated PowerShell: +npm i -g pm2 pm2-windows-service +pm2-service-install -n ruflo-daemon +pm2 start "npx ruflo@latest daemon start" --name ruflo-daemon +pm2 save +pm2 status +``` + +Expected: `pm2 status` показывает `ruflo-daemon` online. + +- [ ] **Step 2.8.2: If elevation = False (Task 1.5.1)** + +Запросить заказчика elevated PowerShell и выполнить команды из Step 2.8.1, ИЛИ fallback на foreground: + +```powershell +npm i -g pm2 +pm2 start "npx ruflo@latest daemon start" --name ruflo-daemon +``` + +Это foreground PM2 (без Windows service wrapping). Daemon будет жить пока сессия открыта. Документировать как known limitation в spec §12 Q4. + +### Task 2.9: Set RUFLO_DAEMON_MAX_USD_PER_DAY env + +**Files:** + +- Create: `.env.local` (gitignored, in repo root) + +- [ ] **Step 2.9.1: Create .env.local** + +```powershell +# .env.local не должен быть в репо (уже в .gitignore из Task 2.3.1) +@" +# Ruflo cost-budget cap (per spec §7) +RUFLO_DAEMON_MAX_USD_PER_DAY=10 +"@ | Out-File -FilePath .env.local -Encoding utf8 -NoNewline +``` + +Expected: .env.local создан, `git status` не показывает его (gitignored). + +--- + +## Phase 3: Rewrite 4 normative files (Day 3, ~25 min, parallel via subagents) + +**Параллелизация:** 4 subagent'а через `Agent` tool dispatch'аются одновременно. Каждый получает один файл + точное описание правок + возвращает diff. Главный agent последовательно применяет 4 атомарных коммита. + +### Task 3.1: Pravila §12 → sub-policy + +**Files:** + +- Modify: `docs/Pravila_raboty_Claude_v1_1.md` + +- [ ] **Step 3.1.1: Dispatch subagent** + +Через `Agent` tool, subagent_type `general-purpose`: + +> Prompt to subagent: «Edit `docs/Pravila_raboty_Claude_v1_1.md` for ruflo big-bang sub-policy conversion. Read the full file first. Then make these specific changes: +> +> 1. §12 title: «§12. Superpowers — hard rule» → «§12. Superpowers — sub-policy (ruflo routing preference)» +> 2. §12 first paragraph: рамка «hard rule, неотменяемое» → «sub-policy ruflo Queen-led routing: prefer Superpowers skills for interactive turns; не absolute block» +> 3. §12.4 «§9 не применяется» → «ruflo Queen может delegate non-Superpowers tools, если routing-pattern matches non-interactive criteria» +> 4. §5 ПДн: добавить inline note «(execution-layer rule: gitleaks pre-commit фильтр обеспечивает технический catch; не regulatory rule выше ruflo)» +> 5. §0 cross-refs row: «v2.0+» → «v3.0+» для PSR_v1; «v1.92+» → «v2.0+» для CLAUDE.md; «v1.17+» → «v2.0+» для Tooling +> 6. Header version: v1.13 → v1.14; добавить «Дата: 2026-05-15» +> 7. §9 «История версий» (если есть) или создать раздел: добавить запись «v1.14 от 2026-05-15 — ruflo big-bang sub-policy conversion: §12 hard rule → sub-policy; §5 ПДн execution-layer note. Связано: ruflo v3.7.0-alpha.33 integration via spec/plan 2026-05-15» +> +> Return: diff против существующего файла. Не commit yourself, не запускай тесты. Return raw diff as text.» + +- [ ] **Step 3.1.2: Apply subagent diff via Edit tool** + +Главный agent читает diff из subagent output, применяет Edit'ы последовательно. + +- [ ] **Step 3.1.3: Verify diff** + +```powershell +git diff docs/Pravila_raboty_Claude_v1_1.md +``` + +Expected: показаны 6 правок из Step 3.1.1. + +- [ ] **Step 3.1.4: Commit Pravila changes** + +```powershell +git add docs/Pravila_raboty_Claude_v1_1.md +git commit -m "docs(pravila): §12 → sub-policy + §5 ПДн execution-layer note — v1.14 (ruflo big-bang Day 3)" +``` + +Expected: pre-commit ✅. Если cspell fail на новых терминах (Queen-led, sub-policy, …) — append к `cspell-words.txt` в **отдельном** prep-commit перед Day 3 или within этого commit'а. + +### Task 3.2: PSR_v1 R0 → sub-policy + +**Files:** + +- Modify: `docs/Plugin_stack_rules_v1.md` + +- [ ] **Step 3.2.1: Dispatch subagent** + +> Prompt: «Edit `docs/Plugin_stack_rules_v1.md` for ruflo big-bang. Read the full file first (~1500 lines). Then: +> +> 1. R0 title: «Правило 0 — базовое: единый stack и обязательный gate» → «Правило 0 — Sub-policy: paired-stack delegation pattern» +> 2. R0.1 «Уровень и головенство» таблица: добавить новый row top «−1. ruflo Queen-led routing | ✅ stack под ruflo делегирует». Изменить uровень 3 row «PSR_v1 (этот документ) | — это и есть stack» → «PSR_v1 (этот документ) | sub-policy ruflo routing» +> 3. R0.2 «Обязательный gate» переписать первое предложение: «Каждая задача… сначала проходит через stack» → «Каждая задача проходит через ruflo Queen-led routing первой; ruflo либо delegates в stack-gate, либо handles напрямую через swarm» +> 4. R0.6 «Hard-стоп даже в Auto mode» — добавить пункт 12 «ruflo Queen routes a task as «autonomous swarm» but human absent for review — pause до review» +> 5. Header version v2.1 → v3.0; добавить «Дата: 2026-05-15» +> 6. История версий: добавить «v3.0 (2026-05-15) — major: R0 stack-gate → sub-policy ruflo Queen-led routing. R0.1 +ruflo level −1. R0.6 +п.12 swarm-pause-without-review. Связано: Pravila v1.14, CLAUDE.md v2.0, Tooling v2.0» +> 7. Cross-refs шапки: Pravila v1.11+ → v1.14+; Tooling v1.16+ → v2.0+; CLAUDE.md v1.88+ → v2.0+ +> +> Return diff.» + +- [ ] **Step 3.2.2: Apply diff** + +- [ ] **Step 3.2.3: Verify** + +```powershell +git diff docs/Plugin_stack_rules_v1.md +``` + +- [ ] **Step 3.2.4: Commit** + +```powershell +git add docs/Plugin_stack_rules_v1.md +git commit -m "docs(psr_v1): R0 → sub-policy + R0.1 +ruflo level −1 + R0.6 +п.12 swarm-pause — v3.0 (ruflo big-bang Day 3)" +``` + +### Task 3.3: CLAUDE.md §1/§5 + §3 ruflo chapter + +**Files:** + +- Modify: `CLAUDE.md` (через claude-md-management или прямой Edit — см. §1.4 spec'а, прямой Edit разрешён по решению заказчика) + +- [ ] **Step 3.3.1: Dispatch subagent** + +> Prompt: «Edit `CLAUDE.md` для ruflo big-bang. Read full file first (~51KB). Then: +> +> 1. Header version v1.93 → v2.0; «Audit #3 deferred fixes sprint closure…» → «ruflo big-bang integration: 8 → 9-level priority chain, ruflo Queen-led routing на уровне −1, §5 п.10 sub-policy, §3 +ruflo chapter; major bump reflects architectural inversion» +> 2. §0 «Источник истины» cross-refs: +> - Pravila v1.13 → v1.14 «ruflo big-bang sub-policy» +> - Plugin_stack_rules_v1 v2.1 → v3.0 «R0 sub-policy» +> - Tooling v1.17 → v2.0 «§4.10 Orchestration layer (ruflo)» +> 3. §1 «Приоритет правил» — добавить уровень −1 над «0. Pravila §12»: +> +> ``` +> −1. ruflo Queen-led routing (entry-point для ВСЕХ задач; SONA neural pattern classifier + swarm topology + HNSW memory + ~210 MCP tools; формализован в Tooling §4.10) +> ↓ +> ``` +> +> Остальные уровни (0-6) — без изменений в нумерации (они становятся «execution layer» под ruflo). +> 4. §3 «Карта 35 инструментов» → «Карта 35 + ruflo (orchestration layer) инструментов»; добавить §3.4 «Off-phase orchestration: ruflo (32 plugins, ~210 MCP tools)» — короткая ссылка на Tooling §4.10 +> 5. §5 п.10 «Не править этот CLAUDE.md без…» — добавить inline note «(sub-policy ruflo: claude-md-management остаётся preferred channel через ruflo routing; ruflo agents могут править напрямую при явном routing-decision)» +> 6. §6 «Текущая фаза»: bump «Post-MVP (10.05.2026)» → добавить параграф «**2026-05-15 ruflo big-bang integration:** Установлен ruflo v3.7.0-alpha.33 как Queen-led routing на уровне −1 иерархии. 4 normative files переписаны под sub-policy paradigm. Карта-форк `docs/automation-graph-ruflo.html` (Day 5). Pre-flight Task 0 results: [TBD reference spec §12]. Day 6 regression: [TBD baseline numbers].» +> 7. §9 «История версий» — добавить «v2.0 от 2026-05-15 — ruflo big-bang…» +> +> Return diff. Do NOT commit, do NOT touch other files.» + +- [ ] **Step 3.3.2: Apply diff** + +- [ ] **Step 3.3.3: Verify CLAUDE.md still ≤ 5000 lines + spell check** + +```powershell +(Get-Content CLAUDE.md | Measure-Object -Line).Lines +npx cspell CLAUDE.md +``` + +Expected: lines < 5000, cspell exit 0. + +- [ ] **Step 3.3.4: Commit** + +```powershell +git add CLAUDE.md +git commit -m "docs(claude_md): §1 +уровень −1 ruflo + §3.4 orchestration chapter + §5 п.10 sub-policy note + §6 ruflo phase — v2.0 (ruflo big-bang Day 3)" +``` + +### Task 3.4: Tooling §0/§4.10 + +**Files:** + +- Modify: `docs/Tooling_v8_3.md` + +- [ ] **Step 3.4.1: Dispatch subagent** + +> Prompt: «Edit `docs/Tooling_v8_3.md`. Read full file first (~3000-5000 lines). Then: +> +> 1. Header version v1.17 → v2.0; date 2026-05-15 +> 2. §0 сводка таблица: добавить row «**ruflo orchestration layer** (off-phase, post-MVP 2026-05-15) | npx ruflo@latest + 32 plugins | +32 plugins». Также: bump «Итого формализованных позиций: 35» → «Итого формализованных позиций: 35 + 32 ruflo plugins = ~67» +> 3. §3.3 «Off-phase tools» — добавить упоминание о новом category «orchestration» с pointer на §4.10 +> 4. Новый §4.10 «Orchestration layer (ruflo) — entry-point иерархии (off-phase)»: +> +> ```markdown +> ### §4.10. Orchestration layer (ruflo) — entry-point иерархии (off-phase) +> +> ruflo (ruvnet/ruflo, MIT, v3.7.0-alpha.33+) встаёт «чистым верхом» над 8-уровневой иерархией (см. CLAUDE.md §1). 32 plugins, ~210 MCP tools, 100+ specialized agents (Queen-led hierarchy: Raft/Byzantine/Gossip), HNSW vector memory, SONA neural routing. +> +> **Архитектурная роль:** entry-point для ВСЕХ задач. Делает первичную классификацию (interactive vs autonomous) и delegate в sub-policy stack-gate (paired-stack: Superpowers + Frontend Design) ИЛИ executes via swarm. +> +> **Категория:** off-phase, **orchestration** (отдельная от UI-пула, infrastructure, debug-runtime). +> +> **Plugins (32, после Task 0 enumerate):** [TBD reference Task 1.3.1 output] +> +> **Cost-budget:** $10/день cap через `.env.local` `RUFLO_DAEMON_MAX_USD_PER_DAY=10` (см. spec §7). +> +> **Связано:** [docs/superpowers/specs/2026-05-15-ruflo-integration-design.md](superpowers/specs/2026-05-15-ruflo-integration-design.md), Pravila v1.14+ §12 sub-policy, PSR_v1 v3.0+ R0 sub-policy, CLAUDE.md v2.0+ §1 уровень −1. +> ``` +> +> 5. История версий: добавить «v2.0 (2026-05-15) — ruflo big-bang: §0 +ruflo orchestration row +32 plugins (35 → 67); новая §4.10. Major bump reflects architectural inversion. Связано: spec/plan 2026-05-15, Pravila v1.14, PSR_v1 v3.0, CLAUDE.md v2.0.» +> +> Return diff.» + +- [ ] **Step 3.4.2: Apply diff** + +- [ ] **Step 3.4.3: Verify** + +```powershell +git diff docs/Tooling_v8_3.md +``` + +- [ ] **Step 3.4.4: Commit** + +```powershell +git add docs/Tooling_v8_3.md +git commit -m "docs(tooling): §0 35 → 67 + §4.10 Orchestration layer (ruflo) — v2.0 (ruflo big-bang Day 3)" +``` + +--- + +## Phase 4: Cross-refs sync (Day 4, ~10 min) + +### Task 4.1: Sync version references between 4 normative files + +**Files:** + +- Possibly modify: `docs/Pravila_raboty_Claude_v1_1.md`, `docs/Plugin_stack_rules_v1.md`, `CLAUDE.md`, `docs/Tooling_v8_3.md`, `docs/CHANGELOG_claude_md.md` + +- [ ] **Step 4.1.1: Grep for stale version refs** + +```powershell +# Поиск устаревших версий в header cross-refs +Select-String -Path "docs/Pravila_raboty_Claude_v1_1.md","docs/Plugin_stack_rules_v1.md","CLAUDE.md","docs/Tooling_v8_3.md" -Pattern "v1\.1[01-7]|v2\.[01]" -SimpleMatch +``` + +Expected: только references на новые версии (v1.14 / v3.0 / v2.0 / v2.0) — старые v1.13 / v2.1 / v1.93 / v1.17 не должны встречаться как «текущие» (только в исторических §9 changelog). + +- [ ] **Step 4.1.2: Update CHANGELOG_claude_md.md** + +```powershell +git diff docs/CHANGELOG_claude_md.md +``` + +Если empty — добавить entry для CLAUDE.md v2.0: + +> «**v2.0 от 15.05.2026** — Ruflo big-bang integration: 8 → 9-level priority chain, ruflo Queen-led routing уровень −1. §1 +уровень −1 ruflo (entry-point); §3.4 +orchestration chapter; §5 п.10 → sub-policy note. Major bump reflects architectural inversion. Spec/plan: [docs/superpowers/specs/2026-05-15-ruflo-integration-design.md](specs/2026-05-15-ruflo-integration-design.md), [docs/superpowers/plans/2026-05-15-ruflo-big-bang-integration.md](plans/2026-05-15-ruflo-big-bang-integration.md). Связано: Pravila v1.14, PSR_v1 v3.0, Tooling v2.0.» + +- [ ] **Step 4.1.3: Commit cross-refs sync + CHANGELOG** + +```powershell +git add docs/CHANGELOG_claude_md.md +# Add any cross-ref fixes if needed +git commit -m "docs(sync): cross-refs + CHANGELOG_claude_md.md +v2.0 entry — Day 4 (ruflo big-bang)" +``` + +--- + +## Phase 5: Map fork — automation-graph-ruflo.html (Day 5, ~20 min) + +### Task 5.1: Copy iter3 carto fork + +**Files:** + +- Create: `docs/automation-graph-ruflo.html` + +- [ ] **Step 5.1.1: Copy file** + +```powershell +Copy-Item -Path "docs\automation-graph.html" -Destination "docs\automation-graph-ruflo.html" -Force +(Get-Content docs\automation-graph-ruflo.html | Measure-Object -Line).Lines +``` + +Expected: ~1609 lines. + +- [ ] **Step 5.1.2: Update title + comment header in HTML** + +Edit `docs/automation-graph-ruflo.html` строки 1-15: + +```html + +``` + +И `` тег: «Лидерра — карта автоматизации (ruflo big-bang)». + +### Task 5.2: Add ruflo group definition + +**Files:** + +- Modify: `docs/automation-graph-ruflo.html` + +- [ ] **Step 5.2.1: Find GROUPS object** + +```powershell +Select-String -Path "docs\automation-graph-ruflo.html" -Pattern "const GROUPS" | Select-Object LineNumber +``` + +- [ ] **Step 5.2.2: Add ruflo group** + +В `GROUPS` объект добавить после последней группы: + +```js +ruflo: { + color: '#ff8800', + border: '#cc6600', + highlight: '#ffaa33', + label: '🌊 ruflo Queen + swarm', +} +``` + +### Task 5.3: Add ruflo Queen + 9 swarm-roles nodes + +**Files:** + +- Modify: `docs/automation-graph-ruflo.html` + +- [ ] **Step 5.3.1: Find NODES array** + +```powershell +Select-String -Path "docs\automation-graph-ruflo.html" -Pattern "const NODES" | Select-Object LineNumber +``` + +- [ ] **Step 5.3.2: Append ruflo nodes** + +В `NODES` массив добавить: + +```js +{ id: 'ruflo_queen', label: 'ruflo Queen', group: 'ruflo', x: 50, y: -50, fixed: true }, +{ id: 'ruflo_architect', label: 'Architect', group: 'ruflo', x: -50, y: -150 }, +{ id: 'ruflo_coder', label: 'Coder', group: 'ruflo', x: 50, y: -200 }, +{ id: 'ruflo_security', label: 'Security', group: 'ruflo', x: 150, y: -150 }, +{ id: 'ruflo_rls', label: 'RLS-reviewer', group: 'ruflo', x: 200, y: -50 }, +{ id: 'ruflo_qa', label: 'QA', group: 'ruflo', x: 200, y: 50 }, +{ id: 'ruflo_tester', label: 'Tester', group: 'ruflo', x: 150, y: 50 }, +{ id: 'ruflo_reviewer', label: 'Reviewer', group: 'ruflo', x: 50, y: 100 }, +{ id: 'ruflo_memory', label: 'Memory-keeper', group: 'ruflo', x: -50, y: 50 }, +{ id: 'ruflo_daemon', label: 'Daemon-worker', group: 'ruflo', x: -100, y: 0 }, +``` + +NB: точные имена swarm-roles — после Task 1.3.2 categorization. Если ruflo enumerate показал другие имена — substitute. + +### Task 5.4: Add subPolicy:true + opacity 0.7 на 73 legacy nodes + +**Files:** + +- Modify: `docs/automation-graph-ruflo.html` + +- [ ] **Step 5.4.1: Find applyHighlight / computeNodeOpacity функцию** + +`Select-String -Path "docs\automation-graph-ruflo.html" -Pattern "computeNodeOpacity"` + +Если функция отсутствует — карта пре-iter3, не имеет highlighting. В таком случае Step 5.4.2 пропускается, opacity ставится через прямой node update. + +- [ ] **Step 5.4.2: Modify default opacity for legacy nodes** + +В блоке NODES после ruflo nodes (Step 5.3.2) — для каждого node БЕЗ `group: 'ruflo'`, добавить `subPolicy: true` поле: + +```js +// До: +{ id: 'pravila', label: 'Pravila §§1-13', group: 'rules' }, +// После: +{ id: 'pravila', label: 'Pravila §§1-13', group: 'rules', subPolicy: true }, +``` + +73 правки — applied через sed-like replacement (`Edit` tool с replace_all): + +```js +// Можно автоматизировать через JS injection в NODES.forEach: +NODES.forEach(n => { if (n.group !== 'ruflo') n.subPolicy = true; }); +``` + +- [ ] **Step 5.4.3: Modify rendering — sub-policy nodes get opacity 0.7** + +В `computeNodeOpacity` (если есть) или в init code: + +```js +const baseOpacity = (n) => n.subPolicy ? 0.7 : 1.0; +``` + +Или через `nodesDS.update(NODES.map(n => ({ id: n.id, opacity: baseOpacity(n) })));` в init. + +### Task 5.5: Add Queen → swarm edges (9) + Queen → group-centroid edges (4) + +**Files:** + +- Modify: `docs/automation-graph-ruflo.html` + +- [ ] **Step 5.5.1: Find EDGES array** + +`Select-String -Path "docs\automation-graph-ruflo.html" -Pattern "const EDGES"` + +- [ ] **Step 5.5.2: Append ruflo edges** + +```js +// Queen → swarm (9 edges, type='подчиняет') +{ from: 'ruflo_queen', to: 'ruflo_architect', label: 'подчиняет' }, +{ from: 'ruflo_queen', to: 'ruflo_coder', label: 'подчиняет' }, +{ from: 'ruflo_queen', to: 'ruflo_security', label: 'подчиняет' }, +{ from: 'ruflo_queen', to: 'ruflo_rls', label: 'подчиняет' }, +{ from: 'ruflo_queen', to: 'ruflo_qa', label: 'подчиняет' }, +{ from: 'ruflo_queen', to: 'ruflo_tester', label: 'подчиняет' }, +{ from: 'ruflo_queen', to: 'ruflo_reviewer', label: 'подчиняет' }, +{ from: 'ruflo_queen', to: 'ruflo_memory', label: 'подчиняет' }, +{ from: 'ruflo_queen', to: 'ruflo_daemon', label: 'подчиняет' }, + +// Queen → group-centroid (4 edges, type='перенял') +{ from: 'ruflo_queen', to: 'pravila', label: 'перенял sub-policy' }, +{ from: 'ruflo_queen', to: 'claude_md', label: 'перенял sub-policy' }, +{ from: 'ruflo_queen', to: 'psr_v1', label: 'перенял sub-policy' }, +{ from: 'ruflo_queen', to: 'tooling', label: 'перенял sub-policy' }, + +// swarm → legacy execution-layer (примеры — 12-20 edges): +{ from: 'ruflo_coder', to: 'ag_pest', label: 'делегирует TDD' }, +{ from: 'ruflo_security', to: 'ag_rls', label: 'делегирует RLS' }, +{ from: 'ruflo_rls', to: 'sk_rls', label: 'делегирует RLS skill' }, +// ... остальные по факту swarm-role mapping (Day 5 polish) +``` + +### Task 5.6: Add 2-3 new ⚫ conflicts + +**Files:** + +- Modify: `docs/automation-graph-ruflo.html` + +- [ ] **Step 5.6.1: Find CONFLICT_TYPES + CONFLICT() helper** + +- [ ] **Step 5.6.2: Append new conflicts** + +```js +// 3 new ⚫ "возник на практике" conflicts: +CONFLICT('ruflo_queen', 'pravila', 'alpha-tool overrides hard-rule', 'BLACK'), +CONFLICT('ruflo_daemon', 'mem_index', 'static .md vs HNSW dual-system', 'BLACK'), +CONFLICT('ruflo_queen', 'mcp_playwright', 'MCP port-conflict potential', 'BLACK'), +``` + +NB: `mem_index` — replace на актуальный legacy memory node id (e.g., `mem_memory_md`). + +### Task 5.7: Update footer cat-legend + +**Files:** + +- Modify: `docs/automation-graph-ruflo.html` + +- [ ] **Step 5.7.1: Find #cat-legend HTML** + +`Select-String -Path "docs\automation-graph-ruflo.html" -Pattern "cat-legend"` + +- [ ] **Step 5.7.2: Add ruflo cat-item** + +В `#cat-legend` div добавить (после последнего .cat-item группового, перед conflict items): + +```html +<div class="cat-item" data-filter-key="group:ruflo"> + <div class="cat-dot" style="background:#ff8800"></div> + 🌊 ruflo Queen + swarm +</div> +``` + +### Task 5.8: Smoke test в браузере + +**Files:** none + +- [ ] **Step 5.8.1: Open in Edge / Chrome** + +```powershell +Start-Process "msedge.exe" "file://$((Get-Item docs\automation-graph-ruflo.html).FullName)" +``` + +Expected: страница открывается, vis-network рендерит граф без ошибок console. + +- [ ] **Step 5.8.2: Visual check** + +- Queen в верхнем-левом углу (50,-50) +- 9 swarm-roles вокруг Queen +- 73 legacy nodes на legacy radial-sector с opacity 0.7 +- 9+4 ruflo edges видны +- 3 новых ⚫ конфликта (пунктирные BLACK) +- footer cat-legend показывает 🌊 ruflo + +Если визуально неправильно — fix через дополнительные Edit'ы, повторить Step 5.8.1. + +### Task 5.9: Commit map fork + +**Files:** + +- Stage: `docs/automation-graph-ruflo.html` + +- [ ] **Step 5.9.1: Stage + commit** + +```powershell +git add docs/automation-graph-ruflo.html +git commit -m "feat(graph): automation-graph-ruflo.html — fork iter3 с ruflo Queen + 9 swarm + 73 legacy as sub-policy slots — Day 5 (ruflo big-bang)" +``` + +Expected: pre-commit ✅. Если cspell fail на «Architect»/«Coder»/etc. — append в cspell-words.txt в follow-up. + +--- + +## Phase 6: Regression checkpoint (Day 6, ~15 min) + +### Task 6.1: Pest regression + +**Files:** none + +- [ ] **Step 6.1.1: Run Pest --parallel** + +```powershell +cd app +.\vendor\bin\pest --parallel --recreate-databases +cd .. +``` + +Expected: `Tests: 742+ passed, 0 failed, 3 skipped` в `~55s`. + +Если failed > 0 — STOP regression checkpoint, выписать failed tests с file:line, диагностировать через `superpowers:systematic-debugging` skill, fix, re-run. Day 7 closure НЕ делается до 0 failed. + +### Task 6.2: Vitest regression + +**Files:** none + +- [ ] **Step 6.2.1: Run Vitest** + +```powershell +cd app +npm run test:vue +cd .. +``` + +Expected: `Test Files: 92+ passed, 0 failed` / `Tests: 736+ passed, 0 failed, 3 skipped, 1 todo`. + +### Task 6.3: lychee broken links + +**Files:** none + +- [ ] **Step 6.3.1: Run lychee** + +```powershell +npm run links +``` + +Expected: «N OK, 0 errors» где N ≥ 325. + +### Task 6.4: gitleaks + +**Files:** none + +- [ ] **Step 6.4.1: Detect** + +```powershell +.\bin\gitleaks.exe detect --log-opts="origin/main..HEAD" +``` + +Expected: «no leaks found», exit 0. + +### Task 6.5: vue-tsc + phpstan + +**Files:** none + +- [ ] **Step 6.5.1: vue-tsc** + +```powershell +cd app +npm run type-check +cd .. +``` + +Expected: 0 errors. + +- [ ] **Step 6.5.2: phpstan** + +```powershell +cd app +composer stan +cd .. +``` + +Expected: 0 errors (baseline). + +### Task 6.6: ruflo doctor + pm2 status + +**Files:** none + +- [ ] **Step 6.6.1: ruflo doctor** + +```powershell +npx ruflo@latest doctor +``` + +Expected: «All subsystems green» или подобный. + +- [ ] **Step 6.6.2: pm2 status** + +```powershell +pm2 status ruflo-daemon +``` + +Expected: ruflo-daemon online. + +Если pm2 fail (Task 2.8.2 fallback) — пропустить с пометкой «foreground PM2, daemon-as-service skipped». + +### Task 6.7: Document regression results + +**Files:** + +- Modify: `docs/CHANGELOG_claude_md.md` (если ещё нет — Task 4.1.2 уже создала) + +- [ ] **Step 6.7.1: Append regression data to v2.0 entry** + +Add к v2.0 entry в CHANGELOG_claude_md.md: + +> «**Regression Day 6:** Pest 742+/0/3sk, Vitest 736+/0/3sk/1td, lychee 325+/0, gitleaks 0/N commits, vue-tsc 0, phpstan 0 baseline. ruflo doctor green, pm2 ruflo-daemon online (или: foreground fallback).» + +--- + +## Phase 7: Closure (Day 7, ~5 min) + +### Task 7.1: Final closure commit + +**Files:** + +- Modify: `docs/CHANGELOG_claude_md.md` (already updated Task 6.7) + +- [ ] **Step 7.1.1: Stage + commit** + +```powershell +git add docs/CHANGELOG_claude_md.md +git commit -m "docs(closure): ruflo big-bang migration v2.0 — Day 6 regression numbers in CHANGELOG" +``` + +### Task 7.2: Push to origin/main + +**Files:** none + +- [ ] **Step 7.2.1: Pre-push gauntlet (lefthook)** + +Pre-push hook автоматически: gitleaks full-history + lychee. Если хук падает — fix, re-push. + +- [ ] **Step 7.2.2: Push** + +```powershell +git push origin main +``` + +Expected: `aa39763..NEW_HEAD main -> main` (где NEW_HEAD — текущий локальный SHA после Task 7.1.1). + +### Task 7.3: Update memory + +**Files:** + +- Modify: `C:\Users\Administrator\.claude\projects\c---------------------crm-------------\memory\project_state.md` +- Create: `C:\Users\Administrator\.claude\projects\c---------------------crm-------------\memory\project_ruflo_integration.md` +- Modify: `C:\Users\Administrator\.claude\projects\c---------------------crm-------------\memory\MEMORY.md` + +- [ ] **Step 7.3.1: Update project_state.md** + +Edit: «HEAD origin/main = `aa39763`» → «HEAD origin/main = `NEW_HEAD` (ruflo big-bang merged 2026-05-15)» — заменить `NEW_HEAD` на актуальный SHA из Task 7.2.2 push output. Bump version counters. + +- [ ] **Step 7.3.2: Create project_ruflo_integration.md** + +```markdown +--- +name: project-ruflo-integration +description: ruflo big-bang integration — Queen-led routing уровень −1, sub-policy paradigm, 32 plugins, daemon mode, 2026-05-15 migration +metadata: + type: project +--- + +**2026-05-15 ruflo big-bang merged into main `<new-head>`.** ruflo v3.7.0-alpha.33 встал уровнем −1 как Queen-led routing entry-point. 4 normative files переписаны под sub-policy paradigm: Pravila v1.14 (§12 → sub-policy), PSR_v1 v3.0 (R0 → sub-policy), CLAUDE.md v2.0 (§1 +уровень −1, §3.4 ruflo chapter, §5 п.10 sub-policy note), Tooling v2.0 (§4.10 +Orchestration layer, 35 → ~67 plugins). Карта-форк `docs/automation-graph-ruflo.html` показывает TO-BE архитектуру. + +**Cost-budget:** `RUFLO_DAEMON_MAX_USD_PER_DAY=10` в `.env.local` (gitignored). + +**Day 6 regression (baseline сохранён):** Pest 742+ / Vitest 736+ / lychee 0 / gitleaks 0 / vue-tsc 0 / phpstan 0; ruflo doctor green; pm2 ruflo-daemon online (или foreground fallback). + +**Spec/plan:** [[spec-2026-05-15-ruflo-integration-design]], [[plan-2026-05-15-ruflo-big-bang-integration]]. + +**Accepted residual risks (per user decision «чистый верх»):** ruflo может править CLAUDE.md без claude-md-management, skip Superpowers TDD, expose dev-tenant data. Технические компенсаторы (gitleaks/RLS/Pest --recreate-databases) сохраняются. + +**Open items:** ruflo alpha — re-evaluate post-stable v4.0; bridge к существующим memory/*.md через `ruflo memory reindex` hook. +``` + +- [ ] **Step 7.3.3: Update MEMORY.md index** + +Add line: `- [Ruflo integration](project_ruflo_integration.md) — 2026-05-15 big-bang merge, 4 normative files v1.14/v3.0/v2.0/v2.0, Queen-led routing уровень −1, accepted residual risks`. + +--- + +## Self-Review + +**Spec coverage check:** + +| Spec section | Plan task(s) | +|---|---| +| §1 Goals | Phase 2-7 (полный execution) | +| §1 Non-goals | Plan не упоминает production data / new tests / 35 dupe — respected | +| §2 Architecture (8→9 levels) | Tasks 3.1-3.4 переписывают все 4 normative files | +| §3 Scope (32 plugins) | Task 1.3 enumerate + Task 2.5 enabledPlugins | +| §4 Sequencing | Phase 1-7 mirror Day 1-7 | +| §5 Map fork | Phase 5 Tasks 5.1-5.9 | +| §6 Memory bridge | Pending — Task 5.8 partial (карта overlay); ruflo memory reindex hook — добавить в plan post-MVP (out of plan scope per §1.7 «no new tests» если interpret as «no new system»). **Gap noted:** добавляю в open questions ниже. | +| §7 Cost-budget | Task 2.9 (.env.local) + Task 6.6.2 | +| §8 Windows daemon | Task 2.8 | +| §9 Safety walls | Inherent (gitleaks/RLS остаются untouched) | +| §10 Cost-benefit | DELIVERABLE в spec (не требует plan task) | +| §11 Verification | Phase 6 Tasks 6.1-6.6 | +| §12 Open questions | Task 1.7 resolve Q1-Q5, Q10; Q6-Q9 — runtime resolve | +| §13 Termination | Phase 7 | + +**Gaps:** + +1. **Memory bridge hook (§6.2 spec)** не имеет plan task. Hook добавляется в `~/.claude/settings.json` PostToolUse matcher на `Edit|Write` файлов в `memory/*.md` с command `npx ruflo memory reindex`. Add Task 2.10 для completeness: + + ### Task 2.10: Add ruflo memory reindex hook + + - [ ] Edit `~/.claude/settings.json`, добавить hook entry: + + ```json + { + "matcher": "Edit|Write", + "hooks": [ + { + "type": "command", + "command": "if (process.env.CLAUDE_FILE_PATH || '').includes('memory/') && /\\.md$/.test(process.env.CLAUDE_FILE_PATH || '')) { require('child_process').spawn('npx', ['ruflo@latest', 'memory', 'reindex'], { detached: true, stdio: 'ignore' }); }" + } + ] + } + ``` + +2. **Day 3 cspell prep** — Task 3.1.4 предупреждает о возможном cspell fail на новых терминах. Add Task 3.0: + + ### Task 3.0: Prep cspell vocab (before Day 3 rewrites) + + - [ ] Append к `cspell-words.txt`: + + ``` + # Day 3 ruflo big-bang rewrite vocab (2026-05-15) + sub-policy + queen-led + architect + coder + reviewer + ``` + + - [ ] Commit: + + ```powershell + git add cspell-words.txt + git commit -m "chore(cspell): vocab prep для Day 3 ruflo rewrites" + ``` + +**Placeholder scan:** Найдены 4 «[TBD reference …]» в Task 3.3.1 §6 и Task 3.4.1 step 4. Эти TBD корректны — они заполняются runtime (Day 1 Task 1.3.1 output substitutes into Day 3.4.1 §4.10 plugins enumeration). Документирую как «runtime substitution»: каждый «[TBD …]» в plan имеет explicit owner и timing. + +**Type consistency:** функции/имена (computeNodeOpacity, applyHighlight, NODES, EDGES, CONFLICT, CONFLICT_TYPES, GROUPS) match existing iter3 codebase per spec §5. Subagent prompt Task 3.1-3.4 — каждый указывает конкретные §-references, не cross-pollutes между файлами. + +--- + +**Plan complete and saved to** `docs/superpowers/plans/2026-05-15-ruflo-big-bang-integration.md`. + +Two execution options: + +**1. Subagent-Driven (recommended)** — fresh subagent per task (особенно подходит Phase 3 параллельные 4 normative files), review между tasks, fast iteration. + +**2. Inline Execution** — execute tasks в этой session используя `superpowers:executing-plans`, batch execution с checkpoints для review. + +**Which approach?**