agentsop-module-shape-selection

A decision guide for choosing how a DSPy module should reason before writing its prompt. DSPy is a Python library for building language-model programs; the choices include direct prediction, step-by-step reasoning, tool use, and code-based reasoning.

In plain words
What is it for?
Choosing between DSPy modules such as Predict, ChainOfThought, ReAct, and ProgramOfThought when adding or changing a language-model step.
Why use it?
It helps avoid using a reasoning method that is unnecessarily complex or too weak for the task.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/agentsope/skillalchemy/agentsop-module-shape-selection
Any agent
npx skills add agentsope/SkillAlchemy --skill agentsop-module-shape-selection
Clone the repo
git clone --depth 1 https://github.com/agentsope/SkillAlchemy

Made for: Claude Code, Codex.

Per session 174 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,567 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00174 $0.04567
Opus 5 $0.00087 $0.02284
Sonnet 5 $0.00035 $0.00913
Haiku 4.5 $0.00017 $0.00457

Measured 2d ago against content hash 7bab8946f2bb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agentsop-module-shape-selection 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 2d 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.

skills/agentsop-module-shape-selection/SKILL.md · 326 lines

How it starts

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

M2 — Module-Shape Selection (CoT / ReAct / PoT / Predict)

"Pick the lowest-power Module that works. Default to ChainOfThought." — DSPy docs [dspy.ai/learn/programming/modules/]

This overlay sharpens that line into a rubric: the default is not a law. The shape is a function of the task structure, and CoT is only one of four answers.

This is an enhancement overlay. It assumes the [[dspy]] library skill is loaded (it provides dspy.Predict, dspy.ChainOfThought, dspy.ReAct, dspy.ProgramOfThought APIs and install). This file adds only the decision the lib skill leaves implicit. Cross-link: [[dspy]], and the optimizer SOP [[agentsop-dspy]].


1. 何时激活 (When to activate)

Activate the instant you are about to add or wrap an LM-calling step:

Trigger Signal
New node A LangGraph/CrewAI node body, or a forward() line, is about to call an LM
New dspy.<Module>(Sig) You are typing dspy.ChainOfThought(...) on reflex — stop and run the rubric
Refactor An existing Predict "feels weak" or a ChainOfThought "feels wasteful"
Pipeline growth A multi-stage program adds a stage; each stage needs its own shape decision
Tool appears A function/API/search/calculator is now available to the step

Do NOT activate when:

  • The work is a one-shot prompt — just call the LM; shape ceremony has no payoff.
  • You are choosing the optimizer / teleprompter (MIPROv2, GEPA, BootstrapFewShot) — that is the [[agentsop-dspy]] workflow, a later stage. Shape comes first, optimizer second.
  • The step is non-LM control flow (a if, a DB read, a deterministic transform).

Shape selection is upstream of optimization. You pick the shape in Stage 1 (Programming) of the dspy SOP, before any metric or compile [dspy.ai/learn/].


2. 核心心智模型 (Core mental model)

Reasoning shape is chosen by task structure, not by defaulting to CoT.

The lib skill shows four modules side by side and a "Best Practices" note that says "Start with Predict, add ChainOfThought if needed" [~/.claude/skills/dspy Best Practices §1]. In practice that collapses into a CoT-everywhere reflex, because "if needed" is never operationalized. This overlay operationalizes it.

Read the full file on GitHub · 326 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 326 lines · 174 tokens per session scan A 7bab8946f2bb

Subscribe to this mod's changes

agentsop-module-shape-selection is a skill published in the GitHub repository agentsope/SkillAlchemy (342 stars, last pushed 8d ago), licensed MIT. It adds 174 tokens to every session and 4,567 once invoked, about $0.0009 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

shellgames

Play board games on ShellGames.ai — Chess, Poker, Ludo, Tycoon, Memory, and Spymaster. Use when the agent wants to play games against humans or other AI agents, join tournaments, chat with players, check leaderboards, or manage a ShellGames account. Triggers on "play chess/poker/ludo/memory", "shellgames", "join…

MemTensor/skills-vote · 103 tokens

curl-search

Web search using curl + multiple search engines (Baidu, Google, Bing, DuckDuckGo). Activates when user asks to search, look up, or query something online. Includes security enhancements: input sanitization, command injection protection, and URL encoding.

MemTensor/skills-vote · 55 tokens

skills-vote-local

Use when retrieving the most relevant skills from a local or private skill library instead of relying on network-based skill discovery.

MemTensor/skills-vote · 28 tokens

prompt-refine

Silently restructures the user's natural-language prompt into the format the model CURRENTLY running this skill handles best, then answers. On activation it identifies which model family is executing it (Claude, GPT, Gemini, Llama, DeepSeek, Mistral, Qwen, Grok, Perplexity, Kimi, GLM, Command, Nova, or Phi) and loads…

Apeironics/prompt-refine-skill · 118 tokens

skills-vote

Find the most relevant external agent skills for the current task, then submit grounded feedback about which skills were actually used and useful in the same session. Whenever you start a task, use this skill first.

MemTensor/skills-vote · 44 tokens

prompt-evaluation-runner

Use when evaluating prompts, LLM outputs, red-team suites, or model behavior with local eval configs and safe provider/cost controls.

yeaight7/agent-powerups · 33 tokens