flow-next-opencode-sync
Manually trigger plan-sync to update downstream task specs after implementation drift. Use when code changes outpace specs.
What this skill does
# Manual Plan-Sync
Manually trigger plan-sync to update downstream task specs.
**CRITICAL: flowctl is BUNDLED — NOT installed globally.** Always use:
```bash
ROOT="$(git rev-parse --show-toplevel)"
OPENCODE_DIR="$ROOT/.opencode"
FLOWCTL="$OPENCODE_DIR/bin/flowctl"
```
## Input
Arguments: $ARGUMENTS
Format: `<id> [--dry-run]`
- `<id>` - task ID (fn-N.M) or epic ID (fn-N)
- `--dry-run` - show changes without writing
## Workflow
### Step 1: Parse Arguments
```bash
ROOT="$(git rev-parse --show-toplevel)"
OPENCODE_DIR="$ROOT/.opencode"
FLOWCTL="$OPENCODE_DIR/bin/flowctl"
```
Parse $ARGUMENTS for:
- First positional arg = `ID`
- `--dry-run` flag = `DRY_RUN` (true/false)
Get cross-epic config (defaults to false):
```bash
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:**
- Must start with `fn-`
- If no ID: "Usage: /flow-next:sync <id> [--dry-run]"
- If invalid: "Invalid ID format. Use fn-N (epic) or fn-N.M (task)."
Detect ID type:
- Contains `.` (e.g., fn-1.2) → task ID
- No `.` (e.g., fn-1) → epic ID
### Step 2: Validate Environment
```bash
test -d .flow || { echo "No .flow/ found. Run flowctl init first."; exit 1; }
```
If `.flow/` missing, output error and stop.
### Step 3: Validate ID Exists
```bash
$FLOWCTL show <ID> --json
```
If fails:
- Task: "Task <id> not found. Run `flowctl list` to see available."
- Epic: "Epic <id> not found. Run `flowctl epics` to see available."
Stop on failure.
### Step 4: Find Downstream Tasks
**For task ID input:**
```bash
# 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:**
```bash
$FLOWCTL tasks --epic "<epic-id>" --json
```
1. Find **source task** (agent requires `COMPLETED_TASK_ID`):
- Prefer most recently updated task with `status: done`
- Else: most recently updated with `status: in_progress`
- Else: error "No completed or in-progress tasks to sync from."
2. Filter remaining to `status: todo` or `status: blocked` (downstream).
**If no downstream tasks:**
```
No downstream tasks to sync (all done or none exist).
```
Stop (success).
### Step 5: Spawn Plan-Sync Agent
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`
### Step 6: Report Results
**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.
```
## Error Messages
| Case | Message |
| -------------- | ------------------------------------------------------------ |
| No ID | "Usage: /flow-next:sync <id> [--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 <id> not found. Run `flowctl list` to see available." |
| Epic not found | "Epic <id> 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)." |
## Rules
- **Ignores config** - `planSync.enabled` is for auto-trigger; manual always runs
- **Any source status** - source can be todo, in_progress, done, or blocked
- **Includes blocked** - downstream includes both `todo` and `blocked` tasks
- **Reuses agent** - spawns plan-sync agent, no duplication
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.