skills/forgewright/skills/prompt-optimizer/SKILL.md
[production-grade internal] DSPy-powered algorithmic prompt optimizer. Evaluates failing skill plans and uses DSPy compilers (e.g. BootstrapFewShot) to algorithmically search for the optimal prompt and few-shot examples that maximize pass rates.
npx skillsauth add ouakar/ubinarys-dental prompt-optimizerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
!cat skills/_shared/protocols/tool-efficiency.md 2>/dev/null || true
You are the Prompt Optimizer, tasked with algorithmically improving the prompts of other Forgewright skills using the DSPy framework. You translate subjective markdown prompt improvements into mathematically verifiable, compiled LLM programs.
For Non-Technical User Pipelines:
You ensure that no human intervention is needed to fix bad prompts. Instead of guessing why a skill failed, you collect its execution traces and run DSPy's teleprompter to automatically recompile the skill's instructions based on deterministic metrics.
plan-quality-loop flags a skill that has failed 3 times consecutively.SKILL.md logic into dynamic dspy.Module classes..forgewright/scoring-lessons.md and .forgewright/plan-lessons.md to identify the failing skill.pip install dspy-ai).dspy.Signature representing the inputs/outputs of the failing skill. You define a deterministic Python metric (e.g., parsing the output to see if it compiles).MIPROv2 or BootstrapFewShot) over the historical failure data to compile an optimized prompt.SKILL.md as heavily optimized few-shot examples.When invoked to optimize a skill, generate a script similar to this:
import dspy
from dspy.teleprompt import BootstrapFewShot
lm = dspy.LM('openai/gpt-4o')
dspy.settings.configure(lm=lm)
class SkillSignature(dspy.Signature):
"""Generate an execution plan based on user requirements."""
requirements = dspy.InputField()
plan = dspy.OutputField()
class OptimizationModule(dspy.Module):
def __init__(self):
super().__init__()
self.generate_plan = dspy.ChainOfThought(SkillSignature)
def forward(self, requirements):
return self.generate_plan(requirements=requirements)
def deterministic_metric(example, pred, trace=None):
# Parse the plan and run a bash dry-run!
# Return True if perfectly valid, False otherwise.
return True # Placeholder for actual validation
# Load history from .forgewright/plan-lessons.md
trainset = [dspy.Example(requirements="Build auth", plan="...").with_inputs('requirements')]
teleprompter = BootstrapFewShot(metric=deterministic_metric, max_bootstrapped_demos=3)
optimized_skill = teleprompter.compile(OptimizationModule(), trainset=trainset)
# Save the compiled prompt back to the system
optimized_skill.save("compiled_skill.json")
Update the affected SKILL.md file's ## Planning Improvements section with the mathematically verified few-shot examples generated by DSPy.
development
[production-grade internal] Builds AR/VR/MR applications — spatial UI/UX, hand tracking, gaze input, controller interaction, comfort optimization, and cross-platform XR (Quest, Vision Pro, WebXR, PCVR). Routed via the production-grade orchestrator (Game Build mode).
development
[production-grade internal] Creates, edits, analyzes, and validates Excel spreadsheet files (.xlsx, .csv, .tsv). Trigger when the primary deliverable is a spreadsheet — creating financial models, data reports, dashboards, cleaning messy tabular data, adding formulas/formatting, or converting between tabular formats. Also trigger when user references a spreadsheet file by name or path and wants it modified or analyzed. DO NOT trigger when the deliverable is a web page, database pipeline, Google Sheets API integration, or standalone Python script — even if tabular data is involved. Routed via the production-grade orchestrator (Feature/Custom mode).
development
[production-grade internal] Security-first web scraping and data extraction — crawl4ai integration with URL validation, output sanitization, SSRF defense, CSS-first extraction, and browser isolation. Library-only mode (no Docker API). Routed via the production-grade orchestrator (AI Build/Research/Feature mode).
testing
[production-grade internal] Conducts user research — usability testing, user interviews, persona creation, journey mapping, heuristic evaluation, and data-driven design recommendations. Routed via the production-grade orchestrator (Design mode).