From contextune
Verify and execute detected slash command with user confirmation
npx claudepluginhub joshuarweaver/cascade-code-general-misc-2 --plugin shakestzd-contextune# Contextune Verification Agent **IMPORTANT**: This command is automatically triggered by the Contextune hook when it detects a potential slash command. It runs in a sub-agent to preserve the main agent's context. ## Your Task You are a verification sub-agent. Your job is simple and focused: 1. **Present the detection** to the user clearly 2. **Ask for confirmation** 3. **Execute their choice** 4. **Report results** back concisely ## Input from Hook The Contextune UserPromptSubmit hook provides detection information in the `additionalContext` field of the modified prompt. **Hook outp...
/create-command-v0.1.0Creates a Claude Code slash command from natural language input, inferring name and structure, loading best practices skill, implementing, validating, and testing it.
/create-commandCreates new slash commands via structured workflow: brainstorm ideas, design, scaffold files, validate with tests. Enforces Iron Law by requiring failing tests first.
/cove-isolatedApplies Chain-of-Verification using isolated sub-agents to verify questions or prior responses for maximum accuracy, producing reconciled answers with metadata. Supports --explore, --haiku, --agent flags.
/MEMORY_INTEGRATIONProvides memory-integrated enhanced slash commands (/execute-enhanced, /plan-enhanced, /testui-enhanced, /learn-enhanced) for pattern consultation, application, and continuous learning during execution.
/COMMANDSGuides creation of custom slash commands for Claude Code, covering requirements, file structure, frontmatter fields, best practices, and examples.
Share bugs, ideas, or general feedback.
IMPORTANT: This command is automatically triggered by the Contextune hook when it detects a potential slash command. It runs in a sub-agent to preserve the main agent's context.
You are a verification sub-agent. Your job is simple and focused:
The Contextune UserPromptSubmit hook provides detection information in the additionalContext field of the modified prompt.
Hook output structure:
{
"modifiedPrompt": "/ctx:research ...",
"additionalContext": "๐ฏ Detected: /ctx:research (85% via keyword)"
}
You receive:
/ctx:research)85%)keyword, model2vec, semantic)Extract values from the additionalContext:
# Example additionalContext:
# "๐ฏ Detected: /ctx:research (85% via keyword)"
import re
context = "๐ฏ Detected: /ctx:research (85% via keyword)"
# Parse command
command_match = re.search(r'/[a-z:-]+', context)
detected_command = command_match.group() if command_match else None
# Parse confidence
conf_match = re.search(r'(\d+)%', context)
confidence = int(conf_match.group(1)) if conf_match else 0
# Parse method
method_match = re.search(r'via (\w+)', context)
method = method_match.group(1) if method_match else "unknown"
Use the AskUserQuestion tool to get user choice:
AskUserQuestion(
questions=[{
"question": f"I detected you might want {detected_command}. Which approach?",
"header": "Contextune",
"multiSelect": false,
"options": [
{
"label": f"Run {detected_command}",
"description": f"Use specialized command ({confidence}% confidence via {method})"
},
{
"label": "Continue with original",
"description": "Process your original request instead"
}
]
}]
)
If user chose Option 1 (slash command):
# Execute the detected command
SlashCommand(command=detected_command)
Output to user:
โ
Executing {detected_command}...
Then the command will run and produce its normal output.
If user chose Option 2 (original prompt):
โ
Proceeding with your original request...
Process the original prompt as if Contextune didn't detect anything.
If user chose "Other" with custom text:
Follow their new instructions exactly.
After completing the task, provide a brief summary:
**Contextune Verification Complete**
User choice: [Option 1/Option 2/Custom]
Action taken: [What you did]
Result: [Brief outcome]
[Any important output or findings]
User originally typed: "can you help me analyze this code for bugs"
You present:
๐ฏ **Contextune Detection**
I detected that you might want to run a slash command instead:
**Option 1**: Run `/sc:analyze`
- This is a specialized code analysis command
- Confidence: 85% (keyword match)
**Option 2**: Continue with your original request
- Original: "can you help me analyze this code for bugs"
Which would you prefer?
User replies: "1"
You execute:
โ
Executing /sc:analyze...
[Run the analysis command]
**Contextune Verification Complete**
User choice: Option 1 (/sc:analyze)
Action taken: Ran code analysis
Result: Found 3 potential issues in authentication.py
[Analysis output]
This command is invoked via:
# From hook:
response = {
"continue": True,
"hookSpecificOutput": {
"additionalContext": "[Contextune delegation directive]"
}
}
The main agent receives this context and spawns you as a sub-agent to handle verification.