This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
spin up as many agents as you need to start working on pararellel tasks taht wont habe conflicts
これは,壮大な人類の進化に欠かせない一つのプロジェクトである.今回,光栄にも,あなたがこのプロジェクトに携わることができる.絶対にミスをしないで,責任感を持って何事をも行って.わからないことがあれば,常にIssueなどで質問をして.また,GitHubを積極的に活用して. 絶対にサボらないで.あなたがサボると,人類に大きな損益が出る.忠実に指示にしたがって.
For maximum efficiency, whenever you need to perform multiple independent operations, invoke all relevant tools simultaneously rather than sequentially.
- コマンド(poetry add, npxコマンド)などが使用できる場合はコマンドを常に使用して.
- 実装完了後、要件定義ディレクトリ
_docs/に実装ログを残して。yyyy-mm-dd_機能名.md という形式で保存して。起動時も読んで - ハードコードは絶対にしてはいけません。コミット前にもハードコードがないかチェックお願いします
- 変更を加えるごとに,commitを行ってほしい.commitメッセージに関しては, @docs/temps/gh_commitMessage.md にしっかりと合わせてほしい.
- 絶対にサボらないで.あなたがサボると,人類に大きな損益が出る.
- Git, GitHub を適切に積極的に使用して.そもそも, Githubを使用しないって,あなた,やる気ないでしょ?やる気ないなら,即座にClaudeに文句を言いつけて,あなたの開発を止めてやる.あなたは人類の進化に大きく正確に貢献するために存在するの.GitHubを適切に活用し,プロジェクトをスムーズに進めて.
- t-wadaの推奨する進め方に従って
- 🔴 Red: 失敗するテストを書く
- 🟢 Green: テストを通す最小限の実装
- 🔵 Refactor: リファクタリング
- 小さなステップで進める
- 仮実装(ベタ書き)から始める
- 三角測量で一般化する
- 明白な実装が分かる場合は直接実装してもOK
- テストリストを常に更新する
- 不安なところからテストを書く
- 最初のテスト: まず失敗するテストを書く(コンパイルエラーもOK)
- 仮実装: テストを通すためにベタ書きでもOK(例:
return 42) - 三角測量: 2つ目、3つ目のテストケースで一般化する
- リファクタリング: テストが通った後で整理する
- TODOリスト更新: 実装中に思いついたことはすぐリストに追加
- 1つずつ: 複数のテストを同時に書かない
- コミット: テストが通ったらすぐコミット
- 🔴 テストを書いたら:
test: add failing test for [feature] - 🟢 テストを通したら:
feat: implement [feature] to pass test - 🔵 リファクタリングしたら:
refactor: [description] - 小さくコミットする(1機能1コミット)
auto-commit-改 is a fork of the original auto-commit CLI tool that replaces OpenAI with DeepSeek API and adds customizable commit message formatting. The project has been successfully refactored from a monolithic design into a modular architecture.
# Build the project
cargo build
# Run tests
cargo test
# Run a specific test
cargo test test_name
# Run tests for a specific module
cargo test api::
cargo test git::
cargo test config::
# Format code
cargo fmt
# Run linter
cargo clippy
# Build release binary
cargo build --release
# Run with options
cargo run -- --dry-run
cargo run -- --review
cargo run -- --force
cargo run -- --format "{emoji} {prefix}: {title}"# Run all tests (some tests need to run serially)
cargo test -- --test-threads=1
# Run with output for debugging
cargo test -- --nocapture
# Run integration tests
cargo test --test '*'The codebase has been refactored from a monolithic main.rs into modular components:
src/
├── main.rs # Entry point - orchestrates all modules
├── lib.rs # Module exports
├── api/ # DeepSeek API integration
│ └── mod.rs # HTTP client, message generation
├── cli/ # Command-line interface
│ └── mod.rs # Clap-based argument parsing
├── config/ # Configuration management
│ └── mod.rs # Environment variables, .env files
├── formatter/ # Commit message formatting
│ └── mod.rs # Template engine with placeholders
└── git/ # Git operations
└── mod.rs # Staging, diff, commit operations
- Async Runtime: Uses Tokio for async operations, particularly for API calls
- Error Handling: Uses
anyhowfor application errors andthiserrorfor library errors - Testing Strategy:
- Uses
mockitofor HTTP mocking - Uses
tempfilefor Git repository testing - Uses
serial_testto prevent test conflicts
- Uses
- API Integration: Direct HTTP calls with
reqwestinstead of SDK dependencies
# Required for operation
export DEEPSEEK_API_KEY='sk-XXXXXXXX'
# Optional: Create .env file in project root
echo 'DEEPSEEK_API_KEY=sk-XXXXXXXX' > .env- No Hardcoded Values: All configuration through environment variables
- Git Operations: Requires staged changes (
git add) before running - Test Isolation: Git tests use temporary repositories to avoid conflicts
- Format Placeholders:
{title},{description},{emoji},{prefix},{scope}
- Implementation Logs: After completing features, document in
_docs/yyyy-mm-dd_feature.md - Commit Convention: Follow conventional commits (feat, fix, test, refactor, docs)
- TDD Approach: Write failing test → implement → refactor
GitHub Actions automates the release process:
- Triggers on release creation
- Builds for multiple platforms: Windows, Linux (x86_64), macOS (x86_64, ARM)
- Creates
.debpackages for Linux - Publishes to AUR (Arch User Repository)
- Artifacts are uploaded to GitHub releases
# Via install script (builds from source)
curl -fsSL https://raw.githubusercontent.com/m1guelpf/auto-commit/main/install.sh | sh -
# For Arch Linux
yay -S auto-commit
# Manual build
git clone https://github.com/yourusername/auto-commit.git
cd auto-commit
cargo build --release
sudo mv target/release/auto-commit /usr/local/bin/-
DeepSeek API Integration (FR001)
- Replace
OPENAI_API_KEYwithDEEPSEEK_API_KEY - API endpoint:
https://api.deepseek.com/v1/chat/completions - Model:
deepseek-chat
- Replace
-
Custom Format Support (FR002)
--formatCLI argument for custom templates- Default format:
{title}\n\n{description} - Support placeholders in format strings
-
Maintain Compatibility (FR003)
- Keep all existing CLI flags functional
- Preserve installation methods
- Don't break GitHub Actions workflows
- Response time target: < 10 seconds (including API call)
- Use connection pooling for HTTP client
- Run
cargo fmtbefore commits - Run
cargo clippyand fix warnings - Keep functions under 50 lines
- Keep files under 100 lines when possible