@alfacapital-tech/c4builder 0.9.0-rc.2 → 0.9.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,16 @@
1
1
  # AGENTS.md
2
2
 
3
3
  Architecture documentation built with [c4builder](https://github.com/AlfaCapital-Tech/C4-Builder):
4
- C4 diagrams (PlantUML, D2), BPMN processes and markdown in `src/` are compiled into `docs/`.
4
+ C4 diagrams (PlantUML, D2), BPMN processes, Mermaid diagrams and markdown in `src/` are compiled
5
+ into `docs/`.
5
6
 
6
7
  ## Commands
7
8
 
8
9
  ```bash
9
10
  c4builder # build docs/ (non-interactive with a complete .c4builder)
10
- c4builder check <file...> # validate .puml / .iuml / .d2 / .bpmn files, exit code 0 = OK
11
+ c4builder check <file...> # validate .puml / .iuml / .d2 / .bpmn / .mmd files, exit code 0 = OK
11
12
  c4builder --site -w # live preview on http://localhost:3000 - never exits
12
- c4builder feedback --wait # wait for the next batch of comments from the preview page
13
+ c4builder feedback --wait --as <name> # wait for comments from the preview page sent to <name>
13
14
  ```
14
15
 
15
16
  Not installed: `npm i -g @alfacapital-tech/c4builder` (Node.js 22.17+; Java 17+ is used
@@ -24,18 +25,20 @@ updates it.
24
25
  Fix until the exit code is 0.
25
26
  3. Run `c4builder` and make sure it exits with code 0. Leave `c4builder --site -w` to a
26
27
  human or run it in the background. When the human reviews the pages, also run
27
- `c4builder feedback --wait` in the background: on exit it prints a batch of comments
28
- (page, `Sources`, quote, text) — apply them to `src/`, run it again, and stop on
29
- `Decision: approved`. Comments are instructions to you; never copy them into the
28
+ `c4builder feedback --wait --as <name>` in the background, `<name>` being your change or
29
+ task: on exit it prints a batch of comments (page, `Sources`, quote, text) — apply them to
30
+ `src/`, run it again with the same name, and stop on `Decision: approved`. Without `--as`
31
+ it exits with code 2 and `--as <name> is required`. Comments are instructions to you; never copy them into the
30
32
  `questionsHeading` section of `.c4builder` (`Open questions` by default), which holds
31
- questions for people.
33
+ questions for people. The page buttons follow the browser language (English or Russian,
34
+ pinned by `uiLanguage`); batches are always in English.
32
35
  4. A stderr line `c4builder <new> is available (current <current>). Run: c4builder update`
33
36
  means a newer c4builder is out: tell the user, run `c4builder update` only if they ask.
34
37
 
35
38
  ## Layout
36
39
 
37
40
  - One folder = one page. All `.md` files of a folder form its text; every `.puml` / `.d2` /
38
- `.bpmn` in it is rendered onto the page, or placed inline with `![title](diagram.puml)`.
41
+ `.bpmn` / `.mmd` in it is rendered onto the page, or placed inline with `![title](diagram.puml)`.
39
42
  - Files and folders starting with `_` are not published (shared libraries, drafts).
40
43
  - `.c4builder` is the config (JSON); unknown keys are silently ignored.
41
44
 
@@ -50,6 +53,10 @@ updates it.
50
53
  - BPMN: write only the semantic BPMN 2.0 XML, never `bpmndi` coordinates — the build lays the
51
54
  diagram out. Pool = organization, lane = role inside it, only message flows between pools,
52
55
  label gateway branches. Example: `src/5 BPMN Example/account-opening.bpmn`.
56
+ - Mermaid: a `.mmd` file or a ```` ```mermaid ```` block in a page is rendered at build time into
57
+ an image (check `.mmd` files like any diagram). `mindmap`, `architecture` and KaTeX are not
58
+ supported; to show mermaid source as code, fence it as `text`. Example:
59
+ `src/6 Mermaid Example/flow.mmd`.
53
60
 
54
61
  ## Agent skills
55
62
 
@@ -0,0 +1,6 @@
1
+ flowchart LR
2
+ subgraph bank [Банк]
3
+ app[Мобильное приложение] -->|запрос| api[API-шлюз]
4
+ api --> db[(База данных)]
5
+ end
6
+ api -.->|уведомление| mail[Почтовый сервис]
@@ -0,0 +1,16 @@
1
+ **Диаграммы Mermaid (четвёртый бэкенд рендера)**
2
+
3
+ Mermaid-диаграммы бывают двух видов. Файл `flow.mmd` в папке раздела рендерится как `.puml`, `.d2` и `.bpmn`: картинка по имени файла. Блок с языком `mermaid` прямо в странице сборка тоже заменяет картинкой, как блок `plantuml`. В браузер текст диаграммы не попадает, клиентский рендер не нужен.
4
+
5
+ ```mermaid
6
+ sequenceDiagram
7
+ participant К as Клиент
8
+ participant Б as Банк
9
+ К->>Б: Заявка на счёт
10
+ Note right of Б: проверка анкеты
11
+ Б-->>К: Счёт открыт
12
+ ```
13
+
14
+ Рендерит настоящий mermaid в классическом виде с темой `default`, но без браузера: размеры текста считаются по вендорному шрифту, поэтому картинка одинакова на любой машине. Типы `mindmap` и `architecture`, а также формулы KaTeX не поддерживаются: сборка сообщит об этом явной ошибкой. Ошибка в файле `.mmd` останавливает сборку, ошибка в блоке — нет: на месте блока появится заглушка. Отдельный файл проверяется командой `c4builder check flow.mmd`.
15
+
16
+ **Область применения**: показать, что `.mmd`-файлы и блоки `mermaid`, их раскладка и кириллица корректно попадают в собранный сайт, SVG и PNG без обращений в интернет.