AI-powered documentation and test generation tool built with IBM Bob
dev-companion is an intelligent development assistant that automatically generates comprehensive documentation, unit tests, code reviews, and README files for your codebase. Built with IBM watsonx.ai and IBM Bob IDE, it streamlines the documentation workflow and helps maintain code quality across Python, JavaScript, TypeScript, Java, Go, Rust, and 15+ other languages.
- π Documentation Generation β Automatically adds Google-style docstrings to every function and class, plus generates markdown reference documentation
- π§ͺ Test Suite Generation β Creates comprehensive pytest-compatible test suites covering happy paths, edge cases, and error conditions
- π Code Review β Performs structured reviews flagging complexity, security, performance, and style issues with severity ratings
- π Sync Check β Detects when code changes make existing documentation or tests stale and flags them for updates
- π README Generation β Scans codebases and generates professional README files based strictly on actual code capabilities
- Multi-language Support β Works with Python, JavaScript, TypeScript, Java, Go, Rust, C/C++, Ruby, PHP, and more
- GitHub Integration β Fetch and analyze entire repositories or individual files directly from GitHub URLs
- Web Interface β Beautiful Streamlit-based UI with real-time generation and downloadable outputs
- CLI Mode β Command-line interface for integration into development workflows
- IBM Bob Commands β Custom
/gendoc,/gentest,/sync, and/genreadmecommands for Bob IDE
- Python 3.8 or higher
- IBM watsonx.ai account with API credentials
- (Optional) GitHub personal access token for private repository access
- Clone the repository
git clone https://github.com/self-reliantkid/dev-companion.git
cd dev-companion- Install dependencies
pip install -r requirements.txt- Configure credentials
Create a .env file in the project root:
WATSONX_API_KEY=your_ibm_api_key
WATSONX_PROJECT_ID=your_project_id
WATSONX_URL=https://us-south.ml.cloud.ibm.com
GITHUB_TOKEN=your_github_token # Optional, for private reposGet your IBM watsonx.ai credentials from IBM Cloud.
Get started in 3 simple steps:
# 1. Install dependencies
pip install -r requirements.txt
# 2. Set up your credentials
echo "WATSONX_API_KEY=your_key_here" > .env
echo "WATSONX_PROJECT_ID=your_project_id" >> .env
echo "WATSONX_URL=https://us-south.ml.cloud.ibm.com" >> .env
# 3. Launch the web interface
streamlit run app.pyVisit http://localhost:8501 and start generating documentation!
Launch the interactive web application:
streamlit run app.pyThe app will open in your browser at http://localhost:8501. You can:
- Paste code directly or provide a GitHub URL
- Select an action (Generate Docs, Tests, Review, Sync, or README)
- Click "run dev-companion" to generate output
- Download the results
Run the demo to see all features:
python main.py demoRun the test suite:
python main.py testdev-companion includes custom Bob commands for seamless IDE integration:
Generate documentation:
/gendoc src/task_service.py
Generate tests:
/gentest src/task_service.py
Check for stale docs/tests:
/sync src/task_service.py
Generate README:
/genreadme
dev-companion/
βββ src/ # Source code being documented and tested
β βββ __init__.py
β βββ task_service.py # Example: Task management service
βββ tests/ # Auto-generated test files
β βββ __init__.py
β βββ test_task_service.py
βββ docs/ # Auto-generated markdown documentation
β βββ task_service.md
β βββ review_report.md
βββ bob_sessions/ # Bob task session reports (for judging)
β βββ gendoc-output.md
β βββ gentest-output.md
β βββ sync-output.md
β βββ genreadme-output.md
βββ app.py # Streamlit web interface
βββ main.py # CLI entry point
βββ watsonx_client.py # watsonx.ai API client
βββ conftest.py # pytest configuration
βββ requirements.txt # Python dependencies
βββ AGENTS.md # Bob agent instructions
βββ README.md # This file
dev-companion leverages IBM Bob IDE in several key ways:
Bob's command system enables natural language task invocation:
/gendocβ Triggers documentation generation workflow/gentestβ Initiates test suite creation/syncβ Runs synchronization checks/genreadmeβ Generates project README
The AGENTS.md file provides Bob with:
- Project context and core workflows
- Documentation style guidelines (Google-style docstrings)
- Test framework preferences (pytest)
- Sync detection rules (function signature comparison)
All Bob interactions are logged in bob_sessions/ for:
- Reproducibility and debugging
- Performance analysis (token consumption)
- Hackathon judging requirements
Bob analyzes codebases to:
- Understand project structure and dependencies
- Generate contextually appropriate documentation
- Create comprehensive test coverage
- Detect stale documentation through signature comparison
The repository includes a complete example demonstrating all features:
Source: src/task_service.py β A task management service with CRUD operations
Generated Documentation: docs/task_service.md β Complete API reference with usage examples
Generated Tests: tests/test_task_service.py β 68 test cases with 100% pass rate covering:
- Happy paths for all methods
- Edge cases (empty inputs, whitespace, boundary conditions)
- Error conditions (invalid priorities, nonexistent IDs)
- Fixtures for test setup and teardown
Test Results:
$ pytest tests/ -v
======================== 68 passed in 0.42s ========================- Language: Python 3.8+
- AI Model: IBM watsonx.ai (Llama 3.3 70B Instruct)
- Web Framework: Streamlit
- Testing: pytest
- Documentation Format: Markdown + Google-style docstrings
- API Client: requests + python-dotenv
- IDE Integration: IBM Bob
- Average generation time: 20-60 seconds per file
- Token efficiency: Cached IAM tokens reduce API overhead
- Test coverage: 100% pass rate on generated tests
- Languages supported: 15+ programming languages
- Repository analysis: Up to 20 source files per scan
- Automatic Validation: Every output is quality-scored (0.0-1.0 scale)
- Smart Retry: Automatically retries low-quality generations (up to 2 times)
- Quality Threshold: 85-95% of outputs meet 0.75+ quality score
- Metrics Tracking: Comprehensive performance and cost monitoring
- Few-Shot Learning: Enhanced prompts with examples improve first-attempt success
Quality Score Breakdown:
- 0.9-1.0: Excellent - Complete, well-structured, comprehensive
- 0.75-0.89: Good - Meets requirements with minor improvements possible
- 0.6-0.74: Acceptable - Functional but may need refinement
- <0.6: Needs Improvement - Automatically retried
dev-companion can be deployed in multiple ways:
- Local Development: Run with
streamlit run app.py - Docker: Containerized deployment with Docker/Docker Compose
- Cloud Platforms: Streamlit Cloud, Heroku, AWS, Google Cloud
- Production: Full deployment guide with security and scaling
See DEPLOYMENT.md for detailed deployment instructions.
Contributions are welcome! We appreciate bug reports, feature suggestions, and code contributions.
Quick Start:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes following our coding standards
- Write tests for new features
- Submit a Pull Request
For detailed guidelines, see CONTRIBUTING.md
# Clone and setup
git clone https://github.com/self-reliantkid/dev-companion.git
cd dev-companion
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Run tests
pytest tests/ -v --cov=srcThis project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2026 Sena Folikumah
This project was built for the IBM Bob Hackathon (May 2026) to demonstrate:
- Custom Bob command integration
- watsonx.ai API usage for code generation
- Multi-language documentation and test generation
- Intelligent sync detection for maintaining code quality
Session Reports: All Bob interactions are documented in bob_sessions/ with token consumption metrics and output samples.
- CHANGELOG.md - Version history and release notes
- CONTRIBUTING.md - Contribution guidelines
- SECURITY.md - Security policy and vulnerability reporting
- IMPROVEMENTS.md - Phase 1 technical details
- PHASE2_SUMMARY.md - Phase 2 implementation guide
- GitHub Repository: https://github.com/self-reliantkid/dev-companion
- IBM watsonx.ai: https://dataplatform.cloud.ibm.com/
- IBM Bob IDE: https://www.ibm.com/products/watsonx-code-assistant
- Streamlit: https://streamlit.io/
- Report Issues: GitHub Issues
Built with β€οΈ using IBM Bob + watsonx.ai