ai-workflow-generator

Generates AI workflow designs with LangChain chains, prompts, validation, and retry strategies.

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/fen-zx/NovelToScript --skill ai-workflow-generator-fen-zx
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ai-workflow-generator
Source: https://github.com/fen-zx/NovelToScript/tree/main/.agents/skills/ai-workflow-generator
Command: npx skills add https://github.com/fen-zx/NovelToScript --skill ai-workflow-generator-fen-zx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing a production AI pipeline from scratch—task decomposition, prompt engineering, context management, and cost control—is error-prone and often results in monolithic prompts with no validation or retry logic. ## Core Features & Use Cases - Structured Workflow Design: Produces a complete AI_WORKFLOW.md covering task breakdown, text chunking, prompt templates, LangChain chains (PromptTemplate, RunnableSequence, OutputParser), and context management. - Reliability Engineering: Defines output schemas (JSON/YAML), validation rules, exponential-backoff retries, Redis caching, and error codes like AI_TIMEOUT and AI_INVALID_YAML. - Use Case: Given a PRD for a novel-to-script tool, generate a multi-stage pipeline (NovelAnalyzerChain → CharacterExtractionChain → SceneGenerationChain → YamlValidationChain) with DeepSeek model settings, token budgets, and risk analysis. ## Quick Start Ask the AI to generate a complete AI workflow design from your PRD.md or business logic document, including prompts, LangChain chains, validation, and cost optimization.

Frequently Asked Questions about ai-workflow-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design an AI workflow from a PRD document?▼

Provide your PRD, business logic, or queue specifications as input, and the workflow generator decomposes the goal into subtasks, designs prompts for each, and outputs a complete AI_WORKFLOW.md covering chains, validation, retries, and cost optimization.

How to structure LangChain chains for multi-stage text generation?▼

Use separate PromptTemplate, RunnableSequence, and OutputParser components per stage rather than one monolithic prompt. The generated design chains stages like summary, character extraction, scene generation, and YAML validation sequentially.

What retry strategy should LLM API calls use?▼

The generated design specifies up to 3 retries with exponential backoff, triggered by timeouts, format errors, or empty outputs. Failed generations are logged and task states rolled back.

How do I reduce token costs in LLM pipelines?▼

Summarize long inputs before generation, cache intermediate results like character analyses in Redis with keys such as summary:{novelId}, and avoid re-calling the model for unchanged content.

Why does LLM output fail schema validation?▼

Free-form natural language output often misses required fields or produces malformed JSON/YAML. The workflow enforces structured output formats with JSON Schema or YAML Schema validation and regenerates on failure.