⚖️ LEGAL DISCLAIMER: This validation guide covers third-party commands for Google's AI CLI tool (
gemini-cli). "Gemini" is a trademark of Google LLC. We are not affiliated with or endorsed by Google LLC.
Before testing the Nexo-Agents commands, ensure your environment meets these requirements:
# Check Google AI CLI version (should be 2025+)
gemini --version
# Verify command discovery paths
ls ~/.gemini/commands/ # Global commands
ls .gemini/commands/ # Project commands (if exists)# Verify TOML syntax for all commands (using Python)
python3 -c "
import toml
import os
errors = []
for root, dirs, files in os.walk('commands'):
for file in files:
if file.endswith('.toml'):
filepath = os.path.join(root, file)
try:
with open(filepath, 'r') as f:
toml.load(f)
except Exception as e:
errors.append((filepath, str(e)))
if errors:
print('Errors found:')
for path, error in errors:
print(f'{path}: {error}')
exit(1)
else:
print('All TOML files are valid!')
"String Quoting for Prompts:
- Use literal strings
'''...'''for prompts containing shell commands with backslashes - Literal strings don't process escape sequences, avoiding "Reserved escape sequence" errors
- This is critical for grep patterns like
grep 'api\|key'or regex patterns
Example - Incorrect (causes "Reserved escape sequence used" error):
prompt = """
!{grep -i 'api\|key' .env.example}
"""Example - Correct:
prompt = '''
!{grep -i 'api\|key' .env.example}
'''Why this matters:
- TOML basic strings
"""..."""process escape sequences like\n,\t,\\ - Invalid sequences like
\|,\w,\scause parsing errors - Literal strings
'''...'''only process'''and\\, treating other backslashes literally - All Nexo-Agents commands use literal strings for reliability
Reference: TOML v1.0.0 Specification - Literal Strings
Test that Google AI CLI can discover and load commands:
# Test on-demand loading (terminal command)
gemini --include nexo-agents/engineering/security-analyst.toml "/security-analyst deps"# First, install the command globally
cp nexo-agents/engineering/security-analyst.toml ~/.gemini/commands/
# Then start the CLI and test discovery
gemini
# Inside the TUI interface:
/help
# Look for security-analyst in the command listTest {{args}} functionality with various input patterns:
# Simple arguments (terminal command)
gemini --include nexo-agents/engineering/security-analyst.toml "/security-analyst deps scan"
# Complex arguments with spaces (terminal command)
gemini --include nexo-agents/engineering/code-reviewer.toml "/code-reviewer file 'src/main.py' quality"
# No arguments (should handle gracefully) (terminal command)
gemini --include nexo-agents/engineering/ai-engineer.toml "/ai-engineer"# Start the CLI
gemini
# Inside TUI, test various argument patterns:
/security-analyst deps scan
/code-reviewer file src/main.py quality
/ai-engineerVerify !{command} context gathering works:
# Test in a Python project
cd /path/to/python/project
gemini --include nexo-agents/engineering/security-analyst.toml "/security-analyst deps"
# Should discover requirements.txt, pyproject.toml, etc.
# Test in a Node.js project
cd /path/to/node/project
gemini --include nexo-agents/engineering/ai-engineer.toml "/ai-engineer llm setup"
# Should discover package.json, node_modules, etc.
# Test in a Git repository
cd /path/to/git/repo
gemini --include nexo-agents/engineering/code-reviewer.toml "/code-reviewer diff"
# Should discover git history, recent commits, etc.Test on different operating systems:
# Copy command to Windows Gemini directory
Copy-Item nexo-agents\engineering\security-analyst.toml $env:USERPROFILE\.gemini\commands\
# Test execution
gemini "/security-analyst deps scan"# Copy command to Unix Gemini directory
cp nexo-agents/engineering/security-analyst.toml ~/.gemini/commands/
# Test execution
gemini "/security-analyst deps scan"# Setup test environment
mkdir test-project && cd test-project
echo "requests==2.25.0" > requirements.txt
echo "flask==1.0.0" >> requirements.txt
# Test dependency scanning
gemini --include ../nexo-agents/engineering/security-analyst.toml "/security-analyst deps"
# Expected behavior:
# - Should discover requirements.txt via !{cat requirements.txt}
# - Should identify vulnerable packages
# - Should provide CVSS scores and remediation steps# Setup test environment with Git
git init test-repo && cd test-repo
echo "def bad_function():\n password = 'hardcoded123'\n return password" > main.py
git add . && git commit -m "Add insecure code"
# Test code review
gemini --include ../nexo-agents/engineering/code-reviewer.toml "/code-reviewer file main.py"
# Expected behavior:
# - Should discover main.py via !{find . -name "*.py"}
# - Should identify hardcoded credentials
# - Should suggest security improvements# Setup Python AI project
mkdir ai-project && cd ai-project
echo "openai==1.0.0\nlangchain==0.1.0" > requirements.txt
# Test AI implementation guidance
gemini --include ../nexo-agents/engineering/ai-engineer.toml "/ai-engineer rag vector-store"
# Expected behavior:
# - Should discover AI dependencies via !{cat requirements.txt | grep -E "(openai|langchain)"}
# - Should provide RAG implementation guidance
# - Should suggest vector database options# Setup React project structure
mkdir ui-project && cd ui-project
mkdir components && echo '{"dependencies": {"react": "^18.0.0"}}' > package.json
# Test UI component generation
gemini --include ../nexo-agents/design/ui-designer.toml "/ui-designer component button react"
# Expected behavior:
# - Should discover React via !{cat package.json}
# - Should generate React component code
# - Should include Tailwind/CSS styling# Measure command execution time
time gemini --include nexo-agents/engineering/security-analyst.toml "/security-analyst deps"
# Target: < 5 seconds for context gathering + response# Compare old vs new command token usage
# Old format: ~800-1200 tokens
# New format: ~300-500 tokens (50-70% reduction)# Test shell command limits work correctly
ls -la | wc -l # Should be manageable number via head/tail limits# Test with malformed arguments
gemini --include nexo-agents/engineering/security-analyst.toml "/security-analyst invalid-command"
# Expected: Clear error message explaining valid options# Test in empty directory
mkdir empty-test && cd empty-test
gemini --include ../nexo-agents/engineering/security-analyst.toml "/security-analyst deps"
# Expected: Graceful handling of missing files# Test when shell commands fail (e.g., no git history)
mkdir no-git && cd no-git
gemini --include ../nexo-agents/engineering/code-reviewer.toml "/code-reviewer diff"
# Expected: Fallback behavior, not command failureCommands pass validation if they meet ALL criteria:
- Command loads successfully via
--include - Command appears in
/helpwhen installed -
{{args}}parsing works with various input patterns - Shell commands
!{command}execute without errors - Context gathering discovers relevant project files
- Output is structured and actionable
- Response time < 10 seconds on typical projects
- Token usage 50-70% less than original format
- Shell commands complete within 2 seconds
- Memory usage remains reasonable (< 100MB)
- Works on Windows, macOS, and Linux
- Compatible with Gemini CLI 2025+
- No conflicts with existing Gemini CLI commands
- Graceful error handling for edge cases
- Clear, actionable output
- Helpful error messages
- Intuitive argument patterns
- Consistent behavior across commands
## Validation Report: [Command Name]
**Date**: [YYYY-MM-DD]
**Tester**: [Name]
**Environment**: [OS, Gemini CLI version]
### Test Results
- [ ] Basic discovery: PASS/FAIL
- [ ] Argument parsing: PASS/FAIL
- [ ] Shell integration: PASS/FAIL
- [ ] Error handling: PASS/FAIL
- [ ] Performance: PASS/FAIL
### Issues Found
1. [Issue description]
2. [Issue description]
### Recommendations
1. [Recommendation]
2. [Recommendation]
**Overall Status**: APPROVED/NEEDS_WORKBefore marking the migration complete:
- Run full test suite on all 44 commands
- Test on 3 different operating systems
- Validate with real project environments
- Performance benchmark against original commands
- User acceptance testing with actual workflows
- Documentation review for accuracy and completeness
Target: 100% command compatibility with zero breaking changes to core functionality.