skills/llm/few-shot-conversation-injection/SKILL.md
Inject fake (user, assistant) turn pairs before the real prompt to steer the LLM into a specific output format
npx skillsauth add wenmin-wu/ds-skills llm-few-shot-conversation-injectionInstall 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.
LLM APIs accept a list of chat messages. Most users only populate system + current user, but you can prepend fabricated prior turns — a pseudo conversation where the "assistant" already output the exact format you want. The live model, trained on turn coherence, continues the pattern. This is a much stronger format steer than any system-prompt instruction because the model sees itself "having already done it" N times.
def build_messages(system_prompt, target_model_name, user_prompt):
few_shot = [
{"role": "user", "content": "Evaluate this essay: 'The quick brown fox...'"},
{"role": "assistant", "content": f"I am {target_model_name}. Count: 9"},
{"role": "user", "content": "Evaluate this essay: 'In summer the sun...'"},
{"role": "assistant", "content": f"I am {target_model_name}. Count: 9"},
]
return [
{"role": "system", "content": system_prompt},
*few_shot,
{"role": "user", "content": user_prompt},
]
role=assistant turns unless they follow a user turn — always alternate.data-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