Skip to content

feat(#496): doc-light モード適用スクリプトを追加(mode 分類に変更種別軸 + doc-light)#503

Merged
s977043 merged 3 commits into
mainfrom
feat/issue-496-doc-light-mode
Jun 8, 2026
Merged

feat(#496): doc-light モード適用スクリプトを追加(mode 分類に変更種別軸 + doc-light)#503
s977043 merged 3 commits into
mainfrom
feat/issue-496-doc-light-mode

Conversation

@s977043

@s977043 s977043 commented Jun 8, 2026

Copy link
Copy Markdown
Owner

概要

issue #496 対応。mode-classification.mdHO パス)に 変更種別軸(doc/config/code)+ doc-light モード を追加するための apply スクリプトを用意する。

AI は HO パスを直接編集できない(HO 常時 block)ため、本 PR は 非HO の apply スクリプト 1 本のみを追加する。HO 実適用(mode-classification.md 変更)は Human が dry-run 確認後に実行する(責務4分類: HO 実適用は Human)。

適用フロー(Human)

# 1. 差分プレビュー(mode-classification.md は変更されない)
sh scripts/apply-mode-classification-doc-light.sh --dry-run
# 2. 内容を承認(C-3 相当の判断)したうえで適用
sh scripts/apply-mode-classification-doc-light.sh

doc-light モード仕様(スクリプトが挿入する内容)

項目 内容
対象 変更種別 = doc かつ ultra-light / light 相当
スキップ V-2 / V-3 / V-4 / 単独リリース
既定リリース 次回機能リリースに同梱(doc-only で単独 tag/Release を切らない)
維持(必須) L-0 / doc 専用 V-1(リンク切れ・正本整合・実行例到達性)/ PR / C-4
除外(安全側) md/docs 以外を含む / 承認境界周辺の .md(最低 high 優先)/ コード追従を要する API 契約

変更種別軸は 5 段階規模モードと直交する補助軸として追加(既存モード体系は不変)。

スクリプト品質

  • 冪等: doc-light が既に存在すればスキップ
  • dry-run: --dry-run で unified diff プレビュー(書き込みなし)
  • アンカー検証: 挿入位置(## フェーズ適用マトリクス)が見つからなければ exit 1

注記

mode 体系(承認境界周辺)の変更のため、Human の C-3 判断後に適用してください。本 PR マージ後も実適用までは doc-light は有効化されません。Issue は実適用完了後にクローズ想定(本 PR は Refs #496)。

🤖 Generated with Claude Code

mode-classification.md(HO パス)に「変更種別軸(doc/config/code)+ doc-light
モード」を追加するための apply スクリプトを用意する。AI は HO パスを直接編集
できないため、本スクリプト(非HO)を AI が作成し、Human が dry-run で差分確認の
うえ適用する(責務4分類: HO 実適用は Human)。

doc-light モード仕様:
- 対象: 変更種別=doc かつ ultra-light/light 相当
- スキップ: V-2 / V-3 / V-4 / 単独リリース
- 既定: 次回機能リリースに同梱(doc-only で単独 tag/Release を切らない)
- 維持: L-0 / doc 専用 V-1(リンク切れ・正本整合・実行例到達性)/ PR / C-4
- 除外(安全側): md/docs 以外を含む / 承認境界周辺の .md(最低 high 優先)/
  コード追従を要する API 契約

スクリプトは冪等(doc-light 既存ならスキップ)・dry-run 対応・アンカー検証付き。

Refs #496

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

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Check PR Issue Link: WARN: no closing keyword found (expected one of: closes #N / fixes #N / resolves #N)

  • 推奨: PR 本文に closes #N / fixes #N / resolves #N を含めてください
  • 対象外の場合: PR に chore / documentation ラベルを付けるか、PR 本文に <!-- skip-issue-link-check --> を含めてください
  • 詳細: Issue #159

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new shell script, apply-mode-classification-doc-light.sh, which appends a "doc-light" mode section to the mode-classification.md rules file. The review feedback points out that the script's argument validation is insufficient, as any invalid option other than --dry-run would trigger the actual file modification. A code suggestion was provided to strictly validate arguments and prevent accidental writes.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +18 to +19
DRY_RUN=0
[ "${1:-}" = "--dry-run" ] && DRY_RUN=1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

引数の検証が不十分なため、--dry-run 以外の無効なオプション(例: --dryrun--help などのタイポ)を指定した場合でも、エラーにならずに実適用(ファイルの書き込み)が実行されてしまいます。意図しない書き込みを防ぐため、引数を厳密にチェックして無効なオプションが指定された場合はエラー終了するように改善することを推奨します。

Suggested change
DRY_RUN=0
[ "${1:-}" = "--dry-run" ] && DRY_RUN=1
DRY_RUN=0
if [ $# -gt 0 ]; then
if [ "$1" = "--dry-run" ] && [ $# -eq 1 ]; then
DRY_RUN=1
else
echo "ERROR: Invalid arguments. Usage: $0 [--dry-run]" >&2
exit 1
fi
fi

PR #503 の Gemini review(high)反映。--dry-run 以外の無効オプション
(--dryrun タイポ等)が実適用をトリガーする問題を修正。引数を厳密検証し、
不正引数は exit 1 で停止する。意図しない HO 書き込みを防ぐ。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@s977043 s977043 added the documentation Improvements or additions to documentation label Jun 8, 2026
@s977043
s977043 merged commit cc73ccf into main Jun 8, 2026
5 checks passed
@s977043
s977043 deleted the feat/issue-496-doc-light-mode branch June 8, 2026 09:26
@s977043

s977043 commented Jun 8, 2026

Copy link
Copy Markdown
Owner Author

Gemini 指摘(high)へ対応済み(commit 484d9e2

  • --dry-run 以外の無効引数(--dryrun タイポ等)が実適用をトリガーする問題を修正。引数を strict 検証し、不正引数は exit 1 で停止します。
  • 実機検証: --dryrun → exit 1 / --dry-run → dry-run 正常動作 を確認済み。

意図しない HO 書き込みを防ぐガードとして妥当なご指摘でした。

s977043 added a commit that referenced this pull request Jun 22, 2026
PR #503 の Gemini review(high)反映。--dry-run 以外の無効オプション
(--dryrun タイポ等)が実適用をトリガーする問題を修正。引数を厳密検証し、
不正引数は exit 1 で停止する。意図しない HO 書き込みを防ぐ。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
s977043 added a commit that referenced this pull request Jun 22, 2026
feat(#496): doc-light モード適用スクリプトを追加(mode 分類に変更種別軸 + doc-light)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant