Gemini CLI Extension with Custom Commands for Planning, DDD Refactoring, and SQL Analysis.
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-commandsGeneral-purpose commands for planning and implementing features in any codebase.
- New Plan: Generates a comprehensive implementation plan for a feature.
- Command:
/plan:new "{{feature_description}}"
- Command:
- Refine Plan: Refines an existing plan based on user feedback.
- Command:
/plan:refine {{path/to/plan.md}}
- Command:
- Implement Plan: Executes the plan using a strict step-by-step TDD approach.
- Command:
/plan:implement {{path/to/plan.md}}
- Command:
Specialized commands for analyzing legacy database code.
- Analyze SQL: Deep analysis of legacy Stored Procedures. Extracts business rules, data dictionaries, and test cases to prepare for refactoring.
- Command:
/sql:analyze {{path/to/legacy_proc.sql}} - Output:
ANALYSIS_[ProcName].md
- Command:
A complete workflow for refactoring legacy SQL into a .NET 10, 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}} - Input: Path to existing code file or directory.
- Output:
user-stories.md
See sql:analyze above. This is the entry point for the DDD workflow.
Transforms the Analysis into a pure Domain Model (Aggregates, Entities, Rules).
- Command:
/ddd:logical {{ANALYSIS_[ProcName].md}} - Input: The Analysis Markdown file (from
sql:analyze). - Output:
LOGICAL_ARCHITECTURE.md - Human Action: Check the Traceability Matrix. Ensure every
BR-###from Step 1 has a home in the new design. - Reset:
/clear
Maps the Domain Model to .NET 10, MediatR, and EF Core patterns.
- Command:
/ddd:physical {{LOGICAL_ARCHITECTURE.md}} - Input: Logical Architecture Markdown.
- Output:
PHYSICAL_ARCHITECTURE.md - Human Action: Verify the Solution Tree and EF Core Code-First strategy.
- Reset:
/clear
Generates a step-by-step TDD execution plan with hygiene checks.
- Command:
/ddd:plan {{PHYSICAL_ARCHITECTURE.md}} - Input: Physical & Logical Architectures.
- Output:
IMPLEMENTATION_PLAN.md - Human Action: Ensure "Phase 1" includes steps to delete legacy code and boilerplate.
- Reset:
/clear
Executes the plan using strict Red-Green-Refactor TDD.
- Command:
/ddd:implement {{IMPLEMENTATION_PLAN.md}} - Input: The Plan, plus read-access to all 3 Architecture/Analysis docs.
- Output: Actual C# code in
src/and tests intests/. - Human Action: Monitor the TDD loop. The agent should output "Tests Passed" after every task.
- Reset:
/clear
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 - Input: The full codebase +
ANALYSIS.md. - Output:
REVIEW_REPORT.md - Status: Look for
🔴 REJECTor🟢 PASS. - Reset:
/clear
If Step 6 failed, this agent fixes the specific issues listed in the report.
- Command:
/ddd:fix {{REVIEW_REPORT.md}} - Input: The Review Report.
- Output: Modified C# code.
- Next Step: Go back to Step 6 (
/ddd:review) and run the Review again. Repeat until PASS. - Reset:
/clear
| File | Purpose | Source of Truth For... |
|---|---|---|
ANALYSIS_*.md |
Legacy Deconstruction | Test Data (Inputs/Outputs) |
LOGICAL_*.md |
Domain Design | Business Rules (Invariants) |
PHYSICAL_*.md |
Tech Spec | Structure (Classes, MediatR) |
IMPLEMENTATION_*.md |
Task List | Sequence (What to do next) |
REVIEW_REPORT.md |
Audit Log | Defects (What to fix) |
- Read the Analysis: The quality of the entire build depends on Step 1. If the Analysis misses a rule, the code will miss it too.
- Don't Combine Contexts: Always
/clear. If you feed the Implementation Agent (/ddd:implement) the raw SQL from Step 1, it might hallucinate legacy patterns (likeDataSet) into your clean .NET 10 code. - Code-First: If the agent tries to write SQL scripts, stop it. Point to the
PHYSICAL_ARCHITECTURE.mdwhich mandatesIEntityTypeConfiguration.