一键导入
flow-analyze-workflow-structure
Analyze Flow SDK workflow structure before migration. Use to map inputs, outputs, steps, control flow, and dependencies.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyze Flow SDK workflow structure before migration. Use to map inputs, outputs, steps, control flow, and dependencies.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Validate 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.
| name | flow-analyze-workflow-structure |
| description | Analyze Flow SDK workflow structure before migration. Use to map inputs, outputs, steps, control flow, and dependencies. |
| allowed-tools | ["Bash","Read","Grep","Glob"] |
This skill helps analyze a Flow SDK workflow before migration to understand its structure, dependencies, and conversion requirements. This is the first step in any migration.
Before Migration:
During Migration:
src/workflows/my_workflow/
├── activities.ts # Activity functions (→ steps.ts)
├── helpers.ts # Optional helper functions
├── prompts.ts # Prompt templates (→ .prompt files)
├── prompts.xml # XML prompts (→ .prompt files)
├── readme.xml # Workflow documentation
├── types.ts # Type definitions (keep)
└── workflow.ts # Workflow definition (convert)
| File | Purpose | Migration Target |
|---|---|---|
workflow.ts | Workflow class | workflow() function |
activities.ts | Activity functions | steps.ts |
types.ts | Type definitions | Keep, add Zod schemas |
prompts.ts | JS prompt arrays | .prompt files |
prompts.xml | XML prompts | .prompt files |
readme.xml | Documentation | Reference during migration |
helpers.ts | Utility functions | Keep or inline |
ls -la src/workflows/my_workflow/
# Find the workflow class
grep -n "class.*Workflow" src/workflows/my_workflow/workflow.ts
grep -n "execute(" src/workflows/my_workflow/workflow.ts
# Find interface definitions
grep -n "interface.*Input" src/workflows/my_workflow/*.ts
grep -n "interface.*Output" src/workflows/my_workflow/*.ts
# Find Zod schemas
grep -n "z.object" src/workflows/my_workflow/types.ts
# Find exported functions in activities.ts
grep -n "export.*async function" src/workflows/my_workflow/activities.ts
grep -n "export function" src/workflows/my_workflow/activities.ts
For each activity, note:
# View activity signatures
grep -A5 "export.*function" src/workflows/my_workflow/activities.ts
# Find completion calls
grep -n "completion(" src/workflows/my_workflow/activities.ts
grep -n "await.*completion" src/workflows/my_workflow/activities.ts
# Find prompt usage
grep -n "Prompt" src/workflows/my_workflow/activities.ts
Read workflow.ts to understand:
# Find external imports
grep -n "^import" src/workflows/my_workflow/*.ts | grep -v "\./"
# Find API calls
grep -n "fetch(" src/workflows/my_workflow/*.ts
grep -n "axios" src/workflows/my_workflow/*.ts
cat src/workflows/my_workflow/readme.xml
Create a migration analysis document:
# Workflow Migration Analysis: [workflow_name]
## Overview
- **Location**: src/workflows/my_workflow/
- **Purpose**: [from readme.xml]
- **Complexity**: [low/medium/high]
## Files to Migrate
| File | Status | Notes |
|------|--------|-------|
| workflow.ts | Needs conversion | Class → function |
| activities.ts | Needs conversion | 5 activities → steps |
| types.ts | Partial | Add Zod schemas |
| prompts.ts | Needs conversion | 3 prompts |
## Workflow Input/Output
### Input
```typescript
interface WorkflowInput {
userId: string;
options: ProcessOptions;
}
interface WorkflowOutput {
success: boolean;
resultId: string;
}
| Activity | Parameters | Return Type | LLM Call |
|---|---|---|---|
| fetchUser | userId: string | User | No |
| analyzeData | data: Data, options: Options | Analysis | Yes |
| saveResults | results: Results | SaveResult | No |
| Name | Location | Variables | Target File |
|---|---|---|---|
| analyzePrompt | prompts.ts | data, options | analyze@v1.prompt |
## Quick Analysis Commands
### Get workflow overview
```bash
# Count activities
grep -c "export.*function" src/workflows/my_workflow/activities.ts
# Count prompts
grep -c "role:" src/workflows/my_workflow/prompts.ts
# Check for Handlebars syntax
grep -c "{{#if" src/workflows/my_workflow/prompts.ts
# Check for zod imports (need conversion)
grep "from 'zod'" src/workflows/my_workflow/*.ts
grep "export.*function" src/workflows/my_workflow/activities.ts | \
sed 's/export async function /- /' | \
sed 's/export function /- /' | \
sed 's/(.*//'
After migration, the folder should look like:
src/workflows/my_workflow/
├── workflow.ts # Converted workflow() function
├── steps.ts # Converted step() definitions
├── types.ts # Types with Zod schemas
├── analyze@v1.prompt # Converted prompts
├── summarize@v1.prompt
└── scenarios/ # NEW: Test scenarios
└── basic_input.json
flow-analyze-prompts - Detailed prompt analysisflow-convert-activities-to-steps - Activity conversionflow-convert-workflow-definition - Workflow conversionflow-conventions-folder-structure - Target structure