A comprehensive Gemini CLI Extension that provides a Multi-Agent Swarm for autonomous software development, alongside specialized, step-by-step commands for SQL-to-DDD Refactoring.
See Gemini CLI Extensions for more details.
Credits: @dandobrin, @jjdelorme & @cedricyao. Parts of this work were adapted from Dan's production serverless repository.
Install the Gemini CLI
From your command line:
gemini extensions install https://github.com/jjdelorme/plan-commandsWhile the agents (architect, engineer, auditor) are installed globally by the extension, the Supervisor (system.md) must be activated locally in each project you want to use it in.
- Navigate to your project directory.
- Run the initialization command:
(This downloads the
/swarm:init
system.mdfile into your local.gemini/folder). - Restart the Gemini CLI with the system override enabled:
GEMINI_SYSTEM_MD=true gemini
This extension packages a portable, framework-agnostic AI agent swarm designed to manage the software development lifecycle using a rigorous Plan -> Act -> Verify state machine.
- Supervisor (
system.md): The Project Manager. Enforces the state machine, manages hand-offs, and gates Git commits. - Architect (
architect): The Planner. Reads research, creates comprehensive step-by-step TDD implementation plans in theplans/directory. - Engineer (
engineer): The Builder. Strictly follows the Architect's plans, writing tests and implementing changes via Red-Green-Refactor. - Auditor (
auditor): The Gatekeeper. Verifies the Engineer's work. Compiles code, runs tests, and hunts for lazy AI shortcuts (TODOs, commented-out tests).
The system moves through distinct phases, enforced by the Supervisor.
graph TD
%% Roles
subgraph Phase 1 & 2: Strategy
Scout[Scout/Investigator: Research & Map]
Architect[Architect: Plan & Strategy]
end
subgraph Phase 3: Construction
Engineer[Engineer: Implement]
Auditor[Auditor: Verify]
end
%% Flow
Start([User Start]) --> Scout
Scout --> Architect
Architect --> Review{User Approval}
Review -- Reject --> Architect
Review -- Approve --> Engineer
Engineer --> Auditor
%% The Three-Way Fork
Auditor -- Code Broken? --> Engineer
Auditor -- Plan Wrong? --> Architect
Auditor -- Verified --> Commit([Git Commit])
Commit --> Engineer
As the Swarm executes tasks, your plans/ directory will accumulate executed task files, research reports, and review feedback. To keep the agent's context window clean and focused, you can archive completed items:
/swarm:archiveWhat it does:
- Reads your Master Roadmap to identify completed campaigns and tasks.
- Moves all corresponding completed files into a
plans/archive/directory. - Automatically updates your project's
.geminiignoreto ensure archived files are hidden from the AI's context in future turns.
The core swarm is agnostic. To add deep codebase intelligence (like a Graph Database), install a specialized skill/agent in your project and update your project's GEMINI.md to instruct the swarm to use it:
# Swarm Routing & Delegation Rules (Add to your project's GEMINI.md)
- For codebase investigation, you MUST delegate to the `scout` agent. Do NOT use the built-in investigator.
- The `auditor` agent MUST utilize the `graphdb` skill for verifying changes.A specialized workflow for refactoring legacy code (specifically SQL) into a modern .NET, Domain-Driven Design (DDD) architecture.
Architecture: .NET 10, C# 14, MediatR (CQRS), EF Core (Code-First). Methodology: Domain-Driven Design (DDD) via Test-Driven Development (TDD).
CRITICAL: This pipeline is state-sensitive. After every step, review the output artifact, then type /clear to reset the context window to prevent "Context Pollution."
Generates agile user stories from existing code to help understand the current system.
- Command:
/ddd:create-user-stories {{path/to/code}} - Output:
user-stories.md
Deep analysis of legacy Stored Procedures. Extracts business rules, data dictionaries, and test cases.
- Command:
/sql:analyze {{path/to/legacy_proc.sql}} - Output:
ANALYSIS_[ProcName].md
Transforms the Analysis into a pure Domain Model (Aggregates, Entities, Rules).
- Command:
/ddd:logical {{ANALYSIS_[ProcName].md}} - Output:
LOGICAL_ARCHITECTURE.md
Maps the Domain Model to .NET 10, MediatR, and EF Core patterns.
- Command:
/ddd:physical {{LOGICAL_ARCHITECTURE.md}} - Output:
PHYSICAL_ARCHITECTURE.md
Generates a step-by-step TDD execution plan.
- Command:
/ddd:plan {{PHYSICAL_ARCHITECTURE.md}} - Output:
IMPLEMENTATION_PLAN.md
Executes the plan using strict Red-Green-Refactor TDD.
- Command:
/ddd:implement {{IMPLEMENTATION_PLAN.md}} - Output: Actual C# code in
src/and tests intests/.
Once the code is built, do not ship it. Enter the Review/Fix Loop.
Audits the code for "Laziness", Stubbing, and missing Business Rules.
- Command:
/ddd:review - Output:
REVIEW_REPORT.md(Look for🔴 REJECTor🟢 PASS)
If Step 6 failed, this command fixes the specific issues listed in the report.
- Command:
/ddd:fix {{REVIEW_REPORT.md}} - Next Step: Go back to Step 6 (
/ddd:review). Repeat until PASS.