Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 13m53s
## HTTP Client Refactoring - Create unified HttpClient module (src/http_client.rs) - Refactor 24 files to use shared HTTP client - Replace .unwrap() with proper error handling - Eliminate code duplication in HTTP requests ## Project Restructuring - Rename package: ai → aibot - Add dual binary support: aibot (main) + ai (compatibility alias) - Migrate config directory: ~/.config/ai/ → ~/.config/syui/ai/bot/ - Implement backward compatibility with automatic migration ## Testing Infrastructure - Add unit tests for HttpClient - Create test infrastructure with cargo-make - Add test commands: test, test-quick, test-verbose ## Documentation - Complete migration guide with step-by-step instructions - Updated development guide with new structure - HTTP client API reference documentation - Comprehensive refactoring summary ## Files Changed - Modified: 24 source files (HTTP client integration) - Added: src/http_client.rs, src/alias.rs, src/tests/ - Added: 5 documentation files in docs/ - Added: migration setup script 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
3.7 KiB
3.7 KiB
ai.bot ドキュメント
ai.botプロジェクトの包括的なドキュメント集です。
ドキュメント一覧
開発者向け
-
- プロジェクト概要とアーキテクチャ
- 開発環境のセットアップ
- 開発ワークフローとベストプラクティス
- 新機能追加の手順
-
- HttpClientモジュールの完全なAPIリファレンス
- 使用例とサンプルコード
- エラーハンドリングのベストプラクティス
保守・運用向け
-
- パッケージ名・CLI名の変更詳細
- 段階的移行手順
- 後方互換性の説明
- トラブルシューティング
-
- HTTPクライアント共通化の詳細
- エラーハンドリング改善の記録
- 対象ファイル一覧とBefore/After
クイックスタート
1. 基本セットアップ
# 依存関係インストール
cargo install cargo-make
# プロジェクトビルド
cargo build
# テスト実行
cargo test
2. CLI使用方法
# 新しいコマンド(推奨)
./target/debug/aibot --help
# 旧コマンド(互換性)
./target/debug/ai --help
3. 設定ディレクトリ
- 新:
~/.config/syui/ai/bot/
- 旧:
~/.config/ai/
(自動移行対応)
主要な変更履歴
2025年6月6日 - 大規模リファクタリング
HTTPクライアント共通化
- 24個のファイルをHttpClientモジュールで統合
- コード重複を大幅削減
- エラーハンドリングを改善(
.unwrap()
→match
)
命名規則統一
- パッケージ名:
ai
→aibot
- CLI名:
ai
→aibot
(ai
は互換性維持) - 設定ディレクトリ:
~/.config/ai/
→~/.config/syui/ai/bot/
テストインフラ構築
- ユニットテストの追加
- cargo-makeによるタスク管理
- CI/CD対応の準備
アーキテクチャ概要
ai.bot/
├── src/
│ ├── main.rs # メインCLI (aibot)
│ ├── alias.rs # 互換性CLI (ai)
│ ├── http_client.rs # 統合HTTPクライアント
│ ├── data.rs # 設定・データ管理
│ ├── game/ # ゲーム機能
│ └── tests/ # テストスイート
├── docs/ # ドキュメント
├── scripts/ # セットアップスクリプト
└── ~/.config/syui/ai/bot/ # 設定ディレクトリ
├── scpt/ # コマンドスクリプト
└── txt/ # ログファイル
サポート・問い合わせ
開発関連
- 新機能追加: 開発ガイドを参照
- API使用方法: HTTPクライアントAPIを参照
移行・運用関連
- 移行作業: 移行ガイドを参照
- トラブル: 各ドキュメントのトラブルシューティング章を参照
履歴・詳細
- 実装詳細: リファクタリングサマリーを参照
貢献ガイドライン
- コードスタイル:
cargo fmt
でフォーマット必須 - テスト: 新機能には対応するテストを追加
- エラーハンドリング:
.unwrap()
の使用禁止 - ドキュメント: 重要な変更は対応ドキュメントも更新
詳細は開発ガイドの「コントリビューション」章を参照してください。