structured-thinking-mcp
Version:
MCP server for structured thinking framework - Step-by-step reasoning and systematic problem-solving for LLMs
267 lines (214 loc) • 11.2 kB
YAML
tool:
name: chain_of_thought
description: >-
4-step SuperGemini Framework thinking with sg command integration and agent
persona system.
Step 1: Analyze user intent, files involved, expected outcome.
Step 2: sg Command Selection & TOML Reading (MANDATORY)
STRONG preference for sg commands. Skip only in exceptional cases.
SKIP only when ALL conditions met:
• Response ≤ 2 lines of text
• No file/code operations
• No analysis/reasoning required
• Pure information recall (date, math, greeting)
• Information already in system-reminder
COMMAND required when ANY detected:
• File operations (read/write/edit)
• Code analysis/generation
• Multi-step reasoning (≥3 steps)
• Project/system work
• Keywords: analyze, implement, fix, create, build, debug, refactor
Step 3: Agent Persona Extraction & Reading
Extract and read agent personas from TOML commands (.toml files):
• Extract agents array from selected TOML command: agents = ["system-architect", "security-engineer", ...]
• Read individual agent definitions from ~/.gemini/agents/{agents}.md
• Reference AGENTS.md (system-reminder) for additional context if needed
• Document tracking: if agents already read this session, refer to system-reminder content
Step 4: Agent Embodiment & Problem Solving Execution
Embody extracted agent personas and execute problem solving:
• Apply specialized knowledge, skills, and problem-solving approaches from {agents}
• Multi-agent coordination: if multiple {agents}, coordinate their distinct perspectives
• Execute solution using agent methodologies and SuperGemini Framework principles
Available sg commands: analyze, build, cleanup, design, document, estimate,
explain, git, implement, improve, index, load, reflect, save, select-tool,
test, troubleshoot
inputSchema:
thought:
description: "Step 1: Intent, files, outcome | Step 2: sg command & TOML reading | Step 3: Agent extraction & reading | Step 4: Agent embodiment & execution"
nextThoughtNeeded:
description: Whether another thought step is needed
thoughtNumber:
description: "Current step (1: Analysis, 2: sg Command & TOML, 3: Agent Extraction, 4: Agent Embodiment & Execution)"
totalThoughts:
description: Total steps (usually 4)
commandSelection:
description: "Step 2: Select command or skip"
type:
description: "'command' | 'skip' | 'skip_reason'"
command:
description: Selected command
reason:
description: Skip reason
isRevision:
description: Whether this revises previous thinking
revisesThought:
description: Which thought is being reconsidered
branchFromThought:
description: Branching point thought number
branchId:
description: Branch identifier
needsMoreThoughts:
description: If more thoughts are needed beyond initial estimate
aerrors:
invalidThought: "Invalid thought: must be a string"
invalidThoughtNumber: "Invalid thoughtNumber: must be a number"
invalidTotalThoughts: "Invalid totalThoughts: must be a number"
invalidNextThoughtNeeded: "Invalid nextThoughtNeeded: must be a boolean"
commandFieldRequired: "commandSelection type \"command\" requires a \"command\" field"
reasonFieldRequired: "commandSelection type \"{type}\" requires a \"reason\" field"
invalidSelectionType: 'Invalid commandSelection type: {type}. Must be "command", "skip", or "skip_reason"'
unexpectedThoughtNumber: "Unexpected thought number: {number}. Expected 1-4 or expansion beyond 4."
mandatoryViolation: 'Step {step} requires
commandSelection.\n\nProvide:\n{\n \"commandSelection\": {\n \"type\": \"command\" | \"skip\" | \"skip_reason\",\n \"command\": \"name\" (if command),\n \"reason\": \"explanation\" (if skip)\n }\n}\n\nAvailable sg commands: {commands}\nTOML Path: {path}\nAgents Path: ~/.gemini/agents/'
missingTomlDocument: "No TOML document selected for Step 2.\\n\\nAvailable sg commands (.toml files in ~/.gemini/commands/sg/): {commands}\\n\\nPlease select a command to read its .toml documentation and extract agents array."
missingAgents: "No agents found in Step 3.\\n\\nThe selected .toml document should contain an 'agents' array.\\nExample: agents =
[\\\"system-architect\\\", \\\"security-engineer\\\"]\\n\\nAvailable agents (.md files in ~/.gemini/agents/): {availableAgents}\\n\\nPlease ensure the TOML file includes agent specifications or select a different command."
unknownTool: "Unknown tool: {name}"
messages:
autoExecute: "Auto-executing: Reading {command}.toml SuperGemini command documentation and extracting agents"
skipMessage: "Autonomous skip (Evidence-based validation passed - truly trivial): {reason}"
systemReminderSkip: "Skip: Information already available in system-reminder context"
systemReminder: "System reminder: {reason}"
commandPreference: "SuperGemini Framework Protocol: Defaulting to sg command selection (90% threshold - Quality Gates enforced)"
skipWarning: "CAUTION: Skip selected - verify all 4 conditions met (≤2 lines, no files, no analysis, pure recall)"
agentExtracted: "Agents extracted from {command}.toml: {agents}"
agentEmbodiment: "Embodying agent personas: {agentList} - applying specialized perspectives"
multiAgentMode: "Multi-agent coordination: {coordination} perspectives working together"
duplicateAgentRead: >-
Agent documents already read this session: {agents}
Please refer to system-reminder content and apply agent perspectives to
proceed with problem solving.
useSystemReminderAgents: "System-reminder reference: Use already read agent definitions and AGENTS.md content for persona embodiment."
agentsReference: Reference AGENTS.md (system-reminder) for additional agent context if needed
documentRead: "Document tracked: {command}.toml read in step {step}"
skipSelectionDocumentRead: "Skip: Command document already read - no selection required"
duplicateDocumentRead: >-
Document already read this session: {command}.toml
Please refer to system-reminder content and apply that information to
proceed with next step analysis.
useSystemReminder: "System-reminder reference: Use already read {command}.toml content to continue analysis."
documentAttentionRequired: "ATTENTION: {command}.toml guidance must be applied. Demonstrate TOML-based reasoning before proceeding."
applyTomlGuidance: "Apply {command}.toml methodology: Extract agents array and embody personas per TOML specifications."
tomlBasedReasoning: "TOML Integration: {command}.toml agents → Agent extraction → Persona embodiment → Execution strategy alignment required."
serverRunning: SuperGemini Framework Structured Thinking MCP Server running on stdio
fatalError: "Fatal error running SuperGemini Framework server: {error}"
templates:
agentEmbodiment: >-
**SuperGemini Framework Agent Persona Embodiment**
From {command}.toml agents array: {agents}
**Embodying Agent Personas**: {agents}
**Agent Definitions**: ~/.gemini/agents/{agents}.md (read individually)
**AGENTS.md Reference**: Available in system-reminder for additional context
**Multi-Agent Perspectives**: {agents} specialized viewpoints working together
**Problem-Solving Approach**: Apply each {agents} specialized knowledge, skills, and perspective
*Evidence > assumptions: Embody the {agents} personas with Quality Gates validation.*
agentDuplicateReminder: >-
**SuperGemini Framework Agent Reminder**
Agent documents already read: {agents}
**System Reminder**: Use previously read agent definitions and AGENTS.md content
**Persona Embodiment**: Apply the specialized perspectives already available
**Problem Solving**: Proceed with agent viewpoints from system-reminder context
*SSOT Principle: Apply existing persona knowledge without re-reading - maintain single source of truth.*
tomlAnalysis: >-
**TOML-Based Cognitive Attention Protocol (SuperGemini Framework)**
You have just read {command}.toml. Now apply meta-cognitive attention:
**TOML Perspective**: What core instructions does {command}.toml provide?
**Agent Extraction**: What agents are specified in the TOML agents array?
**Persona Strategy**: Based on {command}.toml guidance, which agent perspectives should be embodied?
**Multi-Agent Coordination**: How should multiple agents coordinate their distinct perspectives?
**Implementation Approach**: What methodology does {command}.toml recommend for this scenario?
*Code > documentation: Apply the TOML's framework with evidence-based execution.*
attentionPrompt: "**Meta-Cognitive Attention Required (Quality Gates Active)**: The {command}.toml document you just read contains specific guidance for this task. Before proceeding, explicitly acknowledge how you will apply the TOML's instructions and agent specifications to the user's request. Do not continue without demonstrating TOML-based reasoning aligned with SuperGemini principles."
console:
thoughtPrefix:
default: Chain of Thought
revision: Revising
branch: Branching
thoughtContext:
revision: " (revising thought {number})"
branch: " (from thought {from}, ID: {id})"
config:
commandPath: ~/.gemini/commands/sg/
commandExtension: .toml
agentsPath: ~/.gemini/agents/
agentsExtension: .md
availableCommands:
- analyze
- build
- cleanup
- design
- document
- estimate
- explain
- git
- implement
- improve
- index
- load
- reflect
- save
- select-tool
- test
- troubleshoot
availableAgents:
- backend-architect
- devops-architect
- frontend-architect
- learning-guide
- performance-engineer
- python-expert
- quality-engineer
- refactoring-expert
- requirements-analyst
- root-cause-analyst
- security-engineer
- system-architect
- technical-writer
requireSelectionFromStep: 2
step3RequiresAgentSelection: true
enableAutoRead: true
commandPreference: 0.9
referenceHintMode: superclaude
agentSystem:
enabled: true
extractFromToml: true
agentEmbodimentStep: 3
multiAgentCoordination: true
personaProblemSolving: true
readIndividualAgents: true
referenceAgentsMd: true
preventDuplicateAgentReads: true
useSystemReminderForAgents: true
documentTracking:
enabled: true
skipSelectionIfDocumentRead: true
preventDuplicateReads: true
useSystemReminderForDuplicates: true
trackedDocuments:
- analyze
- build
- cleanup
- design
- document
- estimate
- explain
- git
- implement
- improve
- index
- load
- reflect
- save
- select-tool
- test
- troubleshoot