agentsop-signature-design
Decision rubric for promoting a prose prompt into a typed DSPy Signature. This is an ENHANCE overlay on top of the [[dspy]] library skill: it does NOT teach DSPy syntax — it answers the coder-agent decision "when do I stop hand-writing a prompt string and declare it as a `dspy.Signature`, and how do I name/describe its fields so the optimizer and the calling code both get a clean contract." Activate when: a prompt string grows past ~50 lines; the LM output is consumed by code (parsed, branched on, stored) rather than read by a human; the same prompt is reused across >1 call site; or a teammate
npx skills add agentsope/SkillAlchemy --skill agentsop-signature-design --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Promotes prose prompts to a typed Signature when prompts become load-bearing, and provides naming and descriptive guidance to shape inputs/outputs into a stable contract for downstream code and optimizers.
How it works
It defines a gate-based workflow: activate when prompts cross load-bearing thresholds (length, code-consumed output, or reuse). Then it instructs to identify inputs and outputs, rename fields semantically like function parameters, and add InputField/OutputField descriptions only where names alone don’t carry meaning. It explicitly defers module selection and compilation to other skills (dspy and agentsop-dspy). It also outlines a four-step SOP (identify inputs/outputs, name fields, add minimal descriptions, hand off to dspy) and a decision table for promoting or not based on triggers. The workflow emphasizes that field names carry intent, and that signatures should be typed and minimally described, with description added only to underspecified fields. It cautions against promoting one-shot or daily-changing prompts, and against handling the signature’s API details within this skill.
When to use it
Use when a hand-written prompt grows past ~50 lines, when the LM output is consumed by code, or when the same prompt is reused across multiple call sites, or when a teammate questions whether to formalize it as a Signature.
What it can touch
The skill references using dspy.Signature, InputField, OutputField, Predict, ChainOfThought, and related integration with the [[dspy]] and [[agentsop-dspy]] workflows, but it does not perform compilation itself. It directs the user to hand off to those tools for the API shape, evaluation, and optimization steps.
Caveats
Activates only when triggers are met; do NOT activate for one-shot prompts. It does not teach DSPy syntax and defers module/compile decisions to the dspy skill. It promotes a named, typed contract with minimal necessary descriptions and warns against over-describing fields. The guidance relies on the six-step SOP and a decision table, not guarantees about downstream optimization outcomes.
# Signature-Design — Promote Prose → Typed Contract > *"DSPy uses the field names as the only natural-language hint the optimizer has about intent before it sees > data. Name them like you'd name function parameters in well-written code."* > — derived from [dspy.ai/learn/programming/signatures/], see `references/R1-source-evidence.md` This skill is the **decision layer**, not the library layer. It tells you *when* a prose prompt has become "load-bearing" enough to deserve a typed Signature, and *how* to shape its fields. For the actual API (`dspy.Signature`, `InputField`, `OutputField`, `Predict`, `ChainOfThought`, compile, save) defer to the **[[dspy]]** skill; for the full program→evaluate→optimize SOP defer to **[[agentsop-dspy]]**. --- ## 1. 何时激活 (When to activate) Activate this overlay the moment a hand-written prompt crosses **any one** of three load-bearing thresholds. | Trigger | Concrete signal | Why it matters | |---|---|---| | **Length** | A single prompt string grows past **~50 lines** of f-string / template | Long prose prompts hide their I/O contract inside narration; the [[agentsop-dspy]] skill names this exact symptom: "hand-written prompts grow past ~50 lines; brit
- 1. 何时激活 (When to activate)
- 2. 核心心智模型 (Core mental model)
- 3. SOP 工作流 (The promotion SOP)
- Step 0 — Gate: is this prompt load-bearing?
- Step 1 — Identify inputs and outputs
- Step 2 — Name fields semantically
- Step 3 — Add descriptions only where the name underspecifies
- Step 4 — Hand off module choice to [[dspy]]
- When to iterate back
- 4. 操作模型 (Operations — Trigger / Action / Output / Evidence)
- 4.1 Promote-trigger checklist (the gate)
- 4.2 Operation table
- 4.3 Field-naming rules (the heart of this skill)
- 4.4 When InputField vs OutputField descriptions matter
What does the agentsop-signature-design skill do?
Decision rubric for promoting a prose prompt into a typed DSPy Signature. This is an ENHANCE overlay on top of the [[dspy]] library skill: it does NOT teach DSPy syntax — it answers the coder-agent decision "when do I stop hand-writing a prompt string and declare it as a `dspy.Signature`, and how do I name/describe its fields so the optimizer and the calling code both get a clean contract." Activate when: a prompt string grows past ~50 lines; the LM output is consumed by code (parsed, branched on, stored) rather than read by a human; the same prompt is reused across >1 call site; or a teammate
How do I install it?
Run `npx skills add agentsope/SkillAlchemy --skill agentsop-signature-design --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From agentsope/SkillAlchemy, a repository with 255 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
