skills/llm/inverse-task-prompt-template/SKILL.md
Structured prompt template for recovering the instruction that transformed one text into another, with labeled original/rewritten fields and explicit task framing
npx skillsauth add wenmin-wu/ds-skills llm-inverse-task-prompt-templateInstall 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.
To recover an unknown prompt from an (original, rewritten) text pair, frame the task explicitly: show the LLM both texts with clear labels, state that one was derived from the other via a prompt, and ask it to infer that prompt. The template structure — labeled fields, task description, output format constraint — is critical for consistent results across different LLMs.
TEMPLATE = """Below, the `Original Text` has been rewritten into `Rewritten Text`
by an LLM with a certain prompt/instruction. Analyze the differences
and infer the specific prompt that was used.
Original Text:
{original_text}
Rewritten Text:
{rewritten_text}
The prompt was:"""
def build_recovery_prompt(original, rewritten):
return TEMPLATE.format(
original_text=original[:1000],
rewritten_text=rewritten[:1000])
prompt = build_recovery_prompt(row['original_text'], row['rewritten_text'])
output = model.generate(tokenizer(prompt, return_tensors='pt').to(device),
max_new_tokens=50, do_sample=False)
recovered = tokenizer.decode(output[0], skip_special_tokens=True)
recovered = recovered.split("The prompt was:")[-1].strip()
Original Text:, Rewritten Text:)The prompt was:) to constrain output formatThe prompt was: forces concise output without preambledata-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