refactor(cli): drive printHelp from command spec slice#5
Merged
watany-dev merged 6 commits intomainfrom May 1, 2026
Merged
Conversation
ヘルプ文言を `commandUsages` スライスに集約し、`printHelp` がそこから生成するよう変更。コマンド追加時のヘルプ更新漏れを防ぐ。
`AGENT.md` を標準スペックの `AGENTS.md` (複数形) に統合。元の `AGENTS.md` は単なるポインタだったため削除し、本文をリネーム後のファイルへ集約。`.agents/skills/` 内の参照も追従。
- 手動運用の「最終更新」行を削除(git 履歴で代替) - 「MVP ではまだ導入していない」「## MVP コマンド」等の MVP 表記を現状記述に置換 - 約 540 行の旧 main.go プロトタイプ節を削除(責務は internal/cli・internal/git・internal/notify に分割済み)
L205 のリンクが `/workspaces/gitreal/...` という devcontainer 依存の絶対パスだったため、相対パス `docs/development-memo.md` に修正。
148 行の Node.js テンプレートが残っていたため Go 用の最小セットに置換。`/git-real` バイナリ、`coverage.out`、`*.test`、`.cache/` 等の Go 関連と一般的なエディタ/OS 由来ファイルのみに絞った。
`./cmd/git-real` が build と deadcode の 2 ターゲットでハードコードされていたため、`MAIN_PKG` 変数として 1 箇所に集約。
There was a problem hiding this comment.
Pull request overview
CLI のヘルプ文言をコード上の単一スライスに集約し、printHelp がそこから出力を生成する形にリファクタしています。あわせて、設計メモ/エージェント向けガイドの整理と、ビルド・無視ファイルの整備でリポジトリの整合性を上げる変更です。
Changes:
internal/cli/app.goのヘルプ出力をcommandUsagesから生成するように変更AGENT.mdをAGENTS.mdに統合し、関連する skill ドキュメント参照を更新- ドキュメント/開発補助(README リンク、Makefile 変数化、.gitignore の整理)を更新
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/cli/app.go | commandUsages スライスから printHelp の Usage を生成するよう変更 |
| docs/development-memo.md | コマンド一覧セクションの整理、初期プロトタイプの大幅削除などメモのスリム化 |
| README.md | development-memo へのリンクをリポジトリ相対パスに修正 |
| Makefile | MAIN_PKG 変数を導入し、build/deadcode で参照を統一 |
| AGENTS.md | Codex ガイドをここに集約(旧 AGENT.md の内容を移植) |
| AGENT.md | ファイル削除(AGENTS.md へ統合) |
| .gitignore | Node 系テンプレ由来の項目を削除し、Go/生成物中心に整理 |
| .agents/skills/update-plan/SKILL.md | 参照先を AGENTS.md に更新 |
| .agents/skills/update-docs/SKILL.md | 参照先を AGENTS.md に更新 |
| .agents/skills/update-design/SKILL.md | 参照先を AGENTS.md に更新 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+8
to
+10
| Repo-local skills live under `skills/`. | ||
|
|
||
| Note: the reference repository uses `.agents/skills/`, but this workspace mounts hidden top-level agent directories read-only. Keep the same skill content here under `skills/`. |
Comment on lines
+16
to
+45
| The current product shape from `README.md` and `docs/development-memo.md` is: | ||
|
|
||
| - 2-minute push challenge triggered by notification timing | ||
| - default dry-run behavior | ||
| - destructive mode enabled only by explicit `git real arm` | ||
| - backup and recovery through `refs/gitreal/backups/...` | ||
| - planned implementation language: Go | ||
|
|
||
| Current MVP command set: | ||
|
|
||
| ```text | ||
| git real init | ||
| git real status | ||
| git real once | ||
| git real start | ||
| git real arm | ||
| git real disarm | ||
| git real rescue list | ||
| git real rescue restore <ref> | ||
| ``` | ||
|
|
||
| ## Current Source Of Truth | ||
|
|
||
| Until the Go implementation exists, treat these as the primary project documents: | ||
|
|
||
| - `README.md` | ||
| - `docs/development-memo.md` | ||
| - `AGENTS.md` | ||
|
|
||
| Keep those three aligned. |
Comment on lines
+24
to
+35
| Current MVP command set: | ||
|
|
||
| ```text | ||
| git real init | ||
| git real status | ||
| git real once | ||
| git real start | ||
| git real arm | ||
| git real disarm | ||
| git real rescue list | ||
| git real rescue restore <ref> | ||
| ``` |
Comment on lines
+529
to
+530
| "git real once [--grace-seconds=120]", | ||
| "git real start [--grace-seconds=120]", |
| "git real arm", | ||
| "git real disarm", | ||
| "git real rescue list", | ||
| "git real rescue restore <backup-ref>", |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ヘルプ文言を
commandUsagesスライスに集約し、printHelpがそこから生成するよう変更。コマンド追加時のヘルプ更新漏れを防ぐ。