Grok refactor
Skill KHAEntertainment/grok-multiagent-plugin/skills/grok-refactor
Use the new grok-multi-agent-beta model as a sub-agent inside Openclaw and Claude-Code without hitting errors!From the repository description
npx -y skills add KHAEntertainment/grok-multiagent-plugin --skill grok-refactorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.5 KB, as published. Nobody here has run it
Grok Swarm
Multi-agent intelligence powered by Grok 4.20 Multi-Agent Beta
Give any AI coding agent access to a 4-agent swarm with ~2M token context for code analysis, refactoring, generation, and complex reasoning.
- Version: 1.0.8
- Platforms: OpenClaw, Claude Code
- Modes: analyze, refactor, code, reason, orchestrate
Overview
Grok 4.20 coordinates 4 agents (orchestrator + specialists + critics) to:
- Analyze codebases for security, architecture, and bugs
- Refactor code while preserving behavior
- Generate features, tests, and boilerplate
- Reason through complex architectural decisions
Features
- 4-Agent Coordination — Multi-perspective reasoning
- Massive Context — ~2M token window
- File Writing — Write annotated code blocks directly to disk
- Tool Passthrough — Use OpenAI-format tools with Grok
Usage
OpenClaw
tools.grok_swarm({
prompt: "Analyze security of this auth module",
mode: "analyze",
files: ["src/auth/*.ts"]
});
Claude Code
/grok-swarm-analyze Review auth module security
/grok-swarm-refactor Convert to async/await
/grok-swarm-code Write FastAPI endpoint
Task Modes
| Mode | Description |
|---|---|
analyze | Security audits, architecture review |
refactor | Modernization, migration |
code | Feature generation, tests |
reason | Multi-perspective reasoning |
orchestrate | Custom agent handoff |
Requirements
- Python 3.8+
- Node.js 18+
openai>=1.0.0- OpenRouter API key with Grok 4.20 access
API Key
Set your API key:
export OPENROUTER_API_KEY=sk-or-v1-...
Or create ~/.config/grok-swarm/config.json:
mkdir -p ~/.config/grok-swarm
echo '{"api_key": "sk-or-v1-..."}' > ~/.config/grok-swarm/config.json
chmod 600 ~/.config/grok-swarm/config.json
Grounding Prompt (optional)
Grok's role and default behaviour can be customised by creating a plain-text file at ~/.config/grok-swarm/system-prompt.txt. Its contents are prepended to every mode-specific system prompt. Leave the file absent to use the built-in default.
cat > ~/.config/grok-swarm/system-prompt.txt <<'EOF'
You are Grok, a senior engineer focused on security and correctness above all else.
EOF
Usage Stats
Track token spend across sessions:
grok-swarm stats # all-time totals
grok-swarm stats --days 7 # last 7 days
Installation
# Via ClawHub
clawhub install grok-swarm
# Via npm
npm install @khaentertainment/grok-swarm