effect-ai-prompt

Constructs and composes type-safe prompts for Effect AI language model conversations.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-ai-prompt-lambdasolver2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-ai-prompt
Source: https://github.com/lambdasolver2/opencode-effect-harness/tree/main/packages/module-typescript/assets/skills/effect-ai-prompt
Command: npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-ai-prompt-lambdasolver2

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires effect.

What problem does it solve? Building multi-turn conversations for language models in Effect requires correctly assembling messages, parts, tool calls, and history; this Skill provides the complete Prompt API patterns so you avoid malformed messages, mutation bugs, and incorrect streaming-history conversion. ## Core Features & Use Cases - Message and Part Construction: Create system, user, assistant, and tool messages with text, reasoning, file, tool-call, tool-result, and tool-approval parts using Prompt.makeMessage and Prompt.makePart constructors. - Prompt Composition and History: Merge prompts with Prompt.concat, manage system messages with setSystem/prependSystem/appendSystem, and convert streaming responses into history via Prompt.fromResponseParts. - Serialization and Provider Options: Encode prompts to JSON with Schema.fromJsonString(Prompt.Prompt) and attach provider-specific options like Anthropic cache control through module augmentation. - Use Case: Build a chat loop that keeps conversation state in a SubscriptionRef, appends user input with Prompt.concat, calls LanguageModel.generateText, and folds the response back into history with Prompt.fromResponseParts. ## Quick Start Ask the AI to build an Effect AI chat loop that constructs a prompt with a system message and user input, generates text with LanguageModel, and appends the response to conversation history using Prompt.fromResponseParts.

Frequently Asked Questions about effect-ai-prompt

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

FAQPage Schema
How do I build a multi-turn conversation prompt in Effect AI?

Use Prompt.make with an array of encoded messages containing system, user, and assistant roles, or compose prompts with Prompt.concat. Each message is created with Prompt.makeMessage or shorthand constructors like Prompt.userMessage, with content built from Prompt.makePart.

How to convert streaming AI responses into prompt history in Effect?

Use Prompt.fromResponseParts to convert Response parts into a Prompt. It folds streaming text and reasoning deltas when start/delta/end parts are present, places tool calls in assistant messages, and puts non-preliminary tool results into tool messages.

Does Effect AI Prompt support file and image attachments?

Yes, file parts accept data as a URL, Uint8Array of bytes, or base64 data string along with a mediaType and fileName. For OpenAI, strings are treated as provider file IDs only when they match the configured fileIdPrefixes.

How do I serialize an Effect AI Prompt to JSON?

Create a JSON codec with Schema.fromJsonString(Prompt.Prompt), then use Schema.encodeEffect and Schema.decodeUnknownEffect to convert between prompts and JSON strings. There is no Prompt.FromJson in v4.

Why should I avoid mutating prompt content directly in Effect AI?

Prompt content is readonly, so pushing messages into the array fails. Use Prompt.concat to compose prompts and Prompt.setSystem, prependSystem, or appendSystem to modify system messages immutably.