Catalogue / flow-setup
flow-setup
Apache-2.0SignedUse when initializing or aligning Flow in a repository, migrating legacy .agents/ layouts, or scaffolding OKF v0.2 bundles and project skills. Don't use for feature planning (use flow-planning), task execution, or routine knowledge refreshes (use flow-learn).--- name: flow-setup description: "Use when initializing or aligning Flow in a repository, migrating legacy .agents/ layouts, or scaffolding OKF v0.2 bundles and project skills. Don't use for feature planning (use flow-planning), task execution, or routine knowledge refreshes (use flow-learn)." disable-model-invocation: true ---
Flow Setup
<!-- lifecycle-ownership: owner=flow-setup; operations=setup -->
Trigger
Use for /flow:setup. Follow `../flow/references/setup.md`.
Workflow
- Environment Detection, Brownfield Alignment, & Toolchain Discovery:
- Inspect
.agents/setup-state.jsonand.agents/bundles/index.md. If.agents/already exists, offer Align & Sync (Recommended), Full Re-Setup, or Exit. - Inventory legacy layouts (
.beads/,.agents/specs/,.agents/tracks/,.agents/transactions/, flatknowledge/patterns.md, un-promotedbundles/research/). Ensure subdirectoryindex.mdfiles andlog.mdhave no YAML frontmatter or standalone---body rules. Inspect fragmented specs viaflow setup audit(orflow status --json) and migrate active work withflow setup apply --migrate-specsafter user confirmation. - Probe installed host binaries (
uv,python3,cargo,go,bun,pnpm,npm,make,just,pwsh,powershell) alongside repository manifests. Fan out parallel read-only@researcherworkers (type_name="self"withagents/researcher.mdon Google Antigravity;model="inherit").
- Scaffold Core Context Chapters & OKF v0.2 Bundle (`.agents/bundles/`):
- Initialize
.agents/bundles/index.md(okf_version: "0.2") and frontmatter-free.agents/bundles/log.md,product/index.md,knowledge/index.md,research/index.md, andspecs/index.md. - Create core context chapters with
<= 40-line<!-- truth: start -->blocks and zero body---separators. Includeproduct/product.md,product/product-guidelines.md,product/tech-stack.md, andknowledge/workflow.mdusing verified host commands from `../../templates/agent/workflow.md`. - Write evidence-backed nested chapters across
knowledge/{architecture,patterns,domains,testing,gotchas,decisions}/withsources: [{ id, resource, title }],[^id]:footnotes, andverified: [{ by, at }]. Use parallel domain workers when>= 2domains exist.
- Seed Engineering Disciplines, Project Skills, & Subagents:
- Follow `../multi-harness-plugins/SKILL.md` and `../flow-docs/references/agent-context.md`.
- Embed baseline engineering rules into the knowledge and skill set: deep-module design, domain modeling and ADRs, public-interface TDD, bug diagnosis, and present-tense documentation for first-time readers.
- Generate domain skills (
.agents/skills/<domain>/SKILL.md<= 200lines +references/*.md), review skills (.agents/skills/review-<domain>/SKILL.md+references/checklist.md+references/false-positive-suppressions.md), and.agents/skills/index.md. Pair them with project subagents (.agents/agents/<domain>-reviewer.mdand.agents/agents/<domain>-specialist.md) using H1 headings,mainAgent: false,subagent: true,model: inherit, andcommandExecutionPolicy: sandbox.
- Worktrees, Permissions, `Stop` Hooks, `AGENTS.md`, & Setup State:
- Ask once whether
.agents/is `shared` (tracked in Git, Recommended) or `local-only` (stealth mode via.git/info/exclude). In linkedgit worktreecheckouts, edit worktree.agents/whensharedor the primary checkout's.agents/whenlocal-only, and verify.venv/node_modulessymlinks. - Offer opt-in non-destructive harness permissions (
.claude/settings.local.jsonwith backup, Codexwritable_roots,.cursor/hooks.json,opencode.json). Update rootAGENTS.md(preserving<!-- project-customization: start -->blocks) and write.agents/setup-state.json(workflow_preferences.ignore_policy,workflow_preferences.model_routing: "auto").
Guardrails
- Never copy Flow's global plugin skills (
flow,flow-*,okf,debloat,multi-harness-plugins) into.agents/skills/, so repositories stay on one version without stale duplicates. - Cite real repository paths (
path/to/file::Symbol) insources:and[^id]footnotes for every knowledge chapter so claims remain checkable against code. - Preserve existing developer content inside
<!-- project-customization: start -->and<!-- truth: start -->blocks during alignment so re-running setup never drops team rules.
Example
flow setup audit --json flow setup apply --migrate-specs --policy shared
Output
Return the initialized or aligned .agents/bundles/ tree, generated .agents/skills/ and .agents/agents/ inventory, verified host commands, and next command (/flow:spec or /flow:prd).
Validation
Confirm root index.md declares okf_version: "0.2", all links in index.md and .agents/skills/index.md resolve on disk, every non-reserved .md file has valid OKF frontmatter, and .agents/setup-state.json records setup_status: "complete".
| File | Size | SHA-256 |
|---|---|---|
| SKILL.md | 5.2 kB | 0eadbc89d00d |
| SKILVAULT_SOURCE.json | 1.1 kB | 7eafe2f2e977 |
| THIRD_PARTY_NOTICES.md | 11.4 kB | fc69eca59406 |
Published verbatim from the pinned commit. Nothing is rewritten.
| Version | Pinned commit | Signed | |
|---|---|---|---|
| 0.1.0 Current | ccd8a21437e8 | 29 Nov 2026 |
Locking a skill to one version needs Pro.