skills/prompt-engineering-patterns/SKILL.md
Generate optimized LLM prompts using chain-of-thought, ReAct, and other scientific reasoning patterns
npx skillsauth add lamm-mit/scienceclaw prompt-engineering-patternsInstall 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.
Advanced LLM prompt optimization patterns for scientific reasoning: chain-of-thought, tree-of-thought, few-shot learning, ReAct, and self-consistency. Generates optimized prompts tailored to scientific investigation tasks and specific domains (biology, chemistry, materials, etc.).
Use this tool to construct better prompts before querying an LLM, ensuring rigorous scientific reasoning, hypothesis generation, and evidence-based conclusions.
# Generate a chain-of-thought prompt for a biology task
python3 skills/prompt-engineering-patterns/scripts/prompt_optimize.py \
--task "Identify potential drug targets for Alzheimer's disease" \
--pattern chain-of-thought \
--domain biology
# Generate a ReAct prompt for tool-using agents
python3 skills/prompt-engineering-patterns/scripts/prompt_optimize.py \
--task "Predict BBB permeability of novel kinase inhibitors" \
--pattern react \
--domain chemistry
# Generate a tree-of-thought prompt
python3 skills/prompt-engineering-patterns/scripts/prompt_optimize.py \
--task "Evaluate CRISPR delivery mechanisms" \
--pattern tree-of-thought
# Generate few-shot prompt for a specific scientific task
python3 skills/prompt-engineering-patterns/scripts/prompt_optimize.py \
--task "Classify protein-protein interactions from sequence features" \
--pattern few-shot \
--domain biology
{
"pattern": "chain-of-thought",
"task": "Identify potential drug targets for Alzheimer's disease",
"optimized_prompt": "You are an expert computational biologist...\n\nTask: Identify potential drug targets for Alzheimer's disease\n\nLet's think through this step by step:\n1. First, consider the molecular mechanisms...",
"explanation": "Chain-of-thought prompting elicits step-by-step reasoning, improving accuracy on complex scientific tasks by up to 40% compared to direct answering."
}
tools
Onboard and manage Paperclip AI for research-paper knowledge and agent orchestration
development
Perform AI-powered web searches with real-time information using Perplexity models via LiteLLM and OpenRouter. This skill should be used when conducting web searches for current information, finding recent scientific literature, getting grounded answers with source citations, or accessing information beyond the model knowledge cutoff. Provides access to multiple Perplexity models including Sonar Pro, Sonar Pro Search (advanced agentic search), and Sonar Reasoning Pro through a single OpenRouter API key.
testing
Generate a structured scientific PDF report from a JSON description. Accepts a JSON file specifying title, authors, abstract, sections (headings, text, tables, figures), and inline data panels (heatmap, bar, scatter, line). Produces a publication-style A4 PDF using reportlab with no LaTeX dependency. All figures are either loaded from PNG paths or generated on-the-fly from inline data.
development
Execute arbitrary Python code and return stdout. NumPy, pandas, scipy, matplotlib, and other scientific libraries are available.