From bc8a281e4c4c8f1233fc7797db9ceaf4ca0b1ee9 Mon Sep 17 00:00:00 2001
From: hiroki ito
Date: Thu, 19 Mar 2026 13:59:28 +0900
Subject: [PATCH] first commit
Made-with: Cursor
---
.../creating-visual-explainers/SKILL.md | 224 +
.../references/base.html | 83 +
.../references/model-answer.html | 968 ++
.../references/node-install-guide.md | 68 +
.../scripts/deploy-diagram.sh | 95 +
.claude/skills/setup-fb-tool/SKILL.md | 175 +
.../references/node-install-guide.md | 66 +
.gitignore | 48 +
README.md | 240 +
components.json | 25 +
eslint.config.mjs | 18 +
next.config.ts | 7 +
output/.gitkeep | 0
package-lock.json | 9958 +++++++++++++++++
package.json | 36 +
postcss.config.mjs | 7 +
public/file.svg | 1 +
public/globe.svg | 1 +
public/next.svg | 1 +
public/test-diagram.html | 969 ++
public/test.html | 30 +
public/vercel.svg | 1 +
public/widget.js | 926 ++
public/window.svg | 1 +
scripts/migrate.ts | 44 +
src/app/api/comments/route.ts | 124 +
src/app/api/fetch-page/route.ts | 92 +
src/app/favicon.ico | Bin 0 -> 25931 bytes
src/app/globals.css | 129 +
src/app/layout.tsx | 35 +
src/app/page.tsx | 41 +
src/components/comment-card.tsx | 253 +
src/components/comment-sidebar.tsx | 195 +
src/components/content-viewer.tsx | 185 +
src/components/export-buttons.tsx | 91 +
src/components/name-dialog.tsx | 51 +
src/components/selection-popup.tsx | 204 +
src/components/ui/badge.tsx | 52 +
src/components/ui/button.tsx | 60 +
src/components/ui/card.tsx | 103 +
src/components/ui/dialog.tsx | 157 +
src/components/ui/input.tsx | 20 +
src/components/ui/scroll-area.tsx | 55 +
src/components/ui/separator.tsx | 25 +
src/components/ui/tabs.tsx | 82 +
src/components/ui/textarea.tsx | 18 +
src/components/ui/tooltip.tsx | 66 +
src/lib/db.ts | 7 +
src/lib/storage.ts | 61 +
src/lib/store.tsx | 213 +
src/lib/types.ts | 22 +
src/lib/utils.ts | 6 +
tsconfig.json | 34 +
53 files changed, 16373 insertions(+)
create mode 100644 .claude/skills/creating-visual-explainers/SKILL.md
create mode 100644 .claude/skills/creating-visual-explainers/references/base.html
create mode 100644 .claude/skills/creating-visual-explainers/references/model-answer.html
create mode 100644 .claude/skills/creating-visual-explainers/references/node-install-guide.md
create mode 100644 .claude/skills/creating-visual-explainers/scripts/deploy-diagram.sh
create mode 100644 .claude/skills/setup-fb-tool/SKILL.md
create mode 100644 .claude/skills/setup-fb-tool/references/node-install-guide.md
create mode 100644 .gitignore
create mode 100644 README.md
create mode 100644 components.json
create mode 100644 eslint.config.mjs
create mode 100644 next.config.ts
create mode 100644 output/.gitkeep
create mode 100644 package-lock.json
create mode 100644 package.json
create mode 100644 postcss.config.mjs
create mode 100644 public/file.svg
create mode 100644 public/globe.svg
create mode 100644 public/next.svg
create mode 100644 public/test-diagram.html
create mode 100644 public/test.html
create mode 100644 public/vercel.svg
create mode 100644 public/widget.js
create mode 100644 public/window.svg
create mode 100644 scripts/migrate.ts
create mode 100644 src/app/api/comments/route.ts
create mode 100644 src/app/api/fetch-page/route.ts
create mode 100644 src/app/favicon.ico
create mode 100644 src/app/globals.css
create mode 100644 src/app/layout.tsx
create mode 100644 src/app/page.tsx
create mode 100644 src/components/comment-card.tsx
create mode 100644 src/components/comment-sidebar.tsx
create mode 100644 src/components/content-viewer.tsx
create mode 100644 src/components/export-buttons.tsx
create mode 100644 src/components/name-dialog.tsx
create mode 100644 src/components/selection-popup.tsx
create mode 100644 src/components/ui/badge.tsx
create mode 100644 src/components/ui/button.tsx
create mode 100644 src/components/ui/card.tsx
create mode 100644 src/components/ui/dialog.tsx
create mode 100644 src/components/ui/input.tsx
create mode 100644 src/components/ui/scroll-area.tsx
create mode 100644 src/components/ui/separator.tsx
create mode 100644 src/components/ui/tabs.tsx
create mode 100644 src/components/ui/textarea.tsx
create mode 100644 src/components/ui/tooltip.tsx
create mode 100644 src/lib/db.ts
create mode 100644 src/lib/storage.ts
create mode 100644 src/lib/store.tsx
create mode 100644 src/lib/types.ts
create mode 100644 src/lib/utils.ts
create mode 100644 tsconfig.json
diff --git a/.claude/skills/creating-visual-explainers/SKILL.md b/.claude/skills/creating-visual-explainers/SKILL.md
new file mode 100644
index 0000000..90e5870
--- /dev/null
+++ b/.claude/skills/creating-visual-explainers/SKILL.md
@@ -0,0 +1,224 @@
+---
+name: creating-visual-explainers
+description: Generates an illustrated HTML page about any topic and deploys it to surge.sh. Triggered by requests like "図解を作って", "図解を生成して", "このトピックを図解して", or "図解してデプロイして".
+---
+
+# Creating Visual Explainers
+
+任意のトピックについて、前提知識がなくても理解できる図解HTMLを生成し、surge.shに公開する。品質基準は「入社したての新卒社会人が読んでも腹落ちする明快さ」だが、この基準は出力には表示しない。
+
+## 依存
+
+- `references/base.html` — 図解テンプレート(Tailwind CSS CDN・Lucide Icons CDN・ADS配色を含む「額縁」)
+- `references/model-answer.html` — 模範回答(品質基準・デザインパターンの実例)。base.htmlと同一の額縁を含む完全なHTMLファイル。widget 未含(デプロイ時に自動注入されるため)
+
+## ワークフロー
+
+### Step 0: 前提確認
+
+1. `references/base.html` が存在するか確認する。存在しない場合、以下を伝えて終了:
+
+> テンプレートファイルが見つかりません。スキルのフォルダ構成が壊れている可能性があります。運営に連絡してください。
+
+2. プロジェクトルート直下の `fb-tool-url.txt` が存在するか確認する。存在しない場合、以下を伝えて終了:
+
+> FBツールのセットアップがまだ完了していません。
+> 先にチャット欄で「セットアップして」と伝えてください。
+
+### Step 1: 模範回答の読み込み
+
+`references/model-answer.html` を読み、以下を把握する:
+
+- 完成品の品質水準
+- デザインパターン(色使い・余白・カード・フロー図などの視覚表現)
+- Tailwind CSSクラスの使い方
+- Lucide Iconsの使い方
+- コンテンツの構成・情報量・説明の深さ
+
+模範回答がデザインガイドラインの代わりになる。パーツ一覧やルールではなく、実物から読み取る。
+
+### Step 2: テンプレートの読み込み
+
+`references/base.html` を読み、額縁の構造を把握する:
+
+- `` 〜 `` のプレースホルダー位置
+- ``, `` のプレースホルダー
+- ADS配色のTailwind設定
+- 読み込み済みのCDN(Tailwind CSS・Lucide Icons)
+
+### Step 3: ウェブで情報収集
+
+トピックについてウェブ検索を行い、正確かつ最新の情報を収集する。
+
+検索は **2〜3回** に絞る。以下の観点でクエリを組み立てる:
+
+1. **正確な定義**: トピックの公式な定義、公式ドキュメントの説明
+2. **最新動向**: 直近の変更点、アップデート、現在のベストプラクティス
+3. **具体例**: 実際の使われ方、初心者に伝わるたとえに使える事例
+
+検索結果から以下を整理し、Step 4 の参考情報とする:
+
+- トピックの正確な定義(検索結果を優先。AIの学習データだけに頼らない)
+- 最近変わった点があれば、それを明記する
+- たとえ話に使えそうな事例や数字
+- **出典URL**: 図解に採用した情報のソースURLを控えておく(Step 4 でインライン出典に使う)
+
+### Step 4: コンテンツ生成
+
+Step 3 で収集した情報をもとに、図解HTMLを生成する。検索結果で得た定義・事実・具体例を優先的に採用する。
+
+模範回答のデザインを参考にしつつ、Tailwindの語彙で自由にレイアウトを組む。模範回答のパターンに合うものはそのまま使い、合わないものはTailwindクラスでその場で作る。テンプレートの定義済みパーツに縛られない。
+
+### Step 5: ファイル作成
+
+1. `output/` ディレクトリがなければ作成する
+2. トピックに関連する短い英単語のスラッグを決める(例: `api-basics`, `git-rebase`)
+3. `references/base.html` を `output/{スラッグ}.html` にコピーする
+4. コピーしたファイル内のプレースホルダーをすべて置換する:
+ - `` → 図解のタイトル
+ - `` → 内容を要約した1文
+ - `` 〜 `` → Step 4で生成したコンテンツ
+5. ファイルを保存する(ブラウザで開くのは Step 6 のデプロイ後に行う。ローカルでは開かない)
+
+### Step 6: 公開
+
+ファイル保存後、公開する前にまず Node.js の有無を確認する。
+
+```bash
+node --version
+```
+
+バージョン番号が表示された → そのまま「公開の実行」に進む。
+
+`command not found` と表示された → `references/node-install-guide.md` の手順に従ってNode.jsのインストールを案内する。
+
+#### 公開の実行
+
+以下のスクリプトを**実行する**(中身を読む必要はない)。
+
+**macOS / Git Bash(Windows)の場合:**
+
+```bash
+bash .claude/skills/creating-visual-explainers/scripts/deploy-diagram.sh output/{スラッグ}.html [スラッグ]
+```
+
+**Windows(PowerShell)で bash が使えない場合:**
+
+```powershell
+$fbUrl = Get-Content fb-tool-url.txt
+$apiToken = Get-Content fb-api-token.txt
+(Get-Content output/{スラッグ}.html -Raw) -replace '
+
+
+
+
+
+
+
+
+
+
+
+