A collection of reusable GitHub workflows and scripts that leverage AI models (Gemini, GPT) for automated code implementation, discovery, and assistance. Designed for multi-repository use with customizable prompts and flexible configuration.
- 🤖 Gemini CLI Integration: Automated code implementation and discovery workflows
- 🔧 Aider Integration: AI-powered code assistance and refactoring
- 📝 Customizable Prompts: Override default prompts with project-specific rules
- 🔄 Automated PR Creation: Intelligent branch naming and pull request generation
- 🛠️ Git Workflow Automation: Commit message generation and branch management
- 📊 Comprehensive Logging: Detailed execution logs and artifact generation
- 🎯 Multi-Model Support: Gemini 2.0/2.5, Aider with various AI models
dmtools-agentic-workflows/
├── .github/
│ └── workflows/
│ ├── reusable-gemini-implementation.yml # AI code implementation
│ ├── reusable-gemini-discovery.yml # AI code discovery & analysis
│ └── reusable-aider-assist.yml # AI code assistance
├── scripts/
│ ├── prepare-user-request.sh # Request preparation
│ ├── run-gemini.sh # Gemini CLI execution
│ ├── run-aider.sh # Aider execution
│ ├── git-workflow.sh # Git operations automation
│ ├── generate_pr_notes.sh # PR metadata generation
│ └── setup-cli-env.sh # Environment setup
├── prompts/
│ ├── implementation-prompt.md # Default implementation prompt
│ ├── discovery-prompt.md # Default discovery prompt
│ ├── assist-prompt.md # Default assistance prompt
│ └── pull_request_and_commit.md # PR generation prompt
├── docs/
│ ├── SETUP.md # Setup instructions
│ ├── USAGE.md # Usage examples
│ └── PROMPT_CUSTOMIZATION.md # Prompt customization guide
└── examples/
├── basic-usage/ # Basic integration examples
├── custom-prompts/ # Custom prompt examples
└── multi-repo-setup/ # Multi-repository setup
Add this workflow to your repository as .github/workflows/ai-implementation.yml:
name: AI Code Implementation
on:
workflow_dispatch:
inputs:
user_request:
description: 'Your coding request'
required: true
type: string
model:
description: 'Gemini model to use'
required: false
type: choice
default: 'gemini-2.5-flash-preview-05-20'
options:
- gemini-2.0-flash-exp
- gemini-1.5-pro-latest
- gemini-2.5-flash-preview-05-20
jobs:
implement:
uses: IstiN/dmtools-agentic-workflows/.github/workflows/reusable-gemini-implementation.yml@main
with:
user_request: ${{ inputs.user_request }}
model: ${{ inputs.model }}
secrets:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}Add this workflow to your repository as .github/workflows/ai-discovery.yml:
name: AI Code Discovery
on:
workflow_dispatch:
inputs:
user_request:
description: 'Your discovery request'
required: true
type: string
jobs:
discover:
uses: IstiN/dmtools-agentic-workflows/.github/workflows/reusable-gemini-discovery.yml@main
with:
user_request: ${{ inputs.user_request }}
secrets:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}Add this workflow to your repository as .github/workflows/ai-assist.yml:
name: AI Code Assistance
on:
workflow_dispatch:
inputs:
user_request:
description: 'Your assistance request'
required: true
type: string
target_files:
description: 'Files to analyze (comma-separated)'
required: false
type: string
jobs:
assist:
uses: IstiN/dmtools-agentic-workflows/.github/workflows/reusable-aider-assist.yml@main
with:
user_request: ${{ inputs.user_request }}
target_files: ${{ inputs.target_files }}
secrets:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}You can override default prompts and add project-specific rules:
jobs:
implement:
uses: IstiN/dmtools-agentic-workflows/.github/workflows/reusable-gemini-implementation.yml@main
with:
user_request: ${{ inputs.user_request }}
custom_implementation_prompt: '.github/prompts/my-implementation-prompt.md'
custom_rules_file: 'docs/CODING_STANDARDS.md'
additional_context_files: 'README.md,ARCHITECTURE.md,package.json'
secrets:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}Pin to a specific version for stability:
jobs:
implement:
uses: IstiN/dmtools-agentic-workflows/.github/workflows/reusable-gemini-implementation.yml@v1.0.0
# ... rest of configurationUse a fork or custom repository:
jobs:
implement:
uses: IstiN/dmtools-agentic-workflows/.github/workflows/reusable-gemini-implementation.yml@main
with:
user_request: ${{ inputs.user_request }}
workflows_repo: 'my-org/custom-agentic-workflows'
workflows_ref: 'custom-branch'
secrets:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}The agentic workflows support multiple user request formats to handle different scenarios:
For simple, single-line requests, just provide the text directly:
user_request: "Implement user authentication with JWT tokens"For longer requests or when special characters are involved, the system automatically detects and decodes base64-encoded requests:
user_request: "SW1wbGVtZW50IGEgY29tcGxldGUgdXNlciBhdXRoZW50aWNhdGlvbiBzeXN0ZW0K..."For extremely large requests, use GZIP compression with base64 encoding:
user_request: "GZIP_COMPRESSED:H4sIAAAAAAAAA3WOwQ6CMAyG7+U1JG0ZY7yZEA..."Format Detection: The system automatically detects the format based on:
- GZIP: Requests starting with
GZIP_COMPRESSED:prefix - Base64: Valid base64 character patterns with reasonable length (>20 chars)
- Plain Text: Everything else is treated as raw text
For complex multi-line requests in YAML, use the literal block scalar syntax:
user_request: |
Implement a complete user authentication system with the following requirements:
1. JWT token-based authentication
2. Password hashing with bcrypt
3. Role-based access control
4. Session management
5. Password reset functionality
Include comprehensive tests and documentation.| Format | Use Case | Example |
|---|---|---|
| Plain Text | Simple, single-line requests | "Fix the login bug in auth.js" |
| Multi-line YAML | Complex requests with requirements | Multi-step implementation with detailed specs |
| Base64 | Automated systems, special characters | Generated by external tools or APIs |
| GZIP Compressed | Very large requests (>8KB), webhook payloads | Massive requirement documents, full API specs |
For manual testing with large requests:
# Create GZIP compressed request
echo "Your very long request here..." | gzip | base64 -w 0 | sed 's/^/GZIP_COMPRESSED:/'
# Create Base64 encoded request
echo "Your request with special chars" | base64 -w 0The system automatically:
- ✅ Validates DMC ticket numbers in requests (DMC-XXX format)
- ✅ Handles compression/decompression transparently
- ✅ Provides detailed processing logs
- ✅ Falls back gracefully if decoding fails
📖 Detailed Guide: See docs/USER_REQUEST_FORMATS.md for comprehensive documentation on user request formats, including examples, best practices, and troubleshooting.
Set up these secrets in your repository:
GEMINI_API_KEY: Your Google Gemini API key
PAT_TOKEN: GitHub Personal Access Token with repo and PR permissions
- Go to your repository settings
- Navigate to "Secrets and variables" → "Actions"
- Add the required secrets:
- GEMINI_API_KEY: Get from Google AI Studio
- PAT_TOKEN: Create from GitHub Settings
File: reusable-gemini-implementation.yml
Purpose: Automated code implementation using Gemini CLI
Features:
- AI-powered code generation and modification
- Automated PR creation with intelligent branch naming
- Custom prompt support
- Comprehensive logging and debugging
Key Parameters:
user_request: Your implementation requestmodel: Gemini model to usecustom_implementation_prompt: Path to custom prompt filecustom_rules_file: Path to project-specific rulesadditional_context_files: Comma-separated list of context files
File: reusable-gemini-discovery.yml
Purpose: AI-powered code analysis and discovery
Features:
- Codebase exploration and understanding
- Architecture analysis
- Documentation generation
- Issue identification
Key Parameters:
user_request: Your discovery questionmodel: Gemini model to usecustom_discovery_prompt: Path to custom discovery promptcustom_rules_file: Path to project-specific rules
File: reusable-aider-assist.yml
Purpose: AI-powered code assistance and refactoring
Features:
- Code review and suggestions
- Refactoring assistance
- Bug fix recommendations
- Code quality improvements
Key Parameters:
user_request: Your assistance requesttarget_files: Specific files to analyzemodel: AI model to use with Aidermax_tokens: Maximum context tokens
# Trigger: Manual workflow dispatch
user_request: "Implement user authentication with JWT tokens"# Trigger: Manual workflow dispatch
user_request: "Analyze the login failure issue in the authentication module"
target_files: "src/auth/login.js,src/auth/jwt.js"# Trigger: Manual workflow dispatch
user_request: "How does the payment processing system work?"# Trigger: Manual workflow dispatch
user_request: "Review the current microservices architecture and suggest improvements"
additional_context_files: "ARCHITECTURE.md,docker-compose.yml,k8s/"All workflows generate comprehensive artifacts:
- PR Creation: Automated pull request with implementation
- Artifacts:
agentic-workflow-results-{run_number}- Implementation response
- Execution logs
- PR metadata
- Combined prompts
- Analysis Report: Detailed discovery analysis
- Artifacts:
agentic-discovery-results-{run_number}- Discovery response
- Full report
- Execution logs
- Analysis Summary: Code assistance recommendations
- Artifacts:
agentic-aider-results-{run_number}- Assistance response
- Analysis summary
- Execution logs
- Create a prompts directory in your repository:
your-repo/
├── .github/
│ └── prompts/
│ ├── my-implementation-prompt.md
│ ├── my-discovery-prompt.md
│ └── project-rules.md
- Reference them in your workflow:
with:
custom_implementation_prompt: '.github/prompts/my-implementation-prompt.md'
custom_rules_file: '.github/prompts/project-rules.md'Create a project-rules.md file:
# Project-Specific Rules
## Architecture Guidelines
- Use TypeScript strict mode
- Follow React functional components pattern
- Implement proper error boundaries
## Testing Requirements
- Write unit tests for all business logic
- Use Jest and React Testing Library
- Maintain 80%+ code coverage
## Code Style
- Use ESLint and Prettier
- Follow conventional commits
- Use meaningful variable names- Fork the repository
- Create a feature branch
- Make your changes
- Test with your own repository
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Wiki
Made with ❤️ by the DMTools team