skills/llm/dual-role-agent-dispatch/SKILL.md
Single agent entry point that dispatches between multiple roles (ask/answer/guess) based on turn type, combining heuristic and LLM-based strategies
npx skillsauth add wenmin-wu/ds-skills llm-dual-role-agent-dispatchInstall 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.
In multi-agent environments where one agent serves multiple roles (questioner, answerer, guesser), use a single dispatch function that routes to different strategies based on the turn type. This allows mixing heuristic logic (structured questions, keyword lookup) with LLM inference (open-ended answering) in one agent, and lazy-loads models only for roles that need them.
def agent_fn(obs, cfg):
if obs.turnType == "ask":
return ask_question(obs)
elif obs.turnType == "answer":
return answer_question(obs)
elif obs.turnType == "guess":
return make_guess(obs)
def ask_question(obs):
# Heuristic: structured binary search questions
return f"Is it a {CATEGORIES[state['cat_idx']]}?"
def answer_question(obs):
# Quick check: keyword in question?
if obs.keyword.lower() in obs.questions[-1].lower():
return "yes"
# Fall back to LLM
return llm_yes_no(obs.questions[-1], obs.keyword)
def make_guess(obs):
# Filter candidates by accumulated answers, pick best
remaining = filter_candidates(obs)
return remaining.iloc[0]['keyword'] if len(remaining) > 0 else "unknown"
agent_fn(obs, cfg) entry pointobs.turnType to route to role-specific logicdata-ai
Scaled Pinball Loss (SPL) metric for evaluating quantile forecasts, normalized by mean absolute successive differences of training data
data-ai
Walk backward through a time series and multiplicatively rescale segments when jumps exceed a fraction of the running mean to correct data collection anomalies
testing
Transform forecasting target to next/current ratio minus one so that optimizing MAE or squared error implicitly minimizes SMAPE
tools
Convert point forecasts to prediction intervals by scaling with logit-transformed quantile ratios passed through a Normal CDF