Skip to content

Commit e8f3bbc

Browse files
vicentereigclaude
andauthored
refactor(skills): update dspy-ruby skill to DSPy.rb v0.34.3 API (#162)
Rewrite all reference files, asset templates, and SKILL.md to use current API patterns (.call(), result.field, T::Enum classes, Tools::Base). Add two new reference files (toolsets, observability) covering tools DSL, event system, and Langfuse integration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f3b7d11 commit e8f3bbc

12 files changed

Lines changed: 3357 additions & 1887 deletions

File tree

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: "refactor: Update dspy-ruby skill to DSPy.rb v0.34.3 API"
3+
type: refactor
4+
date: 2026-02-09
5+
---
6+
7+
# Update dspy-ruby Skill to DSPy.rb v0.34.3 API
8+
9+
## Problem
10+
11+
The `dspy-ruby` skill uses outdated API patterns (`.forward()`, `result[:field]`, inline `T.enum([...])`, `DSPy::Tool`) and is missing 10+ features (events, lifecycle callbacks, GEPA, evaluation framework, BAML/TOON, storage, etc.).
12+
13+
## Solution
14+
15+
Use the engineering skill as base (already has correct API), enhance with official docs content, rewrite all reference files and templates.
16+
17+
### Source Priority (when conflicts arise)
18+
19+
1. **Official docs** (`../dspy.rb/docs/src/`) — source of truth for API correctness
20+
2. **Engineering skill** (`../engineering/.../dspy-rb/SKILL.md`) — source of truth for structure/style
21+
3. **NavigationContext brainstorm** — for Typed Context pattern only
22+
23+
## Files to Update
24+
25+
### Core (SKILL.md)
26+
27+
1. **`skills/dspy-ruby/SKILL.md`** — Copy from engineering base, then:
28+
- Fix frontmatter: `name: dspy-rb``name: dspy-ruby`, keep long description format
29+
- Add sections before "Guidelines for Claude": Events System, Lifecycle Callbacks, Fiber-Local LM Context, Evaluation Framework, GEPA Optimization, Typed Context Pattern, Schema Formats (BAML/TOON)
30+
- Update Resources section with 5 references + 3 assets using markdown links
31+
- Fix any backtick references to markdown link format
32+
33+
### References (rewrite from themed doc batches)
34+
35+
2. **`references/core-concepts.md`** — Rewrite
36+
- Source: `core-concepts/signatures.md`, `modules.md`, `predictors.md`, `advanced/complex-types.md`
37+
- Cover: signatures (Date/Time types, T::Enum, defaults, field descriptions, BAML/TOON, recursive types), modules (.call() API, lifecycle callbacks, instruction update contract), predictors (all 4 types, concurrent predictions), type system (discriminators, union types)
38+
39+
3. **`references/toolsets.md`** — NEW
40+
- Source: `core-concepts/toolsets.md`, `toolsets-guide.md`
41+
- Cover: Tools::Base, Tools::Toolset DSL, type safety with Sorbet sigs, schema generation, built-in toolsets, testing
42+
43+
4. **`references/providers.md`** — Rewrite
44+
- Source: `llms.txt.erb`, engineering SKILL.md, `core-concepts/module-runtime-context.md`
45+
- Cover: per-provider adapters, RubyLLM unified adapter, Rails initializer, fiber-local LM context (`DSPy.with_lm`), feature-flagged model selection, compatibility matrix
46+
47+
5. **`references/optimization.md`** — Rewrite
48+
- Source: `optimization/miprov2.md`, `gepa.md`, `evaluation.md`, `production/storage.md`
49+
- Cover: MIPROv2 (dspy-miprov2 gem, AutoMode presets), GEPA (dspy-gepa gem, feedback maps), Evaluation (DSPy::Evals, built-in metrics, DSPy::Example), Storage (ProgramStorage)
50+
51+
6. **`references/observability.md`** — NEW
52+
- Source: `production/observability.md`, `core-concepts/events.md`, `advanced/observability-interception.md`
53+
- Cover: event system (module-scoped + global), dspy-o11y gems, Langfuse (env vars), score reporting (DSPy.score()), observation types, DSPy::Context.with_span
54+
55+
### Assets (rewrite to current API)
56+
57+
7. **`assets/signature-template.rb`** — T::Enum classes, `description:` kwarg, Date/Time types, defaults, union types, `.call()` / `result.field` usage examples
58+
59+
8. **`assets/module-template.rb`**`.call()` API, `result.field`, Tools::Base, lifecycle callbacks, `DSPy.with_lm`, `configure_predictor`
60+
61+
9. **`assets/config-template.rb`** — RubyLLM adapter, `structured_outputs: true`, `after_initialize` Rails pattern, dspy-o11y env vars, feature-flagged model selection
62+
63+
### Metadata
64+
65+
10. **`.claude-plugin/plugin.json`** — Version `2.31.0``2.31.1`
66+
67+
11. **`CHANGELOG.md`** — Add `[2.31.1] - 2026-02-09` entry under `### Changed`
68+
69+
## Verification
70+
71+
```bash
72+
# No old API patterns
73+
grep -n '\.forward(\|result\[:\|T\.enum(\[\|DSPy::Tool[^s]' plugins/compound-engineering/skills/dspy-ruby/SKILL.md
74+
75+
# No backtick references
76+
grep -E '`(references|assets|scripts)/' plugins/compound-engineering/skills/dspy-ruby/SKILL.md
77+
78+
# Frontmatter correct
79+
head -4 plugins/compound-engineering/skills/dspy-ruby/SKILL.md
80+
81+
# JSON valid
82+
cat plugins/compound-engineering/.claude-plugin/plugin.json | jq .
83+
84+
# All files exist
85+
ls plugins/compound-engineering/skills/dspy-ruby/{references,assets}/
86+
```
87+
88+
## Success Criteria
89+
90+
- [x] All API patterns updated (`.call()`, `result.field`, `T::Enum`, `Tools::Base`)
91+
- [x] New features covered: events, callbacks, fiber-local LM, GEPA, evals, BAML/TOON, storage, score API, RubyLLM, typed context
92+
- [x] 5 reference files present (core-concepts, toolsets, providers, optimization, observability)
93+
- [x] 3 asset templates updated to current API
94+
- [x] YAML frontmatter: `name: dspy-ruby`, description has "what" and "when"
95+
- [x] All reference links use `[file.md](./references/file.md)` format
96+
- [x] Writing style: imperative form, no "you should"
97+
- [x] Version bumped to `2.31.1`, CHANGELOG updated
98+
- [x] Verification commands all pass
99+
100+
## Source Materials
101+
102+
- Engineering skill: `/Users/vicente/Workspaces/vicente.services/engineering/plugins/engineering-skills/skills/dspy-rb/SKILL.md`
103+
- Official docs: `/Users/vicente/Workspaces/vicente.services/dspy.rb/docs/src/`
104+
- NavigationContext brainstorm: `/Users/vicente/Workspaces/vicente.services/observo/observo-server/docs/brainstorms/2026-02-09-typed-navigation-context-brainstorm.md`

plugins/compound-engineering/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "compound-engineering",
3-
"version": "2.31.0",
3+
"version": "2.31.1",
44
"description": "AI-powered development tools. 29 agents, 24 commands, 18 skills, 1 MCP server for code review, research, design, and workflow automation.",
55
"author": {
66
"name": "Kieran Klaassen",

plugins/compound-engineering/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to the compound-engineering plugin will be documented in thi
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.31.1] - 2026-02-09
9+
10+
### Changed
11+
12+
- **`dspy-ruby` skill** — Complete rewrite to DSPy.rb v0.34.3 API: `.call()` / `result.field` patterns, `T::Enum` classes, `DSPy::Tools::Base` / `Toolset`. Added events system, lifecycle callbacks, fiber-local LM context, GEPA optimization, evaluation framework, typed context pattern, BAML/TOON schema formats, storage system, score reporting, RubyLLM adapter. 5 reference files (2 new: toolsets, observability), 3 asset templates rewritten.
13+
814
## [2.31.0] - 2026-02-08
915

1016
### Added

0 commit comments

Comments
 (0)