Skip to content

About

Project submission for IBM Bob hackathon 2026

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

39 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

dev-companion

License: MIT Python 3.8+ IBM watsonx.ai Streamlit Code style: Google

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.

dev-companion Demo


🎯 Features

Core Capabilities

  • πŸ“„ 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

Additional Features

  • 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 /genreadme commands for Bob IDE

πŸ“¦ Installation

Prerequisites

  • Python 3.8 or higher
  • IBM watsonx.ai account with API credentials
  • (Optional) GitHub personal access token for private repository access

Setup

  1. Clone the repository
git clone https://github.com/self-reliantkid/dev-companion.git
cd dev-companion
  1. Install dependencies
pip install -r requirements.txt
  1. 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 repos

Get your IBM watsonx.ai credentials from IBM Cloud.


⚑ Quick Start

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.py

Visit http://localhost:8501 and start generating documentation!


πŸš€ Usage

Web Interface (Streamlit)

Launch the interactive web application:

streamlit run app.py

The app will open in your browser at http://localhost:8501. You can:

  1. Paste code directly or provide a GitHub URL
  2. Select an action (Generate Docs, Tests, Review, Sync, or README)
  3. Click "run dev-companion" to generate output
  4. Download the results

Command Line Interface

Run the demo to see all features:

python main.py demo

Run the test suite:

python main.py test

IBM Bob IDE Integration

dev-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

πŸ“ Project Structure

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

πŸ€– How IBM Bob is Used

dev-companion leverages IBM Bob IDE in several key ways:

1. Custom Commands

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

2. Agent Instructions (AGENTS.md)

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)

3. Session Tracking

All Bob interactions are logged in bob_sessions/ for:

  • Reproducibility and debugging
  • Performance analysis (token consumption)
  • Hackathon judging requirements

4. Intelligent Code Analysis

Bob analyzes codebases to:

  • Understand project structure and dependencies
  • Generate contextually appropriate documentation
  • Create comprehensive test coverage
  • Detect stale documentation through signature comparison

πŸ§ͺ Example: Task Service

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 ========================

πŸ› οΈ Technology Stack

  • 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

πŸ“Š Performance & Quality

Generation Metrics

  • 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

Phase 2 Quality Improvements (v2.1.0)

  • 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

🚒 Deployment

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.


🀝 Contributing

Contributions are welcome! We appreciate bug reports, feature suggestions, and code contributions.

Quick Start:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes following our coding standards
  4. Write tests for new features
  5. Submit a Pull Request

For detailed guidelines, see CONTRIBUTING.md

Development Setup

# 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=src

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright (c) 2026 Sena Folikumah


πŸ† IBM Bob Hackathon

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.


πŸ“– Documentation

πŸ”— Links


Built with ❀️ using IBM Bob + watsonx.ai

About

Project submission for IBM Bob hackathon 2026

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages