Skip to content
flow-analyze-prompts logo

Analyze Flow SDK Prompts

flow-analyze-prompts

Catalog and analyze prompts in Flow SDK workflows before conversion. Use to identify prompt formats, variables, and conversion requirements.

SKILL.md

Full skill instructions

Analyze Flow SDK Prompts

Overview

This skill helps catalog and analyze all prompts in a Flow SDK workflow before conversion. Understanding prompt structure, variables, and usage is essential for successful migration.

When to Use This Skill

Before Migration:

  • Cataloging prompts in a workflow
  • Understanding prompt complexity
  • Planning prompt file creation

During Migration:

  • Verifying all prompts are converted
  • Checking variable mappings

Flow SDK Prompt Formats

1. JavaScript Array Format (prompts.ts)

export const analyzePrompt = [
  { role: 'system', content: 'You are an analyst.' },
  { role: 'user', content: 'Analyze: {{text}}' }
];

2. Inline String Format (in activities)

const prompt = `You are a helpful assistant.
Analyze this document: ${documentText}`;

3. XML Format (prompts.xml)

<prompts>
  <prompt name="analyze">
    <system>You are an analyst.</​system>
    <user>Analyze: {{text}}</​user>
  </​prompt>
</​prompts>

4. Template Literal with Variables

const systemPrompt = 'You are an expert.';
const userPrompt = `Query: ${query}
Context: ${context}`;

Analysis Process

Step 1: Find All Prompt Sources

# Check for prompt files
ls src/​workflows/​my_workflow/​prompts.*

# Check for inline prompts
grep -n "role:" src/​workflows/​my_workflow/​activities.ts
grep -n "content:" src/​workflows/​my_workflow/​activities.ts

Step 2: Extract Prompts from prompts.ts

# List all exported prompts
grep -n "export const.*Prompt" src/​workflows/​my_workflow/​prompts.ts

# View full prompt definitions
cat src/​workflows/​my_workflow/​prompts.ts

Step 3: Find Inline Prompts in Activities

# Find template literals that might be prompts
grep -n "const.*=" src/​workflows/​my_workflow/​activities.ts | grep -E "prompt|Prompt"

# Find string interpolations
grep -n "\${" src/​workflows/​my_workflow/​activities.ts

Step 4: Analyze XML Prompts

# List prompt names in XML
grep -o 'name="[^"]*"' src/​workflows/​my_workflow/​prompts.xml

# View full XML
cat src/​workflows/​my_workflow/​prompts.xml

Step 5: Extract Variables

For each prompt, identify variables:

# Find Handlebars variables
grep -o "{{[^}]*}}" src/​workflows/​my_workflow/​prompts.ts

# Find template literal variables
grep -o "\${[^}]*}" src/​workflows/​my_workflow/​activities.ts

Step 6: Map Prompt Usage

Find where each prompt is used:

# Find prompt imports
grep -n "from.*prompts" src/​workflows/​my_workflow/​activities.ts

# Find prompt variable usage
grep -n "analyzePrompt" src/​workflows/​my_workflow/​activities.ts

Prompt Catalog Template

Create a catalog of all prompts:

# Prompt Catalog: [workflow_name]

## Summary

| Metric | Count |
|--------|-------|
| Total Prompts | 5 |
| In prompts.ts | 3 |
| Inline (activities) | 2 |
| XML Prompts | 0 |

## Prompts

### 1. analyzePrompt

**Source**: prompts.ts (line 5)
**Type**: Array format
**Used In**: analyzeDocument activity

**System Message**:

You are a document analysis expert.


**User Message**:

Analyze this document: {{documentText}}

Focus on: {{focusAreas}}


**Variables**:
| Variable | Type | Source |
|----------|------|--------|
| documentText | string | activity parameter |
| focusAreas | string[] | activity parameter |

**Template Syntax Issues**:
- Uses Handlebars `{{}}` - needs Liquid.js conversion
- Variable spacing needs fixing

**Target File**: [email protected]

---

### 2. summarizePrompt

**Source**: prompts.ts (line 25)
**Type**: Array format
**Used In**: summarizeContent activity

...

Variable Analysis

Handlebars Variables to Convert

Variable PatternLiquid.js Conversion
{{text}}{{ text }}
{{#if condition}}{% if condition %}
{{user.name}}{{ user.name }}

Template Literal Variables

// These need to be converted to Liquid.js variables
${documentText}  →  {{ documentText }}
${user.name}     →  {{ user.name }}

Prompt Complexity Assessment

Simple Prompts

  • Single system + user message
  • Few variables
  • No conditionals

Complex Prompts

  • Multiple conditionals
  • Loops over data
  • Nested structures
  • Boolean handling

Quick Analysis Commands

Count prompts by type

# Count exported prompts
grep -c "export const.*Prompt" src/​workflows/​my_workflow/​prompts.ts

# Count role definitions (each prompt has at least one)
grep -c "role:" src/​workflows/​my_workflow/​prompts.ts

# Count Handlebars conditionals
grep -c "{{#if" src/​workflows/​my_workflow/​prompts.ts

List all variables

# Handlebars variables (unique)
grep -oh "{{[^#/!][^}]*}}" src/​workflows/​my_workflow/​prompts.ts | sort -u

# All Handlebars patterns
grep -oh "{{[^}]*}}" src/​workflows/​my_workflow/​prompts.ts | sort -u

Check for complex patterns

# Conditionals
grep -c "{{#if" src/​workflows/​my_workflow/​prompts.ts
grep -c "{{#unless" src/​workflows/​my_workflow/​prompts.ts

# Loops
grep -c "{{#each" src/​workflows/​my_workflow/​prompts.ts

# Comparisons
grep -c "{{#if (eq" src/​workflows/​my_workflow/​prompts.ts

Output: Prompt Conversion Plan

After analysis, create conversion plan:

# Prompt Conversion Plan

## Files to Create

| Prompt Name | Target File | Variables | Complexity |
|-------------|-------------|-----------|------------|
| analyzePrompt | [email protected] | documentText, focusAreas | Medium |
| summarizePrompt | [email protected] | text, maxLength | Low |
| extractPrompt | [email protected] | content, categories, includeScores | High |

## Variable Mappings

| Original | Prompt Variable | Step Input |
|----------|-----------------|------------|
| documentText | {{ documentText }} | input.documentText |
| focusAreas | {{ focusAreas }} | input.focusAreas.join(', ') |
| includeScores | {{ includeScores }} | input.includeScores ? 'yes' : 'no' |

## Syntax Conversions Required

- [ ] 5 Handlebars conditionals → Liquid.js
- [ ] 2 Handlebars loops → Liquid.js for loops
- [ ] 12 variables need spacing fix

## Notes

- extractPrompt has boolean variables that need string conversion
- analyzePrompt uses nested conditionals

Related Skills

  • flow-convert-prompts-to-files - Prompt file conversion
  • flow-convert-handlebars-to-liquid - Template syntax
  • flow-analyze-workflow-structure - Overall workflow analysis

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View