redi
AGENTS.md5 starsChanged 3 months agoMITView on GitHub
This file provides guidance to Agents when working with code in this repository. - 操作主体は人(非エージェント) - TUI から入った対話入力 (更新・作成・工数・wiki) をキャンセルしても redi を終了させず、 同じ絞り込み・カーソル位置の TUI に戻す - 削除操作は誤操作の戻しやすさに応じて操作完了までの手間の大小を変える - issue: ダイアログを開き issue_id を打ち直させる(issueに付随する添付ファイルやコメントが削除されるので重く見ている) - wiki: ダイアログを開き DELETE と打たせる(数値idが無く、タイトルは日本語もあり打ち直させられないため確認語にしている) - コメント : ステータスバーの y/N - time_entry : ステータスバーの y/N
In this repository3 other files it gives its agents.
- site/AGENTS.mdAGENTS.md
- dogfooding-rediSkill
- dogfooding-rediSkill
The file
Files
AGENTS.md
This file provides guidance to Agents when working with code in this repository.
Project
rediは Redmine REST API を実行する Python 製 CLI/TUI- Python 3.15+
- uv 管理
- PyPIでは
redtileとして配布されている
Commands
task(go-task) がタスクランナー$ task task: [default] task --list-all --sort none task: Available tasks for this project: * default: list * check: format, lint, typecheck, test * format: format * lint: lint * typecheck: typecheck * test: run tests (except E2E) * test:e2e: run E2E tests (all target Redmine versions) * test:e2e:6.1: run E2E tests against Redmine 6.1 * test:e2e:7.0: run E2E tests against Redmine 7.0 * release: release next version * demo: generate demo
CLI 設計方針
- 引数が不足する場合は対話的に入力させる
- ただしエージェントやCIが非TTY環境で実行できるよう、引数だけで完結する形も用意する
- 非TTY環境で引数が不足した場合は、対話に入らず何の入力を求めたかを示して exit 1 する
redi.cli.interactiveのprompt/ensure_interactiveを経由させるinline_choice/inline_checkbox/open_editorは内部でensure_interactiveを呼んでいる
- エラーや失敗の通知は
redi.outputのeprintで標準エラー出力に出す- 正常な結果は標準出力のまま
- 対話入力のキャンセルは
redi.cli.interactiveのInputCanceledExceptionに揃える- Ctrl-C / Ctrl-D は
raise_on_cancelで受けてこの例外に変換する - 項目未選択や題名が空などユーザーの「やめる」も
sys.exitせずこの例外を送出する - CLI では
redi.cli.main.mainがeprintで通知して exit 1 にする - TUI から呼んだ経路では TUI ループが受けて元の画面に戻し、ステータスバーに通知する
- Ctrl-C / Ctrl-D は
TUI 設計方針
- 操作主体は人(非エージェント)
- TUI から入った対話入力 (更新・作成・工数・wiki) をキャンセルしても redi を終了させず、 同じ絞り込み・カーソル位置の TUI に戻す
- 削除操作は誤操作の戻しやすさに応じて操作完了までの手間の大小を変える
- issue: ダイアログを開き issue_id を打ち直させる(issueに付随する添付ファイルやコメントが削除されるので重く見ている)
- wiki: ダイアログを開き
DELETEと打たせる(数値idが無く、タイトルは日本語もあり打ち直させられないため確認語にしている) - コメント : ステータスバーの y/N
- time_entry : ステータスバーの y/N
層構造
- ※ コードの現状を示すものではなくあくまで志向
tui/cli/service/: CLI や TUI と、 APIの間に入るコードapi/の役割が大きくなっているものを分割することと、CLI/TUI から呼び出しやすい構造にすることが目的。wiki_serviceなどredmineのリソース毎に作る
api/: Redmine のAPI呼び出し、レスポンス型の定義、ステータスコードの解釈- 404 / 409 / 422 などは例外や
Noneに変換して返し、HTTP を呼び出し元に見せない
- 404 / 409 / 422 などは例外や
- 基本的には以下の依存関係を保つ
tui->servicecli->serviceservice->api
テスト
- 守りたい仕様をテストとして書く
- 実装やライブラリの都合でそうなっているだけの挙動はテストとして書かない
- HTTP の正しさは CLI の E2E (
task test:e2e) で担保する - docstring に守りたい仕様を日本語で書く(
pytest -vに一覧として表示される)
i18n
- 英語と日本語の二言語に対応している(デフォルトは英語)
src/redi/i18n/に実装が集約されている_protocol.pyにキーを定義してja.pyとen.pyで対応する値を実装するtests/unit/test_i18n.py
Contributing
- see CONTRIBUTING.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

