xiaohongshu
xiaohongshu
flow-analyze-prompts
Catalog and analyze prompts in Flow SDK workflows before conversion. Use to identify prompt formats, variables, and conversion requirements.
Full skill instructions
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.
Before Migration:
During Migration:
export const analyzePrompt = [
{ role: 'system', content: 'You are an analyst.' },
{ role: 'user', content: 'Analyze: {{text}}' }
];
const prompt = `You are a helpful assistant.
Analyze this document: ${documentText}`;
<prompts>
<prompt name="analyze">
<system>You are an analyst.</system>
<user>Analyze: {{text}}</user>
</prompt>
</prompts>
const systemPrompt = 'You are an expert.';
const userPrompt = `Query: ${query}
Context: ${context}`;
# 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
# 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
# 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
# List prompt names in XML
grep -o 'name="[^"]*"' src/workflows/my_workflow/prompts.xml
# View full XML
cat src/workflows/my_workflow/prompts.xml
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
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
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 Pattern | Liquid.js Conversion |
|---|---|
{{text}} | {{ text }} |
{{#if condition}} | {% if condition %} |
{{user.name}} | {{ user.name }} |
// These need to be converted to Liquid.js variables
${documentText} → {{ documentText }}
${user.name} → {{ user.name }}
# 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
# 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
# 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
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
flow-convert-prompts-to-files - Prompt file conversionflow-convert-handlebars-to-liquid - Template syntaxflow-analyze-workflow-structure - Overall workflow analysisxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
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...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
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...
Display project status, active tracks, and next actions
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.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience