Skip to content

[Fix] next-spec-id にADR/DES通し番号共有機能を追加#171

Merged
BlueEventHorizon merged 1 commit into
developfrom
fix/160-next-spec-id-shared-numbering
Jul 6, 2026
Merged

[Fix] next-spec-id にADR/DES通し番号共有機能を追加#171
BlueEventHorizon merged 1 commit into
developfrom
fix/160-next-spec-id-shared-numbering

Conversation

@BlueEventHorizon

Copy link
Copy Markdown
Owner

概要

  • next-spec-id スキルが「複数prefixで通し番号を共有する」採番モード(--share-prefixes)をサポートしていなかった問題を修正
  • CLAUDE.mdの回避策注意書き(原本を直さず利用者側の注意で回避する構造)を解消

背景

ADR と DES は同一ディレクトリに配置され通し番号を共有する運用だが、scan_spec_ids.py はprefix単位で独立採番するため衝突しうる。これがCLAUDE.mdの重要規約に手動回避策として明文化されており、本リポジトリ自身の「原本を直す、回避策で逃げない」規約と自己矛盾していた。

やったこと

  • scan_spec_ids.py--share-prefixes オプションを追加。カンマ区切りで複数prefixを指定すると、それらすべてのファイルを横断スキャンして最大番号を計算し、指定prefixの次番号として返す(shared_with フィールドで共有先を明示)
  • start-design/SKILL.md のADR/DES採番呼び出しを --share-prefixes ADR,DES 付きに更新
  • CLAUDE.mdの回避策注意書きを削除(ツール側で保証されたため不要化)
  • セルフレビュー(/forge:review code、2ラウンド)で発見した更新漏れを含め、next-spec-id/SKILL.mdadr_format.mdspec_format.mddesign_principles_spec.md のADR採番コマンド例をすべて --share-prefixes ADR,DES に統一
  • tests/forge/scripts/test_scan_spec_ids.pyshare_prefixes 引数・CLIオプションの回帰テストを追加(既存の test_adr_id_numbering_guide.py との後方互換性を確認済み)

やらないこと(このプルリクエストのスコープ外とすること)

  • .doc_structure.yaml での宣言的な共有設定(CLIオプションで代替。将来的な拡張候補として残す)

レビュー観点

  • --share-prefixes 未指定時に既存の独立採番動作が完全に後方互換であること
  • ADR/DES採番コマンド例の記述箇所(4ファイル・6箇所)に矛盾がないこと

レビューレベル

  • Lv0: まったく見ないでAcceptする
  • Lv1: ぱっとみて違和感がないかチェックしてAcceptする
  • Lv2: 仕様レベルまで理解して、仕様通りに動くかある程度検証してAcceptする
  • Lv3: 実際に環境で動作確認したうえでAcceptする

備考

全1256件のユニットテストがpassすることを確認済み。

Closes #160

- scan_spec_ids.py に --share-prefixes オプションを追加(複数prefixを横断して最大番号を計算)
- start-design/SKILL.md のADR/DES採番呼び出しを --share-prefixes ADR,DES 付きに更新
- CLAUDE.mdの回避策注意書き(手動でADR/DES横断最大番号を計算)を削除、ツール仕様として保証
- next-spec-id/SKILL.md, adr_format.md, spec_format.md, design_principles_spec.md の
  ADR採番コマンド例を全て --share-prefixes ADR,DES に統一(セルフレビューで発見した更新漏れ含む)
- tests/forge/scripts/test_scan_spec_ids.py に share_prefixes の回帰テストを追加

Closes #160
@BlueEventHorizon BlueEventHorizon self-assigned this Jul 6, 2026
@BlueEventHorizon
BlueEventHorizon marked this pull request as ready for review July 6, 2026 11:21
@BlueEventHorizon
BlueEventHorizon merged commit 1e8c4e0 into develop Jul 6, 2026
1 check passed
@BlueEventHorizon
BlueEventHorizon deleted the fix/160-next-spec-id-shared-numbering branch July 6, 2026 11:21
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