Analysis & Design Commands
Relevant source files
The following files were used as context for generating this wiki page:
Analysis & Design Commands form the foundational layer of the SuperGemini Framework's systematic development workflow. These commands enable users to transform vague ideas into concrete requirements, assess existing codebases for quality or security issues, and architect complex system designs before implementation begins. By leveraging specialized AI agents and Model Context Protocol (MCP) servers, these commands provide deep introspection and structured planning capabilities.
These commands operate through "Persona Mode," where the Gemini CLI embodies specific roles like System Architect or Requirements Analyst, rather than spawning separate processes. This ensures that the analysis is context-aware and aligned with professional software engineering standards.
Sources: Docs/User-Guide/commands.md:120-140, CLAUDE.md:120-135, Docs/Getting-Started/quick-start.md:65-80
Core Analysis Commands
The framework provides several high-level commands for project discovery and technical assessment.
/sg:analyze
The /sg:analyze command is the primary tool for code assessment and interactive project discovery. It can be used for "Brainstorm Mode" to elicit requirements or for deep technical audits of existing source code.
- Brainstorming: When used with a project description, it triggers a Socratic dialogue to define scope and feasibility.
- Technical Audit: When pointed at a path, it evaluates the codebase across specific domains like security, performance, or quality.
Key Parameters:
| Parameter | Type | Description |
|---|---|---|
[path] | Positional | Target directory or file for analysis. |
--focus | Flag | Specifies the domain: quality, security, performance, or architecture. |
--depth | Flag | Controls analysis intensity (e.g., deep). |
--introspect | Flag | Triggers reflective analysis mode. |
Sources: Docs/User-Guide/commands.md:143-162, Docs/Reference/basic-examples.md:35-60
/sg:troubleshoot
Focused on problem diagnosis, this command uses the root-cause-analyst agent and the Sequential Thinking MCP server to systematically identify the source of runtime or build errors.
Sources: Docs/User-Guide/commands.md:164-180, Docs/Reference/basic-examples.md:65-75
Design & Specification Framework
Architecture and design commands allow for the creation of technical specifications, schemas, and implementation roadmaps.
/sg:design
This command is used to generate technical designs and visual specifications. It can output content in various formats including OpenAPI specs for APIs or Mermaid diagrams for system architecture.
Sources: Docs/User-Guide/commands.md:237-241
/sg:workflow
Before implementation, /sg:workflow generates a structured development roadmap. It decomposes high-level requirements into actionable tasks, often utilizing the Architect and Project Manager specialists.
Sources: Docs/User-Guide/commands.md:214-228
Command Orchestration Flow
The following diagram illustrates the typical progression from initial analysis to a finalized design within the SuperGemini Framework.
The diagram shows how /sg:analyze feeds into the design phase, which subsequently prepares the implementation tasks.
Sources: Docs/User-Guide/commands.md:247-260, Docs/Reference/basic-examples.md:105-120
The Spec-Panel System
The /sg:spec-panel command is a specialized analysis tool that convenes a multi-expert panel to review and improve technical specifications. It utilizes a sophisticated "Panel of Experts" model to provide diverse perspectives on documentation quality.
Expert Panel Composition
The command simulates interactions between renowned software engineering personas.
| Expert | Domain | Focus Area |
|---|---|---|
| Karl Wiegers | Requirements Engineering | SMART criteria, testability, and clarity. |
| Martin Fowler | Architecture & Design | API design, patterns, and bounded contexts. |
| Michael Nygard | Production Systems | Reliability, failure modes, and operational excellence. |
| Gojko Adzic | Specification by Example | BDD scenarios and executable requirements. |
Sources: SuperGemini/Commands/spec-panel.toml:35-100
Multi-Expert Interaction Logic
The system supports different interaction modes to facilitate specification review.
- Critique Mode (
--mode critique): A systematic review where issues are identified with severity levels and priority rankings. - Discussion Mode (
--mode discussion): Collaborative dialogue where experts build upon each others' insights. - Socratic Mode (
--mode socratic): A learning-focused mode that uses questioning to reveal underlying assumptions.
Sources: SuperGemini/Commands/spec-panel.toml:115-180
Spec-Panel Sequence
The sequence diagram below demonstrates the internal coordination between MCP servers and agents during a /sg:spec-panel execution.
The diagram represents the workflow where the Sequential MCP orchestrates the interactions between the expert panel agents to produce a consolidated report.
Sources: SuperGemini/Commands/spec-panel.toml:110-120, CLAUDE.md:165-180
Technical Implementation
Analysis and design commands are defined as TOML configuration files that inject behavioral instructions into the Gemini CLI.
Configuration Structure
Command behavior is determined by several keys within the .toml source files:
- agents: A list of persona files (e.g.,
system-architect,quality-engineer) that are activated. - mcp_servers: External servers utilized for specific logic (e.g.,
sequentialfor reasoning,context7for documentation patterns). - prompt: The core instruction set that defines how the AI should handle flags and inputs.
Sources: SuperGemini/Commands/spec-panel.toml:1-10, CLAUDE.md:185-205
Agent Activation Map
Analysis commands trigger specific specialists based on the task context.
The class diagram shows the relationship between analysis commands and the specialized agents they activate based on user-provided flags.
Sources: CLAUDE.md:210-235, Docs/User-Guide/commands.md:143-162
Summary
Analysis & Design Commands provide the necessary rigor for professional software development within the SuperGemini Framework. By combining exploratory commands like /sg:analyze with structured design tools like /sg:design and the multi-expert /sg:spec-panel, the framework ensures that implementation is preceded by thorough requirements discovery and architectural validation. This phase is critical for maintaining project quality and ensuring that the subsequent implementation phase is grounded in sound engineering principles.