一键导入
flow-analyze-prompts
Catalog and analyze prompts in Flow SDK workflows before conversion. Use to identify prompt formats, variables, and conversion requirements.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Catalog and analyze prompts in Flow SDK workflows before conversion. Use to identify prompt formats, variables, and conversion requirements.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | flow-analyze-prompts |
| description | Catalog and analyze prompts in Flow SDK workflows before conversion. Use to identify prompt formats, variables, and conversion requirements. |
| allowed-tools | ["Bash","Read","Grep","Glob"] |
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**: analyzeDocument@v1.prompt
---
### 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 | analyzeDocument@v1.prompt | documentText, focusAreas | Medium |
| summarizePrompt | summarize@v1.prompt | text, maxLength | Low |
| extractPrompt | extract@v1.prompt | 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 analysisValidate and fix folder structure for Output SDK workflows. Use to ensure migrated workflows follow the correct structure conventions.
Convert Flow SDK activities.ts to Output SDK steps.ts. Use when migrating activity functions to step definitions with typed parameters.
Convert inline prompts and prompt arrays to .prompt files with YAML frontmatter. Use when migrating prompts from Flow SDK format to Output SDK prompt files.
Convert Flow SDK workflow class to Output SDK workflow() function. Use when migrating workflow.ts files from class-based to functional definitions.
Create scenario files for testing migrated Output SDK workflows. Use to set up test inputs in the scenarios/ subfolder.
Fix ESLint issues in migrated Output SDK code. Use when seeing lint errors after migration, or when writing new Output SDK code that needs to follow project conventions.