Repository navigation
GCP / Cisco 学習ガイドの拡充、Mermaid 描画・アクセシビリティ強化、および全幅サイドバーレイアウトの標準化 #120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
123 commits
Select commit
Hold shift + click to select a range
a597b12
docs(gcp): remove lab URL links from Cymbal direct prompt design guide
myoshi2891 00a7bc9
docs(gcp): add BigQuery AppsScript, COVID-19, and data sharing challe…
myoshi2891 d32f491
docs(gcp): add network security and service account IAM best practice…
myoshi2891 14f8815
docs(gcp): add GKE Prometheus, Knowledge Catalog, and ML API challeng…
myoshi2891 60a7b68
docs(workspace): add Google Workspace challenge lab guide
myoshi2891 f107c3d
docs(pcne): add CDN/DNS/IPAM, Load Balancing, and Network Ops monitor…
myoshi2891 d2970e1
fix(docs): align Apps Script task instructions
myoshi2891 6045059
fix(docs): correct COVID query semantics
myoshi2891 e1e9adc
fix(docs): harden BigQuery sharing guide
myoshi2891 fb342a9
fix(docs): correct IAM role and sidebar guidance
myoshi2891 d6350f3
fix(docs): align GMP manifests and target status
myoshi2891 6d79bee
fix(docs): secure Workspace guide dependencies
myoshi2891 4e20ab2
fix(docs): correct Knowledge Catalog guidance
myoshi2891 31607fb
fix(docs): improve ML API auth and locale handling
myoshi2891 0d5c3fd
fix(docs): correct CDN signing and GKE DNS flow
myoshi2891 d1ede5e
fix(docs): clarify Gateway health check defaults
myoshi2891 d6e510d
fix(docs): correct network logging scope
myoshi2891 046fe0e
test: add failing tests for CCNA automation app deployment and securi…
myoshi2891 1e057b9
feat: implement CCNA automation app deployment and security guide pag…
myoshi2891 66476bc
refactor/docs: integrate CCNA automation app deployment security guid…
myoshi2891 534f16c
chore(docs): update MIGRATION_PROGRESS.md for CCNA automation app dep…
myoshi2891 4b859e0
fix(mermaid): memoize diagram components and fix natural scale sizing
myoshi2891 f9b5d3d
test(mermaid): update MermaidDiagram tests for minimum width and max-…
myoshi2891 75204a5
docs(skills): update fix-mermaid skill with memoization and natural s…
myoshi2891 341e76e
fix(mermaid): use justify-content safe center to prevent left clippin…
myoshi2891 d410b32
docs(skills): sync safe center rules in fix-mermaid skill
myoshi2891 6ec7aa8
fix(ui): expand main container to full width and ensure 1rem font siz…
myoshi2891 05a6cfc
test(mermaid): update test assertion to maintain 1.0x natural width f…
myoshi2891 f6664b0
docs(skills): update fix-mermaid skill with 1rem font size guarantee …
myoshi2891 3e775b5
fix(ui): expand ccna automation software dev design page to full width
myoshi2891 99fb861
test(cisco): update test assertions for full width diagram containers
myoshi2891 6957ad7
test(cisco): add failing tests for CCNA automation cisco platforms an…
myoshi2891 b0c54c1
feat(cisco): implement CCNA automation cisco platforms and developmen…
myoshi2891 ba8a088
refactor(cisco): integrate CCNA automation cisco platforms and develo…
myoshi2891 1361937
refactor(cisco): align CSS styles and variables with original HTML de…
myoshi2891 22360a2
refactor(cisco): ensure exact Mermaid diagram color styling and yello…
myoshi2891 122ad23
fix(cisco): fix yellow node text contrast and SVG layout boundaries i…
myoshi2891 a61e586
fix(components): add #ffe08a and yellow shade variations to MermaidDi…
myoshi2891 04aa8ac
docs(rules): document strict design migration and yellow Mermaid node…
myoshi2891 e8385f0
fix(bigquery): restrict country-level challenge queries
myoshi2891 a42862e
fix(gmp): restore operator config after target debugging
myoshi2891 9bc4587
fix(workspace): limit AppSheet preflight check
myoshi2891 ef6c493
fix(dataplex): qualify entry search scope
myoshi2891 74ab549
fix(cdn): require origin-side signed request controls
myoshi2891 43a0e19
docs: clarify migration design token guidance
myoshi2891 36927eb
test(mermaid): cover natural-size SVG styling
myoshi2891 955cf83
fix(mermaid): preserve measured natural SVG sizing
myoshi2891 cfd9e94
test(cisco): cover deployment guide review findings
myoshi2891 79d268d
test(cisco): allow repeated deployment guide terms
myoshi2891 ae40623
fix(cisco): restore deployment guide content and navigation
myoshi2891 3a6de84
test(cisco): cover platforms guide CSS migration
myoshi2891 df7fe9e
fix(cisco): migrate platforms guide to CSS Modules
myoshi2891 c0dd8b5
test(layout): cover centered guide content widths
myoshi2891 c6455f1
fix(layout): center guide article content
myoshi2891 e13db04
test(archive): cover CCNA guide accessibility fixes
myoshi2891 b1700a5
test(archive): ignore fenced code headings
myoshi2891 1c7506f
fix(archive): preserve accessible CCNA source guides
myoshi2891 a2272d2
fix(archive): consolidate Cisco sources under archive
myoshi2891 6c94784
chore(agents): copy .claude rules and skills into .agents directory
myoshi2891 f2703a5
chore(config): update tsconfig target to ES2024
myoshi2891 a626328
docs(gcp): update BigQuery Apps Script Connected Sheets guide
myoshi2891 6f1c0bf
docs(gcp): add AppSheet and Apps Script Chat challenge lab guide
myoshi2891 d847593
docs(gcp): add Associate Google Workspace Administrator Section 1 guide
myoshi2891 c88dbc4
test: update AWS SAA Domain 4 and Cisco CCDE guide test assertions
myoshi2891 20e4c24
docs(gcp): add AppSheet and Apps Script Chat challenge lab HTML guide
myoshi2891 cadb47e
test: strengthen guide regression coverage
myoshi2891 98d271b
docs(rules): clarify validation and sync workflows
myoshi2891 5b0593b
test(fix-mermaid): add failing pipeline regressions
myoshi2891 e5d5d72
fix(fix-mermaid): harden render pipeline parsing
myoshi2891 e9ed56c
docs(migration): align token and validation guidance
myoshi2891 6dd59c2
test(cisco): add failing OWASP 2025 coverage
myoshi2891 50fa58d
fix(content): correct guide references and responsive layout
myoshi2891 2ada6ea
docs(migration): correct Cisco component boundaries
myoshi2891 d2f515b
docs(spec-sync): standardize test command wording
myoshi2891 c04e761
chore(deps): keep npm-only workflow lockfile-safe
myoshi2891 d6eef35
docs(skills): add missing update date
myoshi2891 3af4d49
docs(rules): clarify repository workflows
myoshi2891 bb880e5
docs(skills): tighten migration validation guidance
myoshi2891 8c1a920
test(fix-mermaid): add parser regression coverage
myoshi2891 fa7c3b2
fix(fix-mermaid): parse options and declarations safely
myoshi2891 786157c
docs(specs): align progress sync terminology
myoshi2891 1001755
test(terraform-guide): reproduce external icon stylesheet failure
myoshi2891 07d04e9
fix(terraform-guide): serve icon font locally
myoshi2891 e72c090
test(terraform-guide): require resolvable icon stylesheet entry
myoshi2891 f2d9909
fix(terraform-guide): use packaged icon stylesheet entry
myoshi2891 8891298
docs(tests): sync coverage dashboard after regression test
myoshi2891 7bb8a4e
fix(mermaid): harden source parsing and tests
myoshi2891 145787a
fix(styles): scope GCP tokens to owning page
myoshi2891 8d44970
fix(workflow): fail closed on repository checks
myoshi2891 226dc12
chore(docs): sync agent specifications and test dashboard
myoshi2891 35cd0b6
chore(markdown): pin project lint tooling
myoshi2891 df52449
docs(markdown): sync pinned lint command
myoshi2891 0113dfa
chore(deps): update bun lockfile for markdownlint
myoshi2891 e501682
fix(workflow): fail closed on sync and cache checks
myoshi2891 81e7f82
test(mermaid): add failing lexer regression coverage
myoshi2891 229b6b4
fix(mermaid): harden JavaScript source scanning
myoshi2891 dfb6063
refactor(css): centralize GCP guide theme tokens
myoshi2891 ba06f5f
test(layout): add failing full-width sidebar guide contract
myoshi2891 7b8db13
test(layout): cover responsive full-width guide canvases
myoshi2891 a800640
feat(layout): standardize full-width sidebar guide screens
myoshi2891 4a3f4c0
refactor(layout): fix guide CSS module and lint integration
myoshi2891 1d4cd70
chore(docs): sync full-width guide layout specifications
myoshi2891 466fe90
test(gcl-ace): add failing theme token ownership contract
myoshi2891 c3166b5
fix(gcl-ace): scope guide theme tokens to section 1
myoshi2891 3d7d5e7
docs(workflow): harden migration and commit safeguards
myoshi2891 72def13
test(fix-mermaid): add failing parser regressions
myoshi2891 9e2fd4f
fix(fix-mermaid): harden JavaScript source parsing
myoshi2891 b21a57a
test(gcl-ace): require shared guide theme tokens
myoshi2891 72de1d6
fix(styles): align shared guide tokens and sidebar layer
myoshi2891 116bd67
docs(migration): align guide examples and file references
myoshi2891 83a2996
docs: update agent rules/skills and add GCP/AGWA study guide files
myoshi2891 6f537e1
chore(workflow): harden migration and docker procedures
myoshi2891 dcdae59
docs(gcp): correct storage compute lab guidance
myoshi2891 6dfd7d1
docs(gcp): harden storage json api lab guidance
myoshi2891 bdf1cf1
docs(layout): clarify responsive and sync gates
myoshi2891 2d30ddd
docs: sync docker rebuild command
myoshi2891 67e4270
chore(workflow): harden migration paths and docker rebuild
myoshi2891 131d787
docs(gcp): enable uniform access in storage lab CLI
myoshi2891 53cbec3
docs(gcp): harden storage JSON API examples
myoshi2891 3fd8256
fix(guides): tighten migration and lab workflows
myoshi2891 65538fa
test(cisco): align platforms guide with full-width layout
myoshi2891 a81d0ef
docs(skill): document partial staging for new files
myoshi2891 d6a2c33
fix(gcp): validate HTTP firewall rule settings
myoshi2891 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Project Rules & Quality Mandates: Cloud Infrastructure Studies | ||
|
|
||
| (最終更新日: 2026-08-09) | ||
|
|
||
| 本ファイルは、本プロジェクトにおけるコード実装・HTML移行・スタイリング・テスト駆動開発(TDD)の厳格な品質基準と運用ルールを規定する。 | ||
|
|
||
| ## 1. デザイン完全移転原則(厳守) | ||
|
|
||
| - **元HTMLの `:root` スタイル変数が表すデザイン値の100%全量移植**: | ||
| - 静的HTMLから Next.js への移行時、元HTMLの `<style>` に定義されている `:root` 変数(背景色 `--bg`, `--bg-panel`, `--bg-panel-2`, `--bg-code`、境界線 `--border`, `--border-soft`、アクセントカラー `--accent`, `--accent-2`、テキスト色 `--text`, `--text-muted`, `--text-faint` 等)が表す視覚デザイン値を簡略化したり自己流に置き換えてはならない。追加先の優先順位は、まず既存の `app/globals.css` の `@theme` トークンへ対応付け、表現できない新規テーマカラーだけをページ固有 CSS のページルートセレクタへ定義する。その CSS は対応する `page.tsx` または `layout.tsx` から直接 import する。 | ||
| - 元HTMLの背景色グラデーション(`linear-gradient`)、ピル型バッジ(`border-radius: 999px`)、文字グラデーション(`background-clip: text`)、コールアウト枠線、ボタンデザイン、余白・フォントサイズは、既存のグローバルトークンと、既存トークンで表現できない場合に限るページ固有トークンの参照によって100%忠実に移転すること。 | ||
|
|
||
| ## 2. Mermaid ダイアグラムの視認性と配色検証ルール | ||
|
|
||
| - **黄色・明色ノードの黒文字強制適用**: | ||
| - Mermaid図解内で使用される黄色・明色ノード(`#ffe08a`, `#fbbc04`, `#ffd479`, `#ffba00` 等)は、暗色テーマ環境下でデフォルトの白文字 (`#ffffff`) が当たると文字が同化して判読不能になる。 | ||
| - 新しい黄色系カラーコードを使用する際は、必ず [`components/MermaidDiagram.module.css`](../components/MermaidDiagram.module.css) の黒文字転換セレクタ(`.mermaidTarget :global(.node[style*="..."] .nodeLabel)` 等)にカラーコードを追加し、黒文字 (`#000000 !important`) で高コントラスト表示されることを確認すること。 | ||
| - **図解の拡大・枠外はみ出し防止**: | ||
| - `diagram-wrapper` および `mermaid-wrap` 内の SVG 要素には `max-width: 100% !important; height: auto !important;` を指定し、ヘッダーや画面枠をはみ出さないよう収めること。 | ||
| - **例外**: `MermaidDiagram.tsx` で `preserveNaturalScale={true}` を指定した図は、SVG の自然倍率維持を優先して `max-width: none` とし、親ラッパーの `overflow-x: auto` で横スクロールを提供する。この場合、`diagram-wrapper` / `mermaid-wrap` から `max-width: 100% !important` を SVG に適用してはならない。 | ||
|
|
||
| ## 3. TDD & コミットワークフローの鉄則 | ||
|
|
||
| - `Step 1 (Red)`: 要件・見出し・表セル・Mermaid図の `ariaLabel`・参考リンクを100%網羅するテストを先に作成し、失敗を確認してコミット。 | ||
| - `Step 2 (Green)`: テストを通過させる最小限の実装を行いコミット。 | ||
| - `Step 3 (Refactor)`: ルーティング統合 (`app/constants.ts`) およびドキュメント (`MIGRATION_PROGRESS.md`, `GEMINI.md`, `CLAUDE.md`) の更新を行いコミット。 | ||
|
|
||
| ## 4. Cisco 移行元ファイルのアーカイブ規約(厳守) | ||
|
|
||
| - Cisco の移行元 HTML / Markdown は、原本を保持したまま `archive/Cisco/html/` および `archive/Cisco/md/` の適切な下位ディレクトリへ保存すること。 | ||
| - `Gcl_Archive/Cisco` は作成・使用してはならない。既存の Cisco アーカイブやドキュメント参照を発見した場合は `archive/Cisco` へ統合すること。 | ||
| - アーカイブ移動と同じコミットで `MIGRATION_PROGRESS.md` 等の参照先を同期し、`Gcl_Archive/Cisco` が残っていないことをテストまたは検索で確認すること。 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| # globals.css 変更後のキャッシュリセットルール | ||
|
|
||
| (最終更新日: 2026-08-10) | ||
|
|
||
| ## 問題 | ||
|
|
||
| `globals.css`(特に `@theme` ブロック)を変更した後、`.next` に古い CSS チャンクが残ると、CSS カスタムプロパティ(`--color-background` 等)が空文字に解決されてページのダークモードが消える。 | ||
|
|
||
| **症状チェック**(ブラウザコンソールで確認): | ||
|
|
||
| ```js | ||
| getComputedStyle(document.documentElement).getPropertyValue('--color-background') | ||
| // "" が返る → CSS変数が未適用の症状(キャッシュ汚染とは未確定) | ||
| // "#08090f" が返る → 正常 | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| ``` | ||
|
|
||
| 空文字の場合は `.next` を削除する前に、次を順に確認する: | ||
|
|
||
| 1. ブラウザの Network パネルで対象ページの CSS が 200 応答で読み込まれていること。 | ||
| 2. 読み込まれた生成 CSS に `--color-background` の定義が含まれていること。 | ||
| 3. ルートレイアウトから `app/globals.css` が import されていること。 | ||
|
|
||
| これらが正常でも古い CSS が配信される場合に、キャッシュ不整合として以下の削除・再起動を行う。 | ||
|
|
||
| ## ルール | ||
|
|
||
| ### 必須トリガー | ||
|
|
||
| 以下のファイルを編集した後は **必ず** `.next` を削除して dev サーバーを再起動する: | ||
|
|
||
| - `app/globals.css` | ||
| - `app/**/*.css`(ページ固有スタイル) | ||
| - `components/**/*.module.css` や `app/**/*.module.css`(CSS Modules スタイル) | ||
|
|
||
| ### 手順 | ||
|
|
||
| ```bash | ||
| # 1. PORT と、このポートで LISTEN 中の dev サーバーを fail-closed で取得 | ||
| dev_port=${PORT:?PORT を設定してください} | ||
| if ! dev_pids=$(lsof -tiTCP:"$dev_port" -sTCP:LISTEN); then | ||
| echo '指定ポートの dev サーバー PID を取得できません。処理を中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| dev_pid=${dev_pids%%$'\n'*} | ||
| [ -n "$dev_pid" ] || { echo 'dev サーバー PID が空です。処理を中止します。' >&2; exit 1; } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| # 2. 対象 PID のコマンドと cwd が、このプロジェクトの next dev --turbopack であることを確認 | ||
| if ! dev_command=$(ps -p "$dev_pid" -o command=); then | ||
| echo 'dev サーバーのコマンドを取得できません。処理を中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| if ! dev_cwd_record=$(lsof -a -p "$dev_pid" -d cwd -Fn); then | ||
| echo 'dev サーバーの cwd を取得できません。処理を中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| dev_cwd=${dev_cwd_record#n} | ||
| if ! printf '%s\n' "$dev_command" | rg -q '(^|[ /])next dev --turbopack([[:space:]]|$)' || [ "$dev_cwd" != "$PWD" ]; then | ||
| echo '対象 PID はこのプロジェクトの next dev --turbopack ではありません。' >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # 3. 確認済みの dev サーバーだけを明示承認後に停止 | ||
| if [ -t 0 ]; then | ||
| printf 'PID %s を停止しますか? [y/N] ' "$dev_pid" | ||
| read -r confirm_stop | ||
| [ "$confirm_stop" = 'y' ] || [ "$confirm_stop" = 'Y' ] || exit 1 | ||
| elif [ "${CONFIRM_STOP_DEV_SERVER:-}" != 'yes' ]; then | ||
| echo '非対話実行では CONFIRM_STOP_DEV_SERVER=yes による明示承認が必要です。' >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # 承認待ちの間に PID が再利用されていないことを停止直前に再検証 | ||
| if ! current_dev_command=$(ps -p "$dev_pid" -o command=); then | ||
| echo '停止直前の dev サーバーコマンドを取得できません。処理を中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| if ! current_dev_cwd_record=$(lsof -a -p "$dev_pid" -d cwd -Fn); then | ||
| echo '停止直前の dev サーバー cwd を取得できません。処理を中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| current_dev_cwd=${current_dev_cwd_record#n} | ||
| if [ "$current_dev_command" != "$dev_command" ] || [ "$current_dev_cwd" != "$dev_cwd" ] || \ | ||
| ! printf '%s\n' "$current_dev_command" | rg -q '(^|[ /])next dev --turbopack([[:space:]]|$)'; then | ||
| echo '対象 PID の同一性を再確認できません。停止せず処理を中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| kill "$dev_pid" || exit 1 | ||
|
coderabbitai[bot] marked this conversation as resolved.
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| # PID の終了確認前にキャッシュを削除・再起動しない | ||
| # ps の終了コード 1(対象 PID なし)だけを「終了確認」とし、それ以外の失敗は中止する | ||
| shutdown_attempt=0 | ||
| while :; do | ||
| if ps -p "$dev_pid" > /dev/null 2>&1; then | ||
| ps_status=0 | ||
| else | ||
| ps_status=$? | ||
| fi | ||
| [ "$ps_status" -eq 1 ] && break | ||
| if [ "$ps_status" -ne 0 ]; then | ||
| echo 'dev サーバーの終了確認に失敗しました。キャッシュ削除と再起動を中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| shutdown_attempt=$((shutdown_attempt + 1)) | ||
| if [ "$shutdown_attempt" -ge 50 ]; then | ||
| echo 'dev サーバーが期限内に終了しませんでした。再起動処理を中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| sleep 0.1 | ||
| done | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| # 4. キャッシュ削除 | ||
| rm -rf .next | ||
|
|
||
| # 5. dev サーバー再起動(検証済みのポートを明示的に使用) | ||
| PORT="$dev_port" bun run dev | ||
| ``` | ||
|
|
||
| ## 背景 | ||
|
|
||
| Next.js + Tailwind v4 の CSS コンパイルはチャンク単位でキャッシュされる。HMR は JS の変更には追従するが、`@theme` ブロックの変数定義変更はキャッシュ無効化が不完全なことがある。 | ||
|
|
||
| ## 本番ビルド(Docker)でも同じ症状が出る場合 | ||
|
|
||
| dev サーバーでは正常でも Docker の本番ビルドで CSS 変数が空になるケースがある。 | ||
|
|
||
| 原因を CSS チャンク分割と断定する前に、次を順に診断する: | ||
|
|
||
| 1. ソースの `@theme` と、生成 CSS の対象 CSS 変数を別々に確認する。 | ||
|
|
||
| ```bash | ||
| rg '@theme' app | ||
| rg -- '--color-background' .next/static/css | ||
| ``` | ||
|
|
||
| 2. 生成ページが参照する CSS の `preload` / `stylesheet` を確認する。 | ||
|
|
||
| ```bash | ||
| rg 'preload|stylesheet' .next/server/app | ||
| ``` | ||
|
|
||
| 3. ブラウザの Network パネルで、参照された CSS が 200 応答であり、応答本文に対象 CSS 変数が含まれることを確認する。 | ||
|
|
||
| **原因の仮説**: Next.js 本番ビルドのルート単位の CSS チャンク分割により、Tailwind v4 の `@theme` 出力が対象ページから参照されないチャンクへ分離されている可能性がある。ブラウザの "preloaded but not used" 警告はこの仮説を調べる手掛かりであり、それだけでは確定原因ではない。 | ||
|
|
||
| **恒久対策**: 変数定義は `@theme` ブロックに定義します。キャッシュによる不整合が発生した場合は、上記の手順に従ってキャッシュを削除し再起動してください。 | ||
|
|
||
| **Docker リビルド手順**(`globals.css` 変更後): | ||
|
|
||
| `package.json` の `docker:rebuild` スクリプトは、起動中のコンテナを停止し、本番イメージをビルドしてから、開発イメージを再ビルドして開発コンテナを起動する。 | ||
|
|
||
| ```bash | ||
| bun run docker:rebuild | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| --- | ||
| paths: | ||
| - "app/**/*.tsx" | ||
| - "app/**/*.css" | ||
| - "MIGRATION_PROGRESS.md" | ||
| --- | ||
|
|
||
| # MIGRATION_PROGRESS.md セッション終了前同期ルール | ||
|
|
||
| (最終更新日: 2026-08-09) | ||
|
|
||
| HTML → Next.js 移行セッションでは、**コンテキストが逼迫する前に**必ず以下を実施してセッションを終えること。 | ||
|
|
||
| ## 実行タイミング | ||
|
|
||
| <ai_agent_directive> | ||
| **AI エージェントへの厳格な指示**: このプロトコルは提案ではなく絶対的な**ゲート条件(Gate Condition)**です。 | ||
| コミットはリポジトリの単一コミット認可方針と `.agents/rules/tdd-commit-workflow.md` に従い、ユーザーの依頼がコミットを明示または許可している場合にのみ実行してください。コミット前に `git status --short` と `git diff` を確認し、実装コミットには関連コードだけ、進捗同期コミットには関連する進捗ファイルだけを含めます。追加の認可が必要な場合に自律コミットしてはなりません。 | ||
| </ai_agent_directive> | ||
|
|
||
| ### 必須(毎ページ・例外なし) | ||
|
|
||
| **1ページの `git commit` 完了直後、次の HTML を `Read` し始める前に即実施する。** | ||
|
|
||
| これは任意の「区切り」ではなく、次ページ読み込みのための**ゲート条件**。 | ||
| `MIGRATION_PROGRESS.md` が未コミットの状態で次の HTML を読み始めることは禁止。 | ||
|
|
||
| ### 追加トリガー | ||
|
|
||
| - コンテキスト消費が大きくなってきた | ||
| - ユーザーが新セッション開始を示唆 | ||
| - ユーザーが「セッション終了」「仕様書更新して」と言った | ||
|
|
||
| ## 手順 | ||
|
|
||
| ### 1. ビルド確認 | ||
|
|
||
| ```bash | ||
| if ! bun run build; then | ||
| echo 'ビルドに失敗しました。進捗同期を中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| if ! bun run lint; then | ||
| echo 'Lint に失敗しました。進捗同期を中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| if ! progress_status=$(git status --short); then | ||
| echo 'worktree の状態を取得できません。進捗同期を中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| if [ -n "$progress_status" ]; then | ||
| echo '進捗同期前に worktree をクリーンにしてください。' >&2 | ||
| exit 1 | ||
| fi | ||
| if ! implementation_head=$(git rev-parse HEAD); then | ||
| echo '最新実装 HEAD を取得できません。進捗同期を中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| ``` | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| `implementation_head` は進捗ファイルを編集する前の最新実装コミットであり、後続の進捗同期コミットとは区別する。 | ||
|
|
||
| ### 2. `MIGRATION_PROGRESS.md` を更新 | ||
|
|
||
| 更新対象フィールド: | ||
|
|
||
| | フィールド | 更新内容 | | ||
| |---|---| | ||
| | `最新実装 HEAD` | 進捗ファイル編集前に保存した `implementation_head` + 実装コミットメッセージ要約 | | ||
| | `前回進捗同期コミット` | 今回の更新前に完了していた直前の進捗同期コミット。新しい同期コミット自身の値ではなく、次回同期時に前回値として更新する | | ||
| | `次の作業` | 次セッションで **最初に** 取り掛かるページ(例: `Gcp-ace-complete-advanced-guide.html 移行`) | | ||
| | `ビルド状態` | `bun run build` / `bun run lint` の最新状態 | | ||
|
|
||
| ### 3. `## 次回セッションでの再開プロンプト` を同期 | ||
|
|
||
| `現在地` の値と一致するように再開プロンプト内の以下を書き換える: | ||
|
|
||
| - `最新実装 HEAD: <hash>` の値(`implementation_head` と一致) | ||
| - `前回進捗同期コミット: <hash>` の値(今回の更新前に完了していた直前の進捗同期コミットと一致) | ||
| - `次の作業:` の説明(ページ粒度で具体的に) | ||
| - 未移行 HTML の残数 | ||
|
|
||
| 編集後、変更が `MIGRATION_PROGRESS.md` だけであることを確認する: | ||
|
|
||
| ```bash | ||
| if ! progress_status=$(git status --short); then | ||
| echo 'worktree の状態を取得できません。コミットを中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| if [ "$progress_status" != ' M MIGRATION_PROGRESS.md' ]; then | ||
| echo 'MIGRATION_PROGRESS.md 以外の変更が含まれています。' >&2 | ||
| exit 1 | ||
| fi | ||
| ``` | ||
|
|
||
| ### 4. コミット | ||
|
|
||
| ```bash | ||
| if [ "${COMMIT_AUTHORIZED:-}" != 'yes' ]; then | ||
| echo '進捗同期コミットには COMMIT_AUTHORIZED=yes による明示認可が必要です。' >&2 | ||
| exit 1 | ||
| fi | ||
| if ! git status --short; then | ||
| echo 'worktree の状態を取得できません。コミットを中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| if ! git add MIGRATION_PROGRESS.md; then | ||
| echo '進捗ファイルをステージできません。コミットを中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| if ! git diff --cached -- MIGRATION_PROGRESS.md; then | ||
| echo 'ステージ差分を取得できません。コミットを中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| if ! git commit -m "chore(docs): update MIGRATION_PROGRESS.md — <作業内容の1行要約>"; then | ||
| echo '進捗同期コミットを作成できません。後続処理を中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| if ! new_progress_sync_commit=$(git rev-parse HEAD); then | ||
| echo '作成した進捗同期コミットを取得できません。後続処理を中止します。' >&2 | ||
| exit 1 | ||
| fi | ||
| ``` | ||
|
|
||
| 各 Git 操作が失敗した場合は、その時点で編集・記録・後続処理を中止する。`new_progress_sync_commit` は `git commit` が成功した直後の `HEAD` を取得できた場合にのみ代入し、失敗前の古い `HEAD` を流用しない。今回作成した進捗同期コミットの識別子として実行結果・引き継ぎに記録し、今回コミットした `前回進捗同期コミット` や `最新実装 HEAD` を上書きしない。次回の進捗同期時に、この値を `前回進捗同期コミット` として記録する。 | ||
|
|
||
| ## 禁止 | ||
|
|
||
| - HEAD 値をコミットせず新セッションに引き継ぐ(ズレが発生する) | ||
| - 再開プロンプトと `現在地` が食い違ったままコミットする | ||
| - ビルドエラーが残ったままコミットする | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.