ワンクリックで
flow-next-opencode-sync
// Manually trigger plan-sync to update downstream task specs after implementation drift. Use when code changes outpace specs.
// Manually trigger plan-sync to update downstream task specs after implementation drift. Use when code changes outpace specs.
Scaffold repo-local Ralph autonomous harness under scripts/ralph/. Use when user runs /flow-next:ralph-init.
John Carmack-level implementation review via RepoPrompt or OpenCode. Use when reviewing code changes, PRs, or implementations. Triggers on /flow-next:impl-review.
Carmack-level plan review via RepoPrompt or OpenCode. Use when reviewing Flow epic specs or design docs. Triggers on /flow-next:plan-review.
Comprehensive codebase assessment for agent and production readiness. Scans 8 pillars (48 criteria), verifies commands work, checks GitHub settings. Reports everything, fixes agent readiness only. Triggers on /flow-next:prime.
Local install of flowctl CLI and CLAUDE.md/AGENTS.md instructions. Use when user runs /flow-next:setup.
Interview user in-depth about an epic, task, or spec file to extract complete implementation details. Use when user wants to flesh out a spec, refine requirements, or clarify a feature before building. Triggers on /flow-next:interview with Flow IDs (fn-1, fn-1.2) or file paths.
| name | flow-next-opencode-sync |
| description | Manually trigger plan-sync to update downstream task specs after implementation drift. Use when code changes outpace specs. |
Manually trigger plan-sync to update downstream task specs.
CRITICAL: flowctl is BUNDLED — NOT installed globally. Always use:
ROOT="$(git rev-parse --show-toplevel)"
OPENCODE_DIR="$ROOT/.opencode"
FLOWCTL="$OPENCODE_DIR/bin/flowctl"
Arguments: $ARGUMENTS
Format: <id> [--dry-run]
<id> - task ID (fn-N.M) or epic ID (fn-N)--dry-run - show changes without writingROOT="$(git rev-parse --show-toplevel)"
OPENCODE_DIR="$ROOT/.opencode"
FLOWCTL="$OPENCODE_DIR/bin/flowctl"
Parse $ARGUMENTS for:
ID--dry-run flag = DRY_RUN (true/false)Get cross-epic config (defaults to false):
CROSS_EPIC="$($FLOWCTL config get planSync.crossEpic --json 2>/dev/null | jq -r '.value // empty')"
if [[ -z "$CROSS_EPIC" || "$CROSS_EPIC" == "null" ]]; then
CROSS_EPIC="false"
fi
Validate ID format:
fn-Detect ID type:
. (e.g., fn-1.2) → task ID. (e.g., fn-1) → epic IDtest -d .flow || { echo "No .flow/ found. Run flowctl init first."; exit 1; }
If .flow/ missing, output error and stop.
$FLOWCTL show <ID> --json
If fails:
flowctl list to see available."flowctl epics to see available."Stop on failure.
For task ID input:
# Extract epic from task ID
EPIC=$(echo "<task-id>" | sed 's/\.[0-9]*$//')
# Get all tasks in epic
$FLOWCTL tasks --epic "$EPIC" --json
Filter to status: todo or status: blocked. Exclude source task.
For epic ID input:
$FLOWCTL tasks --epic "<epic-id>" --json
Find source task (agent requires COMPLETED_TASK_ID):
status: donestatus: in_progressFilter remaining to status: todo or status: blocked (downstream).
If no downstream tasks:
No downstream tasks to sync (all done or none exist).
Stop (success).
Build context and spawn via Task tool:
Sync task specs from <source> to downstream tasks.
COMPLETED_TASK_ID: <source task id>
FLOWCTL: $OPENCODE_DIR/bin/flowctl
EPIC_ID: <epic id>
DOWNSTREAM_TASK_IDS: <comma-separated list>
DRY_RUN: <true|false>
CROSS_EPIC: <true|false>
<if DRY_RUN>
DRY RUN MODE: Report changes but do NOT edit files.
</if>
Use Task tool with subagent_type: flow-next:plan-sync
Normal mode:
Plan-sync: <source> -> downstream tasks
Scanned: N tasks (<list>)
<agent summary>
Dry-run mode:
Plan-sync: <source> -> downstream tasks (DRY RUN)
<agent summary>
No files modified.
| Case | Message |
|---|---|
| No ID | "Usage: /flow-next:sync [--dry-run]" |
No .flow/ | "No .flow/ found. Run flowctl init first." |
| Invalid format | "Invalid ID format. Use fn-N (epic) or fn-N.M (task)." |
| Task not found | "Task not found. Run flowctl list to see available." |
| Epic not found | "Epic not found. Run flowctl epics to see available." |
| No source | "No completed or in-progress tasks to sync from." |
| No downstream | "No downstream tasks to sync (all done or none exist)." |
planSync.enabled is for auto-trigger; manual always runstodo and blocked tasks