Index of every page on this site: llms.txt
All skills
masheev avatar

/masheev-workflows

@21d3a39
by masheevmasheev/skills1 stars
Run it yourself

Use when building multi-step conversational workflows with Masheev. Covers WorkflowConfig, WorkflowStepConfig, step definitions with instructions and tool scoping, context interpolation with {{context.KEY}}, step completion events, resume logic, session modes, and A/B testing with variants. Use this skill when someone wants to build a "conversational flow", "onboarding wizard", "guided conversation", "multi-step form", or asks about sessionMode "workflow" in @masheev/embed-sdk.

Use this Skill: https://skilld.dev/gh/masheev/skills/masheev-workflows

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈125 tokens for metadata: the name and description. ≈1.3k when used: this file. ≈1.6k more on demand in 1 file.

Description uses 6.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈502 characters, or 6.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Masheev Workflows

Workflows are multi-step conversational flows where the AI agent follows a script. Each step has instructions, optional tools, and collects structured data before advancing.

Quick Start

import { init } from "@masheev/embed-sdk/js";

init({
  inboxId: "YOUR_INBOX_ID",
  sessionMode: "workflow",
  workflow: {
    id: "booking_flow",
    name: "Restaurant Booking",
    steps: [
      {
        id: "greeting",
        name: "Welcome",
        instructions: "Greet {{context.customerName}} and ask what date they'd like to book.",
      },
      {
        id: "select_date",
        name: "Date Selection",
        instructions: "Help them pick a date and time. Use check_availability to show open slots.",
        tools: ["check_availability"],
      },
      {
        id: "confirm",
        name: "Confirmation",
        instructions: "Summarize the booking details and confirm. Use create_booking to finalize.",
        tools: ["create_booking"],
      },
    ],
    context: {
      customerName: "Jane",
      partySize: 4,
    },
  },
});

WorkflowConfig

interface WorkflowConfig {
  id: string;                 // Unique ID (alphanumeric + _ -), max 64 chars
  name?: string;              // Display name, max 100 chars
  steps?: WorkflowStepConfig[];  // Ordered steps, max 20
  resumeAtStep?: string;      // Step ID to resume returning users at
  context?: Record<string, string | number | boolean>;  // Max 20 keys, 500 chars/value
  variant?: string;           // A/B test variant name
}

WorkflowStepConfig

interface WorkflowStepConfig {
  id: string;                 // Step ID (alphanumeric + _ -), max 64 chars
  name: string;               // Display name, max 100 chars
  instructions?: string;      // AI instructions, max 1000 chars
  allowSkip?: boolean;        // Can the AI skip this step?
  tools?: string[];           // Tool names available in this step only
}

Context Interpolation

Use {{context.KEY}} in step instructions to inject dynamic data:

{
  id: "personalized_greeting",
  name: "Greeting",
  instructions: "Welcome {{context.customerName}}! They are on the {{context.plan}} plan with {{context.credits}} credits remaining.",
}

Context can be updated mid-conversation:

import { updateWorkflow } from "@masheev/embed-sdk/js";

updateWorkflow({
  context: { credits: 42, lastAction: "viewed_pricing" },
});

Step Completion Events

Listen for step and workflow completion:

import { on } from "@masheev/embed-sdk/js";

on("workflow:stepComplete", ({ workflowId, stepId, data }) => {
  console.log(`Step ${stepId} completed with data:`, data);
  // data contains structured output from the step
});

on("workflow:complete", ({ workflowId, outcome, data }) => {
  console.log(`Workflow ${workflowId} finished: ${outcome}`);
  // outcome: "completed", "abandoned", etc.
});

Session Modes

Mode Behavior Use Case
"persistent" Conversations resume across page loads General support chat
"ephemeral" Fresh conversation each visit Anonymous feedback
"workflow" Workflow-driven, follows defined steps Guided flows, onboarding

Tool Scoping

Tools listed in a step's tools array are only available during that step. This prevents the AI from using booking tools during the greeting step:

steps: [
  { id: "greet", name: "Greeting", instructions: "..." },
  // No tools — AI can only chat
  
  { id: "search", name: "Search", instructions: "...", tools: ["search_products"] },
  // Only search_products available
  
  { id: "checkout", name: "Checkout", instructions: "...", tools: ["create_order", "apply_discount"] },
  // Only create_order and apply_discount available
]

Resume Logic

For returning users, set resumeAtStep to skip completed steps:

// Check user's progress from your backend
const progress = await getWorkflowProgress(userId);

init({
  inboxId: "...",
  sessionMode: "workflow",
  workflow: {
    id: "onboarding",
    resumeAtStep: progress.lastCompletedStep,
    steps: [...],
    context: progress.collectedData,
  },
});

A/B Testing

Use variant to test different workflow configurations:

const variant = Math.random() > 0.5 ? "short" : "detailed";

init({
  inboxId: "...",
  sessionMode: "workflow",
  workflow: {
    id: "signup_flow",
    variant,
    steps: variant === "short"
      ? [{ id: "quick", name: "Quick Signup", instructions: "..." }]
      : [
          { id: "step1", name: "Details", instructions: "..." },
          { id: "step2", name: "Preferences", instructions: "..." },
          { id: "step3", name: "Confirm", instructions: "..." },
        ],
  },
});

Track which variant performed better via workflow:complete events.

See references/step-types.md for common workflow patterns (lead qualification, booking, support triage, onboarding).

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts7mo3 checks · Risk SAFE
  • Gen Agent Trust Hub7mo

    This skill provides documentation and implementation examples for building multi-step conversational workflows using the Masheev Embed SDK. It contains legitimate technical guidance for developers and no security risks were detected.

  • Socket7mo

    No alerts

  • Snyk7mo

    Risk: LOW · No issues

Signed by skilld at 21d3a39. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 7 months ago
metadata
{
  "author": "masheev",
  "version": "0.1.0"
}

README badge

README badge for masheev/skills/masheev-workflows