/agentsop-module-shape-selection
ENHANCE overlay on [[dspy]] — the upfront rubric for choosing a reasoning SHAPE (Predict / ChainOfThought / ReAct / ProgramOfThought) BEFORE you write a prompt or pick an optimizer. The local `dspy` skill lists the modules but never surfaces the *selection criterion*: reasoning
$ npx -y skills add agentsope/SkillAlchemy --skill agentsop-module-shape-selection --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/agentsop-module-shape-selection
Context preview
The summary Claude sees to decide when to auto-load this skill.
ENHANCE overlay on [[dspy]] — the upfront rubric for choosing a reasoning SHAPE (Predict / ChainOfThought / ReAct / ProgramOfThought) BEFORE you write a prompt or pick an optimizer. The local `dspy` skill lists the modules but never surfaces the *selection criterion*: reasoning
SKILL.md
agentsop-module-shape-selection.SKILL.mdname: agentsop-module-shape-selection
version: 0.1.0
description: >-
ENHANCE overlay on [[dspy]] — the upfront rubric for choosing a reasoning SHAPE (Predict /
ChainOfThought / ReAct / ProgramOfThought) BEFORE you write a prompt or pick an optimizer.
The local `dspy` skill lists the modules but never surfaces the *selection criterion*:
reasoning shape is chosen by task structure, not by reflexively defaulting to CoT.
Activate every time a new LM-calling node/step is added to a pipeline. Do NOT activate for
one-shot prompts, optimizer/teleprompter choice (that is the dspy SOP's job), or non-LM
control flow. Search keywords: chain of thought vs ReAct, when to use CoT, reasoning type,
ReAct vs CoT vs PoT, which dspy module, predict vs chain of thought.
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.
A module's *shape* is the **control-flow contract** between the LM and your code:
does the answer need is there a real
intermediate reasoning? tool to call?
│ │
simple lookup ── no ──┤ │
/classify ─────────►│ Predict │
│ │
analytic / ── yes ──┤── no tool ──────────────►│ ChainOfThought
judgement │ │
│ │
needs to act ─────────┼── yes, real tool ───────►│ ReAct(tools=[...])
/look things up │ │
│ │
math / counting ──────┴── deterministic compute ► ProgramOfThought
/ strict parsing (code grounds answer)Three shifts the agent must internalize:
1. **The default is a *probe*, not a *destination*.** "Default to CoT" means "when unsure, CoT is the safe baseline" — not "always ship CoT." Every CoT you ship that a Predict would have matched is pure token tax [dspy.ai/learn/programming/modules/].
2. **Shape is structural, optimizer is statistical.** Shape = which control flow (this overlay). Optimizer = which demos/instructions get baked in ([[agentsop-dspy]] §4). A wrong shape cannot be fixed by a better optimizer — MIPROv2 on the wrong shape just optimizes the wrong thing [dspy.ai/learn/optimization/overview/].
3. **Each shape has a cost signature.** Predict ≈ 1 call, no reasoning tokens. CoT ≈ 1 call + a `reasoning`/`rationale` field (more output tokens). ReAct ≈ N calls (a tool loop). PoT ≈ 1 LM call + code execution. Shape choice *is* a cost choice.
---
3. SOP (Classify → Pick → Measure)
A three-step gate, run **per LM-calling step** (not per pipeline):
Step 1 — Classify the task structure
Answer two yes/no questions about the step's *output*:
- **Q1: Does a correct answer require visible intermediate reasoning?**
(Multi-hop inference, judgement, "why", trade-off weighing → yes. Lookup, label, format-conversion → no.)
- **Q2: Does producing the answer require *acting* — calling a tool, fetching data,
or running deterministic computation?** (Search/API/DB → tool. Arithmetic/counting/strict-parse → computation. Neither → no.)
Step 2 — Pick the shape from the selection card (§4)
Map the (Q1, Q2) answers straight onto the card. Do not negotiate with the reflex.
Step 3 — Measure whether the shape earns its cost
A shape is only justified if it *beats the cheaper shape below it*. Before shipping anything heavier than `Predict`:
1. Run the candidate shape and the next-cheaper shape on **5–10 hand-picked examples**. 2. Diff outputs with `dspy.inspect_history(n=3)` [dspy.ai/learn/programming/modules/]. 3. **Keep the heavier shape o
Read more
name: agentsop-module-shape-selection version: 0.1.0 description: >- ENHANCE overlay on [[dspy]] — the upfront rubric for choosing a reasoning SHAPE (Predict / ChainOfThought / ReAct / ProgramOfThought) BEFORE you write a prompt or pick an optimizer. The local `dspy` skill lists the modules but never surfaces the *selection criterion*: reasoning shape is chosen by task structure, not by reflexively defaulting to CoT. Activate every time a new LM-calling node/step is added to a pipeline. Do NOT activate for one-shot prompts, optimizer/teleprompter choice (that is the dspy SOP's job), or non-LM control flow. Search keywords: chain of thought vs ReAct, when to use CoT, reasoning type, ReAct vs CoT vs PoT, which dspy module, predict vs chain of thought.
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.
A module's *shape* is the **control-flow contract** between the LM and your code:
does the answer need is there a real
intermediate reasoning? tool to call?
│ │
simple lookup ── no ──┤ │
/classify ─────────►│ Predict │
│ │
analytic / ── yes ──┤── no tool ──────────────►│ ChainOfThought
judgement │ │
│ │
needs to act ─────────┼── yes, real tool ───────►│ ReAct(tools=[...])
/look things up │ │
│ │
math / counting ──────┴── deterministic compute ► ProgramOfThought
/ strict parsing (code grounds answer)Three shifts the agent must internalize:
1. **The default is a *probe*, not a *destination*.** "Default to CoT" means "when unsure, CoT is the safe baseline" — not "always ship CoT." Every CoT you ship that a Predict would have matched is pure token tax [dspy.ai/learn/programming/modules/].
2. **Shape is structural, optimizer is statistical.** Shape = which control flow (this overlay). Optimizer = which demos/instructions get baked in ([[agentsop-dspy]] §4). A wrong shape cannot be fixed by a better optimizer — MIPROv2 on the wrong shape just optimizes the wrong thing [dspy.ai/learn/optimization/overview/].
3. **Each shape has a cost signature.** Predict ≈ 1 call, no reasoning tokens. CoT ≈ 1 call + a `reasoning`/`rationale` field (more output tokens). ReAct ≈ N calls (a tool loop). PoT ≈ 1 LM call + code execution. Shape choice *is* a cost choice.
---
3. SOP (Classify → Pick → Measure)
A three-step gate, run **per LM-calling step** (not per pipeline):
Step 1 — Classify the task structure
Answer two yes/no questions about the step's *output*:
- **Q1: Does a correct answer require visible intermediate reasoning?**
(Multi-hop inference, judgement, "why", trade-off weighing → yes. Lookup, label, format-conversion → no.)
- **Q2: Does producing the answer require *acting* — calling a tool, fetching data,
or running deterministic computation?** (Search/API/DB → tool. Arithmetic/counting/strict-parse → computation. Neither → no.)
Step 2 — Pick the shape from the selection card (§4)
Map the (Q1, Q2) answers straight onto the card. Do not negotiate with the reflex.
Step 3 — Measure whether the shape earns its cost
A shape is only justified if it *beats the cheaper shape below it*. Before shipping anything heavier than `Predict`:
1. Run the candidate shape and the next-cheaper shape on **5–10 hand-picked examples**. 2. Diff outputs with `dspy.inspect_history(n=3)` [dspy.ai/learn/programming/modules/]. 3. **Keep the heavier shape o
Other skills on skillalchemy.
- /LEAP
LEAP — 落地执行引擎。内含两条管线:A 分支蒸馏(从 raw data 提取 skill)、 B 分支融合(多 skill 编织为一个)。被 SkillAlchemy 编排器调用。 Use when 编排器判断需要蒸馏或融合时。
Open skill - /Lens
Lens — 给你的问题加一层认知镜片。输入任意任务描述,输出增强版 description, 发现「你不知道自己不知道」的隐性维度、前置条件和认知路线。 Use when 用户说「帮我想想」「分析一下」「生成 skill」「蒸馏」「融合」 或输入看起来太简单需要展开。
Open skill - /agentsop-agent-topology-selection
Cross-framework enhancement overlay for choosing a multi-agent topology BEFORE writing any agent. A binary-question rubric — is single-agent + tools enough? do agents need to know about each other? does the output need one voice? — maps the answer to single-agent / supervisor /
Open skill - /agentsop-aider
SOP for terminal-based, git-native AI pair programming with Aider (git work-tree + tree-sitter repo-map + edit-format + human-in-loop REPL). Use when editing code in an existing git repo via an LLM, when you need to converge a change to 2-5 files, pick an edit format that fits
Open skill - /agentsop-bio-fraud-forensics
Screens biomedical / life-science papers for signs of data fabrication, image manipulation, and statistical anomalies, using the detection techniques distilled from the field's canonical exposure platforms (PubPeer, Data Colada, Science Integrity Digest, For Better Science) and
Open skill - /agentsop-bounded-loop
Universal discipline for any LM-driven loop — agent retries, plan-act-observe, multi-agent handoffs, optimiser passes, test-fix cycles. Encodes the one rule every framework documents quietly and every team relearns expensively: the LM in the loop is NEVER a reliable terminator.
Open skill

