feat: usagi issue サブコマンドを追加(CRUD・検索・ready 表示)(#024)#56
Merged
Conversation
タスク issue を .usagi/issues/ に frontmatter 付き markdown + JSON index で 永続化する基盤を追加する。 - domain/issue: Issue/IssueSummary/IssueStatus/IssuePriority と frontmatter の読み書き、dependson、ファイル名スラッグ - infrastructure/issue_store: markdown 走査・読み書き、index.json の生成と 自動再構築、採番、アトミック書き込み - usecase/issue: create/get/list/search/update/delete と、dependson が全て done な「着手可能(ready)」判定(list/search に付与) - usecase/project: usagi init の .gitignore を選択的除外へ変更し .usagi/issues/ のみ git 共有(index.json は除外、レガシー .usagi/ は移行) - document/: アーキテクチャ・データ永続化に issue ストア仕様を追記 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
issue ストア(#23)を CLI から操作する usagi issue を追加する。 - presentation/cli/issue: create/list/show/update/search/delete を clap サブコマンドで実装。--json で機械可読出力(MCP・スクリプト連携向け) - list/search は dependson が全て done な「着手可能(ready)」を可視化し、 ブロック中の issue には未達の依存番号を併記。--ready で絞り込み可 - delete は誤削除防止のため --yes 必須 - main.rs に Issue サブコマンドを配線 - document/ と README に usagi issue の使い方を追記 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts: # README.md # document/02-architecture.md # document/03-commands.md
📊 Test Coverage
🎉✨ パーフェクト!全ファイル Lines カバレッジ 100% を達成しました 🏆🐰 |
kkyosuke
added a commit
that referenced
this pull request
Jun 20, 2026
## 目的 issue #56 への対応。`src/presentation/tui/home/state/mod.rs`(1324 行)に集中していた責務を分解し、規約(1 ファイル 300 行目安・state は表示文字列を持たない)に寄せる。 ## 変更内容 ### 1. 表示文字列を ui 層へ退避(責務違反の解消) - `session list` の整形と「ライブセッションなし」ヒントを新設の `ui/content.rs` へ移動。state は構造化データ(`sessions()`)だけを渡し、整形・モーダル/一行の出し分けは `ui::content::session_list` が担う。 - これにより state のユニットテストが文字列に依存しなくなった(該当テストは `ui/content.rs` 側へ移動)。 - 退避により dead だった `hint_no_live_session` も ui の関数 + テストへ移し、state から削除。 ### 2. サブモードを独自型へ切り出し - create 入力 / rename 入力 / remove モーダル / focus メニューの各サブ状態を `state/modal.rs` の型(`CreateInput` / `RenameInput` / `RemoveModal` / `FocusMenu`)へ集約。編集・カーソル移動・確定・カーソルラップのロジックを各型のメソッドとして公開し、`HomeState` 側の薄い委譲メソッド群(約 30 個)を削除。 - `HomeState` は `create()/create_mut()` などのアクセサと begin/confirm/cancel のライフサイクルのみを保持。イベントハンドラ・ui・テストは型のメソッドを直接呼ぶ。 - `validate_session_name` も `CreateInput` 側へ集約(重複呼び出しを排除)。 ### 3. dispatch+history+modal ロジックの統合(潜在バグ修正) - `submit`(統括)と `focus_prompt_submit`(在席プロンプト)に重複していた「trim→空 early-return→dispatch→history push→ShowText 分岐」を `dispatch_and_record` / `record_response` 共通ヘルパへ集約。 - focus-prompt 経由でも `response_start` を設定するようにし、後で 統括(Overview)へ切り替えた際に結果バンドが古いログを混ぜて表示しうる不整合を解消。両経路でログ/モーダル挙動が一致する。 ## テスト・確認方法 - `cargo fmt` / `cargo clippy --all-targets -- -D warnings` / `cargo test` をパス。 - カバレッジ 100%(lines / functions)を維持。 - `state/mod.rs` は約 190 行削減。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: test <test@example.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 20, 2026
kkyosuke
added a commit
that referenced
this pull request
Jun 20, 2026
## 目的 性能 / UI 応答性・フィードバック / 責務の肥大化 の 3 観点で現行コードをレビューし、まだ issue 化されていない新規所見を issue ストア(`.usagi/issues/`)に登録する。 既存 issue でカバー済みの所見(#40 history append、#44/#57 handlers 引数過多、#45/#56 HomeState 肥大、#61 config 責務、#62 毎フレーム再計算・store 全再構築 など)は重複登録せず除外した。 ## 変更内容 新規 issue 5 件を追加(`index.json` はキャッシュのため gitignore 対象・非コミット): | # | 種別 | 優先度 | 概要 | |---|---|---|---| | 65 | perf(tui) | high | エージェント高頻度出力時の全画面再描画コアレス・`link_cells` 全走査キャッシュ・Switch プレビュー差分化(没入 `drive` の最適化が出力経路/プレビューに未展開) | | 66 | fix(tui) | medium | 統括/在席モードで背景状態(バッジ・update 通知)の反映が次のキー入力まで遅延(`animate` 条件が live セッションを見ていない) | | 67 | chore(tui) | medium | `coming-soon` プレースホルダコマンドが規約「記載=実装済み」に違反(doctor は実装済みなのに placeholder) | | 68 | perf(tui) | low | アイドル時のポーリング起床(`wait` 250Hz・watcher 空時 5Hz)・スクロールバック常駐メモリの最適化 | | 69 | refactor(usecase) | low | `session::set_display_name` の表示ラベル解決を presentation 層へ寄せる(層責務の漏れ) | 各 issue に該当ファイル:行・原因・改善方針・確認方法を記載。 ## テスト・確認方法 - 本 PR はドキュメント(issue ストア)の追加のみでコード変更なし。 - pre-commit / pre-push フック(branch-name / coverage)通過済み。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: test <test@example.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
目的
issue #24。issue ストア基盤(#23)を CLI から操作する
usagi issueを追加する。人間が直接タスクを起票・更新・検索でき、同じ usecase を後続の MCP(#25)も再利用する。変更内容
create/list/show/update/search/deleteを clap サブコマンドで実装。run(cwd + stdout)とexecute(テスト可能な純ロジック)に分離。list/searchは各 issue が ready(dependsonが全てdoneかつ自身が未done)かを表示し、ブロック中には未達の依存番号(blocked by N)を併記。--readyで着手可能なものだけに絞り込み。--jsonで機械可読出力(スクリプト / MCP 連携向け)。deleteは誤削除防止に--yes必須。main.rsにIssueサブコマンドを配線。document/(01-overview / 03-commands / data/02-workspace)とREADME.mdに使い方を追記。テスト・確認方法
cargo fmt/cargo clippy --all-targets -- -D warnings通過。cargo test526 件パス。🤖 Generated with Claude Code