From fb1fa494363a3c8ebfa104af7a18d9f40258c734 Mon Sep 17 00:00:00 2001 From: bwkw Date: Wed, 2 Dec 2026 19:36:29 +0900 Subject: [PATCH 1/4] =?UTF-8?q?da-pr=20=E3=81=AE=E5=9B=B3=E3=82=92?= =?UTF-8?q?=E7=B5=90=E8=AB=96=E3=81=AB=E6=88=BB=E3=81=97=E3=81=A6=E7=B5=90?= =?UTF-8?q?=E6=9E=9C=E3=81=AE=E7=AF=80=E3=82=92=E3=81=AA=E3=81=8F=E3=81=97?= =?UTF-8?q?=E3=80=81=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB=E3=81=AE=E5=BD=A2?= =?UTF-8?q?=E3=82=92=E6=B1=BA=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- docs/decisions.md | 2 ++ skills/da-pr/reference/pr-template.md | 38 ++++++++++++++++++--------- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/docs/decisions.md b/docs/decisions.md index 8e4586e..ba9ed20 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -1880,3 +1880,5 @@ install と status の両方がそう言います。**信頼はセキュリテ **同じ PR で直した CI**: 1 回の CI で `check.sh` の全部が 4 回走っていた(`node-floor`・`shell` の 2 OS・`content` のプロファイル検査)。`content` は `check.sh` の段と同じコマンドを飛ばし、`node-floor` は `.node-version` と同じメジャーの間は高速レーンだけにした。必須チェックの名前はルールセットが参照するので変えない。ループの周の終了待ちを 0.2 秒から 0.05 秒刻みにし、即座に返る偽の周での待ちを減らした。 **再考する条件**: GitHub が添付の公開範囲を変えた時、`--attach` が使えない環境が主になった時、`.node-version` のメジャーが下限から離れた時(`node-floor` は自動で全部に戻る)。 + +**図とタイトル(2026-12-02)**: 図を別の `## 結果` の節に必須で置く形を試したが、要点と図が離れるので、図は `## 結論` の最後に 1 点置く形に戻した。タイトルは `<種類>(<範囲>): <変更後に何がどうなるか> [<チケット ID>]` にそろえる。使い先のリポジトリのマージ済み PR が、種類・範囲の接頭辞と末尾のチケット ID を使っているため。リポジトリにはっきり別の慣習があればそちらに合わせる。 diff --git a/skills/da-pr/reference/pr-template.md b/skills/da-pr/reference/pr-template.md index 9653173..128ff62 100644 --- a/skills/da-pr/reference/pr-template.md +++ b/skills/da-pr/reference/pr-template.md @@ -1,19 +1,30 @@ # PR 本文のテンプレート -`da-pr` で下書き・更新する本文の見出し、順序、表はこのファイルに従う。リポジトリで求められる記載事項は該当する節に入れる。利用者がこの依頼で別の書式を指定した場合はその書式を使う。 +`da-pr` で下書き・更新するタイトルの形と、本文の見出し、順序、表はこのファイルに従う。リポジトリで求められる記載事項は該当する節に入れる。利用者がこの依頼で別の書式を指定した場合はその書式を使う。 + +## タイトル + +次の形で 1 行に書く。リポジトリのマージ済み PR に別の慣習がはっきりある場合は、そちらに合わせる。 + +```text +<種類>(<範囲>): <変更後に何がどうなるか> [<チケット ID>] +``` + +- 種類は `feat`・`fix`・`refactor`・`perf`・`docs`・`test`・`chore` のどれか。利用者から見た変化で選ぶ(振る舞いが増えれば `feat`、誤りを直せば `fix`) +- 範囲は変更の中心になる機能・モジュール名を 1 つ。決められなければ `(<範囲>)` ごと省く +- 要点はリポジトリの言語で、実装ではなく変更後の振る舞いを書く。句点は付けない +- チケット ID はリポジトリがチケットを使う場合だけ、末尾に角括弧で付ける。無ければ省く + +例: `fix(public-id): 公的IDの削除時に利用中の業務を示し、廃棄した番号を古い入力から戻さない [DC-12280]` ## 骨組み -次の見出しを表記どおり、この順で使う。本文は `## 結論` から始める。`## 結論`、`## 結果`、`## 動作確認` は必須。任意の節は条件を満たすものだけを使う。 +次の見出しを表記どおり、この順で使う。本文は `## 結論` から始める。`## 結論` と `## 動作確認` は必須。任意の節は条件を満たすものだけを使う。 ```markdown ## 結論 -(誰にとって何が変わるか。必要になった理由と関連チケットのリンク。) - -## 結果 - -(変更後に何がどうなるかを簡潔に書き、結果が伝わる図を必ず 1 点載せる。) +(誰にとって何が変わるか。必要になった理由と関連チケットのリンク。要点の文の後に図を 1 点置く。) ## 確認してほしいところ @@ -34,14 +45,15 @@ 本文には括弧書きの指示を残さない。 -## 結果に置く図 +## 結論に置く図 -変更後の構造、流れ、状態のうち、読み手に伝えたいことを 1 つ選んで図にする。画像を添付できない場合は、本文に Mermaid の図を入れる。 +変更後の構造、流れ、状態のうち、読み手に伝えたいことを 1 つ選んで図にし、専用の節を作らず `## 結論` の中に置く。画像を添付できない場合は、本文に Mermaid の図を入れる。 -- 変更後の説明に続けて、`## 結果` の最後に置く +- 要点の文の後、`## 結論` の最後に置く。要点の文より前や、文の途中に挟まない - 図の直前に「図: 」で始まる一文を置き、何の構造・流れを表す図かを書く(例: `図: 取り込みが Confidential の置き場に書き、一覧と中身の API が読む流れ`) -- 画像の代替テキストには図で読み取れる事実を書く -- 操作中に撮ったスクリーンショットは `## 動作確認` の対応する結果の直後に置く +- 代替テキストには図で読み取れる事実を書く。「概要図」のような名前だけにしない +- 実画面のスクリーンショットは結論に置かず、`## 動作確認` の対応する結果の直後に置く +- 図は 1 枚までにする。2 枚以上要るなら、変更を分けるか、どちらを結論に置くかを選ぶ ## 変更点の表 @@ -55,7 +67,7 @@ ## 本文の照合 -1. 本文の一行目が `## 結論` で、その下に変更の要点があること、見出しの表記と順序が骨組みと一致すること、任意の節と記載事項が対応することを確認する。`## 結果` に変更後の説明と図が 1 点あることを確認する。 +1. 本文の一行目が `## 結論` で、その下に変更の要点があること、見出しの表記と順序が骨組みと一致すること、任意の節と記載事項が対応することを確認する。`## 結論` の最後に「図: 」の一文と図が 1 点あることを確認する。タイトルが「タイトル」の形に合うことを確認する。 2. 動作確認は実際に行った操作と結果を書く。操作中に撮影したスクリーンショットは、対応する結果の直後に一度だけ掲載する。変更前後の両方を実際に撮った場合は、同じ節で並べてよい。画像がない操作は文章で記録する。サンプル画像、モック画面、画像の仮置きは本文に入れない。 3. 既存本文の判断・確認結果・未確認事項・関連リンクを照合する。画像は何をどの環境で撮ったか、あとから区別できることを確認する。添付後は `body.md` の手順で反映結果を読み直す。 From 55e4dad0f47b165a36223da95ce9f1e06ca88fb4 Mon Sep 17 00:00:00 2001 From: bwkw Date: Wed, 2 Dec 2026 19:40:04 +0900 Subject: [PATCH 2/4] =?UTF-8?q?da-pr=20=E3=81=AE=E5=9B=B3=E3=82=92=20x-pre?= =?UTF-8?q?sent=20=E3=81=AE=20PNG=20=E3=81=AB=E9=99=90=E3=82=8A=E3=80=81Me?= =?UTF-8?q?rmaid=20=E3=81=A7=E4=BB=A3=E3=81=88=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- docs/decisions.md | 2 +- skills/da-pr/reference/pr-template.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/decisions.md b/docs/decisions.md index ba9ed20..e60e226 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -1881,4 +1881,4 @@ install と status の両方がそう言います。**信頼はセキュリテ **再考する条件**: GitHub が添付の公開範囲を変えた時、`--attach` が使えない環境が主になった時、`.node-version` のメジャーが下限から離れた時(`node-floor` は自動で全部に戻る)。 -**図とタイトル(2026-12-02)**: 図を別の `## 結果` の節に必須で置く形を試したが、要点と図が離れるので、図は `## 結論` の最後に 1 点置く形に戻した。タイトルは `<種類>(<範囲>): <変更後に何がどうなるか> [<チケット ID>]` にそろえる。使い先のリポジトリのマージ済み PR が、種類・範囲の接頭辞と末尾のチケット ID を使っているため。リポジトリにはっきり別の慣習があればそちらに合わせる。 +**図とタイトル(2026-12-02)**: 図を別の `## 結果` の節に必須で置く形を試したが、要点と図が離れるので、図は `## 結論` の最後に 1 点置く形に戻した。図は `x-present` の PNG を添付し、Mermaid で代えない。本文に描いた Mermaid は表示先によって描画されず、配色や文字の大きさも決められないため。タイトルは `<種類>(<範囲>): <変更後に何がどうなるか> [<チケット ID>]` にそろえる。使い先のリポジトリのマージ済み PR が、種類・範囲の接頭辞と末尾のチケット ID を使っているため。リポジトリにはっきり別の慣習があればそちらに合わせる。 diff --git a/skills/da-pr/reference/pr-template.md b/skills/da-pr/reference/pr-template.md index 128ff62..badf59b 100644 --- a/skills/da-pr/reference/pr-template.md +++ b/skills/da-pr/reference/pr-template.md @@ -47,7 +47,7 @@ ## 結論に置く図 -変更後の構造、流れ、状態のうち、読み手に伝えたいことを 1 つ選んで図にし、専用の節を作らず `## 結論` の中に置く。画像を添付できない場合は、本文に Mermaid の図を入れる。 +変更後の構造、流れ、状態のうち、読み手に伝えたいことを 1 つ選んで図にし、専用の節を作らず `## 結論` の中に置く。図は `x-present` で PNG にして添付する(手順は `body.md`)。Mermaid やテキストの図で代えない。添付を使えない時は、画像の場所を利用者に伝えて貼ってもらう。 - 要点の文の後、`## 結論` の最後に置く。要点の文より前や、文の途中に挟まない - 図の直前に「図: 」で始まる一文を置き、何の構造・流れを表す図かを書く(例: `図: 取り込みが Confidential の置き場に書き、一覧と中身の API が読む流れ`) From f540a0c02d98f5e16dc433d59a53be87d3dd2d3d Mon Sep 17 00:00:00 2001 From: bwkw Date: Wed, 2 Dec 2026 19:44:20 +0900 Subject: [PATCH 3/4] =?UTF-8?q?x-present=20=E3=81=AE=20ADR=20=E5=9B=B3?= =?UTF-8?q?=E3=81=A8=20PR=20=E3=81=AE=E5=9B=B3=E3=82=92=E5=90=8C=E3=81=98?= =?UTF-8?q?=E8=A6=8B=E3=81=9F=E7=9B=AE=E3=81=AB=E3=81=9D=E3=82=8D=E3=81=88?= =?UTF-8?q?=E3=80=81PR=20=E3=81=AE=E5=9B=B3=E3=82=92=20HTML=20=E3=81=8B?= =?UTF-8?q?=E3=82=89=E6=9B=B8=E3=81=8D=E5=87=BA=E3=81=9B=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- docs/decisions.md | 2 +- scripts/test-da-adr-figure.sh | 15 +++ skills/x-present/figure/guide.md | 2 +- .../figure/reference/example-page.html | 30 +++++ skills/x-present/figure/reference/page.css | 15 +++ skills/x-present/figure/scripts/figure.mjs | 114 +++++++++++------- skills/x-present/reference/architecture.md | 2 +- 7 files changed, 133 insertions(+), 47 deletions(-) create mode 100644 skills/x-present/figure/reference/example-page.html create mode 100644 skills/x-present/figure/reference/page.css diff --git a/docs/decisions.md b/docs/decisions.md index e60e226..d1d90d3 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -1881,4 +1881,4 @@ install と status の両方がそう言います。**信頼はセキュリテ **再考する条件**: GitHub が添付の公開範囲を変えた時、`--attach` が使えない環境が主になった時、`.node-version` のメジャーが下限から離れた時(`node-floor` は自動で全部に戻る)。 -**図とタイトル(2026-12-02)**: 図を別の `## 結果` の節に必須で置く形を試したが、要点と図が離れるので、図は `## 結論` の最後に 1 点置く形に戻した。図は `x-present` の PNG を添付し、Mermaid で代えない。本文に描いた Mermaid は表示先によって描画されず、配色や文字の大きさも決められないため。タイトルは `<種類>(<範囲>): <変更後に何がどうなるか> [<チケット ID>]` にそろえる。使い先のリポジトリのマージ済み PR が、種類・範囲の接頭辞と末尾のチケット ID を使っているため。リポジトリにはっきり別の慣習があればそちらに合わせる。 +**図とタイトル(2026-12-02)**: 図を別の `## 結果` の節に必須で置く形を試したが、要点と図が離れるので、図は `## 結論` の最後に 1 点置く形に戻した。図は `x-present` の PNG を添付し、Mermaid で代えない。本文に描いた Mermaid は表示先によって描画されず、配色や文字の大きさも決められないため。PR・設計の図と ADR の要約図は、同じ配色・札・枠(`x-present` の `figure/reference/page.css` と `figure.mjs` の CSS)にそろえ、PR の図は `figure.mjs shot` で書き出す。図ごとに見た目が違うと、色や札の意味を毎回読み直すことになるため。タイトルは `<種類>(<範囲>): <変更後に何がどうなるか> [<チケット ID>]` にそろえる。使い先のリポジトリのマージ済み PR が、種類・範囲の接頭辞と末尾のチケット ID を使っているため。リポジトリにはっきり別の慣習があればそちらに合わせる。 diff --git a/scripts/test-da-adr-figure.sh b/scripts/test-da-adr-figure.sh index 99013c4..629d987 100755 --- a/scripts/test-da-adr-figure.sh +++ b/scripts/test-da-adr-figure.sh @@ -102,6 +102,11 @@ expect_reject compare-many-rows "{\"title\":\"x\",${sum},\"compare\":{\"title\": long31="$(printf 'あ%.0s' {1..31})" expect_reject compare-long-cell "{\"title\":\"x\",${sum},\"compare\":{\"title\":\"t\",\"head\":[\"a\"],\"rows\":[[\"${long31}\"]]},\"cards\":[$ok_card]}" '30 字まで' +# PR・設計の図の見本は共通の見た目(page.css)を使い、shot は引数が足りなければ黙って成功しない +PAGE="$REPO/skills/x-present/figure/reference/example-page.html" +grep -q 'href="page.css"' "$PAGE" || { echo 'PR の図の見本が page.css を読んでいない' >&2; exit 1; } +if node "$FIG" shot >/dev/null 2>&1; then echo 'shot が引数なしで成功した' >&2; exit 1; fi + # 書き出しは依存がある時だけ確かめる DEPS="${DA_ADR_FIGURE_HOME:-${XDG_CACHE_HOME:-$HOME/.cache}/da-adr-figure}" if [[ -d "$DEPS/node_modules/playwright" ]]; then @@ -114,6 +119,16 @@ if [[ -d "$DEPS/node_modules/playwright" ]]; then echo 'build が文字のあふれた図を成功扱いにした' >&2; exit 1 fi [[ "$out" == *'あふれ'* ]] || { printf 'build のあふれの報告が違う:\n%s\n' "$out" >&2; exit 1; } + + cp "$REPO/skills/x-present/figure/reference/page.css" "$TMP/page.css" + cp "$PAGE" "$TMP/page.html" + node "$FIG" shot "$TMP/page.html" "$TMP/page.png" >/dev/null + [[ -s "$TMP/page.png" ]] || { echo 'shot が PNG を書かなかった' >&2; exit 1; } + printf '%s\n' "
${long}
" > "$TMP/page-overflow.html" + if out="$(node "$FIG" shot "$TMP/page-overflow.html" "$TMP/page-overflow.png" 2>&1)"; then + echo 'shot が文字のあふれた図を成功扱いにした' >&2; exit 1 + fi + [[ "$out" == *'あふれ'* ]] || { printf 'shot のあふれの報告が違う:\n%s\n' "$out" >&2; exit 1; } else echo "skip: 書き出しの検査(依存が無い: ${DEPS})" fi diff --git a/skills/x-present/figure/guide.md b/skills/x-present/figure/guide.md index 1e1e40f..1f96bfc 100644 --- a/skills/x-present/figure/guide.md +++ b/skills/x-present/figure/guide.md @@ -1,7 +1,7 @@ # ADR のすべての判断を 1 枚の PNG にする 図解 1 枚につき**定義 1 ファイル**(`figure.json`)を書き、`${CLAUDE_SKILL_DIR}/figure/scripts/figure.mjs` で PNG にする。 -図は ADR の要約そのものである。**図を見た人が、最初の要約で何を決めたかを知り、カードで判断ごとに「何を選び、なぜか」を掴める**ことを目指す。 +図は ADR の要約そのものである。見た目は PR・設計の図(`reference/page.css`)と同じ配色・札・枠にそろえてあり、`figure.mjs` が描く。**図を見た人が、最初の要約で何を決めたかを知り、カードで判断ごとに「何を選び、なぜか」を掴める**ことを目指す。 判断はすべて載せ、1 つの判断に載せるのは決定と一番強い理由(あれば一番強い対抗案)だけにする。残りの理由と対抗案、前提、失うものは ADR の本文に任せる。 触ってよいもの: 作業ディレクトリ(scratchpad を推奨)に置く定義・HTML・PNG だけ。**ADR は書き換えない。** 図に書きたい理由が ADR に無ければ、止まって報告する(Step 4)。 diff --git a/skills/x-present/figure/reference/example-page.html b/skills/x-present/figure/reference/example-page.html new file mode 100644 index 0000000..97554f4 --- /dev/null +++ b/skills/x-present/figure/reference/example-page.html @@ -0,0 +1,30 @@ + + +

公的IDの削除ダイアログ:削除可否の照会の結果で表示を分ける

+
+
削除メニューを開く公的ID詳細の「…」→ 削除
+
→
+
削除可否を照会(BE)削除と同じ判定を返す
+
+
↓
+
+
止める使用中の業務がある理由(タスク・段階・使っている欄・解除の方法)とタスクへのリンクを表示。
削除ボタンは押せない
+
警告使用中ではないが、削除で失効する提出がある「承認しても台帳に反映できなくなる」提出とタスクへのリンクを表示。
削除はできる
+
削除できるどちらもない削除の影響の説明だけを表示。
削除はできる
+
+
+
+
↓
+
↓
+
+
+
+
削除を確定 → BE が実行時に再判定開いた後に新たに使用中になっていれば、削除せず理由を表示して止める
+
+

警告はマイナンバーの手入力の提出だけが対象。閲覧できない案件はタスク名を出さず、労務担当者への確認を案内する。

+ diff --git a/skills/x-present/figure/reference/page.css b/skills/x-present/figure/reference/page.css new file mode 100644 index 0000000..6597d5f --- /dev/null +++ b/skills/x-present/figure/reference/page.css @@ -0,0 +1,15 @@ +/* PR・設計の図(1 枚の HTML)の共通の見た目。ADR の要約図(figure.mjs の CSS)と同じ配色にそろえる。 + 使える部品:.box(箱)、.tag(札)、色 .red / .amber / .green / .blue、.arrow(矢印)、.note(注記)、code */ +*{box-sizing:border-box;margin:0;padding:0} +body{font-family:"Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans JP","Yu Gothic",sans-serif;background:#fff;color:#1f2933;width:1200px;padding:32px 40px} +h1{font-size:24px;font-weight:700;line-height:1.4;margin-bottom:22px} +.box{border:2px solid #9aa5b1;border-radius:10px;padding:12px 16px;background:#f5f7fa;font-size:17px;line-height:1.5;overflow:hidden} +.box b{display:block;font-size:18px;margin-bottom:4px} +.tag{display:inline-block;font-size:14px;font-weight:700;border-radius:6px;padding:2px 8px;margin-bottom:6px;color:#fff;background:#52606d} +.red{border-color:#c62828;background:#fdecea}.red .tag{background:#c62828} +.amber{border-color:#b26a00;background:#fff4e0}.amber .tag{background:#b26a00} +.green{border-color:#2e7d32;background:#e8f5e9}.green .tag{background:#2e7d32} +.blue{border-color:#1565c0;background:#e8f0fe}.blue .tag{background:#1565c0} +.arrow{font-size:28px;color:#52606d;text-align:center;line-height:1} +.note{font-size:15px;color:#3e4c59;margin-top:18px;line-height:1.6} +code{font-family:"SF Mono",Menlo,monospace;font-size:14px;background:#eef2f6;padding:1px 4px;border-radius:4px} diff --git a/skills/x-present/figure/scripts/figure.mjs b/skills/x-present/figure/scripts/figure.mjs index 3f43ed7..6517fe4 100644 --- a/skills/x-present/figure/scripts/figure.mjs +++ b/skills/x-present/figure/scripts/figure.mjs @@ -3,6 +3,7 @@ // node figure.mjs check 定義の形だけ検査する(依存パッケージ不要) // node figure.mjs html HTML を書く(依存パッケージ不要) // node figure.mjs build HTML と PNG を書き、文字があふれていたら失敗する +// node figure.mjs shot PR・設計の図(reference/page.css を使う HTML)を PNG にし、文字があふれていたら失敗する // 定義の書き方は reference/figure-format.md。出力はすべて引数で指定した場所に書く。 import fs from 'node:fs'; import os from 'node:os'; @@ -108,59 +109,59 @@ const esc = (s) => String(s).replace(/&/g, '&').replace(/ esc(s).replace(/`([^`]+)`/g, '$1').replace(/\*\*([^*]+)\*\*/g, '$1'); const CSS = ` -:root { --ink:#1d2433; --sub:#4a5568; --line:#c9d2e3; --bg:#f7f4ec; --blue:#2f6fb5; --blue-bg:#e6f0fb; - --green:#2f8a57; --green-bg:#e5f4ea; --red:#c0392b; --red-bg:#fbeceb; --amber:#b7791f; --amber-bg:#fdf3dc; - --violet:#5a4fcf; --violet-bg:#eeecfb; --gray-bg:#eef1f6; } +:root { --ink:#1f2933; --sub:#3e4c59; --muted:#52606d; --line:#9aa5b1; --soft:#f5f7fa; --code:#eef2f6; + --blue:#1565c0; --blue-bg:#e8f0fe; --green:#2e7d32; --green-bg:#e8f5e9; --red:#c62828; --red-bg:#fdecea; + --amber:#b26a00; --amber-bg:#fff4e0; --violet:#5b3fc4; --violet-bg:#efeafd; } * { box-sizing:border-box; margin:0; padding:0; } -body { background:var(--bg); color:var(--ink); padding:24px 28px; display:flex; flex-direction:column; gap:14px; +body { background:#fff; color:var(--ink); padding:32px 40px; display:flex; flex-direction:column; gap:20px; font-family:"Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans JP","Yu Gothic",sans-serif; } -h1 { font-size:38px; font-weight:800; } -.summary { background:#fff; border:3px solid var(--ink); border-radius:14px; padding:12px 18px; display:flex; gap:14px; align-items:flex-start; } -.summary .label { flex:none; background:var(--ink); color:#fff; border-radius:8px; padding:3px 12px; font-size:16px; font-weight:800; } -.summary ul { list-style:none; display:flex; flex-direction:column; gap:4px; font-size:17px; font-weight:500; line-height:1.5; color:var(--sub); } -.summary li.main { font-size:22px; font-weight:800; color:var(--ink); } +h1 { font-size:28px; font-weight:700; line-height:1.4; } +.summary { background:var(--blue-bg); border:2px solid var(--blue); border-radius:10px; padding:14px 18px; display:flex; gap:14px; align-items:flex-start; } +.summary .label { flex:none; background:var(--blue); color:#fff; border-radius:6px; padding:2px 10px; font-size:14px; font-weight:700; margin-top:3px; } +.summary ul { list-style:none; display:flex; flex-direction:column; gap:4px; font-size:17px; line-height:1.6; color:var(--sub); } +.summary li.main { font-size:21px; font-weight:700; color:var(--ink); } .summary b { color:var(--blue); } -section.overview, section.compare { background:#fff; border:2px solid var(--line); border-radius:16px; padding:14px 18px; display:flex; flex-direction:column; gap:10px; } -h2 { font-size:23px; font-weight:800; } -.flow { display:flex; gap:10px; align-items:stretch; } -.stage { flex:1 1 0; min-width:0; border:2px solid var(--line); border-radius:12px; padding:10px; display:flex; flex-direction:column; gap:8px; } +section.overview, section.compare { border:2px solid var(--line); background:#fff; border-radius:10px; padding:16px 18px; display:flex; flex-direction:column; gap:12px; } +h2 { font-size:20px; font-weight:700; } +.flow { display:flex; gap:12px; align-items:stretch; } +.stage { flex:1 1 0; min-width:0; border:2px solid var(--line); background:var(--soft); border-radius:10px; padding:12px; display:flex; flex-direction:column; gap:10px; } .stage.dashed { border-style:dashed; border-color:var(--blue); background:var(--blue-bg); } -.big-arrow { align-self:center; font-size:34px; color:var(--sub); font-weight:800; } -.step { display:flex; align-items:center; gap:8px; font-size:16px; font-weight:800; color:var(--blue); } -.num { background:var(--blue); color:#fff; border-radius:999px; width:26px; height:26px; display:grid; place-items:center; font-size:14px; flex:none; } -.row { display:flex; align-items:center; justify-content:center; gap:6px; } -.col { display:flex; flex-direction:column; gap:6px; } -.box { background:#fff; border:2px solid var(--ink); border-radius:10px; padding:7px 10px; font-size:15px; font-weight:700; text-align:center; line-height:1.3; min-width:0; overflow:hidden; } +.big-arrow { align-self:center; font-size:28px; color:var(--muted); } +.step { display:flex; align-items:center; gap:8px; font-size:16px; font-weight:700; color:var(--ink); } +.num { background:var(--ink); color:#fff; border-radius:6px; min-width:26px; height:26px; padding:0 6px; display:grid; place-items:center; font-size:14px; font-weight:700; flex:none; } +.row { display:flex; align-items:center; justify-content:center; gap:8px; } +.col { display:flex; flex-direction:column; gap:8px; } +.box { background:#fff; border:2px solid var(--line); border-radius:10px; padding:8px 12px; font-size:15px; font-weight:700; text-align:center; line-height:1.4; min-width:0; overflow:hidden; } .box.nowrap { white-space:nowrap; } -.box small { display:block; font-weight:500; font-size:12.5px; color:var(--sub); } +.box small { display:block; font-weight:400; font-size:13px; color:var(--sub); } .compare table.cmp { font-size:16px; } .box.store { background:var(--amber-bg); border-color:var(--amber); } -.box.queue { background:var(--gray-bg); } -.arrow { font-size:18px; color:var(--sub); font-weight:700; text-align:center; } -.note { font-size:13.5px; color:var(--sub); line-height:1.45; } -.aside { border:2px solid var(--green); background:var(--green-bg); border-radius:12px; padding:9px 12px; font-size:14.5px; line-height:1.5; } +.box.queue { background:var(--blue-bg); border-color:var(--blue); } +.arrow { font-size:20px; color:var(--muted); text-align:center; } +.note { font-size:14px; color:var(--sub); line-height:1.6; } +.aside { border:2px solid var(--green); background:var(--green-bg); border-radius:10px; padding:10px 14px; font-size:15px; line-height:1.6; } .aside b.label { color:var(--green); } -code { font-family:"SF Mono",Menlo,monospace; font-size:.85em; background:var(--gray-bg); padding:0 3px; border-radius:3px; } -.cards { display:grid; grid-template-columns:1fr 1fr; gap:14px; } -.card { background:#fff; border:2px solid var(--line); border-radius:14px; padding:13px 16px; display:flex; flex-direction:column; gap:9px; overflow:hidden; } -.card h3 { font-size:21px; font-weight:800; line-height:1.3; display:flex; gap:8px; align-items:flex-start; } -.line { display:flex; gap:8px; font-size:15.5px; line-height:1.55; } -.tag { flex:none; width:78px; text-align:center; white-space:nowrap; font-size:12.5px; font-weight:800; border-radius:6px; padding:1px 4px; height:fit-content; margin-top:2px; border:1.5px solid; } -.ketsu { color:var(--green); background:var(--green-bg); } -.naze { color:var(--violet); background:var(--violet-bg); } -.rei { color:var(--blue); background:var(--blue-bg); } -.botsu { color:var(--red); background:var(--red-bg); } -.amber { color:var(--amber); background:var(--amber-bg); } +code { font-family:"SF Mono",Menlo,monospace; font-size:.85em; background:var(--code); padding:1px 4px; border-radius:4px; } +.cards { display:grid; grid-template-columns:1fr 1fr; gap:18px; } +.card { background:var(--soft); border:2px solid var(--line); border-radius:10px; padding:14px 18px; display:flex; flex-direction:column; gap:10px; overflow:hidden; } +.card h3 { font-size:19px; font-weight:700; line-height:1.4; display:flex; gap:10px; align-items:flex-start; } +.line { display:flex; gap:10px; font-size:16px; line-height:1.6; } +.tag { flex:none; width:76px; text-align:center; white-space:nowrap; font-size:13px; font-weight:700; color:#fff; border-radius:6px; padding:2px 6px; height:fit-content; margin-top:3px; } +.ketsu { background:var(--green); } +.naze { background:var(--violet); } +.rei { background:var(--blue); } +.botsu { background:var(--red); } +.amber { background:var(--amber); } ul.pts { list-style:none; display:flex; flex-direction:column; gap:3px; } ul.pts li { padding-left:14px; position:relative; } -ul.pts li::before { content:"・"; position:absolute; left:0; color:var(--violet); font-weight:800; } -.alt { font-size:15px; line-height:1.5; } -.alt .x { color:var(--red); font-weight:800; } +ul.pts li::before { content:"・"; position:absolute; left:0; color:var(--violet); font-weight:700; } +.alt { font-size:15px; line-height:1.6; } +.alt .x { color:var(--red); font-weight:700; } .alt .why { color:var(--sub); } -table.cmp { border-collapse:collapse; width:100%; font-size:14.5px; line-height:1.45; } -table.cmp th, table.cmp td { border:1.5px solid var(--line); padding:5px 7px; vertical-align:top; text-align:left; } -table.cmp th { background:var(--gray-bg); font-weight:800; white-space:nowrap; } -table.cmp td:first-child { font-weight:800; } +table.cmp { border-collapse:collapse; width:100%; font-size:15px; line-height:1.5; background:#fff; } +table.cmp th, table.cmp td { border:1.5px solid var(--line); padding:6px 8px; vertical-align:top; text-align:left; } +table.cmp th { background:var(--soft); font-weight:700; white-space:nowrap; } +table.cmp td:first-child { font-weight:700; } `; const box = (b) => `
${ink(b.name)}${b.sub ? `${ink(b.sub)}` : ''}
`; @@ -224,6 +225,27 @@ async function build(f, html, png) { } finally { await browser.close(); } } +// PR・設計の図は 1 枚の HTML に reference/page.css の部品で描く。幅は page.css の body で決まり、高さは中身で決まる +async function shot(html, png) { + if (!fs.existsSync(path.join(DEPS, 'node_modules', 'playwright'))) { + console.error(`依存が無い。先に: node ${path.join(HERE, 'figure.mjs')} setup`); process.exit(1); + } + const { chromium } = createRequire(path.join(DEPS, 'package.json'))('playwright'); + const browser = await chromium.launch(); + try { + const page = await browser.newPage({ viewport: { width: 1200, height: 200 }, deviceScaleFactor: 2 }); + await page.goto('file://' + path.resolve(html)); + const over = await page.evaluate(() => [...document.querySelectorAll('.box, .note, h1')] + .filter((e) => e.scrollWidth > e.clientWidth + 1 || e.scrollHeight > e.clientHeight + 1) + .map((e) => e.textContent.trim().slice(0, 40))); + await page.screenshot({ path: png, fullPage: true }); + if (over.length) { + console.error(`文字が枠からあふれた(${png} は確認用に書いた):\n- ` + over.join('\n- ')); + process.exit(3); + } + } finally { await browser.close(); } +} + function setup() { fs.mkdirSync(DEPS, { recursive: true }); for (const f of ['package.json', 'package-lock.json']) fs.copyFileSync(path.join(HERE, '..', f), path.join(DEPS, f)); @@ -237,8 +259,12 @@ function setup() { if (process.argv[1] && fs.realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) { const [cmd, file, out] = process.argv.slice(2); if (cmd === 'setup') setup(); - else if (!['check', 'html', 'build'].includes(cmd) || !file || (cmd !== 'check' && !out)) { - console.error('usage: node figure.mjs | html | build >'); + else if (cmd === 'shot') { + if (!file || !out) { console.error('usage: node figure.mjs shot '); process.exit(1); } + await shot(file, out); + console.log('ok', out); + } else if (!['check', 'html', 'build'].includes(cmd) || !file || (cmd !== 'check' && !out)) { + console.error('usage: node figure.mjs | html | build | shot >'); process.exit(1); } else { const f = load(file); diff --git a/skills/x-present/reference/architecture.md b/skills/x-present/reference/architecture.md index 1b55687..8ead41a 100644 --- a/skills/x-present/reference/architecture.md +++ b/skills/x-present/reference/architecture.md @@ -8,6 +8,6 @@ | どちらの案を採るか | 同じ入力・配置・縮尺で候補を並べ、違う経路とその結果を目立たせる。回答後は採用案を明記する | | いつ失敗するか | 開始から失敗までの操作順。検査済みの反例は実行結果を使い、仮説には「未確認」と付ける | -**共有する成果物は PNG を基本にする。** 拡大・探索が必要なら、選択導入の `archify` で構成図や状態図の HTML を生成・検査し、同じ図を PNG に書き出す。小さな比較や、書き出しで要点・文字サイズが失われる時は、SVG に判断と実測を直接配置し、既存のブラウザで画像化する。相談中は一時プレビュー、継続して更新する図には編集可能な元資料も残す。画像生成が使えない時は不足を明かし、同じ判断に必要な情報を表で渡す。 +**共有する成果物は PNG を基本にする。** PR と設計の図は、1 枚の HTML を `${CLAUDE_SKILL_DIR}/figure/reference/page.css` の部品で描き、`node ${CLAUDE_SKILL_DIR}/figure/scripts/figure.mjs shot page.html figure.png` で書き出す。見本は `${CLAUDE_SKILL_DIR}/figure/reference/example-page.html`。page.css を HTML と同じ場所に置いて読ませる。配色は ADR の要約図と同じで、箱は `.box`、判断の状態は色(`.red` 止める・`.amber` 注意・`.green` 通る・`.blue` 処理)と `.tag` の文字の両方で示し、矢印は `.arrow`、補足は `.note` に書く。題(`h1`)は問いの答えを 1 行で書く。`shot` は文字が箱からあふれると失敗するので、文言を詰めて書き出し直す。 拡大・探索が必要なら、選択導入の `archify` で構成図や状態図の HTML を生成・検査し、同じ図を PNG に書き出す。小さな比較や、書き出しで要点・文字サイズが失われる時は、SVG に判断と実測を直接配置し、既存のブラウザで画像化する。相談中は一時プレビュー、継続して更新する図には編集可能な元資料も残す。画像生成が使えない時は不足を明かし、同じ判断に必要な情報を表で渡す。 表示先の幅で画像を開き、日本語の文字、矢印の向き、境界、文字のあふれを確認する。色に加えてラベルで状態を区別し、画像を読めない人に結論を伝える代替テキストを添える。PR には画像をコミットせず、`gh pr edit --attach` で本文に添付する(手順は `da-pr` の `reference/body.md`)。共有ページは読者が開ける同じ版の画像を指す。外部へのアップロードは依頼された宛先だけに行う。 From 773cece7e3066f96b3f3be8c18be4b2b1d795b05 Mon Sep 17 00:00:00 2001 From: bwkw Date: Wed, 2 Dec 2026 20:00:15 +0900 Subject: [PATCH 4/4] =?UTF-8?q?x-present=20=E3=81=AE=20ADR=20=E8=A6=81?= =?UTF-8?q?=E7=B4=84=E5=9B=B3=E3=81=AF=E5=85=83=E3=81=AE=E8=A6=8B=E3=81=9F?= =?UTF-8?q?=E7=9B=AE=E3=81=AB=E6=88=BB=E3=81=97=E3=80=81PR=20=E3=81=AE?= =?UTF-8?q?=E5=9B=B3=E3=81=AE=E9=83=A8=E5=93=81=E3=81=A8=E6=9B=B8=E3=81=8D?= =?UTF-8?q?=E5=87=BA=E3=81=97=E3=81=A0=E3=81=91=E3=82=92=E6=AE=8B=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- docs/decisions.md | 2 +- skills/x-present/figure/guide.md | 2 +- skills/x-present/figure/reference/page.css | 2 +- skills/x-present/figure/scripts/figure.mjs | 84 +++++++++++----------- skills/x-present/reference/architecture.md | 2 +- 5 files changed, 46 insertions(+), 46 deletions(-) diff --git a/docs/decisions.md b/docs/decisions.md index d1d90d3..152f640 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -1881,4 +1881,4 @@ install と status の両方がそう言います。**信頼はセキュリテ **再考する条件**: GitHub が添付の公開範囲を変えた時、`--attach` が使えない環境が主になった時、`.node-version` のメジャーが下限から離れた時(`node-floor` は自動で全部に戻る)。 -**図とタイトル(2026-12-02)**: 図を別の `## 結果` の節に必須で置く形を試したが、要点と図が離れるので、図は `## 結論` の最後に 1 点置く形に戻した。図は `x-present` の PNG を添付し、Mermaid で代えない。本文に描いた Mermaid は表示先によって描画されず、配色や文字の大きさも決められないため。PR・設計の図と ADR の要約図は、同じ配色・札・枠(`x-present` の `figure/reference/page.css` と `figure.mjs` の CSS)にそろえ、PR の図は `figure.mjs shot` で書き出す。図ごとに見た目が違うと、色や札の意味を毎回読み直すことになるため。タイトルは `<種類>(<範囲>): <変更後に何がどうなるか> [<チケット ID>]` にそろえる。使い先のリポジトリのマージ済み PR が、種類・範囲の接頭辞と末尾のチケット ID を使っているため。リポジトリにはっきり別の慣習があればそちらに合わせる。 +**図とタイトル(2026-12-02)**: 図を別の `## 結果` の節に必須で置く形を試したが、要点と図が離れるので、図は `## 結論` の最後に 1 点置く形に戻した。図は `x-present` の PNG を添付し、Mermaid で代えない。本文に描いた Mermaid は表示先によって描画されず、配色や文字の大きさも決められないため。PR・設計の図は `x-present` の `figure/reference/page.css` の部品で描き、`figure.mjs shot` で書き出す。図ごとに見た目が違うと、色や札の意味を毎回読み直すことになるため。ADR の要約図は判断を 1 枚に詰めて読ませる別の用途なので、`figure.mjs` の見た目のまま分けておく。タイトルは `<種類>(<範囲>): <変更後に何がどうなるか> [<チケット ID>]` にそろえる。使い先のリポジトリのマージ済み PR が、種類・範囲の接頭辞と末尾のチケット ID を使っているため。リポジトリにはっきり別の慣習があればそちらに合わせる。 diff --git a/skills/x-present/figure/guide.md b/skills/x-present/figure/guide.md index 1f96bfc..1e1e40f 100644 --- a/skills/x-present/figure/guide.md +++ b/skills/x-present/figure/guide.md @@ -1,7 +1,7 @@ # ADR のすべての判断を 1 枚の PNG にする 図解 1 枚につき**定義 1 ファイル**(`figure.json`)を書き、`${CLAUDE_SKILL_DIR}/figure/scripts/figure.mjs` で PNG にする。 -図は ADR の要約そのものである。見た目は PR・設計の図(`reference/page.css`)と同じ配色・札・枠にそろえてあり、`figure.mjs` が描く。**図を見た人が、最初の要約で何を決めたかを知り、カードで判断ごとに「何を選び、なぜか」を掴める**ことを目指す。 +図は ADR の要約そのものである。**図を見た人が、最初の要約で何を決めたかを知り、カードで判断ごとに「何を選び、なぜか」を掴める**ことを目指す。 判断はすべて載せ、1 つの判断に載せるのは決定と一番強い理由(あれば一番強い対抗案)だけにする。残りの理由と対抗案、前提、失うものは ADR の本文に任せる。 触ってよいもの: 作業ディレクトリ(scratchpad を推奨)に置く定義・HTML・PNG だけ。**ADR は書き換えない。** 図に書きたい理由が ADR に無ければ、止まって報告する(Step 4)。 diff --git a/skills/x-present/figure/reference/page.css b/skills/x-present/figure/reference/page.css index 6597d5f..2767251 100644 --- a/skills/x-present/figure/reference/page.css +++ b/skills/x-present/figure/reference/page.css @@ -1,4 +1,4 @@ -/* PR・設計の図(1 枚の HTML)の共通の見た目。ADR の要約図(figure.mjs の CSS)と同じ配色にそろえる。 +/* PR・設計の図(1 枚の HTML)の共通の見た目。 使える部品:.box(箱)、.tag(札)、色 .red / .amber / .green / .blue、.arrow(矢印)、.note(注記)、code */ *{box-sizing:border-box;margin:0;padding:0} body{font-family:"Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans JP","Yu Gothic",sans-serif;background:#fff;color:#1f2933;width:1200px;padding:32px 40px} diff --git a/skills/x-present/figure/scripts/figure.mjs b/skills/x-present/figure/scripts/figure.mjs index 6517fe4..fc31f27 100644 --- a/skills/x-present/figure/scripts/figure.mjs +++ b/skills/x-present/figure/scripts/figure.mjs @@ -109,59 +109,59 @@ const esc = (s) => String(s).replace(/&/g, '&').replace(/ esc(s).replace(/`([^`]+)`/g, '$1').replace(/\*\*([^*]+)\*\*/g, '$1'); const CSS = ` -:root { --ink:#1f2933; --sub:#3e4c59; --muted:#52606d; --line:#9aa5b1; --soft:#f5f7fa; --code:#eef2f6; - --blue:#1565c0; --blue-bg:#e8f0fe; --green:#2e7d32; --green-bg:#e8f5e9; --red:#c62828; --red-bg:#fdecea; - --amber:#b26a00; --amber-bg:#fff4e0; --violet:#5b3fc4; --violet-bg:#efeafd; } +:root { --ink:#1d2433; --sub:#4a5568; --line:#c9d2e3; --bg:#f7f4ec; --blue:#2f6fb5; --blue-bg:#e6f0fb; + --green:#2f8a57; --green-bg:#e5f4ea; --red:#c0392b; --red-bg:#fbeceb; --amber:#b7791f; --amber-bg:#fdf3dc; + --violet:#5a4fcf; --violet-bg:#eeecfb; --gray-bg:#eef1f6; } * { box-sizing:border-box; margin:0; padding:0; } -body { background:#fff; color:var(--ink); padding:32px 40px; display:flex; flex-direction:column; gap:20px; +body { background:var(--bg); color:var(--ink); padding:24px 28px; display:flex; flex-direction:column; gap:14px; font-family:"Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans JP","Yu Gothic",sans-serif; } -h1 { font-size:28px; font-weight:700; line-height:1.4; } -.summary { background:var(--blue-bg); border:2px solid var(--blue); border-radius:10px; padding:14px 18px; display:flex; gap:14px; align-items:flex-start; } -.summary .label { flex:none; background:var(--blue); color:#fff; border-radius:6px; padding:2px 10px; font-size:14px; font-weight:700; margin-top:3px; } -.summary ul { list-style:none; display:flex; flex-direction:column; gap:4px; font-size:17px; line-height:1.6; color:var(--sub); } -.summary li.main { font-size:21px; font-weight:700; color:var(--ink); } +h1 { font-size:38px; font-weight:800; } +.summary { background:#fff; border:3px solid var(--ink); border-radius:14px; padding:12px 18px; display:flex; gap:14px; align-items:flex-start; } +.summary .label { flex:none; background:var(--ink); color:#fff; border-radius:8px; padding:3px 12px; font-size:16px; font-weight:800; } +.summary ul { list-style:none; display:flex; flex-direction:column; gap:4px; font-size:17px; font-weight:500; line-height:1.5; color:var(--sub); } +.summary li.main { font-size:22px; font-weight:800; color:var(--ink); } .summary b { color:var(--blue); } -section.overview, section.compare { border:2px solid var(--line); background:#fff; border-radius:10px; padding:16px 18px; display:flex; flex-direction:column; gap:12px; } -h2 { font-size:20px; font-weight:700; } -.flow { display:flex; gap:12px; align-items:stretch; } -.stage { flex:1 1 0; min-width:0; border:2px solid var(--line); background:var(--soft); border-radius:10px; padding:12px; display:flex; flex-direction:column; gap:10px; } +section.overview, section.compare { background:#fff; border:2px solid var(--line); border-radius:16px; padding:14px 18px; display:flex; flex-direction:column; gap:10px; } +h2 { font-size:23px; font-weight:800; } +.flow { display:flex; gap:10px; align-items:stretch; } +.stage { flex:1 1 0; min-width:0; border:2px solid var(--line); border-radius:12px; padding:10px; display:flex; flex-direction:column; gap:8px; } .stage.dashed { border-style:dashed; border-color:var(--blue); background:var(--blue-bg); } -.big-arrow { align-self:center; font-size:28px; color:var(--muted); } -.step { display:flex; align-items:center; gap:8px; font-size:16px; font-weight:700; color:var(--ink); } -.num { background:var(--ink); color:#fff; border-radius:6px; min-width:26px; height:26px; padding:0 6px; display:grid; place-items:center; font-size:14px; font-weight:700; flex:none; } -.row { display:flex; align-items:center; justify-content:center; gap:8px; } -.col { display:flex; flex-direction:column; gap:8px; } -.box { background:#fff; border:2px solid var(--line); border-radius:10px; padding:8px 12px; font-size:15px; font-weight:700; text-align:center; line-height:1.4; min-width:0; overflow:hidden; } +.big-arrow { align-self:center; font-size:34px; color:var(--sub); font-weight:800; } +.step { display:flex; align-items:center; gap:8px; font-size:16px; font-weight:800; color:var(--blue); } +.num { background:var(--blue); color:#fff; border-radius:999px; width:26px; height:26px; display:grid; place-items:center; font-size:14px; flex:none; } +.row { display:flex; align-items:center; justify-content:center; gap:6px; } +.col { display:flex; flex-direction:column; gap:6px; } +.box { background:#fff; border:2px solid var(--ink); border-radius:10px; padding:7px 10px; font-size:15px; font-weight:700; text-align:center; line-height:1.3; min-width:0; overflow:hidden; } .box.nowrap { white-space:nowrap; } -.box small { display:block; font-weight:400; font-size:13px; color:var(--sub); } +.box small { display:block; font-weight:500; font-size:12.5px; color:var(--sub); } .compare table.cmp { font-size:16px; } .box.store { background:var(--amber-bg); border-color:var(--amber); } -.box.queue { background:var(--blue-bg); border-color:var(--blue); } -.arrow { font-size:20px; color:var(--muted); text-align:center; } -.note { font-size:14px; color:var(--sub); line-height:1.6; } -.aside { border:2px solid var(--green); background:var(--green-bg); border-radius:10px; padding:10px 14px; font-size:15px; line-height:1.6; } +.box.queue { background:var(--gray-bg); } +.arrow { font-size:18px; color:var(--sub); font-weight:700; text-align:center; } +.note { font-size:13.5px; color:var(--sub); line-height:1.45; } +.aside { border:2px solid var(--green); background:var(--green-bg); border-radius:12px; padding:9px 12px; font-size:14.5px; line-height:1.5; } .aside b.label { color:var(--green); } -code { font-family:"SF Mono",Menlo,monospace; font-size:.85em; background:var(--code); padding:1px 4px; border-radius:4px; } -.cards { display:grid; grid-template-columns:1fr 1fr; gap:18px; } -.card { background:var(--soft); border:2px solid var(--line); border-radius:10px; padding:14px 18px; display:flex; flex-direction:column; gap:10px; overflow:hidden; } -.card h3 { font-size:19px; font-weight:700; line-height:1.4; display:flex; gap:10px; align-items:flex-start; } -.line { display:flex; gap:10px; font-size:16px; line-height:1.6; } -.tag { flex:none; width:76px; text-align:center; white-space:nowrap; font-size:13px; font-weight:700; color:#fff; border-radius:6px; padding:2px 6px; height:fit-content; margin-top:3px; } -.ketsu { background:var(--green); } -.naze { background:var(--violet); } -.rei { background:var(--blue); } -.botsu { background:var(--red); } -.amber { background:var(--amber); } +code { font-family:"SF Mono",Menlo,monospace; font-size:.85em; background:var(--gray-bg); padding:0 3px; border-radius:3px; } +.cards { display:grid; grid-template-columns:1fr 1fr; gap:14px; } +.card { background:#fff; border:2px solid var(--line); border-radius:14px; padding:13px 16px; display:flex; flex-direction:column; gap:9px; overflow:hidden; } +.card h3 { font-size:21px; font-weight:800; line-height:1.3; display:flex; gap:8px; align-items:flex-start; } +.line { display:flex; gap:8px; font-size:15.5px; line-height:1.55; } +.tag { flex:none; width:78px; text-align:center; white-space:nowrap; font-size:12.5px; font-weight:800; border-radius:6px; padding:1px 4px; height:fit-content; margin-top:2px; border:1.5px solid; } +.ketsu { color:var(--green); background:var(--green-bg); } +.naze { color:var(--violet); background:var(--violet-bg); } +.rei { color:var(--blue); background:var(--blue-bg); } +.botsu { color:var(--red); background:var(--red-bg); } +.amber { color:var(--amber); background:var(--amber-bg); } ul.pts { list-style:none; display:flex; flex-direction:column; gap:3px; } ul.pts li { padding-left:14px; position:relative; } -ul.pts li::before { content:"・"; position:absolute; left:0; color:var(--violet); font-weight:700; } -.alt { font-size:15px; line-height:1.6; } -.alt .x { color:var(--red); font-weight:700; } +ul.pts li::before { content:"・"; position:absolute; left:0; color:var(--violet); font-weight:800; } +.alt { font-size:15px; line-height:1.5; } +.alt .x { color:var(--red); font-weight:800; } .alt .why { color:var(--sub); } -table.cmp { border-collapse:collapse; width:100%; font-size:15px; line-height:1.5; background:#fff; } -table.cmp th, table.cmp td { border:1.5px solid var(--line); padding:6px 8px; vertical-align:top; text-align:left; } -table.cmp th { background:var(--soft); font-weight:700; white-space:nowrap; } -table.cmp td:first-child { font-weight:700; } +table.cmp { border-collapse:collapse; width:100%; font-size:14.5px; line-height:1.45; } +table.cmp th, table.cmp td { border:1.5px solid var(--line); padding:5px 7px; vertical-align:top; text-align:left; } +table.cmp th { background:var(--gray-bg); font-weight:800; white-space:nowrap; } +table.cmp td:first-child { font-weight:800; } `; const box = (b) => `
${ink(b.name)}${b.sub ? `${ink(b.sub)}` : ''}
`; diff --git a/skills/x-present/reference/architecture.md b/skills/x-present/reference/architecture.md index 8ead41a..97329cc 100644 --- a/skills/x-present/reference/architecture.md +++ b/skills/x-present/reference/architecture.md @@ -8,6 +8,6 @@ | どちらの案を採るか | 同じ入力・配置・縮尺で候補を並べ、違う経路とその結果を目立たせる。回答後は採用案を明記する | | いつ失敗するか | 開始から失敗までの操作順。検査済みの反例は実行結果を使い、仮説には「未確認」と付ける | -**共有する成果物は PNG を基本にする。** PR と設計の図は、1 枚の HTML を `${CLAUDE_SKILL_DIR}/figure/reference/page.css` の部品で描き、`node ${CLAUDE_SKILL_DIR}/figure/scripts/figure.mjs shot page.html figure.png` で書き出す。見本は `${CLAUDE_SKILL_DIR}/figure/reference/example-page.html`。page.css を HTML と同じ場所に置いて読ませる。配色は ADR の要約図と同じで、箱は `.box`、判断の状態は色(`.red` 止める・`.amber` 注意・`.green` 通る・`.blue` 処理)と `.tag` の文字の両方で示し、矢印は `.arrow`、補足は `.note` に書く。題(`h1`)は問いの答えを 1 行で書く。`shot` は文字が箱からあふれると失敗するので、文言を詰めて書き出し直す。 拡大・探索が必要なら、選択導入の `archify` で構成図や状態図の HTML を生成・検査し、同じ図を PNG に書き出す。小さな比較や、書き出しで要点・文字サイズが失われる時は、SVG に判断と実測を直接配置し、既存のブラウザで画像化する。相談中は一時プレビュー、継続して更新する図には編集可能な元資料も残す。画像生成が使えない時は不足を明かし、同じ判断に必要な情報を表で渡す。 +**共有する成果物は PNG を基本にする。** PR と設計の図は、1 枚の HTML を `${CLAUDE_SKILL_DIR}/figure/reference/page.css` の部品で描き、`node ${CLAUDE_SKILL_DIR}/figure/scripts/figure.mjs shot page.html figure.png` で書き出す。見本は `${CLAUDE_SKILL_DIR}/figure/reference/example-page.html`。page.css を HTML と同じ場所に置いて読ませる。箱は `.box`、判断の状態は色(`.red` 止める・`.amber` 注意・`.green` 通る・`.blue` 処理)と `.tag` の文字の両方で示し、矢印は `.arrow`、補足は `.note` に書く。題(`h1`)は問いの答えを 1 行で書く。`shot` は文字が箱からあふれると失敗するので、文言を詰めて書き出し直す。拡大・探索が必要なら、選択導入の `archify` で構成図や状態図の HTML を生成・検査し、同じ図を PNG に書き出す。小さな比較や、書き出しで要点・文字サイズが失われる時は、SVG に判断と実測を直接配置し、既存のブラウザで画像化する。相談中は一時プレビュー、継続して更新する図には編集可能な元資料も残す。画像生成が使えない時は不足を明かし、同じ判断に必要な情報を表で渡す。 表示先の幅で画像を開き、日本語の文字、矢印の向き、境界、文字のあふれを確認する。色に加えてラベルで状態を区別し、画像を読めない人に結論を伝える代替テキストを添える。PR には画像をコミットせず、`gh pr edit --attach` で本文に添付する(手順は `da-pr` の `reference/body.md`)。共有ページは読者が開ける同じ版の画像を指す。外部へのアップロードは依頼された宛先だけに行う。