Flow next tracker sync

From gmickel/flow-next · View interactive version

Flow next tracker sync is an AI agent skill from the GitHub repository gmickel/flow-next. Project a flow-next spec to a tracker issue (Linear, GitHub, GitLab, Jira) and reconcile two-way. Use when asked to sync to a tracker. NOT plan-sync.

How to use this skill

Skill file

flow-next-tracker-sync

The flow spec is the source of truth and quality layer. The tracker is a

co-editable projection. Tracker activity never starts agents or changes Flow

task state.

Read working-rules.md first unless you already have this run; it holds for every step of this skill.

Load the reached path

Read steps.md for the operation sequence and

references/adapter-interface.md for the

normalized contract. Load only references needed by the reached path:

references/body-merge.md.

references/comments-sync.md.

then only the reached MCP or GraphQL reference.

Never load an unselected provider merely because another reference links it.

Deterministic boundary

flowctl tracker owns tracker transport, normalization, credentials, retries,

capability degradation, lifecycle ordering, receipts, and atomic local state.

The skill supplies only approved semantic inputs and reacts to the structured

result. Do not reconstruct provider requests in skill prose or shell.

Use the lifecycle facade for event-driven projection:

FLOWCTL="${CODEX_HOME:-$HOME/.codex}/scripts/flowctl"
[ -x "$FLOWCTL" ] || FLOWCTL="<plugin-root>/scripts/flowctl"   # <plugin-root> = the directory two levels above this skill's SKILL.md file (the harness gave you that file's absolute path when the skill loaded); substitute it literally
[ -x "$FLOWCTL" ] || FLOWCTL=".flow/bin/flowctl"
$FLOWCTL tracker sync "$SPEC_ID" --op "$OP" --event "$EVENT" \
  --flow-file "$FLOW_FILE" --body-file "$BODY_FILE" \
  --comments-file "$COMMENTS_FILE" --source-body-file "$SOURCE_BODY_FILE"

Pass only flags legal for the selected operation. steps.md lists

the file contract. For discovery, create-first, link, unlink, status, relation,

attachment, and direct wire maintenance, use the matching flowctl tracker

verb. flowctl tracker --help is the executable source of truth.

Every command returns one JSON object on stdout. Success has success: true,

data, degraded, and probe. Failure has success: false, class, error,

retryable, and typed details. Branch on class, never provider text.

Exactly five judgment surfaces

These are the only five surfaces intentionally retained in the host agent:

  1. MCP rung. MCP tools exist only in the host tool environment, so flowctl

cannot invoke them. The agent may perform the explicitly requested Linear

MCP action, then hands the returned identity to tracker persist-external.

  1. Discovery ceremony. Choosing a tracker, project or team, and enabling

lifecycle events is an ambiguous one-time product decision. The agent

surfaces detected choices and asks before persisting configuration.

  1. Body-merge conflict adjudication. A three-way body conflict is semantic

because equivalent prose, intent, and requirement meaning cannot be resolved

from hashes or syntax alone. The agent adjudicates only conflicting sections,

while flowctl owns snapshots and atomic persistence.

  1. Comment content synthesis. Lifecycle comments communicate human context.

The caller decides what the comment should say and supplies a stable

occurrence identity as the first file line, evidence=<token>. Flowctl

rejects missing/placeholder evidence, strips that line from visible content,

and owns marker dedup, transport, and the receipt.

  1. Recovery routing from a structured error. A typed conflict,

external_action_required, or non-retryable capability result can require a

user choice, an MCP continuation, a local correction, or a defer. The agent

selects that next action from the structured envelope instead of parsing

error prose.

No other tracker operation is agentic. In particular, request construction,

pagination, provider field mapping, status policy, relation projection,

comment dedup, credential selection, retry timing, and receipt writes remain

deterministic.

Discovery ceremony

The bridge is off until the user confirms it; steps.md ยง1 is the procedure. Every

discovery surfaces the provider signals, the proposed project or team, and the lifecycle defaults.

Credentials come from the environment, or from tracker.perTracker.tokenCommand, a command

that prints the token from the user's secret store; offer it when no token is exported. A

command whose path belongs to one machine goes in FLOW_TRACKER_TOKEN_COMMAND_LINEAR or _JIRA

instead, never in config. Order: the token variable, then that machine-local command, then the

tracked tokenCommand. Config holds the command, never its output. Never copy credentials into config, a prompt, argv,

receipt, or error note.

Linear MCP is discovery/create only. All later shell-reachable operations use

the deterministic GraphQL route. If an MCP create returns only a display key,

tracker persist-external resolves and stores its durable identity.

Operating rules

Never rename an existing Flow-first spec.

remains silent because the lifecycle facade is not invoked.

never argv. Delete temporary files after the call.

recreate a user-controlled relation without evidence that Flow owns it.

external_action_required follow the recovery table in steps.md.

mode:autonomous caller) or a forked lifecycle call, queue a decision that

needs a person with flowctl sync defer. Never attempt an interactive prompt

there.

Boundaries

This skill is projection, not coordination. /flow-next:tracker-sync is

distinct from /flow-next:sync. Flow state remains authoritative. Provider

wire details live in deterministic Python; the Markdown references document

their shapes so reviewers can inspect the contract without copying executable

transport recipes into prompts.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.