qredence/agentic-fleet/dspy-agent-framework-quick-ref

Claude Code and agent skill by qredence/agentic-fleet

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Quick reference card for DSPy + Agent Framework integration patterns: typed signatures, assertions, routing cache, and agent handoffs.

Install

npx vskill@latest install qredence/agentic-fleet/dspy-agent-framework-quick-ref

SKILL.md

DSPy + Agent Framework Quick Reference

Typed Signatures

python
class TaskRouting(dspy.Signature):
task: str = dspy.InputField(desc="Task to route")
team: str = dspy.InputField(desc="Available agents")
decision: RoutingDecisionOutput = dspy.OutputField()
class RoutingDecisionOutput(BaseModel):
assigned_to: list[str] = Field(min_length=1)
execution_mode: Literal["delegated", "sequential", "parallel"]
subtasks: list[str] = Field(default_factory=list)
tool_plan: list[str] = Field(default_factory=list)
reasoning: str

DSPy Assertions

python
dspy.Assert(condition, "error message") # Hard constraint
dspy.Suggest(condition, "guidance") # Soft constraint
def validate_agent_exists(agents, available):
Assert(len(agents) > 0, "Must assign at least one agent")
for a in agents:
Assert(a.lower() in [x.lower() for x in available],
f"Agent {a} not in pool")

Routing Cache

python
class RoutingCache:
def __init__(self, ttl_seconds=300, max_size=1024):
self.ttl = ttl_seconds
self.max_size = max_size
def get(self, key): ... # Returns None if expired/missing
def set(self, key, value): ... # Auto-evicts oldest
def clear(self): ...

DSPy-Enhanced Agent

python
class DSPyEnhancedAgent(ChatAgent):
def __init__(self, reasoning_strategy="chain_of_thought"):
self.reasoning_strategy = reasoning_strategy
if reasoning_strategy == "react":
self.react_module = dspy.ReAct("q -> a", tools=self.tools)
elif reasoning_strategy == "chain_of_thought":
self.cot_module = dspy.ChainOfThought("q -> a")

Workflow with Checkpoints

python
from agent_framework._workflows import (
WorkflowStartedEvent, WorkflowStatusEvent,
WorkflowOutputEvent, ExecutorCompletedEvent,
RequestInfoEvent, FileCheckpointStorage
)
class SupervisorWorkflow:
def __init__(self, checkpoint_dir=".var/checkpoints"):
self.checkpoint_storage = FileCheckpointStorage(checkpoint_dir)
async def resume(self, checkpoint_id: str):
state = self.checkpoint_storage.load(checkpoint_id)
self.context.restore_from_state(state)

Agent Handoffs

python
class HandoffManager:
def prepare_handoff(self, from_agent, to_agent, context):
return {
"task": context["original_task"],
"findings": context.get("findings", []),
"decisions": context.get("decisions", []),
"from_agent_summary": self._summarize(from_agent)
}
def execute_sequential_with_handoffs(self, agents, tasks):
context = {"original_task": tasks[0], "findings": [], "decisions": []}
results = []
for i, (agent, task) in enumerate(zip(agents, tasks)):
handoff = self.prepare_handoff(
agents[i-1] if i > 0 else None, agent, context
)
result = self._run_with_context(agent, task, handoff)
context["findings"].extend(result.get("findings", []))
results.append(result)
return results

GEPA Optimization

bash
agentic-fleet optimize # Outputs: .var/cache/dspy/compiled_reasoner.json

Config:

yaml
dspy:
use_typed_signatures: true
enable_routing_cache: true
routing_cache_ttl_seconds: 300
optimization:
use_gepa: true
gepa_auto: light

Key Imports

python
# DSPy
import dspy
from dspy import TypedPredictor, ChainOfThought, ReAct, ProgramOfThought
# Agent Framework
from agent_framework._agents import ChatAgent
from agent_framework._workflows import Workflow, AgentThread
from agent_framework._types import AgentRunResponse, ChatMessage
# Pydantic
from pydantic import BaseModel, Field
from typing import Literal

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
103
Repository forks
10
7-day trend score
23

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/qredence/agentic-fleet/dspy-agent-framework-quick-ref/badge)](https://verified-skill.com/skills/qredence/agentic-fleet/dspy-agent-framework-quick-ref)

Something wrong with this skill or its page? Tell us.