Agent skill

Dspy Reasoning Modules

by OmidZamani in OmidZamani/dspy-skills

A skill your agent uses for DSPy reasoning modules including RLM, ProgramOfThought, CodeAct, Parallel, sandboxed execution, and long-context workflows.

MITAuto-check passed

Install Dspy Reasoning Modules

skills CLI
$ npx skills add OmidZamani/dspy-skills --skill dspy-reasoning-modules -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install OmidZamani/dspy-skills dspy-reasoning-modules --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/OmidZamani/dspy-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/dspy-reasoning-modules .claude/skills/dspy-reasoning-modules && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dspy-reasoning-modules
GitHub stars
123
Token cost
~874 tokens
SKILL.md length
221 words
Files
2
Skills in repo
17
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses for DSPy reasoning modules including RLM, ProgramOfThought, CodeAct, Parallel, sandboxed execution, and long-context workflows.

  • Works in 5 steps: Prefer Predict or ChainOfThought until… → Treat RLM as experimental and load-test… → Bound loops and sub-LM calls. → …
  • DSPy reasoning modules including RLM
  • SKILL.md covers Goal, Module Selection, RLM for Large Contexts and Sandboxed Execution, plus 4 more sections
  • Runs Python scripts from its folder

What it does

Dspy Reasoning Modules is an agent skill from OmidZamani/dspy-skills. Use for DSPy reasoning modules including RLM, ProgramOfThought, CodeAct, Parallel, sandboxed execution, and long-context workflows.

Its SKILL.md is about 870 tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `example.py`).

It works with Deno. The repository describes itself as: Collection of Claude Skills for DSPy framework - program language models, optimize prompts, and build RAG pipelines systematically. The licence is MIT.

When your agent uses it

  • DSPy reasoning modules including RLM
  • ProgramOfThought
  • Sandboxed execution
  • Long-context workflows

Example prompts

  • “/dspy-reasoning-modules”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Read, Write, Glob, Grep

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Prefer Predict or ChainOfThought until code execution or long-context exploration is justified.
  2. Treat RLM as experimental and load-test before production deployment.
  3. Bound loops and sub-LM calls.
  4. Keep sandbox permissions narrow.
  5. Create separate interpreters for concurrent custom-interpreter use.

What it can do on your machine

Read from SKILL.md and the folder at commit f5db3b7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • dspy.ai

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dspy Reasoning Modules loads about 874 tokens when it runs. Until then it costs about 39 tokens; SKILL.md has 221 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~39
When it runs · the whole SKILL.md, loaded when a task matches
~874

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from OmidZamani/dspy-skills at commit f5db3b7, republished under its MIT licence (© OmidZamani). 221 words, ~874 tokens.

Download SKILL.mdSave it as .claude/skills/dspy-reasoning-modules/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
dspy-reasoning-modules
description
Use for DSPy reasoning modules including RLM, ProgramOfThought, CodeAct, Parallel, sandboxed execution, and long-context workflows.
allowed-tools
Read, Write, Glob, Grep
version
1.0.0
dspy-compatibility
3.2.1
tags
reasoning

DSPy Reasoning Modules

Goal

Choose the appropriate DSPy reasoning module for long-context exploration, code-assisted reasoning, or parallel execution.

Module Selection

ModuleUse it forImportant constraint
dspy.RLMExploring very large contexts with iterative REPL code and recursive sub-LM callsExperimental; requires Deno by default
dspy.ProgramOfThoughtSolving tasks by generating and executing PythonRequires Deno by default
dspy.CodeActCombining generated Python with predefined tool functionsFunctions only; requires Deno
dspy.ParallelRunning (module, example) pairs concurrentlyTune threads and error handling

RLM for Large Contexts

RLM treats long inputs as external data in a sandbox rather than placing the full context in each LM prompt.

python
import dspy

dspy.configure(lm=dspy.LM("openai/gpt-4o"))

rlm = dspy.RLM(
    "document, question -> answer",
    max_iterations=12,
    max_llm_calls=30,
    sub_lm=dspy.LM("openai/gpt-4o-mini"),
)

result = rlm(
    document=very_long_document,
    question="What were the main revenue drivers?",
)
print(result.answer)

Use max_iterations, max_llm_calls, and max_output_chars as explicit cost and output bounds.

Sandboxed Execution

The default dspy.PythonInterpreter uses Deno and Pyodide. It denies host filesystem, environment, and network access unless explicitly enabled.

python
from pathlib import Path
import dspy

with dspy.PythonInterpreter(
    enable_read_paths=[Path("./inputs")],
    enable_network_access=["api.example.com"],
) as interpreter:
    print(interpreter.execute("print('ready')"))

Grant only the minimum paths, environment variables, and network hosts needed by the task.

ProgramOfThought and CodeAct

python
import dspy

dspy.configure(lm=dspy.LM("openai/gpt-4o-mini"))

math = dspy.ProgramOfThought("question -> answer")
print(math(question="What is the sum of the first 100 integers?").answer)

Use CodeAct when generated code also needs curated host-side tools:

python
def lookup_rate(currency: str) -> float:
    """Return a trusted exchange rate from the application service."""
    return rates[currency]

agent = dspy.CodeAct("amount, currency -> converted", tools=[lookup_rate])

Parallel Execution

python
parallel = dspy.Parallel(num_threads=8, return_failed_examples=True)
results, failed_examples, exceptions = parallel(
    [(program, {"question": question}) for question in questions]
)

Best Practices

  1. Prefer Predict or ChainOfThought until code execution or long-context exploration is justified.
  2. Treat RLM as experimental and load-test before production deployment.
  3. Bound loops and sub-LM calls.
  4. Keep sandbox permissions narrow.
  5. Create separate interpreters for concurrent custom-interpreter use.

Official Documentation

© OmidZamani, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/dspy-reasoning-modules of OmidZamani/dspy-skills.

  • SKILL.md
  • example.py

Open the folder on GitHubat commit f5db3b7

Compare with similar skills

Dspy Reasoning Modules next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dspy Reasoning Modules compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dspy Reasoning Modules this skillOmidZamani/dspy-skills123—~874Automated safety check: PassMIT
NubaseOtterMind/Nubase622—~2.2kAutomated safety check: NotesApache-2.0
Yahoo Finance2gadicc/yahoo-finance2802—~1.8kAutomated safety check: PassMIT
Yalidine Delivery Integrationbighadj22/codflow354—~2.5kAutomated safety check: PassApache-2.0
Dddswamp-club/swamp646—~1.4kAutomated safety check: PassCustom licence
TS SDK Authormindfold-ai/Trellis15k—~6.1kAutomated safety check: PassMIT

Similar skills

  • Nubase

    OtterMind/Nubase

    A skill your agent uses when the user mentions Nubase broadly, wants a backend for an AI-generated app, or needs to deploy/publish generated code online — across Database, Auth, Storage, Assets…

    622 GitHub stars~2.2k tokensUpdated 12 days ago
    Backend & APIsAuto-check: notes
  • Yahoo Finance2

    gadicc/yahoo-finance2

    A skill your agent uses when building with the yahoo-finance2 TypeScript/Deno/npm library, using its Yahoo Finance data modules, CLI, or MCP server, or contributing to the yahoo-finance2 repository…

    802 GitHub stars~1.8k tokensUpdated 6 days ago
    Agent WorkflowsAuto-check passed
  • Wires an app to the Yalidine (Guepex) Algerian courier API: parcels, zone lookups, delivery fees and verified delivery-status webhooks.

    354 GitHub stars~2.5k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • Ddd

    swamp-club/swamp

    Domain Driven Design guidance for TypeScript/Deno codebases.

    646 GitHub stars~1.4k tokensUpdated today
    DevelopmentAuto-check passed
  • TS SDK Author

    mindfold-ai/Trellis

    Design, build, verify, and publish production-grade TypeScript SDKs as npm packages inside a pnpm monorepo.

    15k GitHub stars~6.1k tokensUpdated 10 days ago
    DevelopmentAuto-check passed
  • Deno Script

    cataclysmbn/Cataclysm-BN

    Write or modify Cataclysm-BN Deno/TypeScript scripts. An agent skill from cataclysmbn/Cataclysm-BN.

    1.3k GitHub stars~1.8k tokensUpdated today
    DevelopmentAuto-check passed

More from OmidZamani/dspy-skills

All 17 skills in this repo
  • Skill Perfection

    OmidZamani/dspy-skills

    A skill your agent uses when you need to QA audit and fix a plugin skill file.

    123 GitHub stars~1.6k tokensUpdated 3 mo ago
    Auto-check passed
  • Dspy Haystack Integration

    OmidZamani/dspy-skills

    A skill your agent uses for integrating DSPy with Haystack, optimizing Haystack prompts, improving retrieval pipelines, and extracting DSPy prompts.

    123 GitHub stars~1.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Dspy Adapters Multimodal

    OmidZamani/dspy-skills

    A skill your agent uses for DSPy adapter selection, JSONAdapter, XMLAdapter, ChatAdapter, native function calling, structured outputs, and multimodal inputs like dspy.Image or dspy.Audio.

    123 GitHub stars~864 tokensUpdated 3 mo ago
    Auto-check passed
  • Dspy Advanced Module Composition

    OmidZamani/dspy-skills

    A skill your agent uses for composing DSPy modules with Ensemble, MultiChainComparison, ensemble voting, sequential pipelines, and multi-program workflows.

    123 GitHub stars~2.2k tokensUpdated 3 mo ago
    Auto-check passed
  • Dspy Better Together

    OmidZamani/dspy-skills

    A skill your agent uses for BetterTogether, prompt plus weight optimization, fine-tuning sequences, and strategy chains like p - w - p.

    123 GitHub stars~756 tokensUpdated 3 mo ago
    Auto-check passed
  • Dspy Bootstrap Fewshot

    OmidZamani/dspy-skills

    A skill your agent uses for BootstrapFewShot, bootstrapped demonstrations, teacher-model demos, and low-data DSPy prompt optimization.

    123 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Questions about Dspy Reasoning Modules

What does Dspy Reasoning Modules do?

A skill your agent uses for DSPy reasoning modules including RLM, ProgramOfThought, CodeAct, Parallel, sandboxed execution, and long-context workflows. Dspy Reasoning Modules is an agent skill from OmidZamani/dspy-skills. Use for DSPy reasoning modules including RLM, ProgramOfThought, CodeAct, Parallel, sandboxed execution, and long-context workflows.

When should I use Dspy Reasoning Modules?

Dspy Reasoning Modules fits situations like: DSPy reasoning modules including RLM; programOfThought; sandboxed execution; long-context workflows.

How do I install Dspy Reasoning Modules in Claude Code?

Run `npx skills add OmidZamani/dspy-skills --skill dspy-reasoning-modules -a claude-code`. Or copy the skill folder (skills/dspy-reasoning-modules in OmidZamani/dspy-skills) into .claude/skills/dspy-reasoning-modules in your project. Claude Code loads it when a task matches its description.

How do I install Dspy Reasoning Modules in Codex?

Run `npx skills add OmidZamani/dspy-skills --skill dspy-reasoning-modules -a codex`. Or copy the skill folder (skills/dspy-reasoning-modules in OmidZamani/dspy-skills) into .agents/skills/dspy-reasoning-modules in your project. Codex loads it when a task matches its description.

Can I use Dspy Reasoning Modules in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add OmidZamani/dspy-skills --skill dspy-reasoning-modules -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dspy-reasoning-modules, .gemini/skills/dspy-reasoning-modules, .github/skills/dspy-reasoning-modules and .opencode/skills/dspy-reasoning-modules in your project.

What does Dspy Reasoning Modules need to run?

Going by SKILL.md and its folder, Dspy Reasoning Modules needs Python for the scripts in its folder. Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Glob, Grep.

Does Dspy Reasoning Modules access the network?

SKILL.md names 1 domain. As links in the text: dspy.ai. This is read from the text; nothing was executed.

Is Dspy Reasoning Modules safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Dspy Reasoning Modules use?

Dspy Reasoning Modules is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dspy Reasoning Modules use?

About 874 tokens (SKILL.md is roughly 3.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Dspy Reasoning Modules?

Skills that share tags, products or a category with Dspy Reasoning Modules: Nubase (OtterMind/Nubase, 622 stars), Yahoo Finance2 (gadicc/yahoo-finance2, 802 stars), Yalidine Delivery Integration (bighadj22/codflow, 354 stars) and Ddd (swamp-club/swamp, 646 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dspy Reasoning Modules?

OmidZamani (a GitHub user) maintains it in OmidZamani/dspy-skills, which has 123 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on June 23, 2026.

Source: OmidZamani/dspy-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.