effect-ai-language-model

effect-ai-language-model is a skill for Claude Code, Codex from mpsuesser/pi-effect-harness. It costs 44 tokens per session (4,597 once invoked), scanned A, original, MIT.

A pattern guide for using Effect AI's language-model service in TypeScript. It covers generating text, returning data checked against a schema, streaming chat responses, calling tools, and keeping conversation history.

In plain words
What is it for?
Use it when building text-generation features, chat systems, structured data extraction, streaming responses, or model-driven tool calls with Effect AI.
Why use it?
It helps keep language-model interactions type-safe and consistent with Effect's programming style. It also explains how to work with different AI providers through the same service pattern.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building text-generation features, chat systems, structured data extraction, streaming responses, or model-driven tool calls with Effect AI.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mpsuesser/pi-effect-harness/effect-ai-language-model
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mpsuesser/pi-effect-harness --skill effect-ai-language-model
Clone the repo
git clone --depth 1 https://github.com/mpsuesser/pi-effect-harness

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for effect-ai-language-model

README.md
[![agentmods](https://agentmods.dev/badge/skills/mpsuesser/pi-effect-harness/effect-ai-language-model/github.svg)](https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-ai-language-model)
Your own site
<a href="https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-ai-language-model"><img src="https://agentmods.dev/badge/skills/mpsuesser/pi-effect-harness/effect-ai-language-model/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for effect-ai-language-model

Your own site · 80×15
<a href="https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-ai-language-model"><img src="https://agentmods.dev/badge/skills/mpsuesser/pi-effect-harness/effect-ai-language-model.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,597 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00044 $0.04597
Opus 5 $0.00022 $0.02299
Sonnet 5 $0.00009 $0.00919
Haiku 4.5 $0.00004 $0.00460

Measured 9d ago against content hash 5d62dc5712d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

effect-ai-language-model scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

harnesses/effect/skills/effect-ai-language-model/SKILL.md · 624 lines

How it starts

The opening of the file, as written. The whole thing — 624 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Effect AI Language Model

Pattern guide for working with the LanguageModel service from Effect AI for type-safe LLM interactions with Effect's functional patterns.

Import Patterns

CRITICAL: Always use namespace imports:

import * as LanguageModel from 'effect/unstable/ai/LanguageModel';
import * as Prompt from 'effect/unstable/ai/Prompt';
import * as Response from 'effect/unstable/ai/Response';
import * as Toolkit from 'effect/unstable/ai/Toolkit';
import * as Tool from 'effect/unstable/ai/Tool';
import * as Effect from 'effect/Effect';
import * as Stream from 'effect/Stream';
import * as Schema from 'effect/Schema';

When to Use This Skill

  • Generating text completions from language models
  • Extracting structured data with schema validation
  • Real-time streaming responses for chat interfaces
  • Tool calling and function execution
  • Multi-turn conversations with history
  • Switching between different AI providers

Service Interface

LanguageModel :: Service

-- Core operations
generateText   :: Options → Effect GenerateTextResponse E R
generateObject :: Options → Schema A → Effect (GenerateObjectResponse A) E R
streamText     :: Options → Stream StreamPart E R

-- Service as dependency (LanguageModel is both a namespace and a service tag)
LanguageModel ∈ R → Effect.gen(function*() {
  -- Option A: use static accessors (adds LanguageModel to R automatically)
  const response = yield* LanguageModel.generateText(options)
  -- Option B: yield the tag explicitly
  const model = yield* LanguageModel.LanguageModel
  const response = yield* model.generateText(options)
})

generateText Pattern

Basic text generation with optional tool calling:

import * as LanguageModel from 'effect/unstable/ai/LanguageModel';
import * as Effect from 'effect/Effect';

// Simple text generation
const simple = LanguageModel.generateText({
	prompt: 'Explain quantum computing'
});

// With system prompt and conversation history
const withHistory = LanguageModel.generateText({
	prompt: [
		{ role: 'system', content: 'You are a helpful assistant' },
		{ role: 'user', content: [{ type: 'text', text: 'Hello!' }] }
	]
});

// With toolkit for tool calling
const withTools = LanguageModel.generateText({
	prompt: "What's the weather in SF?",
	toolkit: weatherToolkit,
	toolChoice: 'auto' // "none" | "required" | { tool: "name" } | { oneOf: [...] }
});

// Parallel tool call execution
const withConcurrency = LanguageModel.generateText({
	prompt: 'Search multiple sources',
	toolkit: searchToolkit,
	concurrency: 'unbounded' // or number for limited parallelism
});

// Disable automatic tool call resolution
const manualTools = LanguageModel.generateText({
	prompt: 'Search for X',
	toolkit: searchToolkit,
	disableToolCallResolution: true // Get tool calls without executing
});

Read the full file on GitHub · 624 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 624 lines · 44 tokens per session scan A 5d62dc5712d8

Subscribe to this mod's changes

effect-ai-language-model is a skill published in the GitHub repository mpsuesser/pi-effect-harness (24 stars, last pushed 2mo ago), licensed MIT. It adds 44 tokens to every session and 4,597 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories