Implementation Commands
Relevant source files
The following files were used as context for generating this wiki page:
Implementation Commands within the SuperGemini Framework are a subset of the 18 slash commands designed to facilitate active software development. These commands transform the Gemini CLI from a general-purpose AI into a structured development platform by automating feature creation, project compilation, and code refinement. They operate through behavioral instruction injection, using TOML-based configurations to modify the AI's persona and tool selection during the development lifecycle.
Sources: README.md:27-31, CLAUDE.md:14-18, Docs/User-Guide/commands.md:104-108
Core Implementation Workflow
The implementation lifecycle typically follows a structured progression from planning to execution and validation. This systematic approach ensures that domain expertise is applied at each stage, utilizing specialized AI personas like the backend-architect or security-engineer.
Command Orchestration Flow
The following diagram illustrates the typical sequence of implementation commands used during a feature development cycle.
This flow ensures that context is preserved via session management before and after the actual implementation phase.
Sources: Docs/User-Guide/commands.md:164-169, Docs/Reference/quick-start-practices.md:162-167
Primary Implementation Commands
/sg:implement - Feature Development
The /sg:implement command is the primary engine for full-stack feature creation. It utilizes intelligent routing to activate domain specialists based on the provided description. When a user requests an authentication system, for instance, the framework automatically triggers the security-engineer persona and relevant Model Context Protocol (MCP) servers like Context7.
Key Characteristics:
- Auto-Activation: Triggers
frontend-architect,backend-architect, andsecurity-engineerpersonas. - Tooling: Integrates Magic MCP for UI components and Context7 for official patterns.
- Validation: Includes built-in quality gates to ensure code is production-ready.
Sources: Docs/User-Guide/commands.md:110-128, Docs/Reference/basic-examples.md:43-48
/sg:build - Project Compilation
Once implementation is complete, the /sg:build command handles the packaging and compilation of the project. It is managed by the devops-architect persona and is designed for CI/CD compatibility.
Technical Capabilities:
- Optimization: Supports flags like
--optimizefor production-ready artifacts. - Error Recovery: The
--fix-errorsflag allows the framework to attempt automatic resolution of missing dependencies or compilation issues.
Sources: Docs/User-Guide/commands.md:195-200, CLAUDE.md:126-128
/sg:improve - Code Refinement
This command applies systematic enhancements to existing codebases. It relies on the refactoring-expert persona and the Morphllm MCP server for pattern-based transformations.
Refinement Types:
- Performance: Focused on identifying and fixing bottlenecks.
- Security: Hardening code against vulnerabilities.
- Quality: General refactoring to reduce technical debt.
Sources: Docs/User-Guide/commands.md:144-150, Docs/Reference/basic-examples.md:310-315
Command Configuration and Flags
Implementation commands utilize a variety of flags to fine-tune AI behavior and resource usage. These flags allow developers to balance deep reasoning with execution speed.
Common Implementation Flags
| Flag | Purpose | Command Context |
|---|---|---|
--validate | Performs a pre-execution risk assessment. | /sg:implement, /sg:improve |
--safe-mode | Enables maximum safety checks and rollback capability. | /sg:improve, /sg:cleanup |
--introspect | Exposes the AI's structured reasoning and markers. | All Implementation Commands |
--c7 | Activates Context7 MCP for official library patterns. | /sg:implement, /sg:design |
--optimize | Targets production builds and performance tuning. | /sg:build, /sg:improve |
Sources: Docs/Reference/quick-start-practices.md:218-245, Docs/Reference/README.md:112-125
Architectural Integration
Implementation commands are not standalone scripts but are part of a Configuration Distribution System. They reside as TOML files in the ~/.gemini/commands/sg/ directory.
Implementation Logic Sequence
When an implementation command is executed, the framework follows this internal logic:
This mechanism ensures that the AI's behavior is modified via prompt injection rather than direct code execution.
Sources: CLAUDE.md:85-101, Docs/Getting-Started/quick-start.md:46-51
Summary of Specialized Personas
Implementation commands rely on specific specialized agents (Personas) to provide domain-specific expertise during execution.
| Persona | Primary Implementation Role |
|---|---|
backend-architect | Handles server-side logic, APIs, and data persistence. |
frontend-architect | Manages UI/UX architecture and responsive components. |
security-engineer | Acts as a veto authority, ensuring secure coding practices. |
devops-architect | Manages build processes, Git operations, and deployment. |
refactoring-expert | Specializes in code quality and technical debt reduction. |
Sources: CLAUDE.md:116-135, Docs/User-Guide/commands.md:193-210
Conclusion
Implementation commands represent the active "building" phase of the SuperGemini Framework. By combining structured TOML instructions with specialized AI personas and MCP toolsets, these commands enable a systematic approach to software development. Whether creating new features with /sg:implement or preparing for deployment with /sg:build, the framework ensures that quality gates and domain expertise are consistently applied.