一键导入
flow-next-opencode-ralph-init
// Scaffold repo-local Ralph autonomous harness under scripts/ralph/. Use when user runs /flow-next:ralph-init.
// Scaffold repo-local Ralph autonomous harness under scripts/ralph/. Use when user runs /flow-next:ralph-init.
Collect, deduplicate, enrich, triage, and convert code comments (TODO/FIXME/HACK/NOTE/OPTIMIZE/SECURITY/DEBT) into structured, dependency-ordered task lists ready for autonomous agents. Use when processing technical debt, converting code notes into tracked work, preparing task backlogs, or generating executable task graphs. Triggers: TODO triage, fixme list, tech debt scan, task extraction, comment analysis.
Converts any MCP server into a standalone skill package with zero runtime dependencies (no MCP process required). Trigger when user says: "convert this MCP to a skill", "I don't want to use MCP anymore", "wrap MCP X as a skill", "MCP is too heavy", "turn MCP capabilities into a skill". Does: connects to MCP server to extract tool schemas, analyzes source code to infer equivalent Bash commands, generates a ready-to-use skill package and registers it with the agent, optionally asks user to remove the original MCP. Does NOT: execute MCP tool calls to complete tasks (that's using MCP, not converting it); wrap existing Bash scripts as skills (use skill-creator); execute MCP business logic. Optional dependency: skill-creator (improves generated SKILL.md quality).
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
Creates high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services. Use when building MCP servers to integrate APIs, designing tool schemas, or implementing Python (FastMCP) or TypeScript (MCP SDK) servers. Triggers include "MCP server", "tool schema", "model context protocol", or "FastMCP".
Builds and refactors production-ready Python CLI tools and packages with modern pyproject layouts, uv workflows, and robust testing.
Packages repositories into AI-friendly bundles with Repomix and can reconstruct files from existing Repomix outputs. Use when packaging codebases for LLM analysis, creating repository snapshots, reversing bundles, or preparing security audits. Triggers include "repomix", "package codebase", "repomix-unmix", "extract-bundle", "AI-friendly", or "LLM context".
| name | flow-next-opencode-ralph-init |
| description | Scaffold repo-local Ralph autonomous harness under scripts/ralph/. Use when user runs /flow-next:ralph-init. |
Scaffold repo-local Ralph harness. Opt-in only.
scripts/ralph/ in the current repo.scripts/ralph/ already exists, offer to update (preserves config.env).opencode/skill/flow-next-opencode-ralph-init/templates/ into scripts/ralph/.flowctl and flowctl.py from $OPENCODE_DIR/bin/ into scripts/ralph/.scripts/ralph/ralph.sh, scripts/ralph/ralph_once.sh, and scripts/ralph/flowctl.Resolve repo root and OpenCode dir:
ROOT="$(git rev-parse --show-toplevel)"
OPENCODE_DIR="$ROOT/.opencode"
TEMPLATE_DIR="$ROOT/opencode/skill/flow-next-opencode-ralph-init/templates"
Check if scripts/ralph/ exists:
Detect available review backends (skip if UPDATE_MODE=1):
HAVE_RP=0;
if command -v rp-cli >/dev/null 2>&1; then
HAVE_RP=1;
elif [[ -x /opt/homebrew/bin/rp-cli || -x /usr/local/bin/rp-cli ]]; then
HAVE_RP=1;
fi
Determine review backend (skip if UPDATE_MODE=1):
If rp-cli available, ask user:
Which review backend?
a) OpenCode (GPT‑5.2 High)
b) RepoPrompt (macOS, visual builder)
(Reply: "a", "opencode", "b", "rp", or just tell me)
Wait for response. Default if empty/ambiguous: opencode
If only rp-cli available and user chooses rp: use rp
Otherwise: use opencode
If neither available and user requests none: use none
Copy files using bash (MUST use cp, NOT Write tool):
If UPDATE_MODE=1 (updating):
# Backup config.env
cp scripts/ralph/config.env /tmp/ralph-config-backup.env
# Update templates (preserves runs/)
cp "$TEMPLATE_DIR/ralph.sh" scripts/ralph/
cp "$TEMPLATE_DIR/ralph_once.sh" scripts/ralph/
cp "$TEMPLATE_DIR/prompt_plan.md" scripts/ralph/
cp "$TEMPLATE_DIR/prompt_work.md" scripts/ralph/
cp "$TEMPLATE_DIR/watch-filter.py" scripts/ralph/
cp "$OPENCODE_DIR/bin/flowctl" "$OPENCODE_DIR/bin/flowctl.py" scripts/ralph/
chmod +x scripts/ralph/ralph.sh scripts/ralph/ralph_once.sh scripts/ralph/flowctl
# Restore config.env
cp /tmp/ralph-config-backup.env scripts/ralph/config.env
If UPDATE_MODE=0 (fresh install):
mkdir -p scripts/ralph/runs
cp -R "$TEMPLATE_DIR/." scripts/ralph/
cp "$OPENCODE_DIR/bin/flowctl" "$OPENCODE_DIR/bin/flowctl.py" scripts/ralph/
chmod +x scripts/ralph/ralph.sh scripts/ralph/ralph_once.sh scripts/ralph/flowctl
Note: cp -R templates/. copies all files including dotfiles (.gitignore).
Edit scripts/ralph/config.env to set the chosen review backend (skip if UPDATE_MODE=1):
{{PLAN_REVIEW}} with <chosen>{{WORK_REVIEW}} with <chosen>Print next steps (run from terminal, NOT inside OpenCode):
If UPDATE_MODE=1:
Ralph updated! Your config.env was preserved.
Run from terminal:
- ./scripts/ralph/ralph_once.sh (one iteration, observe)
- ./scripts/ralph/ralph.sh (full loop, AFK)
If UPDATE_MODE=0:
Ralph initialized!
Next steps (run from terminal, NOT inside OpenCode):
- Edit scripts/ralph/config.env to customize settings
- ./scripts/ralph/ralph_once.sh (one iteration, observe)
- ./scripts/ralph/ralph.sh (full loop, AFK)
- Uninstall: rm -rf scripts/ralph/