# C10 Business-Process Tooling 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:** Populate the empty `C10 «Бизнес-процессы (общее)»` map section with a conflict-minimal business-process toolset — install the **operations** marketplace plugin, author **two self-authored vendored skills** (`process-modeling`, `process-analysis`), surface **five reuse cross-references**, and register **n8n-mcp as a deferred reserved slot** — so C10 becomes a working playbook covering modeling + automation + analysis.

**Architecture:** C10 is an **empty** functional section — `NODE_SECTION` in `docs/automation-graph.html` tags zero nodes `C10`. Approach 3 (hybrid + vendoring, chosen 2026-05-17): one **marketplace plugin** (`operations@knowledge-work-plugins`, Anthropic — the same marketplace as the already-integrated #42 product-management / #46 design), **two self-authored vendored skills** into `.claude/skills/process-modeling/` and `.claude/skills/process-analysis/` (no plugin, no marketplace, no hooks — the project-skill pattern of `audit-portal`/`regression`), and **five reuse cross-references** of already-installed tools surfaced in C10 via `NODE_SECTION_SECONDARY` (the A3 XREF pattern). **n8n-mcp** (workflow engine) is **deferred** — the portal stack has no n8n (the process engine is the Laravel queue); adopting n8n is an architecture decision, not a tooling pick. n8n-mcp is registered now as a reserved slot, installed later by a separate severable task. All C10 tools are non-UI → a new **business-process** off-phase category, outside the PSR_v1 UI-pool. C10 artifacts live in `docs/process/`.

**Tech Stack:** the `operations` plugin (`anthropics/knowledge-work-plugins` marketplace, Anthropic Verified); two self-authored Claude Code skills (markdown — `SKILL.md` + `references/`); n8n-mcp (`czlonkowski/n8n-mcp`, MIT — deferred, not installed); the already-installed mermaid / architecture-patterns / CCPM / product-management / superpowers (reuse cross-refs); project normative docs; `docs/automation-graph.html` (vis.js).

**Sequencing (2026-05-17):** the worktree branch `worktree-c10-business-process-tooling` was created from `origin/main` (`008c8a3`, A11 landed) and already holds the brainstorming spec commit (`cd56efb`). C10's Tooling numbers are runtime-resolved (NUM1) — never hard-coded before reading the live counter. Push pattern: `git push origin worktree-c10-business-process-tooling:main`.

---

## Tool Identity (verified 2026-05-17 via WebSearch / WebFetch)

| # | Tool | Install mode | Source / License | Hooks? |
|---|---|---|---|---|
| 1 | **operations plugin** — 9 business-process skills: `process-doc`, `process-optimization`, `change-request`, `capacity-plan`, `compliance-tracking`, `risk-assessment`, `runbook`, `status-report`, `vendor-review`. | Claude Code **marketplace plugin** — `operations@knowledge-work-plugins` v1.2.0; marketplace `anthropics/knowledge-work-plugins` (already added — #42/#46 installed from it) | GitHub `anthropics/knowledge-work-plugins`, Anthropic Verified | **None** — skills-only plugin, no `hooks/` dir, no `commands/` dir (verified on install 2026-05-17, Task 2) |
| 2 | **process-modeling skill** — BPMN 2.0 notation, process maps, customer-journey / value-stream maps, RACI matrices, state-machine modeling. Renders via the `mermaid` skill. | **Self-authored** standalone skill — created in `.claude/skills/process-modeling/` (no plugin, no marketplace) | Project-authored — content in this plan (Task 3) | None — self-authored, no `hooks` block |
| 3 | **process-analysis skill** — process discovery (reverse-engineer the as-is process from Laravel code + audit-log tables), bottleneck analysis, requirement→process traceability, business-process KPI/metrics. | **Self-authored** standalone skill — created in `.claude/skills/process-analysis/` | Project-authored — content in this plan (Task 4) | None — self-authored, no `hooks` block |
| — | **n8n-mcp** (`czlonkowski/n8n-mcp`) — workflow-automation MCP server for the n8n platform. | **NOT installed** — deferred reserved slot (see "Deferred Task"). | GitHub `czlonkowski/n8n-mcp`, **MIT** | n/a — not installed |
| — | **mermaid** / **architecture-patterns** / **CCPM** / **product-management** / **superpowers writing-plans** | **Reuse** — already installed; surfaced in C10 via `NODE_SECTION_SECONDARY` | A6 #37/#38, C9 #41/#42, superpowers | n/a |

**Verification status:** operations — plugin **name `operations`** confirmed via the live `anthropics/knowledge-work-plugins` `.claude-plugin/marketplace.json` (WebFetch 2026-05-17); plugin-id `operations@knowledge-work-plugins`. **Installed 2026-05-17 (Task 2): v1.2.0, scope user.** It ships **9 skills** (`process-doc`, `process-optimization`, `change-request`, `capacity-plan`, `compliance-tracking`, `risk-assessment`, `runbook`, `status-report`, `vendor-review`) — **not** `/ops:*` slash-commands — and **no lifecycle hooks** (no `hooks/` / `commands/` dir). n8n-mcp — repo `czlonkowski/n8n-mcp`, MIT, Claude Code compatible, confirmed via WebSearch; **not installed by this plan**.

**Deferred (with reason — no task in this plan):**

- **n8n-mcp** — a workflow engine for the n8n platform. The Лидерра stack has **no n8n**: business-process automation runs through the Laravel queue (Redis) + events/jobs. Adopting n8n as portal infrastructure is an **architecture decision** (its own ADR), not a tooling pick. Registered in the Tooling registry as a **pending** slot (Task 7); installed later by the severable task in "Deferred Task" below.

**Dropped (with reason — no task, no slot):**

- **A community BPMN MCP / mcpmarket BPMN skill** — Decision 2 (2026-05-17) chose a self-authored vendored skill; community BPMN skills have unverified provenance (the FM2 risk). `process-modeling` covers the niche.
- **A dedicated DMN / business-rules tool** — the portal's business rules (`calc_lead_score`, `PricingTierResolver`, status transitions) are simple; decision flows are covered by `process-modeling` (gateways) + mermaid. A separate tool would be a §5 п.6 duplication.
- **A process-mining tool** — heavy, no verified Claude plugin; the `process-analysis` skill's discovery mode covers light process reconstruction from audit logs.

---

## Design Decisions & Conflict Audit

Pattern follows the AK1–CC1 / ML1–NUM1 audits used for the A6 / C9 / D3 / A11 plans. Verified against the live `knowledge-work-plugins` marketplace, project `.claude/settings.json`, `~/.claude/settings.json`, `.mcp.json`, `lefthook.yml`, `cspell.json`, `.markdownlintignore`, and the A11 plan.

| # | Tool | Sev | Conflict | Resolution (locked) |
|---|---|---|---|---|
| OPS1 | operations | 🟢 | The operations `process-doc` skill produces a flowchart; the `mermaid` skill (A6) renders diagrams — overlapping render. | operations emits **Mermaid source**; the `mermaid` skill stays the render-SoT. operations owns the *document* + methodology, mermaid owns *rendering*. Stated in `docs/process/README.md` (Task 5) + the Tooling entry (Task 7). |
| OPS2 | operations | 🟢 | The operations `capacity-plan` skill overlaps product-management `/sprint-planning` (C9) and the C8 HR domain. | Boundary by scope: operations `capacity-plan` = cross-functional business-process capacity; `/sprint-planning` = dev-team sprints; C8 = HR. Boundary documented in `docs/process/README.md` (Task 5). |
| OPS3 | operations | 🟢 | The operations `change-request` skill overlaps adr-kit (A6) and claude-md-management. | Distinct objects: `change-request` = business-process change; ADR = architecture decision; claude-md-management = normative-doc edit. Documented in `docs/process/README.md` (Task 5). |
| OPS4 | operations | 🟢 | knowledge-work-plugins are built primarily for "Claude Cowork" — the plugin must verifiably activate in **Claude Code**. | **Resolved on install (Task 2):** operations v1.2.0 installed (scope user), present in `~/.claude/settings.json` `enabledPlugins`, ships 9 skills auto-discovered by Claude Code, **0 lifecycle hooks**. Same marketplace as the working #42/#46. |
| OPS5 | operations vs the 2 self-authored skills | 🟢 | operations ships `process-doc` (overlaps `process-modeling`) and `process-optimization` (overlaps `process-analysis`). | Boundary: operations skills are **generic, stack-agnostic** business-process methodology. The self-authored skills cover what operations structurally cannot: **`process-modeling`** = formal BPMN 2.0 / state-machine notation rendered via `mermaid`, grounded in `db/schema.sql` (the 14-status funnel); **`process-analysis`** = as-is discovery grounded in the Лидерра codebase (`routes/`, `app/Jobs`, `audit_*` tables) — operations cannot read the repo. Each self-authored `SKILL.md` "Границы" names the operations skills explicitly; generic optimization methodology is delegated to operations `process-optimization`. |
| BPMN1 | process-modeling | 🟢 | Overlap with the `mermaid` skill. | `mermaid` renders flowchart/state; it does **not** carry BPMN 2.0 semantics (pools/lanes/gateways/events methodology). `process-modeling` owns BPMN methodology and **delegates rendering** to `mermaid`. Stated in the skill's `SKILL.md` "Границы" section (Task 3). |
| LINT1 | process-modeling, process-analysis | 🟡 | Self-authored skills `.claude/skills/process-{modeling,analysis}/**/*.md` are caught by the cspell + markdownlint pre-commit jobs. | **Decision:** these are **self-authored project skills** — they are **linted** like `audit-portal` / `regression` (NOT lint-ignored like the vendored `mermaid`/`ccpm`/`data-scientist`). Skill content is written lint-clean; new technical vocabulary (`BPMN`, `swimlane`, `gateway`, `RACI`, `throughput`, …) goes to `cspell-words.txt`. Task 1 Step 5 confirms project skills are not in `cspell.json` `ignorePaths` / `.markdownlintignore`; if they unexpectedly are → follow suit and record. |
| PA1 | process-analysis | 🟢 | Overlap with `perf-analyzer` / `analysis:bottleneck-detect` and product-management `/metrics-review`. | Different objects: `process-analysis` = *business-process* discovery/optimization; `perf-analyzer` / `bottleneck-detect` = *code/runtime* performance; `/metrics-review` = *product* metrics. Boundary in the skill's "Границы" section (Task 4) + `docs/process/README.md` (Task 5). |
| N8N1 | n8n-mcp | 🟡 | The portal stack has no n8n; the process engine is the Laravel queue. Adopting n8n = architecture decision, not a tooling pick. | **DEFERRED** (Decision 1, 2026-05-17) — registered as a reserved **pending** slot (Task 7); `.mcp.json` untouched in core scope. Activation gated on a dedicated ADR (see "Deferred Task"). |
| XREF1 | reuse layer | 🟢 | Re-tagging `mermaid_skill`/`arch_patterns`/`ccpm`/`product_mgmt`/`sk_wplans` to C10 would empty their home sections — `NODE_SECTION` is 1-node→1-section. | Reuse nodes **stay** in their home sections; C10 surfaces them via `NODE_SECTION_SECONDARY` (the A3 precedent — `mcp_boost`/`context7`/etc. `→ ['A3']`). C10 gets its own 3 new nodes in `NODE_SECTION`. |
| CAT1 | all | 🟢 | C10 is non-UI tooling. | New off-phase category **business-process** (a new off-phase subcategory — exact ordinal confirmed against the live registry in Task 7; A11 ml-ai-tooling is the 10th, so business-process is the 11th), outside the PSR_v1 UI-pool → no R6.0/R6.1 stack-filter, no R14 pipeline — same treatment as architecture-tooling (A6) / audit-security (D3) / project-management (C9) / ml-ai-tooling (A11). |
| BUS1 | all | 🟡 | Bus-factor — operations is Anthropic; the two skills are self-authored; n8n-mcp is community. | operations = Anthropic Verified, stable. `process-modeling` / `process-analysis` = **self-authored** → no upstream dependency at all. n8n-mcp = community (czlonkowski, ~16.6k★, MIT) but **deferred** + version-pinned at install. Noted in the Tooling entries (Task 7). |
| NUM1 | normative sync | 🟡 | The A6/D3/C9/A3/A4/A11 epics each bumped the Tooling counter. C10 must not collide. | Task 1 Step 6 + Task 7 Step 1 read the **live** `docs/Tooling_v8_3.md` Прил. Н §0 counter and assign C10's numbers sequentially. Expected (post-A11): operations `#51`, process-modeling `#52`, process-analysis `#53`, n8n-mcp `#54` (pending) — **verify against the live counter, never hard-code before reading it**. |

**Severable scope.** Core C10 = Tasks 1-9 (operations + the 2 skills + reuse cross-refs + `docs/process/` + normative + map + finish) — already populates and closes the section across modeling + automation + analysis. The only deferred piece, n8n-mcp, is a *future* task outside this plan (see "Deferred Task"). C10 adds **no lefthook job** and **no `.mcp.json` change** in the core scope — fewer conflicts by design (the C9/A11 shape).

---

## File Structure

| File | Created / Modified | Responsibility |
|---|---|---|
| `docs/process/` | Create dir | C10 home — the business-process playbook |
| `docs/process/README.md` | Create | The BP convention: tool boundaries (operations = *document/change/capacity* · process-modeling = *model* · process-analysis = *discover & optimize* · n8n-mcp = *deferred engine*); the reuse-layer cross-ref map; the OPS1/OPS2/OPS3/PA1 boundaries |
| `docs/process/examples/deal-lifecycle-process.md` | Create | One worked example — the deal-lifecycle process modeled as a BPMN-style swimlane (the seed artifact, the A11 `promptfoo-example` pattern) |
| `.claude/skills/process-modeling/SKILL.md` | Create (self-authored) | The process-modeling skill — frontmatter + methodology |
| `.claude/skills/process-modeling/references/bpmn.md` | Create (self-authored) | BPMN 2.0 element reference + the BPMN→mermaid rendering map |
| `.claude/skills/process-analysis/SKILL.md` | Create (self-authored) | The process-analysis skill — frontmatter + methodology |
| `.claude/skills/process-analysis/references/discovery.md` | Create (self-authored) | The Лидерра as-is discovery map: which code/tables hold which process facts |
| `docs/adr/ADR-008-business-process-tooling.md` | Create | Seed ADR documenting the C10 tooling decision + the n8n defer |
| `cspell-words.txt` | Modify | New business-process vocabulary (BPMN, swimlane, RACI, throughput, …) |
| `docs/Tooling_v8_3.md` | Modify | Прил. Н — new business-process subsections §4.26-4.29 + §0 counter bump |
| `docs/Plugin_stack_rules_v1.md` | Modify | R10.1 — new business-process rows (operations = Block 1 marketplace plugin; the 2 skills = note; n8n-mcp = Block 3 MCP, DEFERRED) |
| `docs/Pravila_raboty_Claude_v1_1.md` | Modify | §13.2 — business-process category note |
| `CLAUDE.md` | Modify (**via claude-md-management only**, §5 п.10) | §3 title count, §1 row 2b count, new §3.3 business-process rows, §6 + §9 entries |
| `docs/CHANGELOG_claude_md.md` | Modify | CLAUDE.md version-bump entry |
| `docs/automation-graph.html` | Modify | 3 new C10 nodes → `NODE_SECTION` C10; 5 cross-refs → `NODE_SECTION_SECONDARY`; header metrics |
| `.mcp.json` | **NOT modified in core scope** | n8n-mcp deferred — `.mcp.json` touched only by the conditional task |
| `cspell.json`, `.markdownlintignore` | **NOT modified** (per LINT1) | Self-authored skills are linted, not ignored — no `ignorePaths` change |

---

## Task 1: Pre-flight — baseline, branch, snapshot, fact-check

**Files:** none modified (read-only)

- [ ] **Step 1: Confirm tree state and branch**

```bash
cd "c:/моя/проекты/портал crm/Документация/.claude/worktrees/c10-business-process-tooling"
git status --short
git rev-parse --short HEAD
git branch --show-current
```

Expected: branch `worktree-c10-business-process-tooling`, HEAD at the spec commit `cd56efb` (or later). Record the HEAD SHA as the regression baseline.

- [ ] **Step 2: Snapshot the hook chain**

Read `.claude/settings.json`, `.claude/settings.local.json` (if present), and `~/.claude/settings.json`. Record every hook on `SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, `PreCompact`, `PostCompact`, `Stop`. This is the OPS4 baseline — Task 2 compares against it to confirm the operations plugin added no lifecycle hooks.
Expected (`~/.claude/settings.json`): SessionStart economy-self-check; PreToolUse skill-marker/skill-check/economy-state-guard/CLAUDE.md-warn/security-guidance; UserPromptSubmit economy-mode; PostCompact economy-postcompact; Stop economy-verifier. Project `.claude/settings.json`: ruflo-recall + ruflo-queen (UserPromptSubmit), markdownlint-fix + schema-CHANGELOG-reminder (PostToolUse).

- [ ] **Step 3: Baseline regression**

```
/regression quick
```

Expected: GREEN. Record the current Pest / Vitest counts from the last green run (memory `project_state.md`). C10 touches no `app/` code → the final run (Task 9) must match.

- [ ] **Step 4: Fact-check the operations plugin + n8n-mcp**

operations — confirm the marketplace is registered and the plugin is installable:

```bash
claude plugin marketplace list
```

Expected: `knowledge-work-plugins` (`anthropics/knowledge-work-plugins`) is listed (it was added for #42 product-management / #46 design). If absent → `claude plugin marketplace add anthropics/knowledge-work-plugins`. Record the marketplace status. Confirm the plugin id is `operations@knowledge-work-plugins`.

n8n-mcp — open `https://github.com/czlonkowski/n8n-mcp` and confirm: MIT license, the npm/install form, Claude Code compatibility. This is **documentation only** — n8n-mcp is NOT installed by this plan (N8N1).

- [ ] **Step 5: LINT1 — inspect how project skills are linted**

Read `cspell.json` (`ignorePaths` array) and `.markdownlintignore`. Confirm whether `.claude/skills/` project skills (`audit-portal`, `regression`, `rls-check`) are excluded:

```bash
grep -n "skills" cspell.json .markdownlintignore
```

Expected: only the **vendored** skills (`mermaid`, `ccpm`, `data-scientist`) are in `ignorePaths` — the project's own skills are **linted**. Record the result. This locks LINT1: `process-modeling` / `process-analysis` are written lint-clean and **not** added to `ignorePaths` (if the inspection shows project skills ARE ignored wholesale, follow that pattern instead and record the deviation).

- [ ] **Step 6: Read the live Tooling counter + ADR number (NUM1)**

```bash
ls docs/adr/
```

Read `docs/Tooling_v8_3.md` Прил. Н §0 — record the **live** tool counter and the last `§4.x` subsection number. Expected (post-A11): counter `50`, last subsection `§4.25`. Record:

- C10 numbers = `counter+1 .. counter+4`: operations, process-modeling, process-analysis, n8n-mcp (pending).
- C10 subsections = next four after the last `§4.x`.
- ADR number = next free after the highest existing `ADR-NNN` (expected `ADR-008` — `ADR-007-ml-ai-tooling.md` exists).
- off-phase subcategory ordinal (expected 11th — ml-ai-tooling is 10th).

No repo files changed → no commit.

---

## Task 2: Install the operations plugin (OPS4)

**Files:** none in the repo — installs a Claude Code plugin into `~/.claude`

- [ ] **Step 1: Add the marketplace if missing**

If Task 1 Step 4 found `knowledge-work-plugins` absent:

```bash
claude plugin marketplace add anthropics/knowledge-work-plugins
```

Expected: marketplace added. (Usually already present from #42/#46.)

- [ ] **Step 2: Install the operations plugin**

```bash
claude plugin install operations@knowledge-work-plugins
```

Expected: the plugin installs; it appears in `claude plugin list`. Record the installed version.

- [ ] **Step 3: Verify the slash-commands surfaced (OPS4)**

In-session, confirm the `/ops:*` commands are available (e.g. `/ops:process-doc`, `/ops:change-request`, `/ops:capacity-plan`, `/ops:vendor-review`). Record the exact command list — it feeds the Tooling entry (Task 7) and `docs/process/README.md` (Task 5). If `/ops:*` do **not** appear → **stop**, report; the operations plugin does not activate in Claude Code and the design must be revisited.

- [ ] **Step 4: Verify NO lifecycle hooks were added (OPS4)**

Read the `hooks` block of `~/.claude/settings.json` AND project `.claude/settings.json`. Both must be **unchanged** vs the Task 1 Step 2 snapshot. knowledge-work plugins (#42/#46) are skills + slash-commands and added no hooks — confirm operations is the same. If a `hooks` entry appeared → stop, re-audit.

- [ ] **Step 5: Confirm `enabledPlugins`**

Confirm `operations@knowledge-work-plugins` is listed in `~/.claude/settings.json` `enabledPlugins` (so it is a formalized, PSR_v1 R0.2-compliant plugin). Record the entry. No repo files changed in Task 2 → no commit.

---

## Task 3: Author the process-modeling skill (BPMN1 / LINT1)

**Files:**

- Create: `.claude/skills/process-modeling/SKILL.md`
- Create: `.claude/skills/process-modeling/references/bpmn.md`

- [ ] **Step 1: Create the skill directory + SKILL.md**

```bash
mkdir -p ".claude/skills/process-modeling/references"
```

Create `.claude/skills/process-modeling/SKILL.md` with exactly this content:

```markdown
---
name: process-modeling
description: Моделирование бизнес-процесса — BPMN 2.0 (пулы, дорожки, задачи, гейтвеи, события), карты процессов, customer-journey / value-stream, RACI-матрицы, state-машины. Триггеры — «смоделируй процесс», «нарисуй BPMN», «карта процесса», «swimlane / дорожки», «customer journey», «RACI», проектирование state-машины (воронка сделок, цепочка джобов). Раздел C10 карты «Бизнес-процессы (общее)».
---

# Process Modeling

Превращает словесное описание бизнес-процесса в формальную модель. Скил даёт
**нотацию и методологию** — рендер диаграмм делегируется скилу `mermaid`
(process-modeling не рендерит сам — конфликт-граница OPS1/BPMN1: mermaid
остаётся рендер-SoT).

## Когда какой артефакт

| Нужно | Артефакт |
|---|---|
| Кто-что-в-каком-порядке делает, с ветвлениями | BPMN 2.0 / swimlane |
| Сквозной поток end-to-end крупными блоками | Карта процесса (flowchart) |
| Опыт клиента/лида по этапам + точки боли | Customer-journey map |
| Поток создания ценности + потери и ожидания | Value-stream map |
| Распределение ответственности по шагам | RACI-матрица |
| Конечный автомат (статусы + переходы) | State-диаграмма |

## Рабочий процесс

1. **Собрать процесс** — уточнить: триггер (что запускает), участники (роли),
   шаги по порядку, ветвления и условия, итог, исключения. Неясное — один
   вопрос за раз.
2. **Выбрать артефакт** по таблице выше.
3. **Построить модель** в нотации (BPMN — см. `references/bpmn.md`).
4. **Отрендерить** — передать исходник скилу `mermaid`.
5. **Свериться** — модель не должна противоречить ТЗ / `db/schema.sql` /
   `Открытые_вопросы`. Процесс вне ТЗ И не в реестре открытых вопросов —
   hard-стоп (Pravila §7): не моделировать молча, поднять вопрос.

## BPMN 2.0 — ядро

Полная нотация и маппинг на mermaid — `references/bpmn.md`. Кратко:

- **Pool** — организация/система; **Lane** — роль внутри pool.
- **Task** — атомарное действие; **Sub-process** — свёрнутый под-поток.
- **Gateway** — ветвление: exclusive (XOR — один путь), parallel (AND — все
  пути), inclusive (OR — один и более).
- **Event** — start / intermediate / end; типы: timer, message, error.
- **Sequence flow** — порядок внутри pool; **Message flow** — между pool'ами.

## Границы

- **Рендер диаграмм** — скил `mermaid` (C10 OPS1/BPMN1). Этот скил исходник не
  рисует — отдаёт его mermaid.
- **DDD-границы доменных процессов** — скил `architecture-patterns` (bounded
  context = граница бизнес-процесса).
- **Документ процесса, change-request, оптимизация** — плагин `operations`
  (скилы `process-doc`, `change-request`, `process-optimization`).
- **Анализ as-is процесса** (discovery, узкие места) — скил `process-analysis`.
- Этот скил — про проектирование **to-be модели**, не про вскрытие as-is.
```

- [ ] **Step 2: Create the BPMN reference**

Create `.claude/skills/process-modeling/references/bpmn.md` with exactly this content:

```markdown
# BPMN 2.0 — справочник нотации и рендер в mermaid

mermaid не имеет нативного BPMN-рендера. BPMN-модель выражается через mermaid
`flowchart` (swimlane через `subgraph` = дорожки) или `stateDiagram-v2`.

## Элементы BPMN → mermaid

| BPMN | Смысл | mermaid-выражение |
|---|---|---|
| Pool / Lane | организация / роль | `subgraph Роль ... end` |
| Task | действие | прямоугольник `id[Текст]` |
| Sub-process | свёрнутый поток | `id[[Текст]]` |
| Start event | старт | `id((Старт))` |
| End event | конец | `id((Конец))` |
| Exclusive gateway (XOR) | один путь | ромб `id{Условие?}` + подписи на рёбрах |
| Parallel gateway (AND) | все пути | ромб `id{И}` с несколькими исходящими |
| Sequence flow | порядок | `-->` |
| Message flow | между pool | `-.->` |

## Шаблон swimlane

\`\`\`mermaid
flowchart TD
  subgraph Менеджер
    A((Старт)) --> B[Принять лид]
    B --> C{Лид валиден?}
  end
  subgraph Система
    C -->|да| D[Создать сделку]
    C -->|нет| E((Отклонён))
    D --> F((Сделка создана))
  end
\`\`\`

## State-машина

Для конечных автоматов (воронка сделок — 14 статусов из `db/schema.sql`)
использовать `stateDiagram-v2`:

\`\`\`mermaid
stateDiagram-v2
  [*] --> new
  new --> in_progress
  in_progress --> won
  in_progress --> lost
  won --> [*]
  lost --> [*]
\`\`\`

Статус-слаги — из `db/schema.sql` (источник истины воронки), не выдумывать.

## Правила

- Один gateway — один вопрос; каждое исходящее ребро подписано условием.
- Каждый путь оканчивается end-событием (нет «висящих» задач).
- Исключения (timer/error) моделировать явно, не прятать в «happy path».
```

- [ ] **Step 3: Reload and verify the skill is discoverable**

```
/reload-plugins
```

Confirm `process-modeling` is listed among available skills (project `.claude/skills/` is auto-discovered, like `audit-portal`/`regression`). Confirm neither `settings.json` `hooks` block changed.

- [ ] **Step 4: Lint + commit**

```bash
npx markdownlint-cli2 ".claude/skills/process-modeling/**/*.md"
npx cspell --no-progress --no-summary --no-gitignore ".claude/skills/process-modeling/**/*.md"
```

Expected: clean. cspell will flag technical terms (`BPMN`, `swimlane`, `gateway`, `mermaid`, `stateDiagram`, `flowchart`, …) — add the valid ones to `cspell-words.txt` (LINT1: self-authored skills are linted, not ignored). Then:

```bash
git add .claude/skills/process-modeling/ cspell-words.txt
git commit -m "feat(c10): add self-authored process-modeling skill (BPMN/process maps)"
```

---

## Task 4: Author the process-analysis skill (PA1 / LINT1)

**Files:**

- Create: `.claude/skills/process-analysis/SKILL.md`
- Create: `.claude/skills/process-analysis/references/discovery.md`

- [ ] **Step 1: Create the skill directory + SKILL.md**

```bash
mkdir -p ".claude/skills/process-analysis/references"
```

Create `.claude/skills/process-analysis/SKILL.md` with exactly this content:

```markdown
---
name: process-analysis
description: Анализ и оптимизация существующего бизнес-процесса — process discovery (реконструкция as-is процесса из кода Laravel и audit-логов), поиск узких мест, трассировка требование→процесс, метрики и KPI процесса. Триггеры — «проанализируй процесс», «где узкое место», «process discovery», «как устроен процесс X», «метрики процесса», «оптимизируй процесс». Раздел C10 карты «Бизнес-процессы (общее)».
---

# Process Analysis

Разбирает **существующий** бизнес-процесс: восстанавливает фактическую модель,
находит узкие места, считает метрики. Парный скил к `process-modeling` — тот
проектирует to-be, этот вскрывает as-is.

## Четыре режима

### 1. Process discovery — реконструкция as-is
Восстановить фактический процесс из артефактов кода (карта источников —
`references/discovery.md`): маршруты + контроллеры (точки входа), джобы/события
(асинхронные шаги), enum статусов + переходы (state-машина), audit-таблицы
(фактические следы), cron/scheduler (периодические шаги). Итог — модель,
которую можно передать `process-modeling` для отрисовки.

### 2. Bottleneck — поиск узких мест
Паттерны: ручной шаг между авто-шагами; шаг с ожиданием внешней системы; точка
сериализации (advisory-lock, `lockForUpdate`); N+1 внутри шага; ретраи/таймауты;
шаг с наибольшей долей исключений.
Граница: это **процессные** узкие места. Runtime/код-производительность —
`perf-analyzer` / скил `analysis:bottleneck-detect` (PA1).

### 3. Трассировка требование→процесс
Связать пункт ТЗ / `Открытые_вопросы` → шаги процесса → код (file:line) →
тесты. Выявить шаги без требования (скрытая логика) и требования без
реализации.

### 4. Метрики процесса
Определить KPI: throughput, cycle time, конверсия между статусами, доля
исключений, объём ручного труда. Числа берутся из БД через `Boost`, не
выдумываются.
Граница: продуктовые метрики — плагин `product-management` (`/metrics-review`).

## Рабочий процесс

1. Определить режим (1-4) по запросу.
2. Собрать факты из кода / БД / логов — никаких допущений без пинов (file:line).
3. Выдать находки: модель / список узких мест / матрицу трассировки / таблицу
   метрик.
4. Рекомендации направить в `process-modeling` (to-be) или в задачи. Этот скил
   код не правит.

## Границы

- **Проектирование to-be модели** — скил `process-modeling`.
- **Runtime / код-производительность** — `perf-analyzer`,
  `analysis:bottleneck-detect` (PA1).
- **Продуктовые метрики** — плагин `product-management`.
- **Документ / change-request процесса** — плагин `operations`.
- **Генерик-методология оптимизации процесса** — скил `process-optimization`
  плагина `operations`. Этот скил — про code-grounded discovery конкретного
  процесса Лидерры (вскрытие as-is), не про общую методологию и не про
  проектирование to-be.
```

- [ ] **Step 2: Create the discovery reference**

Create `.claude/skills/process-analysis/references/discovery.md` with exactly this content:

```markdown
# Process discovery — карта источников as-is процесса в Лидерре

Где в коде Лидерры лежат факты о фактическом бизнес-процессе.

## Источники

| Артефакт процесса | Где искать |
|---|---|
| Точки входа процесса | `app/routes/*.php` + `app/app/Http/Controllers/**` |
| Синхронные шаги | методы контроллеров + `app/app/Services/**` |
| Асинхронные шаги | `app/app/Jobs/**`, `app/app/Events/**` + listeners |
| State-машина | enum/константы статусов + `db/schema.sql` (воронка — 14 статусов) |
| Фактические следы выполнения | `audit_*` таблицы, `audit_chain_hash` (событийный лог) |
| Периодические шаги | `app/app/Console/**` + scheduler (`partitions:create-months` и пр.) |
| Бизнес-правила в шагах | `calc_lead_score` (SQL), `PricingTierResolver`, `LedgerService` |

## Метод

1. От **точки входа** (route → controller) пройти по вызовам до терминального
   состояния.
2. Каждый `dispatch()` / событие — асинхронная ветка; проследить listener/job.
3. Переход статуса = ребро state-машины; собрать все переходы в автомат.
4. Свериться с **audit-логом**: фактический порядок событий в `audit_*` может
   расходиться с «проектным» — расхождение само по себе находка.
5. Зафиксировать каждый шаг пином `file:line`; без пина — это допущение, не факт.

## Антипаттерны при discovery

- Принять «happy path» за весь процесс — исключения (catch, failed jobs,
  таймауты) тоже шаги.
- Пропустить cron-шаги — они не видны из route-графа.
- Доверять имени метода вместо его тела.
```

- [ ] **Step 3: Reload and verify the skill is discoverable**

```
/reload-plugins
```

Confirm `process-analysis` is listed among available skills. Confirm neither `settings.json` `hooks` block changed.

- [ ] **Step 4: Lint + commit**

```bash
npx markdownlint-cli2 ".claude/skills/process-analysis/**/*.md"
npx cspell --no-progress --no-summary --no-gitignore ".claude/skills/process-analysis/**/*.md"
```

Expected: clean. Add valid flagged terms (`throughput`, `discovery`, `bottleneck`, `listener`, …) to `cspell-words.txt`. Then:

```bash
git add .claude/skills/process-analysis/ cspell-words.txt
git commit -m "feat(c10): add self-authored process-analysis skill (discovery/bottleneck)"
```

---

## Task 5: Bootstrap the C10 home — `docs/process/` + worked example + ADR-008

**Files:**

- Create: `docs/process/README.md`, `docs/process/examples/deal-lifecycle-process.md`
- Create: `docs/adr/ADR-008-business-process-tooling.md`
- Modify (conditional): `cspell-words.txt`

- [ ] **Step 1: Create the C10 home + the BP convention**

```bash
mkdir -p "docs/process/examples"
```

Create `docs/process/README.md` with exactly this content:

```markdown
# docs/process — business-process playbook (map section C10)

Home of the `C10 «Бизнес-процессы (общее)»` section. Defines the tooling Лидерра
uses to model, automate and analyse business processes.

## Toolset

| Tool | Role | Status |
|---|---|---|
| **operations plugin** | 9 skills — `process-doc`, `process-optimization`, `change-request`, `capacity-plan`, `compliance-tracking`, `risk-assessment`, `runbook`, `status-report`, `vendor-review`. | installed — `operations@knowledge-work-plugins` v1.2.0 |
| **process-modeling skill** | Model a to-be process — BPMN 2.0, process maps, customer-journey / value-stream, RACI, state-machines. | installed — self-authored skill |
| **process-analysis skill** | Analyse an as-is process — discovery from code/audit-logs, bottlenecks, traceability, BP metrics. | installed — self-authored skill |
| **n8n-mcp** | Workflow-automation engine. | **deferred** — see below |
| mermaid · architecture-patterns · CCPM · product-management · writing-plans | Reuse — diagram render · DDD process boundaries · requirements→process traceability · process specs/metrics · process decomposition. | reuse — cross-referenced into C10 |

## Boundaries (which tool for which job)

- **Documenting a process / a change to it / capacity / generic optimization** →
  the **operations** plugin skills (`process-doc`, `change-request`,
  `capacity-plan`, `process-optimization`, …).
- **Designing a to-be process model** (formal BPMN 2.0, swimlane, state-machine) →
  the **process-modeling** skill — which delegates *rendering* to the **mermaid**
  skill (operations and process-modeling emit Mermaid source; mermaid renders —
  OPS1/BPMN1).
- **Reverse-engineering an as-is process from the Лидерра codebase** → the
  **process-analysis** skill (discovery from `routes/`, `app/Jobs`, `audit_*`
  tables — what the generic `process-optimization` skill cannot do; OPS5).
- The operations `capacity-plan` skill plans **cross-functional business-process**
  capacity; dev-team sprint capacity is product-management `/sprint-planning` (OPS2).
- The operations `change-request` skill = a **business-process** change; an
  architecture decision is an ADR (adr-kit); a normative-doc edit is
  claude-md-management (OPS3).
- process-analysis finds **business-process** bottlenecks; **code/runtime**
  performance is `perf-analyzer` / `analysis:bottleneck-detect` (PA1).

## n8n-mcp — why deferred

n8n-mcp builds workflows for the n8n platform. The Лидерра stack has **no n8n** —
the process engine is the Laravel queue (Redis) + events/jobs. Adopting n8n as
portal infrastructure is an architecture decision, not a tooling pick. n8n-mcp is a
**reserved slot**: registered in the Tooling registry as *pending*, installed by a
separate severable task when (and if) n8n is adopted via its own ADR. See the C10
plan's "Deferred Task".
```

- [ ] **Step 2: Create the worked example**

Create `docs/process/examples/deal-lifecycle-process.md` with exactly this content:

```markdown
# Worked example — the deal-lifecycle process

A worked `process-modeling` artifact: the lead→deal lifecycle as a BPMN-style
swimlane. Demonstrates the C10 modeling workflow. Status slugs are illustrative —
the source of truth for the funnel is `db/schema.sql`.

\`\`\`mermaid
flowchart TD
  subgraph Поставщик
    A((Лид поступил)) --> B[Лид в проекте-канале]
  end
  subgraph Менеджер
    B --> C{Лид валиден?}
    C -->|нет| D((Отклонён))
    C -->|да| E[Создать сделку — статус new]
    E --> F[Квалификация]
    F --> G{Квалифицирован?}
    G -->|нет| H((Потерян — lost))
    G -->|да| I[Работа по сделке — in_progress]
  end
  subgraph Система
    I --> J{Итог сделки}
    J -->|успех| K((Выиграна — won))
    J -->|провал| H
    K --> L[Списание по тарифу — LedgerService]
    L --> M((Завершено))
  end
\`\`\`

## How this was built

1. **process-analysis** (discovery mode) reconstructed the as-is flow from
   `routes/*.php`, the deal controllers, and the status enum in `db/schema.sql`.
2. **process-modeling** chose the swimlane artifact (three roles, branching) and
   wrote the BPMN structure.
3. The **mermaid** skill rendered the source above.
4. **operations** `/ops:process-doc` would wrap this into a full process document
   when one is needed.
```

- [ ] **Step 3: Write ADR-008**

Create `docs/adr/ADR-008-business-process-tooling.md` (verify `ADR-008` is the next free number from Task 1 Step 6; adjust if not) with exactly this content:

```markdown
# ADR-008: Business-process tooling (C10)

- **Status:** Accepted
- **Date:** 2026-05-17
- **Deciders:** Дмитрий

## Context
The `C10 «Бизнес-процессы (общее)»` map section had zero tooling. C10 is the
catch-all of bucket C — its work (modeling, automation, analysis of business
processes) partly overlaps already-populated sections (C9 PM, E2 orchestration,
A6 diagrams). A toolset is needed without duplicating those.

## Decision
C10 adopts a hybrid toolset (Approach 3):
- **operations plugin** (`operations@knowledge-work-plugins`, Anthropic) —
  process documentation, change management, capacity planning.
- **process-modeling skill** — self-authored vendored skill: BPMN 2.0, process
  maps, RACI, state-machines. Renders via the mermaid skill.
- **process-analysis skill** — self-authored vendored skill: as-is discovery,
  bottlenecks, traceability, BP metrics.
- **Five reuse cross-references** (mermaid, architecture-patterns, CCPM,
  product-management, writing-plans) surfaced via `NODE_SECTION_SECONDARY` — no
  re-tagging of their home sections.
- **n8n-mcp** (workflow engine) is **deferred**: the portal stack has no n8n
  (the process engine is the Laravel queue); adopting n8n is an architecture
  decision with its own ADR. n8n-mcp is a reserved registry slot.
- C10 tools are non-UI → the `business-process` off-phase category, outside the
  PSR_v1 UI-pool.

## Consequences
- Positive: C10 populated; modeling + automation + analysis covered with zero
  duplication of C9/E2/A6 tools.
- Risk: the two skills are self-authored — owned by the project, no upstream
  dependency (this is the mitigation, not a risk).
- Deferred: no workflow engine until n8n is adopted as infrastructure — accepted,
  this is the decision.

## Enforcement
None — C10 tools are advisory; verified by use and code review.
```

- [ ] **Step 4: Lint + commit**

```bash
npx markdownlint-cli2 "docs/process/**/*.md" "docs/adr/ADR-008-*.md"
npx cspell --no-progress --no-summary --no-gitignore "docs/process/**/*.md" "docs/adr/ADR-008-*.md"
```

Add valid flagged terms to `cspell-words.txt`. Then:

```bash
git add docs/process/ docs/adr/ADR-008-*.md cspell-words.txt
git commit -m "feat(c10): bootstrap docs/process — README + worked example + ADR-008"
```

---

## Task 6: Smoke-test the C10 toolset

**Files:** none modified

- [ ] **Step 1: Smoke-test the operations plugin**

Invoke the operations `process-doc` skill on a trivial process (e.g. "лид поступил → менеджер принял → создана сделка"). Expected: the skill loads and produces a process document / flowchart. Functional smoke — no file output required. The 9 operations skills were already enumerated on install (Task 2): `process-doc`, `process-optimization`, `change-request`, `capacity-plan`, `compliance-tracking`, `risk-assessment`, `runbook`, `status-report`, `vendor-review`.

- [ ] **Step 2: Smoke-test the process-modeling skill**

Invoke the `process-modeling` skill with a trivial request (e.g. "смоделируй процесс приёма лида в виде swimlane"). Expected: the skill loads, `SKILL.md` routes the intent, it picks the swimlane artifact and emits a BPMN/mermaid structure (delegating render to mermaid).

- [ ] **Step 3: Smoke-test the process-analysis skill**

Invoke the `process-analysis` skill with a trivial request (e.g. "process discovery: как устроен процесс создания сделки"). Expected: the skill loads, routes to discovery mode, and references the code/audit-log sources from `references/discovery.md`.

- [ ] **Step 4: Confirm the hook chain is intact (OPS4)**

Submit a trivial prompt; the economy marker still appears, the Stop verifier still runs, ruflo + CLAUDE.md-warn hooks fire. No plugin/skill leaked a `hooks` entry vs the Task 1 Step 2 snapshot. No repo files changed in Task 6 → no commit.

---

## Task 7: Normative registry sync (NUM1 / CAT1)

**Files:** Modify `docs/Tooling_v8_3.md`, `docs/Plugin_stack_rules_v1.md`, `docs/Pravila_raboty_Claude_v1_1.md`, `CLAUDE.md`, `docs/CHANGELOG_claude_md.md`

- [ ] **Step 1: Read the registry homes + the live counter (NUM1)**

Read for exact insertion points and the **current** counter: `docs/Tooling_v8_3.md` Прил. Н §0 + the last `§4.x` subsection (expected `§4.25`); `docs/Plugin_stack_rules_v1.md` R10.1 (Block 1 marketplace plugins, Block 3 MCP servers); `docs/Pravila_raboty_Claude_v1_1.md` §13.2. Assign the C10 numbers from `counter+1`:

- `#N` operations, `#N+1` process-modeling, `#N+2` process-analysis, `#N+3` n8n-mcp (registered **pending**) — sequential. Expected `#51`–`#54`; **verify against the live counter**, do not hard-code.

- [ ] **Step 2: Add the Tooling Прил. Н business-process subsections**

Edit `docs/Tooling_v8_3.md`: add `§4.26`–`§4.29` (next four after the last subsection), category **business-process** (off-phase). Per tool:

- **operations** (`#51`) — marketplace plugin `operations@knowledge-work-plugins` v1.2.0 (`anthropics/knowledge-work-plugins`), Anthropic Verified; ships **9 skills** (`process-doc`, `process-optimization`, `change-request`, `capacity-plan`, `compliance-tracking`, `risk-assessment`, `runbook`, `status-report`, `vendor-review`); **0 lifecycle hooks**; boundaries OPS1/OPS2/OPS3/OPS5.
- **process-modeling** (`#52`) — self-authored standalone skill in `.claude/skills/process-modeling/`; BPMN 2.0 + process maps; renders via mermaid (BPMN1); linted, not lint-ignored (LINT1).
- **process-analysis** (`#53`) — self-authored standalone skill in `.claude/skills/process-analysis/`; as-is discovery / bottleneck / traceability / metrics; boundary vs perf-analyzer (PA1).
- **n8n-mcp** (`#54`) — `czlonkowski/n8n-mcp`, MIT, **pending — NOT installed**; deferred severable task gated on an ADR adopting n8n (N8N1); the Sentry #34 / Jupyter #50 "pending" precedent.

Add **business-process** as the **11th** off-phase subcategory (after UI-pool, infrastructure, debug-runtime, orchestration, architecture-tooling, audit-security, project-management, design-tooling, integration-tooling, ml-ai-tooling — confirm the exact count against the live file). Bump §0 counter (`50→54`, total `70→74`). Bump the Прил. Н version header.

- [ ] **Step 3: Add PSR_v1 R10.1 rows**

Edit `docs/Plugin_stack_rules_v1.md`: R10.1 — Block 1 (marketplace plugins) += operations; Block 1 note += the two self-authored skills; Block 3 (MCP servers) += n8n-mcp marked **DEFERRED**. Category **business-process** (off-phase), explicitly *outside* the UI-pool → no R6.0/R6.1 stack-filter, no R14 pipeline. Bump the PSR_v1 version header.

- [ ] **Step 4: Add the Pravila §13.2 note**

Edit `docs/Pravila_raboty_Claude_v1_1.md` §13.2: add a one-line **business-process** category note, alongside the existing infrastructure / debug-runtime / architecture-tooling / audit-security / project-management / design-tooling / integration-tooling / ml-ai-tooling notes. Re-read Pravila §0/§13 first to keep section numbering consistent. Bump the Pravila version header.

- [ ] **Step 5: Update CLAUDE.md via the governed channel**

Invoke `/claude-md-management:claude-md-improver`. Apply: §3 title count bump, §1 priority-chain row 2b count bump, new §3.3 business-process row(s) (operations + the 2 skills + n8n-mcp DEFERRED), §6 + §9 entries. The plugin also writes the `docs/CHANGELOG_claude_md.md` entry and bumps §0 cross-ref versions (Tooling / PSR_v1 / Pravila). **Do not** edit `CLAUDE.md` directly (§5 п.10).

- [ ] **Step 6: Lint + commit**

```bash
npx markdownlint-cli2 "docs/Tooling_v8_3.md" "docs/Plugin_stack_rules_v1.md" "docs/Pravila_raboty_Claude_v1_1.md" "docs/CHANGELOG_claude_md.md"
npx cspell --no-progress --no-summary --no-gitignore "docs/Tooling_v8_3.md" "docs/Plugin_stack_rules_v1.md" "docs/Pravila_raboty_Claude_v1_1.md"
git add docs/Tooling_v8_3.md docs/Plugin_stack_rules_v1.md docs/Pravila_raboty_Claude_v1_1.md CLAUDE.md docs/CHANGELOG_claude_md.md cspell-words.txt
git commit -m "docs(c10): register business-process category — operations/process-modeling/process-analysis/n8n-mcp (NUM1)"
```

---

## Task 8: Reflect C10 on the map — close the section

**Files:** Modify `docs/automation-graph.html`

- [ ] **Step 1: Read the structures to replicate**

In `docs/automation-graph.html` read, as templates: a plugin node (`fd_plugin` / `product_mgmt`), a project-skill node (the `mermaid_skill` / `sk_qitem` shape), the `NODE_SECTION` C9/A11 comment blocks, the `NODE_SECTION_SECONDARY` A3 block, and the "Паспорт узла" `since:` date field. Record the current node/edge counts from the header and the group-count comments.

- [ ] **Step 2: Add the 3 C10 nodes**

Add to `NODES`, replicating the template shapes:

- `ops_plugin` — label `operations\n(plugin)`, `plugins` group.
- `process_modeling` — label `process-modeling\n(skill)`, `skills_proj` group.
- `process_analysis` — label `process-analysis\n(skill)`, `skills_proj` group.

Add matching `nd(...)` / `NODE_DETAILS` entries (Russian, per the file's convention), Паспорт `since: '2026-05-17'`:

- `ops_plugin` — "Плагин Anthropic operations: документирование процессов, change-management, capacity-планирование. Раздел C10."
- `process_modeling` — "Свой скил: моделирование to-be процесса — BPMN 2.0, карты процессов, RACI. Рендер — через mermaid."
- `process_analysis` — "Свой скил: анализ as-is процесса — discovery из кода, узкие места, трассировка, метрики."

- [ ] **Step 3: Map the 3 nodes to section C10**

In `NODE_SECTION` add (a new comment block, after the A11/A3 blocks):

```js
// C10 business-process 17.05.2026 — раздел «Бизнес-процессы (общее)» наполнен
ops_plugin: 'C10', process_modeling: 'C10', process_analysis: 'C10',
```

`C10 «Бизнес-процессы (общее)»` goes from 0 → 3 primary nodes — the section is no longer empty. (No `n8n_mcp` node — n8n-mcp is deferred, N8N1.)

- [ ] **Step 4: Add the 5 cross-references (XREF1)**

In `NODE_SECTION_SECONDARY` add the five reuse nodes (each maps to its own home section primarily; `['C10']` is the cross-ref):

```js
// C10 business-process 17.05.2026 — кросс-реф reuse-инструментов
mermaid_skill: ['C10'],
arch_patterns: ['C10'],
ccpm:          ['C10'],
product_mgmt:  ['C10'],
sk_wplans:     ['C10'],
```

(Verify none of these five already has a `NODE_SECTION_SECONDARY` entry — the A3 block uses `mcp_boost`/`context7`/`ag_pest`/`mcp_semgrep`/`mcp_sentry`, no overlap. If an overlap is found, append `'C10'` to the existing array instead of adding a new key.)

- [ ] **Step 5: Update header metrics + group-count comments**

Bump the node count in the map header/legend by 3. Bump the edge count if Step 2's node details add governing edges (match how the A11 nodes were wired — replicate that pattern, else node-only). Update the `NODE_SECTION` group-count comments (`plugins`, `skills_proj`).

- [ ] **Step 6: Smoke-test the map**

```bash
npx stylelint docs/automation-graph.html
```

Open `docs/automation-graph.html` (Playwright MCP or a local `http.server` — quirk 90: `file://` rejected). Expected: 0 JS console errors; the 3 new nodes render; clicking section `C10` highlights the 3 primary nodes **and** the 5 cross-referenced nodes.

- [ ] **Step 7: Commit**

```bash
git add docs/automation-graph.html
git commit -m "feat(map): C10 nodes — closes section «Бизнес-процессы (общее)»"
```

---

## Task 9: Final regression & branch finish

**Files:** none modified

- [ ] **Step 1: Rebase onto latest origin/main (sequencing)**

```bash
git fetch origin
git rebase origin/main
```

Expected: a clean rebase. If `origin/main` moved (another epic landed touching the map / 4 normative docs / the Tooling counter) — resolve any conflict by **re-reading the live file and re-applying the C10 delta**, never blindly. Re-run the live-counter read (Task 7 Step 1) if the Tooling counter moved.

- [ ] **Step 2: Full pre-commit chain**

```bash
npx lefthook run pre-commit
```

Expected: all jobs green — C10 adds **no** lefthook job (job count unchanged vs the Task 1 baseline).

- [ ] **Step 3: Confirm app code untouched — run the suites**

C10 changes no `app/` code → suites must match the Task 1 Step 3 baseline:

```bash
cd app && php artisan test --parallel
cd .. && npm run test:vue
```

Expected: Pest and Vitest counts unchanged vs the Task 1 baseline (0 regressions). Record exact counts; write out any failure with file:line.

- [ ] **Step 4: Confirm the economy/ruflo hook chain is intact**

Economy marker still appears; the Stop verifier still runs; no plugin/skill leaked a `hooks` entry into either `settings.json`. Compare to the Task 1 Step 2 snapshot.

- [ ] **Step 5: Pre-push checks**

```bash
./bin/gitleaks.exe detect --source . --no-banner --redact
./bin/lychee.exe --config .lychee.toml "docs/**/*.md" "*.md"
```

Expected: gitleaks 0 leaks; lychee 0 broken (new `docs/process/**/*.md` + `docs/adr/ADR-008-*.md` are scanned — fix or `.lychee.toml`-exclude any link).

- [ ] **Step 6: Finish the branch**

Invoke `superpowers:finishing-a-development-branch` — present the standard options. Do **not** push without an explicit user choice. Push pattern: `git push origin worktree-c10-business-process-tooling:main`.

---

## Deferred Task (NOT in this plan — future, severable)

**n8n-mcp install — gated on adopting n8n as infrastructure.** When (and if) n8n is
adopted as a portal workflow engine, run a separate task:

1. Write an ADR deciding to adopt n8n as portal infrastructure — an explicit
   architecture weighing (where n8n runs, which processes it owns vs the Laravel
   queue, the operational cost).
2. Spike `czlonkowski/n8n-mcp` before integrating — confirm Claude Code
   compatibility and the n8n-instance connection model.
3. Install n8n-mcp as a new `.mcp.json` server, version-pinned.
4. Flip the Tooling registry entry from **pending** to **active**; add an `n8n_mcp`
   node to `docs/automation-graph.html` → `NODE_SECTION` C10 (now 4 primary nodes).
5. Re-run the full regression + the conflict re-audit.

Until then, C10 is fully covered by the 3 installed positions + the 5 reuse
cross-references — the automation subcategory is served by process-modeling
(state-machine design of the Laravel-queue automations) + the writing-plans / ruflo
cross-refs.

---

## Self-Review

**1. Spec coverage (the 9-position C10 coverage, Approach 3).** operations — installed (Task 2), smoked (Task 6 Step 1), registered (Task 7). process-modeling — authored (Task 3), smoked (Task 6 Step 2), registered (Task 7). process-analysis — authored (Task 4), smoked (Task 6 Step 3), registered (Task 7). n8n-mcp — registered pending (Task 7 Step 2), deferred task documented ("Deferred Task"). The 5 reuse cross-refs — surfaced on the map (Task 8 Step 4), documented in `docs/process/README.md` (Task 5 Step 1). C10 home — `docs/process/` (Task 5). Section closure: normative (Task 7), map (Task 8), regression/finish (Task 9). Conflict audit: OPS1→T5.1+T7.2, OPS2→T5.1, OPS3→T5.1, OPS4→T2.3-5, BPMN1→T3.1, LINT1→T1.5+T3.4+T4.4, PA1→T4.1+T5.1, N8N1→T7.2+"Deferred Task", XREF1→T8.4, CAT1→T7.2-4, BUS1→T7.2, NUM1→T1.6+T7.1+T9.1. No gaps.

**2. Placeholder scan.** `#N`/`#51`–`#54`, `ADR-008` (verified in Task 1 Step 6), the `§4.26`–`§4.29` numbers, and the map node group choice are **runtime-resolved / verified-in-Task-1 by design** — the live Tooling counter and the live ADR/subsection numbers are not knowable before Task 1, and each carries concrete resolution criteria (the A11 NUM1 pattern). The `/ops:*` command list is verified at install (Task 2 Step 3) — the design cannot pin it before the plugin is installed. All file contents shown in full — `docs/process/README.md`, the worked example, ADR-008, both `SKILL.md` files, both `references/*.md` files. No "TBD" / "handle edge cases".

**3. Consistency.** Branch `worktree-c10-business-process-tooling` consistent T1↔T9. Node ids `ops_plugin` / `process_modeling` / `process_analysis` consistent T8 Steps 2-3 + the `docs/process/README.md` table. Skill names `process-modeling` / `process-analysis` consistent across the SKILL.md frontmatter, the `.claude/skills/` paths, the Tooling entries (Task 7), and the map nodes. Category name **business-process** consistent T7 Steps 2-4 + ADR-008. n8n-mcp flagged **deferred/pending** uniformly (Tool Identity, N8N1, Task 7 Step 2, Task 8 Step 3, "Deferred Task"). LINT1 resolved consistently — skills linted, no `cspell.json`/`.markdownlintignore` change (File Structure + Task 3/4 Step 4). No lefthook job added.

---

## Execution Handoff

Plan complete and saved to `docs/superpowers/plans/2026-05-17-c10-business-process-tooling-integration.md`. Two execution options:

1. **Subagent-Driven** — fresh subagent per task, two-stage review. *Caveat:* Task 2 (`claude plugin install`, `/ops:*` verification), Task 3/4 Step 3 (`/reload-plugins`, skill smoke), Task 6 (skill/plugin invocations) and Task 7 Step 5 (`/claude-md-management`) are main-session-bound — those steps stay with the controller.
2. **Inline Execution** — `superpowers:executing-plans`, batch with checkpoints. **Recommended here** — install/config/docs-heavy with many interactive main-session steps (the A6/C9/D3/A11 pattern).

One open item before execution: execution method — **1** (Subagent-Driven) or **2** (Inline, recommended here).
