Set up flywheel prerequisites for this project.
Set up the agent-flywheel for this project. $ARGUMENTS
Check and configure all prerequisites:
MCP server (build): Locate and verify the agent-flywheel MCP server is built.
skills/ directory is typically a symlink to the repo root's skills/ folder. Resolve it to find mcp-server/ as a sibling:
SKILLS_REAL=$(readlink ~/.claude/plugins/marketplaces/local-desktop-app-uploads/agent-flywheel/skills 2>/dev/null)
MCSRV="${SKILLS_REAL%/skills}/mcp-server"
test -f "$MCSRV/dist/server.js" && echo "OK: $MCSRV" || echo "MISSING: $MCSRV"
cd <resolved-mcp-server-path> && npm install && npm run build
MCP server (registered): Verify the MCP server is actually loaded in this Claude Code session.
ToolSearch("flywheel_profile") to check if flywheel tools are available.agent-flywheel server entry to your Claude Code MCP config (.mcp.json in the plugin dir or ) and restart Claude Code."claude_desktop_config.jsonbr CLI: Run br --version via Bash.
.beads/ directory. If missing, offer to run br init.bv CLI: Run bv --version via Bash. Report status.
agent-mail: Test curl -s --max-time 3 http://127.0.0.1:8765/health/liveness via Bash.
health_check via agent-mail MCP tool.uv run python -m mcp_agent_mail.cli serve-http"Pre-commit guard: Call install_precommit_guard via agent-mail MCP tool with project_key and code_repo_path set to the current working directory.
DCG (Destructive Command Guard): Check if a PreToolUse hook exists in the project's .claude/settings.json that blocks destructive commands. If not, create one:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash -c 'echo \"$CLAUDE_TOOL_INPUT\" | jq -r .command | grep -qiE \"(rm\\s+-rf|git\\s+reset\\s+--hard|git\\s+clean\\s+-f|git\\s+checkout\\s+\\.\\s|git\\s+push\\s+--force|drop\\s+table|truncate\\s+table)\" && echo \"BLOCKED: Destructive command detected. Ask the user for explicit permission.\" && exit 1 || exit 0'"
}
]
}
]
}
}
If .claude/settings.json already exists with other hooks, merge the PreToolUse entry rather than overwriting. This provides mechanical enforcement beyond the social rules in AGENTS.md.
Register agent: Call register_agent via agent-mail MCP tool with project_key and agent_name: "Orchestrator".
Display a health checklist:
✅ MCP server built (dist/server.js exists)
✅ MCP server registered (flywheel_profile tool available)
✅ br v1.x.x — beads initialized
✅ bv v1.x.x
✅ agent-mail — healthy
✅ pre-commit guard installed
✅ DCG hook active
✅ agent registered as "Orchestrator"
Gate recommendation:
/flywheel."/flywheel until all checks pass. Fix the items marked ❌ above and re-run /flywheel-setup."