Skip to content

Commit b1f7f14

Browse files
committed
docs: rewrite README for v3 with all new features and clean formatting
1 parent 8ceb7b1 commit b1f7f14

1 file changed

Lines changed: 132 additions & 97 deletions

File tree

README.md

Lines changed: 132 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,133 @@
1-
# 🛡️ DevGuardian MCP Server: v2 — The Autonomous Engineering Edition
1+
# DevGuardian MCP Server — v3 Autonomous Engineering Ecosystem
22

3-
> An AI-powered, **Project-Aware** coding assistant MCP server built with **Gemini 2.0 Flash** and **UV**.
4-
> Plug it into **Antigravity** or **Claude Desktop** and get a full AI engineering team: debugging, reviewing, testing, deploying, and securing your code — all autonomously.
3+
> An AI-powered, project-aware coding assistant MCP server built with Gemini 2.0 Flash and UV.
4+
> Plug it into Antigravity or Claude Desktop and get a full AI engineering team: debugging, reviewing, testing, deploying, and securing your code — all autonomously.
55
66
---
77

8-
## 🌟 What makes DevGuardian a "Monster"?
8+
## What is DevGuardian?
99

10-
DevGuardian v2 is no longer a single script. It is a **multi-agent autonomous engineering ecosystem**:
10+
DevGuardian v3 is a multi-agent autonomous engineering ecosystem. It goes far beyond a single script — it reads your entire project structure before acting, uses a team of AI agents to validate work iteratively, and now actively repairs its own CI failures.
1111

12-
1. **🧠 Project DNA Awareness** — Before writing a single line of code, DevGuardian reads your `README`, `pyproject.toml`, full file tree, and import graph. It generates code that *fits your architecture*.
13-
2. **🤖 Agent Swarm** — A 3-agent pipeline (Coder → Tester → Reviewer) that builds features autonomously, finds bugs, and returns production-ready code.
14-
3. **🧪 TDD Auto-Pilot**Generates pytest tests, runs them, reads failures, fixes the source code, and loops until green.
15-
4. **🌐 GitHub PR Reviewer**Connects to live GitHub PRs, reads the diffs, and posts a structured expert review.
16-
5. **🐳 DevOps Generator**Produces a production-grade `Dockerfile`, `docker-compose.yml`, and GitHub Actions `ci.yml` by reading your project stack.
17-
6. **🏗️ God-Mode Mass Refactoring**Applies a single instruction across **every Python file** in the project simultaneously.
18-
7. **🛡️ Pre-Push Security Gate**Actively blocks accidental pushes of API keys, tokens, and passwords.
12+
**Core Design Principles:**
13+
14+
1. **Project DNA Awareness**Before writing a single line of code, DevGuardian reads your README, `pyproject.toml`, full file tree, and import graph. It generates code that fits your architecture, not generic boilerplate.
15+
2. **Agent Swarm with Adversarial Review**A 3-agent pipeline (Coder → Tester → Reviewer) that loops until the code is production-ready. If the Reviewer rejects the code, it sends specific feedback back to the Coder for another pass (up to 3 iterations).
16+
3. **Semantic Memory**DevGuardian remembers your coding style preferences and lessons learned across sessions, stored locally in `.devguardian_memory.json`.
17+
4. **Sandbox Execution**The Tester agent actually runs the generated code in a safe subprocess to catch runtime errors, not just look for them visually.
18+
5. **Self-Healing CI**If a push to `main` fails CI checks, a repair job automatically triggers DevGuardian to diagnose and fix the issue, then re-pushes a repair commit.
1919

2020
---
2121

22-
## ✨ Complete Tool Reference (27 Tools)
22+
## Tool Reference (31 Tools)
23+
24+
### Autonomous Agents
2325

24-
### 🤖 Autonomous Agents
2526
| Tool | Description |
2627
|---|---|
27-
| 🤖 `agent_swarm` | **3-Agent Pipeline**: Coder → Tester → Reviewer. Builds features, audits for bugs, returns production-ready code. |
28-
| 🚀 `autonomous_engineer` | **Stateful LangGraph Agent**: Plans, executes tools in loops, verifies work, and self-corrects. |
28+
| `agent_swarm` | 3-agent pipeline (Coder, Tester, Reviewer) with adversarial feedback loops and sandbox execution. Loops until code is accepted. |
29+
| `autonomous_engineer` | Stateful LangGraph agent that plans, executes tools in loops, verifies work, and self-corrects. |
30+
31+
### AI Code Intelligence
2932

30-
### 🧠 AI Code Intelligence
3133
| Tool | Description |
3234
|---|---|
33-
| `debug_error` | Analyze errors & stack traces; get root cause + fix with project context |
34-
| `explain_code` | Understand what any code does in plain English |
35-
| `review_code` | Full project-aware codebase review: bugs, security, performance, style |
36-
| `generate_code` | Generate clean code tailored to your project's architecture |
37-
| `improve_code` | Refactor and improve existing code consistently |
35+
| `debug_error` | Analyze errors and stack traces; returns root cause and exact fix with full project context. |
36+
| `explain_code` | Understand what any code does in plain English. |
37+
| `review_code` | Project-aware code review covering bugs, security, performance, and style. |
38+
| `generate_code` | Generate clean code tailored to your project's architecture. |
39+
| `improve_code` | Refactor and improve existing code consistently. |
40+
41+
### Quality and Testing
3842

39-
### 🔬 Quality & Testing
4043
| Tool | Description |
4144
|---|---|
42-
| 🧪 `test_and_fix` | **TDD Auto-Pilot**: generates pytest tests, runs them, fixes source until tests pass |
43-
| 🌐 `review_pull_request` | **GitHub PR Reviewer**: fetches PR diffs from GitHub & performs AI code review |
45+
| `test_and_fix` | TDD Auto-Pilot: generates pytest tests, runs them, fixes source until tests pass. |
46+
| `review_pull_request` | Fetches PR diffs from GitHub and performs an AI-powered code review. |
47+
48+
### DevOps and Infrastructure
4449

45-
### 🐳 DevOps & Infrastructure
4650
| Tool | Description |
4751
|---|---|
48-
| 🐳 `dockerize` | Auto-generates `Dockerfile` + `docker-compose.yml` for your project |
49-
| 🚀 `generate_ci` | Auto-generates `.github/workflows/ci.yml` (linting, testing, Docker) |
52+
| `dockerize` | Auto-generates `Dockerfile` and `docker-compose.yml` tailored to your stack. |
53+
| `generate_ci` | Auto-generates `.github/workflows/ci.yml` with linting, testing, Docker, and self-healing jobs. |
54+
| `generate_gitignore` | Analyzes your project structure and generates a tailored `.gitignore`. Asks for permission before including `.env` patterns. |
55+
56+
### Architecture and Documentation
5057

51-
### 🏗️ Mass Operations
5258
| Tool | Description |
5359
|---|---|
54-
| 🏗️ `mass_refactor` | **God-Mode**: applies one instruction across ALL Python files simultaneously |
60+
| `generate_architecture_map` | Analyzes internal imports and generates a Mermaid.js dependency diagram of your project. |
61+
| `generate_technical_docs` | Generates a high-density technical architecture summary using Gemini. |
62+
63+
### Mass Operations
64+
65+
| Tool | Description |
66+
|---|---|
67+
| `mass_refactor` | Applies a single instruction across every Python file in the project simultaneously. |
68+
69+
### Security
5570

56-
### 🛡️ Security
5771
| Tool | Description |
5872
|---|---|
59-
| 🛂 `validate_env` | Validates `.env` file format safely — never exposes secret values |
60-
| 🔍 `security_scan` | Scans repo for 20+ credential types + missing `.gitignore` rules |
73+
| `validate_env` | Validates `.env` file format safely — never exposes secret values. |
74+
| `security_scan` | Scans the repo for 20+ credential types and missing `.gitignore` coverage. |
75+
76+
### Git Suite
6177

62-
### ⚡ Version Control (Git Suite)
6378
| Tool | Description |
6479
|---|---|
65-
| `smart_commit` | **AI reads your diffwrites commit messagescans for leaks commits!** |
66-
| `git_status` | Show working tree status |
67-
| `git_add` | Stage files for commit |
68-
| `git_commit` | Commit with a custom message |
69-
| `git_push` | Push to remote **(Protected by Security Gate)** |
70-
| `git_pull` | Pull from remote |
71-
| `git_log` | View commit history |
72-
| `git_diff` | Show staged or unstaged diffs |
73-
| `git_branch` | List all branches |
74-
| `git_checkout` | Switch or create branches |
75-
| `git_stash` | Stash / unstash changes |
76-
| `git_reset` | Reset HEAD (soft, mixed, hard) |
77-
| `git_remote` | List configured remotes |
80+
| `smart_commit` | AI reads your diff, writes a commit message, scans for credential leaks, then commits. |
81+
| `git_status` | Show working tree status. |
82+
| `git_add` | Stage files for commit. |
83+
| `git_commit` | Commit with a custom message. |
84+
| `git_push` | Push to remote (protected by the security gate). |
85+
| `git_pull` | Pull from remote. |
86+
| `git_log` | View commit history. |
87+
| `git_diff` | Show staged or unstaged diffs. |
88+
| `git_branch` | List all branches. |
89+
| `git_checkout` | Switch or create branches. |
90+
| `git_stash` | Stash or unstash changes. |
91+
| `git_reset` | Reset HEAD (soft, mixed, hard). |
92+
| `git_remote` | List configured remotes. |
7893

7994
---
8095

81-
## 🚀 Setup
96+
## Setup
8297

83-
### 1. Prerequisites
98+
### Prerequisites
8499
- [UV](https://docs.astral.sh/uv/getting-started/installation/) installed
85100
- Python 3.10+
86101
- Git installed
87102
- A [Gemini API Key](https://aistudio.google.com/app/apikey) (free)
88103

89-
### 2. Create virtual environment & install dependencies
104+
### Installation
105+
90106
```bash
91107
cd DevGuardian
92108
uv venv
93109
uv pip install -e .
94110
```
95111

96-
### 3. Configure your API key
112+
### Configure your API key
113+
97114
```bash
98115
copy .env.example .env
99116
# Open .env and paste your Gemini API key
100117
# Optionally add GITHUB_TOKEN for private repo PR reviews
101118
```
102119

103-
### 4. Test the server runs
120+
### Test the server runs
121+
104122
```bash
105123
uv run devguardian
106124
```
125+
107126
You should see no errors — the server waits for MCP connections on stdio.
108127

109128
---
110129

111-
## 🔌 MCP Configuration
130+
## MCP Configuration
112131

113132
### Antigravity (VS Code)
114133
Add to your `.gemini/settings.json`:
@@ -145,86 +164,102 @@ Add to `%APPDATA%\Claude\claude_desktop_config.json`:
145164

146165
---
147166

148-
## 💡 Usage Examples
167+
## Usage Examples
149168

150-
### 🤖 Agent Swarm — Build a feature with 3 AI agents
169+
**Agent Swarm — Build a feature with 3 AI agents**
151170
> "DevGuardian, use the agent swarm to create a rate-limiting utility for our API."
152-
Coder writes a `RateLimiter` class, Tester finds 5 edge cases, Reviewer incorporates all fixes and returns the final production-ready file.
171+
> Coder writes a `RateLimiter` class. Tester finds edge cases. Reviewer rejects and sends feedback. Coder fixes. Reviewer accepts on pass 2. Final production-ready file is returned.
153172
154-
### 🧪 TDD Auto-Pilot — Test-driven bug fixing
173+
**TDD Auto-Pilot — Test-driven bug fixing**
155174
> "Run test_and_fix on `devguardian/tools/debugger.py`"
156-
DevGuardian writes pytest tests, runs them, reads the failures, patches the source, and loops until all tests go green.
175+
> DevGuardian writes pytest tests, runs them, reads the failures, patches the source, and loops until all tests go green.
157176
158-
### 🌐 GitHub PR Review — Review any live PR
177+
**PR Review — Review any live pull request**
159178
> "Review PR #42 in myorg/myrepo"
160-
DevGuardian fetches the diff from GitHub and gives you a structured review: Bugs, Security, Performance, Style, and a final verdict.
179+
> DevGuardian fetches the diff from GitHub and produces a structured review covering bugs, security, performance, and style.
161180
162-
### 🐳 Dockerize a project in seconds
163-
> "Dockerize this project."
164-
DevGuardian reads your stack from `pyproject.toml`, generates a multi-stage `Dockerfile` and `docker-compose.yml`, and writes them to your project root.
181+
**Architecture Map — Visualize your codebase**
182+
> "Generate an architecture map for this project."
183+
> DevGuardian scans all internal imports and produces a Mermaid.js dependency diagram showing how every file connects to every other file.
165184
166-
### 🏗️ Mass Refactoring
167-
> "Add type hints to all function signatures in the project."
168-
DevGuardian scans every `.py` file, rewrites functions that need type hints, and reports all 14 files it modified.
185+
**Smart .gitignore — Context-aware generation**
186+
> "Generate a gitignore for this project."
187+
> DevGuardian reads your tech stack and file structure. It asks for your permission before including `.env` patterns, then generates a tailored file — not a generic template.
169188
170-
### 🛡️ Push Code Safely
189+
**Push Code Safely**
171190
> "Push my changes to main."
172-
DevGuardian scans all staged files. If it finds `api_key = "AIzaSy..."` hardcoded anywhere, it **BLOCKS the push** and tells you exactly which file and line contains the secret.
191+
> DevGuardian scans all staged files. If it detects a hardcoded API key or token, it blocks the push and reports the exact file and line number.
173192
174193
---
175194

176-
## 📁 Project Structure
195+
## Project Structure
196+
177197
```
178198
DevGuardian/
179-
├── .env.example Copy to .env, add your API key
180-
├── .gitignore ← Comprehensive security-focused rules
181-
├── pyproject.toml UV project config (dependencies)
182-
├── Dockerfile ← 🐳 Auto-generated production container
183-
├── docker-compose.yml ← 🐳 Auto-generated service orchestration
199+
├── .env.example Copy to .env and add your API key
200+
├── .gitignore Security-focused ignore rules
201+
├── pyproject.toml UV project config and dependencies
202+
├── Dockerfile Production container
203+
├── docker-compose.yml Service orchestration
184204
├── README.md
185205
├── tests/
186-
│ └── test_debugger.py ← 🧪 TDD Auto-Pilot generated tests
206+
│ └── test_debugger.py TDD-generated test suite
187207
├── .github/
188208
│ └── workflows/
189-
│ └── ci.yml ← 🚀 Auto-generated GitHub Actions CI/CD
209+
│ └── ci.yml GitHub Actions CI/CD with self-healing job
190210
└── devguardian/
191-
├── server.py ← Robust MCP server (27 tools, logging, error handling)
211+
├── server.py MCP server entry point (31 tools)
192212
├── agents/
193-
│ ├── engineer.py ← Single stateful LangGraph agent
194-
│ └── swarm.py ← 🤖 3-Agent Swarm (Coder + Tester + Reviewer)
213+
│ ├── engineer.py Stateful LangGraph autonomous agent
214+
│ └── swarm.py 3-Agent Swarm v3 with adversarial loops
195215
├── tools/
196-
│ ├── debugger.py ← debug_error
197-
│ ├── code_helper.py ← explain, review, generate, improve
198-
│ ├── git_ops.py ← Full git suite + ⭐ smart_commit
199-
│ ├── tdd.py ← 🧪 TDD Auto-Pilot
200-
│ ├── github_review.py ← 🌐 GitHub PR Reviewer
201-
│ ├── infra.py ← 🐳 Dockerfile + CI/CD generator
202-
│ └── mass_refactor.py ← 🏗️ God-Mode mass refactoring
216+
│ ├── debugger.py debug_error
217+
│ ├── code_helper.py explain, review, generate, improve
218+
│ ├── git_ops.py Full git suite + smart_commit
219+
│ ├── tdd.py TDD Auto-Pilot
220+
│ ├── github_review.py GitHub PR Reviewer
221+
│ ├── infra.py Dockerfile, CI/CD, and gitignore generators
222+
│ ├── architect.py Architecture mapping and technical docs
223+
│ ├── self_healing.py CI failure detection and repair engine
224+
│ └── mass_refactor.py Mass codebase refactoring
203225
└── utils/
204-
├── gemini_client.py ← Gemini 2.0 Flash wrapper (lazy init)
205-
├── file_reader.py ← 🧠 Project DNA Context Builder
206-
├── security.py ← 🛡️ Pre-push secret gate & .env validator
207-
└── memory.py ← Threading & Agent state management
226+
├── gemini_client.py Gemini 2.0 Flash wrapper
227+
├── file_reader.py Project DNA context builder
228+
├── security.py Pre-push security gate and .env validator
229+
├── memory.py Persistent semantic memory (JSON-based)
230+
└── executor.py Safe subprocess execution sandbox
208231
```
209232

210233
---
211234

212-
## 🔐 Enterprise-Grade Security
235+
## Security Model
213236

214-
- **Anti-Leak Shield**: `security.py` detects 20+ credential types (AWS, GitHub, OpenAI, Google, Stripe, Slack…) before any `git push` or `smart_commit`.
215-
- **Smart Detection**: Only flags **hardcoded quoted values** — never false-positives on `os.getenv()` calls.
216-
- **`.env` Safety**: `validate_env` reviews your `.env` file format — shows keys but **never exposes values**.
237+
- **Anti-Leak Shield**: `security.py` detects 20+ credential types (AWS, GitHub, OpenAI, Google, Stripe, Slack) before any `git push` or `smart_commit`.
238+
- **Precise Detection**: Only flags hardcoded quoted values — no false positives on `os.getenv()` calls.
239+
- **Env Safety**: `validate_env` reviews your `.env` file structure — shows keys but never exposes values.
240+
- **Permission-Based Gitignore**: The `generate_gitignore` tool asks for explicit user permission before adding `.env` patterns — nothing is done without your approval.
217241
- **Local Execution**: Your code never leaves your machine except for Gemini API calls.
218242

219243
---
220244

221-
## 🐳 Docker
245+
## CI/CD Pipeline
246+
247+
The pipeline runs on every push and pull request to `main`:
248+
249+
1. **lint** — Ruff checks code style and format
250+
2. **test** — Pytest runs the full test suite with coverage
251+
3. **Self-Healing Repair** — Triggers only if lint or test fails. Uses the Agent Swarm to diagnose, fix, and re-push a repair commit automatically.
252+
4. **build** — Builds the Python package
253+
5. **docker** — Builds the Docker image
254+
255+
---
256+
257+
## Docker
222258

223259
```bash
224-
# Build and run DevGuardian in a container
225260
docker compose up --build
226261
```
227262

228263
---
229264

230-
*Built with ❤️ by **Karan** using Gemini 2.0 Flash + LangGraph + MCP SDK + UV*
265+
*Built by Karan using Gemini 2.0 Flash, LangGraph, MCP SDK, and UV.*

0 commit comments

Comments
 (0)