{"id":46937868,"url":"https://github.com/purus/pragents","last_synced_at":"2026-03-11T06:04:00.260Z","repository":{"id":337970986,"uuid":"1150290859","full_name":"Purus/pragents","owner":"Purus","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-12T07:10:36.000Z","size":1677,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-12T16:44:58.850Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Purus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-05T05:21:27.000Z","updated_at":"2026-02-12T07:10:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Purus/pragents","commit_stats":null,"previous_names":["purus/pragents"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Purus/pragents","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Purus%2Fpragents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Purus%2Fpragents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Purus%2Fpragents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Purus%2Fpragents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Purus","download_url":"https://codeload.github.com/Purus/pragents/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Purus%2Fpragents/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30372561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-11T06:03:27.402Z","updated_at":"2026-03-11T06:04:00.253Z","avatar_url":"https://github.com/Purus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Code Coverage Agent\n\nA modular, LangGraph-based agentic system that automates code coverage improvement by orchestrating specialized agents to clone repositories, analyze coverage, generate tests, and submit pull requests.\n\n## Features\n\n- **🤖 Reusable Agents**: Modular agents for Git operations, SonarQube integration, code analysis, test generation, and PR creation\n- **🔄 LangGraph Workflow**: State-based workflow with conditional branching based on coverage thresholds\n- **🧠 LLM Abstraction**: Provider-agnostic LLM service layer (OpenAI, Anthropic, Azure OpenAI, etc.)\n- **🔌 Azure DevOps Integration**: Native support for Azure DevOps Repos and Pull Requests\n- **🌐 RESTful API**: FastAPI endpoints for external system integration\n- **💬 Interactive UI**: Streamlit-based chat interface for workflow configuration and monitoring\n- **⚙️ Highly Configurable**: YAML-based configuration with environment variable support\n\n## Architecture\n\n```mermaid\ngraph TD\n    A[Entry Point: CLI/API/UI] --\u003e B[Configuration Loader]\n    B --\u003e C[LangGraph Workflow]\n    C --\u003e D[Git Agent]\n    C --\u003e E[SonarQube Agent]\n    C --\u003e F[Analyzer Agent]\n    C --\u003e G[Test Gen Agent]\n    C --\u003e H[PR Agent]\n    G --\u003e I[LLM Service]\n    I --\u003e J[Provider: OpenAI/Anthropic/etc]\n```\n\n## Quick Start\n\n### Prerequisites\n\n- Python 3.10+\n- UV package manager (recommended) or pip\n- Azure DevOps PAT with Code and PR permissions\n- SonarQube server access\n- LLM API key (OpenAI, Anthropic, etc.)\n\n### Installation\n\n#### Using UV (Recommended)\n\n```bash\n# Install UV\npowershell -c \"irm https://astral.sh/uv/install.ps1 | iex\"\n\n# Clone and setup\ngit clone \u003cyour-repo-url\u003e code-coverage-agent\ncd code-coverage-agent\nuv sync\n\n# Install with dev dependencies\nuv sync --extra dev\n```\n\n#### Using pip\n\n```bash\ncd code-coverage-agent\npip install -e .\n\n# With dev dependencies\npip install -e \".[dev]\"\n```\n\n### Configuration\n\n1. Copy the environment template:\n```bash\ncp .env.example .env\n```\n\n2. Edit `.env` with your credentials:\n```bash\n# Azure DevOps\nAZURE_DEVOPS_ORG_URL=https://dev.azure.com/yourorg\nAZURE_DEVOPS_PROJECT=YourProject\nAZURE_DEVOPS_PAT=your_pat_token\n\n# SonarQube\nSONAR_URL=https://sonarqube.example.com\nSONAR_TOKEN=your_sonar_token\nSONAR_PROJECT_KEY=your_project_key\n\n# LLM Provider\nOPENAI_API_KEY=your_openai_key\n```\n\n3. (Optional) Customize `config/default.yaml` for workflow settings\n\n## Usage\n\n### CLI Mode\n\n```bash\n# Using UV\nuv run python main.py --repo https://dev.azure.com/org/project/_git/repo \\\n  --sonar-key my-project \\\n  --threshold 90\n\n# Using Python\npython main.py --repo \u003crepo-url\u003e --config config/default.yaml\n```\n\n### API Mode\n\nStart the FastAPI server:\n\n```bash\n# Using UV\nuv run uvicorn src.api.main:app --host 0.0.0.0 --port 8000 --reload\n\n# Using Python\nuvicorn src.api.main:app --reload\n```\n\nStart a workflow via API:\n\n```bash\ncurl -X POST http://localhost:8000/api/workflow/start \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"repo_url\": \"https://dev.azure.com/org/project/_git/repo\",\n    \"sonar_project_key\": \"my-project\",\n    \"coverage_threshold\": 90\n  }'\n```\n\nCheck workflow status:\n\n```bash\ncurl http://localhost:8000/api/workflow/{workflow_id}\n```\n\nAPI documentation available at: `http://localhost:8000/docs`\n\n### UI Mode\n\nLaunch the Streamlit chat interface:\n\n```bash\n# Using UV\nuv run streamlit run src/ui/app.py --server.port 8501\n\n# Using Python\nstreamlit run src/ui/app.py\n```\n\nAccess the UI at: `http://localhost:8501`\n\n## Project Structure\n\n```\ncode-coverage-agent/\n├── src/\n│   ├── agents/          # Reusable agent implementations\n│   ├── llm/             # LLM service abstraction\n│   ├── workflow/        # LangGraph workflow\n│   ├── api/             # FastAPI application\n│   ├── ui/              # Streamlit UI\n│   ├── config/          # Configuration management\n│   └── utils/           # Shared utilities\n├── config/              # Configuration files\n├── tests/               # Test suite\n├── main.py              # CLI entry point\n└── pyproject.toml       # Dependencies\n```\n\n## Configuration\n\nSee `config/example.yaml` for all available options:\n\n- Git provider settings (Azure DevOps)\n- SonarQube connection\n- LLM provider configuration\n- Workflow parameters (retries, timeouts, etc.)\n- API and UI settings\n\n## Extending the System\n\n### Adding a New LLM Provider\n\n1. Create `src/llm/providers/your_provider.py`\n2. Implement `BaseLLMProvider` interface\n3. Register in `src/llm/factory.py`\n4. Update configuration schema\n\n### Adding a New Agent\n\n1. Create agent in `src/agents/your_agent.py`\n2. Inherit from `BaseAgent`\n3. Implement `execute()` method\n4. Integrate into workflow graph\n\n## Development\n\n### Running Tests\n\n```bash\n# All tests\nuv run pytest tests/ -v --cov=src\n\n# Specific test suite\nuv run pytest tests/agents/\nuv run pytest tests/api/\n```\n\n### Code Quality\n\n```bash\n# Format code\nuv run black src/ tests/\n\n# Lint\nuv run ruff check src/ tests/\n\n# Type checking\nuv run mypy src/\n```\n\n## Workflow\n\n1. **Clone Repository**: Git agent clones the target repository\n2. **Check Coverage**: SonarQube agent fetches current coverage metrics\n3. **Decision Point**: If coverage \u003c threshold, proceed; else exit\n4. **Analyze Code**: Analyzer identifies uncovered functions/classes\n5. **Generate Tests**: Test generator creates unit tests using LLM\n6. **Create PR**: PR agent submits pull request with generated tests\n\n## Troubleshooting\n\n- **Authentication Issues**: Verify Azure DevOps PAT has correct permissions\n- **SonarQube Connection**: Check firewall and API token validity\n- **LLM Errors**: Verify API key and check rate limits\n- **UV Installation**: May require execution policy adjustment on Windows\n\n## License\n\nMIT\n\n## Contributing\n\nContributions welcome! Please open an issue or PR.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurus%2Fpragents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpurus%2Fpragents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurus%2Fpragents/lists"}