Skip to content

feat: /lawページに「最近の改正をわかりやすく」解説を追加 (SEO B案 Phase1)#3

Merged
wharfe merged 13 commits into
mainfrom
feat/law-explainer-seo
Jun 9, 2026
Merged

feat: /lawページに「最近の改正をわかりやすく」解説を追加 (SEO B案 Phase1)#3
wharfe merged 13 commits into
mainfrom
feat/law-explainer-seo

Conversation

@wharfe

@wharfe wharfe commented Jun 9, 2026

Copy link
Copy Markdown
Owner

概要

GSC/GA4分析で判明した課題(表示回数は急増中だがCTRほぼ0、/law改正履歴ページが唯一クリックを獲得する勝ち型)への対応。/law/{lawId} ページに、最近の改正を平易に解説するAI生成セクションを追加し、上がってきた検索露出を実クリックに変えます。

設計: docs/superpowers/specs/2026-06-09-law-explainer-seo-design.md
プラン: docs/superpowers/plans/2026-06-09-law-explainer-seo.md

変更内容

  • (frontend/lib/types.ts): LawExplainer/ExplainerChange/ExplainerFaq 追加、LawTimeline.explainer?(optional・後方互換)。
  • 生成 (scripts/explainer.py 新規): Claude(claude-sonnet-4-6)で explainer(intro/recent_changes/faq) を生成しtimeline JSONに格納。
  • 描画 (frontend/components/law-explainer.tsx 新規 + app/law/[lawId]/page.tsx): summaryカード直後にセクション描画。meta descriptionを explainer.intro 優先に。
  • データ: Phase1対象4法令(不動産登記法・民法・労働基準法・道路交通法)を生成。

hallucination対策(設計の中核)

year/grounded/採用する改正はPython側で決定的に確定し、LLMには散文(title/what/why/impact)のみ書かせる。grounded:true(既存diffのpr_summaryが根拠)の改正だけwhy/impactを許可、diff_id:nullwhatのみで背景・影響を抑制。検証(validate_explainer)と正規化(normalize_explainer)が同じ不変条件を二重に強制。

レビュー

  • Codexによる設計レビュー → 反映済み(根拠付け・データ重複排除・FAQPage格下げ等)。
  • コード品質レビュー(純関数)→ 非dict入力への堅牢化を追加。
  • 最終ブランチレビュー → Ready to merge(Critical/Importantなし)。FAQ件数上限の検証も追加。
  • 生成4法令の事実性手動レビュー実施:groundedな記述は全てpr_summaryに準拠、新規hallucination無し。

テスト・検証

  • uv run pytest tests/test_explainer.py → 14 passed(純関数のTDD)。
  • npm run build → 成功。対象4法令にセクション有り、対象外法令は従来通り(後方互換確認済み)。

マージ後

main反映でVercelが本番デプロイ。2-3週間後にGSC/GA4で4法令の /law のクリック・CTR・対象クエリ順位を観測し、効果が出れば残り法令へ横展開。

🤖 Generated with Claude Code

wharfe and others added 13 commits June 9, 2026 22:07
GSC分析を受けたSEOコンテンツ強化。/law改正履歴ページに
「最近の改正をわかりやすく」長文解説を追加する設計。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 根拠付け: diff有改正はpr_summaryを入力にgrounded:true、diff無はwhy/impact抑制
- recent_changesを改正法/トピック単位に集約(重複・技術的整理法を排除)
- FAQPage JSON-LDを格下げ(lexdiffはリッチリザルト対象外)・スコープ外に
- meta descriptionをexplainer.intro優先に
- 事実性レビューゲートと自動スキーマ検証を明文化
- Phase1の成功条件・観測期間を追加

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…red snapshot)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
不動産登記法・民法・労働基準法・道路交通法に「最近の改正をわかりやすく」
解説を生成。groundedな記述は各diffのpr_summaryに基づき、ungroundedは
施行年・改正法名のみのwhatに限定(why/impact抑制)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lex-diff Ready Ready Preview, Comment Jun 9, 2026 1:49pm

@wharfe wharfe merged commit 22fde07 into main Jun 9, 2026
4 checks passed
@wharfe wharfe deleted the feat/law-explainer-seo branch June 9, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant