Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Systematic prompt engineering methods for AI-assisted academic research workf...
.claude/skills/brycewang-stanford-prompt-engineering-research/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 27% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 109% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 206% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 33% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 0% | 0% |
A skill for applying systematic prompt engineering techniques in academic research contexts. Covers prompt design patterns, evaluation methodologies, and practical workflows for using large language models (LLMs) as research tools.
| Strategy | Description | Best For | Reliability | |----------|------------|---------|-------------| | Zero-shot | Direct instruction, no examples | Simple, well-defined tasks | Moderate | | Few-shot | Include 2-5 examples in prompt | Pattern matching, formatting | High | | Chain-of-thought | "Think step by step" | Reasoning, math, analysis | High | | Role prompting | "You are an expert in..." | Domain-specific tasks | Moderate | | Structured output | Request JSON/YAML/table format | Data extraction | High | | Self-consistency | Sample multiple times, majority vote | Fact-checking, reasoning | Very high |
pythondef create_research_prompt(task_type: str, context: dict) -> str: """ Generate a structured prompt for common research tasks. Args: task_type: One of 'literature_summary', 'methodology_critique', 'code_review', 'data_interpretation', 'writing_feedback' context: Dict with task-specific context """ templates = { 'literature_summary': """ You are an academic researcher specializing in {domain}. Summarize the following paper excerpt, focusing on: 1. The research question and its significance 2. The methodology used 3. Key findings and their implications 4. Limitations acknowledged by the authors 5. How this work relates to {related_topic} Paper excerpt: {text} Provide a structured summary in 200-300 words. Distinguish clearly between what the authors claim and what the evidence supports. """, 'methodology_critique': """ You are a methods expert reviewing a research design. Evaluate the following methodology description: {text} Assess the following: 1. Internal validity: Are there confounding variables not controlled? 2. External validity: How generalizable are the findings? 3. Statistical approach: Is the analysis appropriate for the data? 4. Sample: Is the sample size adequate? Any selection bias? 5. Reproducibility: Could another researcher replicate this? For each concern, rate severity (minor/moderate/major) and suggest a specific improvement. """, 'data_interpretation': """ You are a statistical consultant helping interpret results. Given these results: {results} Context: {context_description} Provide: 1. Plain-language interpretation of each result 2. Effect size interpretation (is it practically significant?) 3. Potential alternative explanations 4. Caveats the authors should mention 5. Suggested follow-up analyses Be precise about what the data does and does not support. Do not overstate findings. """ } template = templates.get(task_type, templates['literature_summary']) return template.format(**context)
pythondef research_cot_prompt(question: str, data: str) -> str: """ Create a chain-of-thought prompt for complex research analysis. """ return f""" I need to analyze the following research question step by step. Research Question: {question} Available Data: {data} Please reason through this systematically: Step 1: Identify the key variables and their relationships Step 2: Consider what statistical test or analytical approach is appropriate Step 3: Check assumptions required for this approach Step 4: Perform the analysis or describe how to perform it Step 5: Interpret the results in context Step 6: State limitations and alternative interpretations Show your reasoning at each step before moving to the next. If you are uncertain about any step, explicitly state the uncertainty rather than guessing. """
pythondef evaluate_prompt(prompt_template: str, test_cases: list[dict], expected_outputs: list[str], model_fn: callable) -> dict: """ Systematically evaluate a prompt template's reliability. Args: prompt_template: The prompt template with {placeholders} test_cases: List of dicts with placeholder values expected_outputs: Expected outputs for each test case model_fn: Function that takes a prompt string and returns model output """ results = [] for case, expected in zip(test_cases, expected_outputs): prompt = prompt_template.format(**case) # Run multiple times for consistency check outputs = [model_fn(prompt) for _ in range(3)] # Measure consistency (self-agreement) from difflib import SequenceMatcher similarities = [] for i in range(len(outputs)): for j in range(i+1, len(outputs)): sim = SequenceMatcher(None, outputs[i], outputs[j]).ratio() similarities.append(sim) avg_similarity = sum(similarities) / len(similarities) if similarities else 0 results.append({ 'test_case': case, 'n_runs': 3, 'consistency': round(avg_similarity, 3), 'outputs': outputs }) return { 'n_test_cases': len(test_cases), 'avg_consistency': round( sum(r['consistency'] for r in results) / len(results), 3 ), 'results': results, 'reliability': ( 'high' if all(r['consistency'] > 0.8 for r in results) else 'moderate' if all(r['consistency'] > 0.5 for r in results) else 'low -- prompt needs refinement' ) }
pythondef screen_paper_relevance(title: str, abstract: str, inclusion_criteria: list[str], exclusion_criteria: list[str]) -> str: """ Generate a prompt for AI-assisted paper screening in systematic reviews. """ return f""" You are screening papers for a systematic review. Paper: Title: {title} Abstract: {abstract} Inclusion criteria: {chr(10).join(f'- {c}' for c in inclusion_criteria)} Exclusion criteria: {chr(10).join(f'- {c}' for c in exclusion_criteria)} Evaluate the paper against each criterion and respond with: 1. INCLUDE, EXCLUDE, or UNCERTAIN 2. Which specific criteria were met or not met 3. Confidence level (high/medium/low) Important: When uncertain, err on the side of INCLUDE (to be screened at full-text stage). False exclusions are worse than false inclusions in systematic review screening. """
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-02 | fail→fail | 11,490 | 24,315 | +112% | 1 | 1 | 0% | 1,826 | 6,089 | +233% | 0 | 0 | — |
case-01 | fail→pass | 17,219 | 13,409 | -22% | 1 | 1 | 0% | 3,420 | 4,343 | +27% | 0 | 0 | — |
case-03 | fail→fail | 23,168 | 14,544 | -37% | 1 | 1 | 0% | 4,689 | 4,905 | +5% | 0 | 0 | — |
case-04 | fail→fail | 16,000 | 14,104 | -12% | 1 | 1 | 0% | 2,799 | 4,163 | +49% | 0 | 0 | — |
case-05 | fail→pass | 12,902 | 17,993 | +39% | 1 | 1 | 0% | 2,043 | 4,272 | +109% | 0 | 0 | — |
case-06 | fail→fail | 17,035 | 19,055 | +12% | 1 | 1 | 0% | 2,708 | 4,490 | +66% | 0 | 0 | — |
case-07 | fail→pass | 32,232 | 18,222 | -43% | 1 | 1 | 0% | 1,550 | 4,744 | +206% | 0 | 0 | — |
case-08 | pass→pass | 15,509 | 15,852 | +2% | 1 | 1 | 0% | 2,443 | 4,297 | +76% | 0 | 0 | — |
case-09 | pass→pass | 17,233 | 16,607 | -4% | 1 | 1 | 0% | 2,892 | 4,558 | +58% | 0 | 0 | — |
case-10 | pass→pass | 16,189 | 20,430 | +26% | 1 | 1 | 0% | 2,493 | 5,083 | +104% | 0 | 0 | — |
case-11 | pass→pass | 17,267 | 11,501 | -33% | 1 | 1 | 0% | 2,660 | 3,635 | +37% | 0 | 0 | — |
case-12 | fail→pass | 12,174 | 6,787 | -44% | 1 | 1 | 0% | 2,153 | 2,861 | +33% | 0 | 0 | — |
case-13 | fail→pass | 14,827 | 2,701 | -82% | 1 | 1 | 0% | 2,200 | 2,192 | -0% | 0 | 0 | — |
case-14 | pass→pass | 12,524 | 11,969 | -4% | 1 | 1 | 0% | 2,393 | 3,991 | +67% | 0 | 0 | — |
case-15 | pass→pass | 14,355 | 13,799 | -4% | 1 | 1 | 0% | 2,403 | 4,097 | +70% | 0 | 0 | — |
case-16 | fail→pass | 14,916 | 10,947 | -27% | 1 | 1 | 0% | 2,413 | 3,450 | +43% | 0 | 0 | — |
case-17 | fail→fail | 12,759 | 11,461 | -10% | 1 | 1 | 0% | 2,104 | 3,658 | +74% | 0 | 0 | — |
case-18 | fail→pass | 9,645 | 2,565 | -73% | 1 | 1 | 0% | 1,376 | 2,284 | +66% | 0 | 0 | — |
case-19 | pass→pass | 18,194 | 12,545 | -31% | 1 | 1 | 0% | 2,547 | 3,991 | +57% | 0 | 0 | — |
case-20 | fail→fail | 13,903 | 10,736 | -23% | 1 | 1 | 0% | 2,164 | 3,452 | +60% | 0 | 0 | — |
case-21 | pass→pass | 11,938 | 2,274 | -81% | 1 | 1 | 0% | 1,856 | 2,161 | +16% | 0 | 0 | — |
case-22 | pass→pass | 9,337 | 9,638 | +3% | 1 | 1 | 0% | 1,757 | 3,241 | +84% | 0 | 0 | — |
case-23 | pass→pass | 5,630 | 7,642 | +36% | 1 | 1 | 0% | 1,106 | 3,286 | +197% | 0 | 0 | — |
case-24 | pass→pass | 14,369 | 15,485 | +8% | 1 | 1 | 0% | 2,197 | 4,145 | +89% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted, and 23 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +29 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.