flowbook 0.1.3 → 0.1.6

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.
package/README.fr.md DELETED
@@ -1,233 +0,0 @@
1
- # Flowbook
2
-
3
- > [English](./README.md) | [한국어](./README.ko.md) | [简体中文](./README.zh-CN.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [Português (BR)](./README.pt-BR.md) | **Français** | [Русский](./README.ru.md) | [Deutsch](./README.de.md)
4
-
5
- Storybook pour les diagrammes de flux. Découvre automatiquement les fichiers de diagrammes Mermaid dans votre code, les organise par catégorie et les affiche dans un visualiseur navigable.
6
-
7
- ![Vite](https://img.shields.io/badge/vite-6.x-646CFF?logo=vite&logoColor=white)
8
- ![React](https://img.shields.io/badge/react-19.x-61DAFB?logo=react&logoColor=white)
9
- ![Mermaid](https://img.shields.io/badge/mermaid-11.x-FF3670?logo=mermaid&logoColor=white)
10
- ![TypeScript](https://img.shields.io/badge/typescript-5.x-3178C6?logo=typescript&logoColor=white)
11
-
12
- ## Démarrage Rapide
13
-
14
- ```bash
15
- # Initialiser — ajoute les scripts + fichier d'exemple
16
- npx flowbook@latest init
17
-
18
- # Démarrer le serveur de développement
19
- npm run flowbook
20
- # → http://localhost:6200
21
-
22
- # Construire le site statique
23
- npm run build-flowbook
24
- # → flowbook-static/
25
- ```
26
-
27
- ## CLI
28
-
29
- ```
30
- flowbook init Configurer Flowbook dans votre projet
31
- flowbook dev [--port 6200] Démarrer le serveur de développement
32
- flowbook build [--out-dir d] Construire un site statique
33
- ```
34
-
35
- ### `flowbook init`
36
-
37
- - Ajoute les scripts `"flowbook"` et `"build-flowbook"` à votre `package.json`
38
- - Crée `flows/example.flow.md` comme modèle de départ
39
-
40
- ### `flowbook dev`
41
-
42
- Démarre un serveur de développement Vite sur `http://localhost:6200` avec HMR. Toute modification de fichiers `.flow.md` ou `.flowchart.md` est prise en compte instantanément.
43
-
44
- ### `flowbook build`
45
-
46
- Construit un site statique dans `flowbook-static/` (configurable via `--out-dir`). Déployez-le n'importe où.
47
-
48
- ## Écrire des Fichiers de Flux
49
-
50
- Créez un fichier `.flow.md` (ou `.flowchart.md`) n'importe où dans votre projet :
51
-
52
- ````markdown
53
- ---
54
- title: Flux de Connexion
55
- category: Authentification
56
- tags: [auth, login, oauth]
57
- order: 1
58
- description: Flux d'authentification utilisateur avec OAuth2
59
- ---
60
-
61
- ```mermaid
62
- flowchart TD
63
- A[Utilisateur] --> B{Authentifié ?}
64
- B -->|Oui| C[Tableau de bord]
65
- B -->|Non| D[Page de connexion]
66
- ```
67
- ````
68
-
69
- Flowbook découvre automatiquement le fichier et l'ajoute au visualiseur.
70
-
71
- ## Schéma du Frontmatter
72
-
73
- | Champ | Type | Requis | Description |
74
- |---------------|------------|--------|----------------------------------------|
75
- | `title` | `string` | Non | Titre affiché (par défaut : nom du fichier) |
76
- | `category` | `string` | Non | Catégorie dans la barre latérale (par défaut : "Uncategorized") |
77
- | `tags` | `string[]` | Non | Tags filtrables |
78
- | `order` | `number` | Non | Ordre de tri dans la catégorie (par défaut : 999) |
79
- | `description` | `string` | Non | Description affichée dans la vue détaillée |
80
-
81
- ## Découverte des Fichiers
82
-
83
- Flowbook analyse ces motifs par défaut :
84
-
85
- ```
86
- **/*.flow.md
87
- **/*.flowchart.md
88
- ```
89
-
90
- Ignore `node_modules/`, `.git/` et `dist/`.
91
-
92
- ## Compétence Agent IA
93
-
94
- `flowbook init` installe automatiquement les compétences d'agent IA dans tous les répertoires d'agents de codage supportés.
95
- Lorsqu'un agent de codage (Claude Code, OpenAI Codex, VS Code Copilot, Cursor, Gemini CLI, etc.) détecte le mot-clé **"flowbook"** dans votre invite, il :
96
-
97
- 1. Analyse votre base de code pour les flux logiques (routes API, authentification, gestion d'état, logique métier, etc.)
98
- 2. Configure Flowbook s'il n'est pas déjà initialisé
99
- 3. Génère des fichiers `.flow.md` avec des diagrammes Mermaid pour chaque flux significatif
100
- 4. Vérifie la compilation
101
-
102
- ### Installation Manuelle de Compétence
103
-
104
- Si vous n'avez pas utilisé `flowbook init`, copiez la compétence manuellement :
105
-
106
- ```bash
107
- # Claude Code
108
- mkdir -p .claude/skills/flowbook
109
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .claude/skills/flowbook/
110
-
111
- # OpenAI Codex
112
- mkdir -p .agents/skills/flowbook
113
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .agents/skills/flowbook/
114
-
115
- # VS Code / GitHub Copilot
116
- mkdir -p .github/skills/flowbook
117
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .github/skills/flowbook/
118
-
119
- # Google Antigravity
120
- mkdir -p .agent/skills/flowbook
121
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .agent/skills/flowbook/
122
-
123
- # Gemini CLI
124
- mkdir -p .gemini/skills/flowbook
125
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .gemini/skills/flowbook/
126
-
127
- # Cursor
128
- mkdir -p .cursor/skills/flowbook
129
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .cursor/skills/flowbook/
130
-
131
- # Windsurf (Codeium)
132
- mkdir -p .windsurf/skills/flowbook
133
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .windsurf/skills/flowbook/
134
-
135
- # AmpCode
136
- mkdir -p .amp/skills/flowbook
137
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .amp/skills/flowbook/
138
-
139
- # OpenCode / oh-my-opencode
140
- mkdir -p .opencode/skills/flowbook
141
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .opencode/skills/flowbook/
142
- ```
143
-
144
- ### Agents Compatibles
145
-
146
- | Agent | Emplacement de Compétence |
147
- |-------|---------------|
148
- | Claude Code | `.claude/skills/flowbook/SKILL.md` |
149
- | OpenAI Codex | `.agents/skills/flowbook/SKILL.md` |
150
- | VS Code / GitHub Copilot | `.github/skills/flowbook/SKILL.md` |
151
- | Google Antigravity | `.agent/skills/flowbook/SKILL.md` |
152
- | Gemini CLI | `.gemini/skills/flowbook/SKILL.md` |
153
- | Cursor | `.cursor/skills/flowbook/SKILL.md` |
154
- | Windsurf (Codeium) | `.windsurf/skills/flowbook/SKILL.md` |
155
- | AmpCode | `.amp/skills/flowbook/SKILL.md` |
156
- | OpenCode / oh-my-opencode | `.opencode/skills/flowbook/SKILL.md` |
157
-
158
- ## Fonctionnement
159
-
160
- ```
161
- fichiers .flow.md ──→ Plugin Vite ──→ Module Virtuel ──→ Visualiseur React
162
- │ │
163
- ├─ scan fast-glob ├─ export default { flows: [...] }
164
- ├─ gray-matter │
165
- │ parsing └─ HMR sur modification de fichier
166
- └─ bloc mermaid
167
- extraction
168
- ```
169
-
170
- 1. **Découverte** — `fast-glob` analyse le projet à la recherche de `*.flow.md` / `*.flowchart.md`
171
- 2. **Parsing** — `gray-matter` extrait le frontmatter YAML ; regex extrait les blocs `` ```mermaid ``
172
- 3. **Module Virtuel** — Le plugin Vite sert les données parsées comme `virtual:flowbook-data`
173
- 4. **Rendu** — L'application React rend les diagrammes Mermaid via `mermaid.render()`
174
- 5. **HMR** — Les modifications de fichiers invalident le module virtuel, déclenchant un rechargement
175
-
176
- ## Structure du Projet
177
-
178
- ```
179
- src/
180
- ├── types.ts # Types partagés (FlowEntry, FlowbookData)
181
- ├── node/
182
- │ ├── cli.ts # Point d'entrée CLI (init, dev, build)
183
- │ ├── server.ts # Serveur Vite programmatique et build
184
- │ ├── init.ts # Logique d'initialisation du projet
185
- │ ├── discovery.ts # Scanner de fichiers (fast-glob)
186
- │ ├── parser.ts # Extraction frontmatter + mermaid
187
- │ └── plugin.ts # Plugin de module virtuel Vite
188
- └── client/
189
- ├── index.html # HTML d'entrée
190
- ├── main.tsx # Entrée React
191
- ├── App.tsx # Layout avec recherche + barre latérale + visualiseur
192
- ├── vite-env.d.ts # Déclarations de type du module virtuel
193
- ├── styles/globals.css # Tailwind v4 + styles personnalisés
194
- └── components/
195
- ├── Header.tsx # Logo, barre de recherche, nombre de flux
196
- ├── Sidebar.tsx # Arbre de catégories repliable
197
- ├── MermaidRenderer.tsx # Rendu des diagrammes Mermaid
198
- ├── FlowView.tsx # Vue détaillée d'un flux individuel
199
- └── EmptyState.tsx # État vide avec guide
200
- ```
201
-
202
- ## Développement (Contribution)
203
-
204
- ```bash
205
- git clone https://github.com/Epsilondelta-ai/flowbook.git
206
- cd flowbook
207
- npm install
208
-
209
- # Développement local (utilise le vite.config.ts racine)
210
- npm run dev
211
-
212
- # Construire le CLI
213
- npm run build
214
-
215
- # Tester le CLI localement
216
- node dist/cli.js dev
217
- node dist/cli.js build
218
- ```
219
-
220
- ## Stack Technique
221
-
222
- - **Vite** — Serveur de développement avec HMR
223
- - **React 19** — Interface utilisateur
224
- - **Mermaid 11** — Rendu de diagrammes
225
- - **Tailwind CSS v4** — Stylisation
226
- - **gray-matter** — Parsing de frontmatter YAML
227
- - **fast-glob** — Découverte de fichiers
228
- - **tsup** — Bundler CLI
229
- - **TypeScript** — Sûreté de type
230
-
231
- ## Licence
232
-
233
- MIT
package/README.ja.md DELETED
@@ -1,233 +0,0 @@
1
- # Flowbook
2
-
3
- > [English](./README.md) | [한국어](./README.ko.md) | [简体中文](./README.zh-CN.md) | **日本語** | [Español](./README.es.md) | [Português (BR)](./README.pt-BR.md) | [Français](./README.fr.md) | [Русский](./README.ru.md) | [Deutsch](./README.de.md)
4
-
5
- フローチャートのための Storybook。コードベースから Mermaid ダイアグラムファイルを自動検出し、カテゴリ別に整理して、ブラウザで閲覧可能なビューアでレンダリングします。
6
-
7
- ![Vite](https://img.shields.io/badge/vite-6.x-646CFF?logo=vite&logoColor=white)
8
- ![React](https://img.shields.io/badge/react-19.x-61DAFB?logo=react&logoColor=white)
9
- ![Mermaid](https://img.shields.io/badge/mermaid-11.x-FF3670?logo=mermaid&logoColor=white)
10
- ![TypeScript](https://img.shields.io/badge/typescript-5.x-3178C6?logo=typescript&logoColor=white)
11
-
12
- ## クイックスタート
13
-
14
- ```bash
15
- # 初期化 — スクリプト + サンプルファイルを追加
16
- npx flowbook@latest init
17
-
18
- # 開発サーバーを起動
19
- npm run flowbook
20
- # → http://localhost:6200
21
-
22
- # 静的サイトをビルド
23
- npm run build-flowbook
24
- # → flowbook-static/
25
- ```
26
-
27
- ## CLI
28
-
29
- ```
30
- flowbook init プロジェクトに Flowbook をセットアップ
31
- flowbook dev [--port 6200] 開発サーバーを起動
32
- flowbook build [--out-dir d] 静的サイトをビルド
33
- ```
34
-
35
- ### `flowbook init`
36
-
37
- - `package.json` に `"flowbook"` と `"build-flowbook"` スクリプトを追加します
38
- - `flows/example.flow.md` をスターターテンプレートとして作成します
39
-
40
- ### `flowbook dev`
41
-
42
- `http://localhost:6200` で HMR 対応の Vite 開発サーバーを起動します。`.flow.md` や `.flowchart.md` ファイルの変更が即座に反映されます。
43
-
44
- ### `flowbook build`
45
-
46
- `flowbook-static/` ディレクトリに静的サイトをビルドします(`--out-dir` で変更可能)。どこにでもデプロイできます。
47
-
48
- ## フローファイルの作成
49
-
50
- プロジェクト内の任意の場所に `.flow.md`(または `.flowchart.md`)ファイルを作成してください:
51
-
52
- ````markdown
53
- ---
54
- title: ログインフロー
55
- category: 認証
56
- tags: [auth, login, oauth]
57
- order: 1
58
- description: OAuth2 を使用したユーザー認証フロー
59
- ---
60
-
61
- ```mermaid
62
- flowchart TD
63
- A[ユーザー] --> B{認証済み?}
64
- B -->|はい| C[ダッシュボード]
65
- B -->|いいえ| D[ログインページ]
66
- ```
67
- ````
68
-
69
- Flowbook がファイルを自動検出し、ビューアに追加します。
70
-
71
- ## フロントマタースキーマ
72
-
73
- | フィールド | 型 | 必須 | 説明 |
74
- |---------------|------------|--------|-------------------------------------|
75
- | `title` | `string` | いいえ | 表示タイトル(デフォルト: ファイル名)|
76
- | `category` | `string` | いいえ | サイドバーのカテゴリ(デフォルト: "Uncategorized")|
77
- | `tags` | `string[]` | いいえ | フィルタリング可能なタグ |
78
- | `order` | `number` | いいえ | カテゴリ内の並び順(デフォルト: 999)|
79
- | `description` | `string` | いいえ | 詳細ビューに表示される説明 |
80
-
81
- ## ファイル検出
82
-
83
- Flowbook はデフォルトで以下のパターンをスキャンします:
84
-
85
- ```
86
- **/*.flow.md
87
- **/*.flowchart.md
88
- ```
89
-
90
- `node_modules/`、`.git/`、`dist/` は無視します。
91
-
92
- ## AI Agent Skill
93
-
94
- `flowbook init` はサポートされているすべてのコーディングエージェントディレクトリに AI エージェントスキルを自動的にインストールします。
95
- コーディングエージェント(Claude Code、OpenAI Codex、VS Code Copilot、Cursor、Gemini CLI など)がプロンプト内の **"flowbook"** キーワードを検出した場合、以下を実行します:
96
-
97
- 1. コードベース内の論理的なフローを分析(API ルート、認証、状态管理、ビジネスロジックなど)
98
- 2. まだ初期化されていない場合、Flowbook を設定
99
- 3. すべての重要なフローに対して Mermaid ダイアグラム付き `.flow.md` ファイルを生成
100
- 4. ビルドを検証
101
-
102
- ### 手動スキルインストール
103
-
104
- `flowbook init` を使用しなかった場合、スキルを手動でコピーしてください:
105
-
106
- ```bash
107
- # Claude Code
108
- mkdir -p .claude/skills/flowbook
109
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .claude/skills/flowbook/
110
-
111
- # OpenAI Codex
112
- mkdir -p .agents/skills/flowbook
113
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .agents/skills/flowbook/
114
-
115
- # VS Code / GitHub Copilot
116
- mkdir -p .github/skills/flowbook
117
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .github/skills/flowbook/
118
-
119
- # Google Antigravity
120
- mkdir -p .agent/skills/flowbook
121
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .agent/skills/flowbook/
122
-
123
- # Gemini CLI
124
- mkdir -p .gemini/skills/flowbook
125
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .gemini/skills/flowbook/
126
-
127
- # Cursor
128
- mkdir -p .cursor/skills/flowbook
129
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .cursor/skills/flowbook/
130
-
131
- # Windsurf (Codeium)
132
- mkdir -p .windsurf/skills/flowbook
133
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .windsurf/skills/flowbook/
134
-
135
- # AmpCode
136
- mkdir -p .amp/skills/flowbook
137
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .amp/skills/flowbook/
138
-
139
- # OpenCode / oh-my-opencode
140
- mkdir -p .opencode/skills/flowbook
141
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .opencode/skills/flowbook/
142
- ```
143
-
144
- ### 互換性のあるエージェント
145
-
146
- | エージェント | スキル位置 |
147
- |-------|---------------|
148
- | Claude Code | `.claude/skills/flowbook/SKILL.md` |
149
- | OpenAI Codex | `.agents/skills/flowbook/SKILL.md` |
150
- | VS Code / GitHub Copilot | `.github/skills/flowbook/SKILL.md` |
151
- | Google Antigravity | `.agent/skills/flowbook/SKILL.md` |
152
- | Gemini CLI | `.gemini/skills/flowbook/SKILL.md` |
153
- | Cursor | `.cursor/skills/flowbook/SKILL.md` |
154
- | Windsurf (Codeium) | `.windsurf/skills/flowbook/SKILL.md` |
155
- | AmpCode | `.amp/skills/flowbook/SKILL.md` |
156
- | OpenCode / oh-my-opencode | `.opencode/skills/flowbook/SKILL.md` |
157
-
158
- ## 仕組み
159
-
160
- ```
161
- .flow.md ファイル ──→ Vite プラグイン ──→ 仮想モジュール ──→ React ビューア
162
- │ │
163
- ├─ fast-glob スキャン ├─ export default { flows: [...] }
164
- ├─ gray-matter │
165
- │ パース └─ ファイル変更時に HMR
166
- └─ mermaid ブロック
167
- 抽出
168
- ```
169
-
170
- 1. **検出** — `fast-glob` がプロジェクト内の `*.flow.md` / `*.flowchart.md` をスキャン
171
- 2. **パース** — `gray-matter` が YAML フロントマターを抽出;正規表現で `` ```mermaid `` ブロックを抽出
172
- 3. **仮想モジュール** — Vite プラグインがパースしたデータを `virtual:flowbook-data` として提供
173
- 4. **レンダリング** — React アプリが `mermaid.render()` で Mermaid ダイアグラムをレンダリング
174
- 5. **HMR** — ファイル変更時に仮想モジュールを無効化し、リロードをトリガー
175
-
176
- ## プロジェクト構成
177
-
178
- ```
179
- src/
180
- ├── types.ts # 共有型 (FlowEntry, FlowbookData)
181
- ├── node/
182
- │ ├── cli.ts # CLI エントリポイント (init, dev, build)
183
- │ ├── server.ts # プログラマティック Vite サーバー & ビルド
184
- │ ├── init.ts # プロジェクト初期化ロジック
185
- │ ├── discovery.ts # ファイルスキャナー (fast-glob)
186
- │ ├── parser.ts # フロントマター + mermaid 抽出
187
- │ └── plugin.ts # Vite 仮想モジュールプラグイン
188
- └── client/
189
- ├── index.html # エントリ HTML
190
- ├── main.tsx # React エントリ
191
- ├── App.tsx # 検索 + サイドバー + ビューアレイアウト
192
- ├── vite-env.d.ts # 仮想モジュール型宣言
193
- ├── styles/globals.css # Tailwind v4 + カスタムスタイル
194
- └── components/
195
- ├── Header.tsx # ロゴ、検索バー、フロー数
196
- ├── Sidebar.tsx # 折りたたみ可能なカテゴリツリー
197
- ├── MermaidRenderer.tsx # Mermaid ダイアグラムレンダリング
198
- ├── FlowView.tsx # 単一フロー詳細ビュー
199
- └── EmptyState.tsx # 空状態ガイド
200
- ```
201
-
202
- ## 開発(コントリビューション)
203
-
204
- ```bash
205
- git clone https://github.com/Epsilondelta-ai/flowbook.git
206
- cd flowbook
207
- npm install
208
-
209
- # ローカル開発(ルートの vite.config.ts を使用)
210
- npm run dev
211
-
212
- # CLI をビルド
213
- npm run build
214
-
215
- # ローカルで CLI をテスト
216
- node dist/cli.js dev
217
- node dist/cli.js build
218
- ```
219
-
220
- ## 技術スタック
221
-
222
- - **Vite** — HMR 対応開発サーバー
223
- - **React 19** — UI
224
- - **Mermaid 11** — ダイアグラムレンダリング
225
- - **Tailwind CSS v4** — スタイリング
226
- - **gray-matter** — YAML フロントマターパーサー
227
- - **fast-glob** — ファイル検出
228
- - **tsup** — CLI バンドラー
229
- - **TypeScript** — 型安全性
230
-
231
- ## ライセンス
232
-
233
- MIT
package/README.ko.md DELETED
@@ -1,233 +0,0 @@
1
- # Flowbook
2
-
3
- > **[English](./README.md)** | **한국어** | [简体中文](./README.zh-CN.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [Português (BR)](./README.pt-BR.md) | [Français](./README.fr.md) | [Русский](./README.ru.md) | [Deutsch](./README.de.md)
4
-
5
- 플로우차트를 위한 Storybook. 코드베이스에서 Mermaid 다이어그램 파일을 자동으로 발견하고, 카테고리별로 정리하여 브라우저에서 볼 수 있게 렌더링합니다.
6
-
7
- ![Vite](https://img.shields.io/badge/vite-6.x-646CFF?logo=vite&logoColor=white)
8
- ![React](https://img.shields.io/badge/react-19.x-61DAFB?logo=react&logoColor=white)
9
- ![Mermaid](https://img.shields.io/badge/mermaid-11.x-FF3670?logo=mermaid&logoColor=white)
10
- ![TypeScript](https://img.shields.io/badge/typescript-5.x-3178C6?logo=typescript&logoColor=white)
11
-
12
- ## 빠른 시작
13
-
14
- ```bash
15
- # 초기화 — 스크립트 + 예제 파일 추가
16
- npx flowbook@latest init
17
-
18
- # 개발 서버 실행
19
- npm run flowbook
20
- # → http://localhost:6200
21
-
22
- # 정적 사이트 빌드
23
- npm run build-flowbook
24
- # → flowbook-static/
25
- ```
26
-
27
- ## CLI
28
-
29
- ```
30
- flowbook init 프로젝트에 Flowbook 설정
31
- flowbook dev [--port 6200] 개발 서버 실행
32
- flowbook build [--out-dir d] 정적 사이트 빌드
33
- ```
34
-
35
- ### `flowbook init`
36
-
37
- - `package.json`에 `"flowbook"`, `"build-flowbook"` 스크립트를 추가합니다
38
- - `flows/example.flow.md` 예제 템플릿을 생성합니다
39
-
40
- ### `flowbook dev`
41
-
42
- `http://localhost:6200`에서 HMR이 지원되는 Vite 개발 서버를 실행합니다. `.flow.md` 또는 `.flowchart.md` 파일 변경 사항이 즉시 반영됩니다.
43
-
44
- ### `flowbook build`
45
-
46
- `flowbook-static/` 디렉토리에 정적 사이트를 빌드합니다 (`--out-dir`로 변경 가능). 어디서든 배포 가능합니다.
47
-
48
- ## 플로우 파일 작성
49
-
50
- 프로젝트 어디에서나 `.flow.md` (또는 `.flowchart.md`) 파일을 생성하세요:
51
-
52
- ````markdown
53
- ---
54
- title: 로그인 흐름
55
- category: 인증
56
- tags: [auth, login, oauth]
57
- order: 1
58
- description: OAuth2를 사용한 사용자 인증 흐름
59
- ---
60
-
61
- ```mermaid
62
- flowchart TD
63
- A[사용자] --> B{인증됨?}
64
- B -->|예| C[대시보드]
65
- B -->|아니오| D[로그인 페이지]
66
- ```
67
- ````
68
-
69
- Flowbook이 자동으로 파일을 발견하여 뷰어에 추가합니다.
70
-
71
- ## 프론트매터 스키마
72
-
73
- | 필드 | 타입 | 필수 | 설명 |
74
- |---------------|------------|------|-------------------------------------|
75
- | `title` | `string` | 아니오 | 표시 제목 (기본값: 파일명) |
76
- | `category` | `string` | 아니오 | 사이드바 카테고리 (기본값: "Uncategorized") |
77
- | `tags` | `string[]` | 아니오 | 필터링 가능한 태그 |
78
- | `order` | `number` | 아니오 | 카테고리 내 정렬 순서 (기본값: 999) |
79
- | `description` | `string` | 아니오 | 상세 보기에 표시되는 설명 |
80
-
81
- ## 파일 탐색
82
-
83
- Flowbook은 기본적으로 다음 패턴을 스캔합니다:
84
-
85
- ```
86
- **/*.flow.md
87
- **/*.flowchart.md
88
- ```
89
-
90
- `node_modules/`, `.git/`, `dist/`는 무시합니다.
91
-
92
- ## AI Agent Skill
93
-
94
- `flowbook init`은 지원하는 모든 코딩 에이전트 디렉토리에 AI 에이전트 스킬을 자동으로 설치합니다.
95
- 코딩 에이전트(Claude Code, OpenAI Codex, VS Code Copilot, Cursor, Gemini CLI 등)가 프롬프트에서 **"flowbook"** 키워드를 감지하면 다음을 수행합니다:
96
-
97
- 1. 코드베이스에서 논리적 흐름 분석 (API 라우트, 인증, 상태 관리, 비즈니스 로직 등)
98
- 2. 아직 초기화되지 않았으면 Flowbook 설정
99
- 3. 모든 중요한 흐름에 대해 Mermaid 다이어그램이 포함된 `.flow.md` 파일 생성
100
- 4. 빌드 검증
101
-
102
- ### 수동 스킬 설치
103
-
104
- `flowbook init`을 사용하지 않았다면 스킬을 수동으로 복사하세요:
105
-
106
- ```bash
107
- # Claude Code
108
- mkdir -p .claude/skills/flowbook
109
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .claude/skills/flowbook/
110
-
111
- # OpenAI Codex
112
- mkdir -p .agents/skills/flowbook
113
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .agents/skills/flowbook/
114
-
115
- # VS Code / GitHub Copilot
116
- mkdir -p .github/skills/flowbook
117
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .github/skills/flowbook/
118
-
119
- # Google Antigravity
120
- mkdir -p .agent/skills/flowbook
121
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .agent/skills/flowbook/
122
-
123
- # Gemini CLI
124
- mkdir -p .gemini/skills/flowbook
125
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .gemini/skills/flowbook/
126
-
127
- # Cursor
128
- mkdir -p .cursor/skills/flowbook
129
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .cursor/skills/flowbook/
130
-
131
- # Windsurf (Codeium)
132
- mkdir -p .windsurf/skills/flowbook
133
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .windsurf/skills/flowbook/
134
-
135
- # AmpCode
136
- mkdir -p .amp/skills/flowbook
137
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .amp/skills/flowbook/
138
-
139
- # OpenCode / oh-my-opencode
140
- mkdir -p .opencode/skills/flowbook
141
- cp node_modules/flowbook/src/skills/flowbook/SKILL.md .opencode/skills/flowbook/
142
- ```
143
-
144
- ### 호환 에이전트
145
-
146
- | 에이전트 | 스킬 위치 |
147
- |-------|---------------|
148
- | Claude Code | `.claude/skills/flowbook/SKILL.md` |
149
- | OpenAI Codex | `.agents/skills/flowbook/SKILL.md` |
150
- | VS Code / GitHub Copilot | `.github/skills/flowbook/SKILL.md` |
151
- | Google Antigravity | `.agent/skills/flowbook/SKILL.md` |
152
- | Gemini CLI | `.gemini/skills/flowbook/SKILL.md` |
153
- | Cursor | `.cursor/skills/flowbook/SKILL.md` |
154
- | Windsurf (Codeium) | `.windsurf/skills/flowbook/SKILL.md` |
155
- | AmpCode | `.amp/skills/flowbook/SKILL.md` |
156
- | OpenCode / oh-my-opencode | `.opencode/skills/flowbook/SKILL.md` |
157
-
158
- ## 동작 원리
159
-
160
- ```
161
- .flow.md 파일 ──→ Vite 플러그인 ──→ 가상 모듈 ──→ React 뷰어
162
- │ │
163
- ├─ fast-glob 스캔 ├─ export default { flows: [...] }
164
- ├─ gray-matter │
165
- │ 파싱 └─ 파일 변경 시 HMR
166
- └─ mermaid 블록
167
- 추출
168
- ```
169
-
170
- 1. **탐색** — `fast-glob`이 프로젝트에서 `*.flow.md` / `*.flowchart.md`를 스캔
171
- 2. **파싱** — `gray-matter`가 YAML 프론트매터를 추출; 정규식으로 `` ```mermaid `` 블록 추출
172
- 3. **가상 모듈** — Vite 플러그인이 파싱된 데이터를 `virtual:flowbook-data`로 제공
173
- 4. **렌더링** — React 앱이 `mermaid.render()`를 통해 Mermaid 다이어그램 렌더링
174
- 5. **HMR** — 파일 변경 시 가상 모듈을 무효화하여 리로드 트리거
175
-
176
- ## 프로젝트 구조
177
-
178
- ```
179
- src/
180
- ├── types.ts # 공유 타입 (FlowEntry, FlowbookData)
181
- ├── node/
182
- │ ├── cli.ts # CLI 진입점 (init, dev, build)
183
- │ ├── server.ts # 프로그래밍 방식 Vite 서버 & 빌드
184
- │ ├── init.ts # 프로젝트 초기화 로직
185
- │ ├── discovery.ts # 파일 스캐너 (fast-glob)
186
- │ ├── parser.ts # 프론트매터 + mermaid 추출
187
- │ └── plugin.ts # Vite 가상 모듈 플러그인
188
- └── client/
189
- ├── index.html # 진입 HTML
190
- ├── main.tsx # React 진입점
191
- ├── App.tsx # 검색 + 사이드바 + 뷰어 레이아웃
192
- ├── vite-env.d.ts # 가상 모듈 타입 선언
193
- ├── styles/globals.css # Tailwind v4 + 커스텀 스타일
194
- └── components/
195
- ├── Header.tsx # 로고, 검색바, 플로우 개수
196
- ├── Sidebar.tsx # 접을 수 있는 카테고리 트리
197
- ├── MermaidRenderer.tsx # Mermaid 다이어그램 렌더링
198
- ├── FlowView.tsx # 단일 플로우 상세 보기
199
- └── EmptyState.tsx # 빈 상태 안내
200
- ```
201
-
202
- ## 개발 (기여)
203
-
204
- ```bash
205
- git clone https://github.com/Epsilondelta-ai/flowbook.git
206
- cd flowbook
207
- npm install
208
-
209
- # 로컬 개발 (루트 vite.config.ts 사용)
210
- npm run dev
211
-
212
- # CLI 빌드
213
- npm run build
214
-
215
- # 로컬에서 CLI 테스트
216
- node dist/cli.js dev
217
- node dist/cli.js build
218
- ```
219
-
220
- ## 기술 스택
221
-
222
- - **Vite** — HMR 지원 개발 서버
223
- - **React 19** — UI
224
- - **Mermaid 11** — 다이어그램 렌더링
225
- - **Tailwind CSS v4** — 스타일링
226
- - **gray-matter** — YAML 프론트매터 파싱
227
- - **fast-glob** — 파일 탐색
228
- - **tsup** — CLI 번들러
229
- - **TypeScript** — 타입 안전성
230
-
231
- ## 라이선스
232
-
233
- MIT