iblai-vibe-workflow
Skill15 starsChanged 2 months agoMITView on GitHub
Add workflow builder components to your Next.js app
- Reads credentials
In this repository158 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- iblai-vibe-pr-reviewSkill
- iblai-api-agent-accessSkill
- iblai-api-agent-auditSkill
- iblai-api-agent-chatSkill
- iblai-api-agent-createSkill
- iblai-api-agent-datasetSkill
- iblai-api-agent-disclaimerSkill
- iblai-api-agent-embedSkill
- iblai-api-agent-evalSkill
- iblai-api-agent-historySkill
- iblai-api-agent-llmSkill
- iblai-api-agent-mcpSkill
- iblai-api-agent-memorySkill
- iblai-api-agent-privacySkill
- iblai-api-agent-promptSkill
- iblai-api-agent-safetySkill
- iblai-api-agent-sandboxSkill
- iblai-api-agent-sessionSkill
- iblai-api-agent-settingSkill
- iblai-api-agent-skillSkill
- iblai-api-agent-supportSkill
- iblai-api-agent-toolSkill
- iblai-api-inferenceSkill
- iblai-api-searchSkill
- iblai-vibe-agent-accessSkill
- iblai-vibe-agent-apiSkill
- iblai-vibe-agent-auditSkill
- iblai-vibe-agent-billingSkill
- iblai-vibe-agent-chat-sidebarSkill
- iblai-vibe-agent-chatSkill
- iblai-vibe-agent-createSkill
- iblai-vibe-agent-datasetSkill
- iblai-vibe-agent-disclaimerSkill
- iblai-vibe-agent-embedSkill
- iblai-vibe-agent-evalsSkill
- iblai-vibe-agent-graderSkill
- iblai-vibe-agent-historySkill
- iblai-vibe-agent-llmSkill
- iblai-vibe-agent-ltiSkill
- iblai-vibe-agent-mcpSkill
- iblai-vibe-agent-memorySkill
- iblai-vibe-agent-privacySkill
- iblai-vibe-agent-promptSkill
- iblai-vibe-agent-safetySkill
- iblai-vibe-agent-sandboxSkill
- iblai-vibe-agent-searchSkill
- iblai-vibe-agent-settingSkill
- iblai-vibe-agentSkill
- iblai-vibe-agent-skillsSkill
- iblai-vibe-agent-supportSkill
- iblai-vibe-agent-taskSkill
- iblai-vibe-agent-toolSkill
- iblai-vibe-agent-virtual-machineSkill
- iblai-vibe-agent-voiceSkill
- iblai-vibe-local-llmSkill
- iblai-vibe-os-agent-code-modeSkill
- iblai-vibe-projectSkill
- iblai-api-analyticsSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 5 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Add AI workflow builder features -- a visual workflow editor with a node type browser sidebar, node configuration panels, connector …
- Very specific: line 28
Before proceeding, check for a iblai.env in the project root.
- Very specific: line 30
If the file does not exist or is missing these variables, tell the user: "You need an iblai.env with your platform configuration.
- Distinctive: line 52
Import SDK components directly -- there is no CLI generator:
- Very specific: line 78
CRITICAL: Add workflowsApiSlice to the store in store/iblai-store.ts:
- Very specific: line 137
WARNING: Does NOT use isOpen/onClose/onCreate.
- Very specific: line 149
WARNING: Does NOT use workflowId or onDelete.
- Very specific: line 153
Create components/workflows/types.ts with the shared data model.
- Distinctive: line 255
Default nodes for new workflows:
- Distinctive: line 298
Use a 2-second debounced auto-save:
- Very specific: line 364
Run /iblai-vibe-ops-test before telling the user the work is ready:
- Distinctive: line 367
Start dev server and verify the workflow pages render:
- Very specific: line 380
Edge line gap: If edges don't connect flush to handle dots, check that HANDLE_OFFSET equals the handle dot's center offset from the node …
- Very specific: line 385
"Cannot read properties of null": When dropping from sidebar, read e.dataTransfer.getData() instead of a ref.
- Very specific: line 394
workflowsApiSlice not in store: All workflow hooks return undefined if the slice isn't registered.
- Very specific: line 406
Missing continueOnError in sync effect: If you add continueOnError state, you MUST also add setContinueOnError(nodeData.continueOnError ??
- Very specific: line 415
Redux store: Must include mentorReducer, mentorMiddleware, AND workflowsApiSlice
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/iblai-vibe-workflow
Add AI workflow builder features -- a visual workflow editor with a node type browser sidebar, node configuration panels, connector management, and create/delete workflow modals. Includes a custom canvas with drag-and-drop, bezier curve edges, pan/zoom, undo/redo, and auto-save.
Common setup (brand, conventions, env files, verification): see docs/skill-setup.md.
Prerequisites
- Auth must be set up first (
/iblai-vibe-auth) - MCP server + skills configured (
@iblai/mcpin.mcp.json)
Step 1: Check Environment
Before proceeding, check for a iblai.env
in the project root. Look for PLATFORM, DOMAIN, and TOKEN variables.
If the file does not exist or is missing these variables, tell the user:
"You need an iblai.env with your platform configuration. Download the
template and fill in your values:
curl -o iblai.env https://raw.githubusercontent.com/iblai/vibe/refs/heads/main/iblai.env"
Architecture
The workflow feature has two pages and three custom components:
app/(app)/workflows/
├── page.tsx # List page (grid of workflows)
└── [id]/page.tsx # Editor page (sidebar + canvas)
components/workflows/
├── types.ts # Shared types (CanvasNode, CanvasEdge, NodeConfig)
├── workflow-canvas.tsx # Custom canvas with SVG edges, pan/zoom, undo/redo
└── node-config-panel.tsx # Context-aware node property editorStep 2: SDK Components
Import SDK components directly -- there is no CLI generator:
// UI components
import {
WorkflowSidebar,
ConnectorManagementDialog,
CreateWorkflowModal,
DeleteWorkflowModal,
} from "@iblai/iblai-js/web-containers";
// RTK Query hooks
import {
useGetWorkflowsQuery,
useGetWorkflowQuery,
useCreateWorkflowMutation,
useDeleteWorkflowMutation,
usePatchWorkflowMutation,
usePublishWorkflowMutation,
useValidateWorkflowMutation,
workflowsApiSlice,
} from "@iblai/iblai-js/data-layer";Step 3: Register workflowsApiSlice in Redux Store
CRITICAL: Add workflowsApiSlice to the store in store/iblai-store.ts:
import {
coreApiSlice,
mentorReducer,
mentorMiddleware,
workflowsApiSlice,
} from "@iblai/iblai-js/data-layer";
export const store = configureStore({
reducer: {
[coreApiSlice.reducerPath]: coreApiSlice.reducer,
[workflowsApiSlice.reducerPath]: workflowsApiSlice.reducer,
mentor: mentorReducer,
},
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware()
.concat(coreApiSlice.middleware)
.concat(workflowsApiSlice.middleware)
.concat(mentorMiddleware),
});Without this, all workflow API hooks will silently return undefined.
SDK Component Props (VERIFIED)
IMPORTANT: The prop names below are the ACTUAL props accepted by the SDK. The skill docs in older versions had incorrect prop names. Do NOT use
isOpen,onClose,org, oronCreate-- they will fail.
<WorkflowSidebar>
Node type browser sidebar. Does NOT accept org or tenant.
| Prop | Type | Description |
onDragStart | (item: {id, label, type}) => void | Called when user starts dragging a node type |
onItemClick | (item: {id, label, type}) => void | Called when user clicks a node type |
<ConnectorManagementDialog>
| Prop | Type | Description |
open | boolean | Whether the dialog is visible |
onClose | () => void | Close callback |
Note: Uses open (NOT isOpen). Does NOT accept org.
<CreateWorkflowModal>
| Prop | Type | Description |
open | boolean | Whether the modal is visible |
onOpenChange | (open: boolean) => void | Open state setter |
onCreateWorkflow | (name: string) => void | Callback with workflow name |
isCreating | boolean | Loading state |
WARNING: Does NOT use isOpen/onClose/onCreate. Those are wrong.
<DeleteWorkflowModal>
| Prop | Type | Description |
isOpen | boolean | Whether the modal is visible |
onClose | () => void | Close callback |
onConfirm | () => void | Confirm deletion callback |
isDeleting | boolean | Loading state |
workflowName | string | Name displayed in confirmation |
WARNING: Does NOT use workflowId or onDelete. Those are wrong.
Step 4: Create the Types File
Create components/workflows/types.ts with the shared data model.
Node data is nested in node.data (not flat on the node):
// Workflow canvas types — matching mentorai's data model
export interface Variable {
id: string;
name: string;
type: string;
defaultValue?: string;
}
export interface Condition {
id: string;
caseName: string;
expression: string;
}
export interface TransformExpression {
id: string;
key: string;
value: string;
}
export interface SetStateAssignment {
id: string;
variable: string;
value: string;
}
export interface NodeConfig {
label: string;
subtitle?: string;
color?: string;
content?: string;
// Start node
stateVariables?: Variable[];
// Mentor node
entry_mentor_id?: string;
mentor_id?: string;
instructions?: string;
model?: string;
// Conditional
conditionCount?: number;
conditions?: Condition[];
// While
whileExpression?: string;
// User-approval
userApprovalMessage?: string;
// Transform
transformMode?: "expressions" | "object";
transformExpressions?: TransformExpression[];
// Set-state
setStateAssignments?: SetStateAssignment[];
// End
output?: string;
// File-search
datasetId?: string;
datasetName?: string;
maxResults?: number;
fileSearchQuery?: string;
// Shared
continueOnError?: boolean;
// MCP
mcpConnectors?: { id: string; name: string; icon?: string }[];
}
export interface CanvasNode {
id: string;
type: string;
position: { x: number; y: number };
data: NodeConfig;
width?: number;
height?: number;
selected?: boolean;
dragging?: boolean;
draggable?: boolean;
selectable?: boolean;
connectable?: boolean;
}
export interface CanvasEdge {
id: string;
source: string;
target: string;
sourceHandle?: string;
targetHandle?: string;
}Step 5: Create the Workflow List Page
app/(app)/workflows/page.tsx -- shows all workflows in a grid.
Key patterns:
- Uses
useGetWorkflowsQuery({ org: tenant, params: search ? { search } : undefined }) - Workflow response has
resultsarray withunique_id,name,is_active,description,updated_at - Create: passes
{ name, definition: { nodes: DEFAULT_NODES, edges: DEFAULT_EDGES } } - Delete: passes
{ org: tenant, uniqueId: deleteTarget.id } - Navigates to
/workflows/${result.unique_id}after create
Default nodes for new workflows:
const DEFAULT_NODES = [
{
id: "start",
type: "start",
position: { x: 300, y: 250 },
data: { label: "Start" },
},
{
id: "mentor-1",
type: "mentor",
position: { x: 550, y: 250 },
data: { label: "My mentor", subtitle: "Mentor" },
},
];
const DEFAULT_EDGES = [
{
id: "e-start-mentor-1",
source: "start",
target: "mentor-1",
sourceHandle: "right",
targetHandle: "left",
},
];Step 6: Create the Workflow Editor Page
app/(app)/workflows/[id]/page.tsx -- loads a workflow and renders
the sidebar + canvas with save/publish controls.
Key patterns:
- Uses
useGetWorkflowQuery({ org: tenant, uniqueId: workflowId }) - Save:
usePatchWorkflowMutationwith{ org, uniqueId, data: { definition: { nodes, edges } } } - Publish: save first, then
useValidateWorkflowMutation, thenusePublishWorkflowMutation - Validation response:
{ errors: string[], warnings: string[] } - Cast
workflow.definition?.nodes as CanvasNode[](API types them asunknown[])
Auto-save pattern
Use a 2-second debounced auto-save:
const autoSaveTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const isSavingRef = useRef(false);
const doSave = useCallback(async () => {
if (isSavingRef.current) return;
const { nodes, edges } = currentStateRef.current;
const current = JSON.stringify({ nodes, edges });
if (current === initialDataRef.current) return;
isSavingRef.current = true;
try {
await patchWorkflow({ org: tenant, uniqueId: workflowId, data: { definition: { nodes, edges } } }).unwrap();
initialDataRef.current = current;
setHasUnsavedChanges(false);
setSaveMessage("Saved");
setTimeout(() => setSaveMessage(null), 2000);
} catch {
setSaveMessage("Save failed");
setTimeout(() => setSaveMessage(null), 3000);
} finally {
isSavingRef.current = false;
}
}, [patchWorkflow, tenant, workflowId]);
const scheduleAutoSave = useCallback(() => {
if (autoSaveTimerRef.current) clearTimeout(autoSaveTimerRef.current);
autoSaveTimerRef.current = setTimeout(() => doSave(), 2000);
}, [doSave]);
const handleStateChange = useCallback((nodes, edges) => {
currentStateRef.current = { nodes, edges };
if (initialDataRef.current) {
const changed = JSON.stringify({ nodes, edges }) !== initialDataRef.current;
setHasUnsavedChanges(changed);
if (changed) scheduleAutoSave();
}
}, [scheduleAutoSave]);Manual save should cancel any pending auto-save timer:
const handleSave = async () => {
if (autoSaveTimerRef.current) clearTimeout(autoSaveTimerRef.current);
await doSave();
};Clean up the timer on unmount:
useEffect(() => {
return () => {
if (autoSaveTimerRef.current) clearTimeout(autoSaveTimerRef.current);
};
}, []);Steps 7–8: Canvas component and node config panel
The full implementations (React Flow canvas with its critical details, WorkflowCanvas props, the node config panel with event-propagation and isLocalUpdate sync patterns, per-node-type panels, handleUpdateNode) are in references/canvas-and-node-panel.md. Copy them as written.
Step 9: Verify
Run /iblai-vibe-ops-test before telling the user the work is ready:
pnpm build-- must pass with zero errors- Start dev server and verify the workflow pages render:
pnpm dev & npx playwright screenshot http://localhost:3000/workflows /tmp/workflows.png
Common Pitfalls
- Wrong SDK prop names: The skill docs previously listed incorrect props.
CreateWorkflowModalusesopen/onOpenChange/onCreateWorkflow(NOTisOpen/onClose/onCreate).ConnectorManagementDialogusesopen(NOTisOpen). Neither takesorg.WorkflowSidebarusesonDragStart/onItemClick(NOTorg). - Edge line gap: If edges don't connect flush to handle dots, check that
HANDLE_OFFSETequals the handle dot's center offset from the node edge (typically 2, not 8). Also ensure ALL node types haveref={nodeRef(node.id)}on their outermost div so dimensions are measured correctly. - "Cannot read properties of null": When dropping from sidebar, read
e.dataTransfer.getData()instead of a ref. The ref may not be set. - TypeScript
e.buttonnarrowing: Handle middle-click before the!== 0guard to avoid type narrowing issues. - Node data model: Data must be nested in
node.data(NodeConfig), not flat on the node. The API returns{ id, type, position, data: {...} }. - workflowsApiSlice not in store: All workflow hooks return
undefinedif the slice isn't registered. Add both reducer and middleware. - Config panel closes on click: The
panelShelldiv MUST have bothonClick={(e) => e.stopPropagation()}andonMouseDown={(e) => e.stopPropagation()}. Without BOTH, clicks propagate to the canvas, deselecting the node and closing the panel. Same applies to any modals spawned inside the panel. - Dragging opens config panel: Config panel must open on mouseup
(when
!dragMovedRef.current), NOT on mousedown. Opening on mousedown means every drag also opens the panel. - Missing continueOnError in sync effect: If you add
continueOnErrorstate, you MUST also addsetContinueOnError(nodeData.continueOnError ?? false)to the sync effect. Otherwise undo/redo and node switching won't update the toggle state.
Important Notes
- Import:
@iblai/iblai-js/web-containers-- framework-agnostic - Data hooks:
@iblai/iblai-js/data-layer-- RTK Query hooks - Redux store: Must include
mentorReducer,mentorMiddleware, ANDworkflowsApiSlice initializeDataLayer(): 5 args (v1.2+)@reduxjs/toolkit: Deduplicated via webpack aliases innext.config.ts- Brand guidelines: BRAND.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

