Markdown Converter
Agent skill for markdown-converter
This is a Rust CLI tool that generates intelligent git commit messages using multiple AI services. It supports bilingual output (Chinese/English), integrates with GitHub/Gerrit for code reviews, and provides automatic commit message translation and enhancement.
Sign in to like and favorite skills
This is a Rust CLI tool that generates intelligent git commit messages using multiple AI services. It supports bilingual output (Chinese/English), integrates with GitHub/Gerrit for code reviews, and provides automatic commit message translation and enhancement.
main.rs): Command parsing and orchestration using clapai_service.rs): Abstracted AI provider implementations with async traitsconfig.rs): Service management and user preferencesgit.rs): Hook processing and commit message handlinggithub.rs), Gerrit (gerrit.rs) for remote reviewsAiService trait with chat() and translate() methodsai_service::translate_with_fallback() tries multiple services on failureterminal_format::print_progress() for user feedbackConfig structcargo build --release # Production build cargo build # Debug build
cargo test # Run all tests cargo test --lib # Library tests only
./install.sh # Quick install from source git-commit-helper install # Install git hooks in current repo
Before making any changes or contributions, always read the README.md file for the latest information on:
The README.md contains critical information that may not be reflected in these guidelines.
When updating version numbers for releases, always update both the Version field AND the %changelog section in
git-commit-helper.spec. The changelog must follow RPM format with proper date, author, and version-release format.
#[async_trait] impl AiService for MyTranslator { async fn chat(&self, system_prompt: &str, user_content: &str) -> Result<String> { // Implementation with proper error handling } }
#[derive(Serialize, Deserialize)] pub struct Config { pub default_service: AIService, pub services: Vec<AIServiceConfig>, // ... other fields }
anyhow::Result<()> for fallible operations? operator for error propagationlog::{debug, info, warn, error}tokio::mainreqwest for HTTP requests with timeout configuration<type>(<scope>): <english title> <detailed english description> <chinese title> <chinese description> Fixes: #123 PMS: BUG-456
feat: New featuresfix: Bug fixesdocs: Documentationstyle: Code style changesrefactor: Code refactoringtest: Testingchore: Maintenancehttps://github.com/owner/repo/issues/123 → Fixes: owner/repo#123https://pms.uniontech.com/bug-view-123.html → PMS: BUG-123123 → Fixes: #123#[cfg(test)] mod tests { #[test] fn test_my_function() { // Test implementation } }
Uses
assert_cmd for command-line interface testing in dev-dependencies.
PKGBUILD with makepkgdebian/ directory with debuildcompletions/src/main.rs: CLI command structure and main flowsrc/ai_service.rs: AI service abstractions and implementationssrc/commit.rs: Commit message parsing and generation logicsrc/config.rs: Configuration structures and file handlingsrc/git.rs: Git hook integration and commit processingsrc/github.rs: GitHub API interactionssrc/gerrit.rs: Gerrit API interactionssrc/terminal_format.rs: Terminal output styling and progressinstall.sh: Installation script with dependency checkingcompletions/: Shell completion filesAIService enum in config.rsAiService trait in ai_service.rsai_service::create_translator()main.rscommit.rsREADME.mdmyplatform.rs)github.rs/gerrit.rs patternsreview.rsResult types