### Setup and Configuration Commands Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/fix-erlang-ssh-cve/environment/skills/senior-security/SKILL.md Install dependencies and configure environment. Use npm install for Node.js projects or pip install for Python projects, then copy the environment example file. ```bash # Install dependencies npm install # or pip install -r requirements.txt # Configure environment cp .env.example .env ``` -------------------------------- ### Setup and run calibration for absorb_and_evaluate example Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/examples/absorb_and_evaluate/README.md Run from the repository root after installing with `python -m pip install -e .`. Configure the model backend as described in the LLM configuration docs, or substitute your own command that reads a prompt from stdin and writes to stdout. The commands make real model calls; set the executor command separately if you want a different executor and revision model. Use a new output directory for each independent experiment. ```bash EXAMPLE="$PWD/examples/absorb_and_evaluate" PYTHON="$(command -v python)" LLM_COMMAND="\"$PYTHON\" -m skillrevise.llm.command" export SKILL_REVISE_EXAMPLE_EXECUTOR_COMMAND="$LLM_COMMAND" # Use a new output directory for each independent experiment. OUT="$PWD/runs/absorb-and-evaluate" python -m skillrevise.benchmarks.calibration \ --calibration "$EXAMPLE/calibration_tasks.json" \ --evaluation "$EXAMPLE/evaluation_tasks.json" ``` -------------------------------- ### Example usage with start-time Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/video-silence-remover/environment/skills/pause-detector/SKILL.md Example command that detects pauses starting from a specific time, with a comment showing the expected result. ```bash # Detect pauses after opening (start at 221s) python3 /root/.claude/skills/pause-detector/scripts/detect_pauses.py \ --energies energies.json \ --start-time 221 \ --output pauses.json # Result: Found 11 pauses totaling 28 seconds ``` -------------------------------- ### Quick Start Commands for Core Tools Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/powerlifting-coef-calc/environment/skills/senior-data-scientist/SKILL.md Three bash commands to run the core tools: experiment_designer.py, feature_engineering_pipeline.py, and model_evaluation_suite.py. Each command includes example arguments. ```bash # Core Tool 1 python scripts/experiment_designer.py --input data/ --output results/ # Core Tool 2 python scripts/feature_engineering_pipeline.py --target project/ --analyze # Core Tool 3 python scripts/model_evaluation_suite.py --config config.yaml --deploy ``` -------------------------------- ### Run lake build before first use Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/INSTALLATION.md Run this command in your Lean project before starting the LSP server to avoid client timeouts during initial setup. ```bash lake build ``` -------------------------------- ### Example: Generate compression report with sample paths Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/video-silence-remover/environment/skills/report-generator/SKILL.md Example invocation of the report generator script with sample file paths. Demonstrates the command with a comment and uses the same script as the usage example. ```bash # Generate compression report python3 /root/.claude/skills/report-generator/scripts/generate_report.py \ --original data/input_video.mp4 \ --compressed compressed_video.mp4 \ --segments all_segments.json \ --output compression_report.json ``` -------------------------------- ### GLM configuration file example (glm3.nml) Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/glm-lake-mendota/environment/skills/glm-basics/SKILL.md Example of a GLM namelist configuration file with sections for setup, light, mixing, meteorology, inflow, and outflow. This is the main configuration file that GLM reads. ```fortran &glm_setup sim_name = 'LakeName' max_layers = 500 / &light Kw = 0.3 / &mixing coef_mix_hyp = 0.5 / &meteorology meteo_fl = 'bcs/meteo.csv' wind_factor = 1 lw_factor = 1 ch = 0.0013 / &inflow inflow_fl = 'bcs/inflow1.csv','bcs/inflow2.csv' / &outflow outflow_fl = 'bcs/outflow.csv' / ``` -------------------------------- ### Quick Start: Quantum state evolution with QuTiP Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/quantum-numerical-simulation/environment/skills/qutip/SKILL.md A basic example showing how to create a quantum state (basis), define a Hamiltonian (sigmaz), perform time evolution with sesolve, and plot the expectation value of sigmaz over time. Requires numpy and matplotlib for numerical and plotting support. ```python from qutip import * import numpy as np import matplotlib.pyplot as plt # Create quantum state psi = basis(2, 0) # |0⟩ state # Create operator H = sigmaz() # Hamiltonian # Time evolution tlist = np.linspace(0, 10, 100) result = sesolve(H, psi, tlist, e_ops=[sigmaz()]) # Plot results plt.plot(tlist, result.expect[0]) plt.xlabel('Time') plt.ylabel('⟨σz⟩') plt.show() ``` -------------------------------- ### Install SeisBench with pip Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/earthquake-phase-association/environment/skills/seisbench-model-api/SKILL.md Install SeisBench using pip. This is the recommended installation method. ```bash pip install seisbench ``` -------------------------------- ### Install pymatgen with optional dependencies Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/crystallographic-wyckoff-position-analysis/environment/skills/pymatgen/SKILL.md Install pymatgen using uv. The first command installs the core package. The second adds Materials Project API access. The last two install optional analysis and visualization tools. ```bash # Core pymatgen uv pip install pymatgen # With Materials Project API access uv pip install pymatgen mp-api # Optional dependencies for extended functionality uv pip install pymatgen[analysis] # Additional analysis tools uv pip install pymatgen[vis] # Visualization tools ``` -------------------------------- ### Install dependencies with uv add, uv pip install, and uv sync Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/fix-build-agentops/environment/skills/uv-package-manager/SKILL.md Add packages to the project, install dev dependencies, install from a requirements.txt, or sync from pyproject.toml. The venv is created automatically if needed. ```bash # Install packages (creates venv if needed) uv add requests pandas # Install dev dependencies uv add --dev pytest black ruff # Install from requirements.txt uv pip install -r requirements.txt # Install from pyproject.toml uv sync ``` -------------------------------- ### Install Python versions with uv python install Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/fix-build-agentops/environment/skills/uv-package-manager/SKILL.md Shows how to install Python versions using uv python install, list installed versions, and find available versions. ```bash # Install Python version uv python install 3.12 # Install multiple versions uv python install 3.11 3.12 3.13 # Install latest version uv python install # List installed versions uv python list # Find available versions uv python list --all-versions ``` -------------------------------- ### Parallel Installation Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/fix-build-agentops/environment/skills/uv-package-manager/SKILL.md Shows how uv installs packages in parallel by default and how to control the number of parallel jobs using the --jobs flag. Setting --jobs 1 forces sequential installation. ```bash # UV installs packages in parallel by default # Control parallelism uv pip install --jobs 4 package1 package2 # No parallel (sequential) uv pip install --jobs 1 package ``` -------------------------------- ### Install pandas Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/travel-planning/environment/skills/search-flights/SKILL.md Install the pandas library, a prerequisite for using the search_flights skill. ```bash pip install pandas ``` -------------------------------- ### Install QuTiP with uv pip Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/quantum-numerical-simulation/environment/skills/qutip/SKILL.md Install the core QuTiP package using uv pip. This is the primary installation command for the library. ```bash uv pip install qutip ``` -------------------------------- ### Install SkillRevise and run tests Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/README.md Creates a virtual environment, installs the package with dev and benchmark extras, and runs the test suite. ```bash python -m venv .venv source .venv/bin/activate python -m pip install -U pip python -m pip install -e ".[dev,benchmarks]" pytest ``` -------------------------------- ### Example: Calculate energy from audio.wav Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/video-silence-remover/environment/skills/energy-calculator/SKILL.md Example command using relative paths for input and output files. ```bash # Calculate energy from extracted audio python3 /root/.claude/skills/energy-calculator/scripts/calc_energy.py \ --audio audio.wav \ --output energies.json ``` -------------------------------- ### Verify uv installation with uv --version Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/fix-build-agentops/environment/skills/uv-package-manager/SKILL.md Check that uv is installed correctly. The output shows the installed version, e.g., uv 0.x.x. ```bash uv --version # uv 0.x.x ``` -------------------------------- ### Install openai-whisper via pip Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/video-filler-word-remover/environment/skills/whisper-transcription/SKILL.md Install the OpenAI Whisper package using pip. This is the required setup step before using any transcription code. ```bash pip install openai-whisper ``` -------------------------------- ### Import Order Example Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/lean4-theorem-proving/references/mathlib-guide.md Demonstrates the recommended import order: Mathlib imports first, then project imports, and tactic imports when needed. ```lean -- 1. Mathlib imports first import Mathlib.Data.Real.Basic import Mathlib.Topology.Basic -- 2. Then your project imports import MyProject.Utils import MyProject.Lemmas -- 3. Tactic imports when needed import Mathlib.Tactic.Linarith import Mathlib.Tactic.Ring ``` -------------------------------- ### Starting a New Project Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/fix-build-agentops/environment/skills/uv-package-manager/SKILL.md Complete workflow for initializing a new project with uv, including setting Python version, adding dependencies, creating structure, running tests, and formatting code. ```bash # Complete workflow uv init my-project cd my-project # Set Python version uv python pin 3.12 # Add dependencies uv add fastapi uvicorn pydantic # Add dev dependencies uv add --dev pytest black ruff mypy # Create structure mkdir -p src/my_project tests # Run tests uv run pytest # Format code uv run black . uv run ruff check . ``` -------------------------------- ### Bond Valence Sum with BVAnalyzer Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/crystallographic-wyckoff-position-analysis/environment/skills/pymatgen/references/analysis_modules.md Calculate oxidation states and get a structure decorated with oxidation states using BVAnalyzer. The example shows how to get valences and the decorated structure. ```python from pymatgen.analysis.bond_valence import BVAnalyzer bva = BVAnalyzer() # Calculate oxidation states valences = bva.get_valences(struct) # Get structure with oxidation states struct_with_oxi = bva.get_oxi_state_decorated_structure(struct) ``` -------------------------------- ### Basic Usage Invocation Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/flink-query/environment/skills/senior-data-engineer/HOW_TO_USE.md Example prompt to start using the senior-data-engineer skill with a dataset. ```text Hey Claude—I just added the "senior-data-engineer" skill. Can you analyze this dataset? ``` -------------------------------- ### Install pubchempy Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/find-topk-similiar-chemicals/environment/skills/pubchem-database/SKILL.md Install the PubChemPy library for Python-based access to PubChem. ```bash uv pip install pubchempy ``` -------------------------------- ### Set up molecular dynamics simulation with VASP (Workflow 5) Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/crystallographic-wyckoff-position-analysis/environment/skills/pymatgen/references/transformations_workflows.md Creates a 2x2x2 supercell, sets up VASP input using MVLRelaxSet, and modifies INCAR for NVT MD with Nose-Hoover thermostat. Includes parameters for temperature, time step, and number of steps. ```python from pymatgen.core import Structure from pymatgen.io.vasp.sets import MVLRelaxSet from pymatgen.io.vasp.inputs import Incar # Read structure struct = Structure.from_file("POSCAR") # Create 2x2x2 supercell for MD from pymatgen.transformations.standard_transformations import SupercellTransformation trans = SupercellTransformation([[2,0,0],[0,2,0],[0,0,2]]) supercell = trans.apply_transformation(struct) # Set up VASP input md_input = MVLRelaxSet(supercell) # Modify INCAR for MD incar = md_input.incar incar.update({ "IBRION": 0, # Molecular dynamics "NSW": 1000, # Number of steps "POTIM": 2, # Time step (fs) "TEBEG": 300, # Initial temperature (K) "TEEND": 300, # Final temperature (K) "SMASS": 0, # NVT ensemble "MDALGO": 2, # Nose-Hoover thermostat }) md_input.incar = incar md_input.write_input("./md_calc") ``` -------------------------------- ### Example with opening and pause removal Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/video-silence-remover/environment/skills/video-processor/SKILL.md Example command to process a lecture video with opening and pause removal, showing the expected compression result. ```bash # Process video with opening and pause removal python3 /root/.claude/skills/video-processor/scripts/process_video.py \ --input /root/lecture.mp4 \ --output /root/compressed.mp4 \ --remove-segments /root/opening.json /root/pauses.json # Result: 65 min → 51 min (21.2% compression) ``` -------------------------------- ### Distributed supervisor, worker, and process group modules Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/fix-erlang-ssh-cve/environment/skills/erlang-distribution/SKILL.md Three Erlang modules for distributed supervision: a supervisor that starts workers on remote nodes, a worker that spawns on a specific node, and an example using the pg module for distributed process groups. The supervisor uses a one_for_one strategy with intensity 5 and period 60. The worker uses spawn_link to start on the given node. The pg example shows starting the pg application, joining a group, and broadcasting to all members. ```erlang -module(distributed_supervisor). -behaviour(supervisor). -export([start_link/0, start_worker/1]). -export([init/1]). start_link() -> supervisor:start_link({local, ?MODULE}, ?MODULE, []). start_worker(Node) -> ChildSpec = #{ id => make_ref(), start => {worker, start_link, [Node]}, restart => permanent, type => worker }, supervisor:start_child(?MODULE, ChildSpec). init([]) -> SupFlags = #{ strategy => one_for_one, intensity => 5, period => 60 }, {ok, {SupFlags, []}}. ``` ```erlang %% Worker module spawning on specific node -module(worker). -export([start_link/1, loop/0]). start_link(Node) -> Pid = spawn_link(Node, ?MODULE, loop, []), {ok, Pid}. loop() -> receive stop -> ok; Msg -> io:format("Worker on ~p: ~p~n", [node(), Msg]), loop() end. ``` ```erlang %% Distributed process groups -module(pg_example). -export([start/0, join/1, broadcast/1]). start() -> pg:start_link(). join(Group) -> pg:join(Group, self()). broadcast(Group, Message) -> Members = pg:get_members(Group), [Pid ! Message || Pid <- Members]. ``` -------------------------------- ### Goal-based query workflow Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/lean4-theorem-proving/references/lean-lsp-tools-api.md Example of getting the current goal with lean_goal and using it with lean_leanfinder, recommended for proofs. ```python # Get current goal: lean_goal(file_path="/path/to/file.lean", line=24) # Output: ⊢ |re z| ≤ ‖z‖ # Use goal with optional hint: lean_leanfinder(query="⊢ |re z| ≤ ‖z‖ + transform to squared norm") ``` -------------------------------- ### Install via plugin marketplace Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/INSTALLATION.md Commands to add the plugin repository and install the core skill plus optional plugins. The core plugin is required; optional plugins depend on it. ```bash /plugin marketplace add cameronfreer/lean4-skills /plugin install lean4-theorem-proving # Core skill + 6 slash commands (REQUIRED) /plugin install lean4-memories # Optional: persistent memory (requires lean4-theorem-proving) /plugin install lean4-subagents # Optional: specialized agents (requires lean4-theorem-proving) ``` -------------------------------- ### lean_local_search example Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/lean4-theorem-proving/references/lean-lsp-tools-api.md Example call and output for lean_local_search with query 'add_zero' and limit 5. ```text lean_local_search("add_zero", limit=5) → [{"name": "add_zero", "kind": "theorem", "file": "Init/Grind/Ring/Envelope.lean"}, {"name": "add_zero", "kind": "theorem", "file": "Init/Grind/Module/Envelope.lean"}] ``` -------------------------------- ### Quick start: GoogleDistanceMatrix usage Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/travel-planning/environment/skills/search-driving-distance/SKILL.md Instantiate GoogleDistanceMatrix and call run with origin, destination, and mode='driving' to get distance/duration. ```python from search_driving_distance import GoogleDistanceMatrix matrix = GoogleDistanceMatrix() print(matrix.run("Seattle", "Portland", mode="driving")) ``` -------------------------------- ### Topic Configuration Example Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/flink-query/environment/skills/senior-data-engineer/references/tools.md Example generated topic configuration with 12 partitions, replication factor 3, and 7-day retention. Includes cleanup policy delete and min.insync.replicas=2. ```properties # user-events topic configuration num.partitions=12 replication.factor=3 retention.ms=604800000 segment.bytes=1073741824 cleanup.policy=delete min.insync.replicas=2 compression.type=producer ``` -------------------------------- ### Numerical Evaluation When Needed Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/crystallographic-wyckoff-position-analysis/environment/skills/sympy/SKILL.md Use evalf() to get numerical approximations. The example shows default precision and 50 digits of precision. ```python from sympy import pi, sqrt result = sqrt(8) + pi result.evalf() # 5.96371554103586 result.evalf(50) # 50 digits of precision ``` -------------------------------- ### Real example from practice: manual vs fun_prop Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/lean4-theorem-proving/references/tactics-reference.md Compares manual proof using hf_meas.comp and measurable_pi_apply with automated proof using fun_prop (disch := measurability) when component lemmas have @[fun_prop]. ```lean -- Without @[fun_prop]: manual proof needed have h : Measurable (fun ω => f (ω (-1))) := by exact hf_meas.comp (measurable_pi_apply (-1)) -- With @[fun_prop] on component lemmas: automated have h : Measurable (fun ω => f (ω (-1))) := by fun_prop (disch := measurability) ``` -------------------------------- ### Check PySCIPOpt availability Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/bike-rebalance/environment/skills/scip-opt/SKILL.md Use this snippet to verify that PySCIPOpt is installed before starting an optimization task. It raises a RuntimeError if the import fails, indicating that PySCIPOpt is required. ```python try: from pyscipopt import Model, quicksum except ImportError as exc: raise RuntimeError("PySCIPOpt is required for this optimization approach") from exc ``` -------------------------------- ### Basic usage examples for etl_performance_optimizer.py Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/flink-query/environment/skills/senior-data-engineer/references/tools.md Shows three command-line invocations: analyzing an Airflow DAG, analyzing a Spark job with optimization, and profiling SQL queries with EXPLAIN ANALYZE. Each uses different flags and arguments. ```bash # Analyze Airflow DAG performance python scripts/etl_performance_optimizer.py \ --airflow-db postgresql://host/airflow \ --dag-id sales_etl_pipeline \ --days 30 ``` ```bash # Analyze Spark job python scripts/etl_performance_optimizer.py \ --spark-history-server http://spark-history:18080 \ --app-id app-20250115-001 \ --optimize ``` ```bash # Profile SQL queries python scripts/etl_performance_optimizer.py \ --db postgresql://host/db \ --queries queries/sales_etl.sql \ --explain-analyze ``` -------------------------------- ### Multiple initializations with best solution selection Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/energy-ac-optimal-power-flow/environment/skills/casadi-ipopt-nlp/SKILL.md Try multiple starting points and keep the best solution by objective value, catching exceptions and raising an error if all fail. ```python initializations = [x0_from_data, x0_flat_start] best_sol = None for x0 in initializations: try: sol = solver(x0=x0, lbx=lbx, ubx=ubx, lbg=lbg, ubg=ubg) if best_sol is None or float(sol["f"]) < float(best_sol["f"]): best_sol = sol except Exception: continue if best_sol is None: raise RuntimeError("Solver failed from all initializations") ``` -------------------------------- ### Get Specific Properties Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/find-topk-similiar-chemicals/environment/skills/pubchem-database/SKILL.md Requests only specific properties using get_properties, returning a list of dictionaries. The example requests MolecularFormula, MolecularWeight, CanonicalSMILES, and XLogP for aspirin. ```python # Request only specific properties properties = pcp.get_properties( ['MolecularFormula', 'MolecularWeight', 'CanonicalSMILES', 'XLogP'], 'aspirin', 'name' ) # Returns list of dictionaries ``` -------------------------------- ### Create a new uv project with uv init Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/fix-build-agentops/environment/skills/uv-package-manager/SKILL.md Initialize a new project with a virtual environment. Use 'uv init my-project' to create a named project or 'uv init .' for the current directory. This creates .python-version, pyproject.toml, README.md, and .gitignore. ```bash # Create new project with virtual environment uv init my-project cd my-project # Or create in current directory uv init . # Initialize creates: # - .python-version (Python version) # - pyproject.toml (project config) # - README.md # - .gitignore ``` -------------------------------- ### Example Workflow: Finding Continuous Compactness Lemmas Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/lean4-theorem-proving/references/mathlib-guide.md A step-by-step command-line workflow for finding lemmas about continuous functions preserving compact sets, including file search, reading, and verifying with #check. ```bash # Step 1: Identify keywords # Looking for: "continuous functions preserve compact sets" # Keywords: continuous, compact, preimage # Step 2: Find relevant files find .lake/packages/mathlib -name "*.lean" -exec grep -l "continuous.*compact\|compact.*continuous" {} \; | head -10 # Might return: Mathlib/Topology/Compactness.lean # Step 3: Use Read tool to examine file # Read: .lake/packages/mathlib/Mathlib/Topology/Compactness.lean # Step 4: Search for specific lemmas with line numbers grep -n "continuous.*isCompact\|isCompact.*continuous" .lake/packages/mathlib/Mathlib/Topology/Compactness.lean # Step 5: Import and use import Mathlib.Topology.Compactness #check Continuous.isCompact_preimage ``` -------------------------------- ### Determine coordination environment with CrystalNN Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/crystallographic-wyckoff-position-analysis/environment/skills/pymatgen/SKILL.md Use CrystalNN to get neighbor information for a site. The example prints the coordination number and each neighbor's species and distance. ```python from pymatgen.analysis.local_env import CrystalNN cnn = CrystalNN() neighbors = cnn.get_nn_info(struct, n=0) # Neighbors of site 0 print(f"Coordination number: {len(neighbors)}") for neighbor in neighbors: site = struct[neighbor['site_index']] print(f" {site.species_string} at {neighbor['weight']:.3f} Å") ``` -------------------------------- ### Create Molecule from scratch and from file Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/crystallographic-wyckoff-position-analysis/environment/skills/pymatgen/references/core_classes.md Shows how to instantiate a Molecule from coordinates and species, and load from .xyz or .mol files using Molecule.from_file(). ```python from pymatgen.core import Molecule # From scratch coords = [[0.00, 0.00, 0.00], [0.00, 0.00, 1.08]] mol = Molecule(["C", "O"], coords) # From file mol = Molecule.from_file("molecule.xyz") mol = Molecule.from_file("molecule.mol") ``` -------------------------------- ### Example class implementation in TypeScript Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/fix-erlang-ssh-cve/environment/skills/senior-security/references/penetration_testing_guide.md Shows a basic TypeScript class structure for a best practice implementation. Use as a starting point for defining classes with implementation details. ```typescript // Example code implementation export class Example { // Implementation details } ``` -------------------------------- ### Using uv with existing projects Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/fix-build-agentops/environment/skills/uv-package-manager/SKILL.md Commands to migrate from requirements.txt or poetry, and to export the environment to requirements.txt with optional hashes. ```bash # Migrate from requirements.txt uv add -r requirements.txt # Migrate from poetry # Already have pyproject.toml, just use: uv sync # Export to requirements.txt uv pip freeze > requirements.txt # Export with hashes uv pip freeze --require-hashes > requirements.txt ``` -------------------------------- ### Pattern: Script vs Slash Command Decision - Use script directly Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/lean4-theorem-proving/references/subagent-workflows.md Example of a subagent dispatch instruction for using a script directly to get raw output. ```text "Dispatch Explore agent to: Run scripts/sorry_analyzer.py . --format=text and report total sorry count" ``` -------------------------------- ### lean_hover_info - Example Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/lean4-theorem-proving/references/lean-lsp-tools-api.md Example call to lean_hover_info with file, line, and column parameters. Returns definition, type, and diagnostics at that location. ```lean lean_hover_info(file, line=20, column=30) → Shows definition, type, diagnostics at that location ``` -------------------------------- ### Coordination Geometry with ChemEnv Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/crystallographic-wyckoff-position-analysis/environment/skills/pymatgen/references/analysis_modules.md Identify coordination environments using LocalGeometryFinder and SimplestChemenvStrategy. The example shows how to compute structure environments and get the coordination environment for a specific site. ```python from pymatgen.analysis.chemenv.coordination_environments.coordination_geometry_finder import LocalGeometryFinder from pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies import SimplestChemenvStrategy lgf = LocalGeometryFinder() lgf.setup_structure(struct) # Get coordination environment for site se = lgf.compute_structure_environments(only_indices=[0]) strategy = SimplestChemenvStrategy() lse = strategy.get_site_coordination_environment(se[0]) print(f"Coordination: {lse}") ``` -------------------------------- ### Manual installation via git clone Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/INSTALLATION.md Commands to clone the repository and copy plugin directories to ~/.claude/skills/. The core plugin is required; optional plugins depend on it. ```bash git clone https://github.com/cameronfreer/lean4-skills.git cd lean4-skills # Install core skill + commands (REQUIRED - foundation for other plugins) cp -r plugins/lean4-theorem-proving ~/.claude/skills/ # Install memory skill (optional, requires lean4-theorem-proving + MCP memory server) cp -r plugins/lean4-memories ~/.claude/skills/ # Install specialized agents (optional, requires lean4-theorem-proving) cp -r plugins/lean4-subagents ~/.claude/skills/ ``` -------------------------------- ### Ewald Summation for Electrostatic Energy Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/crystallographic-wyckoff-position-analysis/environment/skills/pymatgen/references/analysis_modules.md Calculate electrostatic energy of ionic structures using EwaldSummation. The example shows how to get total energy in eV and forces on each site. ```python from pymatgen.analysis.ewald import EwaldSummation ewald = EwaldSummation(struct) total_energy = ewald.total_energy # In eV forces = ewald.forces # Forces on each site ``` -------------------------------- ### Choose startup tier based on prior offline duration Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/energy-unit-commitment/environment/skills/unit-commitment-data-modeling/SKILL.md Selects the appropriate startup tier by sorting tiers by lag and picking the last tier whose lag is less than or equal to the prior offline duration. Assumes tiers are keyed by lag and does not assume order. Keep prior offline duration consistent with initial status and transition timing. ```python def choose_startup_tier(tiers, prior_offline_duration): tiers = sorted(tiers, key=lambda x: x["lag"]) chosen = tiers[0] for tier in tiers: if tier["lag"] <= prior_offline_duration: chosen = tier else: break return chosen ``` -------------------------------- ### Continued fractions: continued_fraction_iterator Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/crystallographic-wyckoff-position-analysis/environment/skills/sympy/references/advanced-topics.md Generate continued fraction expansions for rational and irrational numbers using SymPy. The example shows the continued fraction for 415/93 and starts an approximation for pi. ```python from sympy import nsimplify, continued_fraction_iterator from sympy import Rational, pi # Convert to continued fraction cf = continued_fraction_iterator(Rational(415, 93)) list(cf) # [4, 2, 6, 7] # Approximate irrational numbers cf_pi = continued_fraction_iterator(pi.evalf(20)) ``` -------------------------------- ### Partial Application in Python (functools.partial) Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/python-scala-translation/environment/skills/python-scala-functional/SKILL.md Uses functools.partial to fix the first argument of a function. The example creates add_5 from add, then calls add_5(3, 2) to get 10. ```python # Python from functools import partial def add(a, b, c): return a + b + c add_5 = partial(add, 5) result = add_5(3, 2) # 10 ``` -------------------------------- ### Complete Example: Multi-Slide Presentation Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/exceltable-in-ppt/environment/skills/pptx/html2pptx.md A complete example that creates a presentation with two slides, adds a chart with custom options, and saves the file. ```javascript const pptxgen = require('pptxgenjs'); const html2pptx = require('./html2pptx'); async function createPresentation() { const pptx = new pptxgen(); pptx.layout = 'LAYOUT_16x9'; pptx.author = 'Your Name'; pptx.title = 'My Presentation'; // Slide 1: Title const { slide: slide1 } = await html2pptx('slides/title.html', pptx); // Slide 2: Content with chart const { slide: slide2, placeholders } = await html2pptx('slides/data.html', pptx); const chartData = [{ name: 'Sales', labels: ['Q1', 'Q2', 'Q3', 'Q4'], values: [4500, 5500, 6200, 7100] }]; slide2.addChart(pptx.charts.BAR, chartData, { ...placeholders[0], showTitle: true, title: 'Quarterly Sales', showCatAxisTitle: true, catAxisTitle: 'Quarter', showValAxisTitle: true, valAxisTitle: 'Sales ($000s)' }); // Save await pptx.writeFile({ fileName: 'presentation.pptx' }); console.log('Presentation created successfully!'); } createPresentation().catch(console.error); ``` -------------------------------- ### Pattern: Script vs Slash Command Decision - Use slash command Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/lean4-theorem-proving/references/subagent-workflows.md Example of a subagent dispatch instruction for using a slash command to get a richer workflow with interpretation. ```text "Dispatch Explore agent to: Use /analyze-sorries to get categorized sorry breakdown and report which category has the most sorries" ``` -------------------------------- ### Install SkillRevise with development and benchmark extras Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/docs/running.md Creates a virtual environment, activates it, upgrades pip, and installs the package with development and benchmark extras. The benchmarks extra adds PyYAML for the SWE-Skills-Bench export helper. ```bash python -m venv .venv source .venv/bin/activate python -m pip install -U pip python -m pip install -e ".[dev,benchmarks]" ``` -------------------------------- ### Retrieve Project Conventions Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/lean4-memories/references/memory-patterns.md Query for ProjectConvention entities in the measure_theory domain to get conventions for starting a new theorem. Expected result includes a pattern for instance declaration and frequency. ```python # Query for measure theory conventions results = memory.search_entities( query="measure theory proof structure", entity_type="ProjectConvention", filters={ "project": os.getcwd(), "skill": "lean4-memories", "domain": "measure_theory" } ) # Expected result: # ProjectConvention: measure_theory_instance_declaration # - Pattern: haveI : MeasurableSpace Ω := inferInstance # - Frequency: 15 occurrences # Suggested action: # "Based on project conventions, start with:" # haveI : MeasurableSpace Ω := inferInstance ``` -------------------------------- ### Using simp effectively with simp? and simp only Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/lean4-theorem-proving/references/tactics-reference.md Shows the exploration phase using simp? to see which lemmas are used, then converting to an explicit simp only proof. ```lean -- 1. Exploration phase: Use simp? to see what happens example : x + 0 + y * 1 = x + y := by simp? -- Output: Try this: simp only [add_zero, mul_one] -- 2. Production: Convert to explicit example : x + 0 + y * 1 = x + y := by simp only [add_zero, mul_one] ``` -------------------------------- ### Retrieve structures by material ID Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/crystallographic-wyckoff-position-analysis/environment/skills/pymatgen/references/materials_project_api.md Use MPRester to fetch a single structure or multiple structures by their material IDs. The example shows getting 'mp-149' and a list of three IDs. ```python with MPRester() as mpr: # Get structure structure = mpr.get_structure_by_material_id("mp-149") # Get multiple structures structures = mpr.get_structures(["mp-149", "mp-510", "mp-19017"]) ``` -------------------------------- ### Quick Reference Workflow Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/lean4-theorem-proving/references/mathlib-guide.md A numbered list of steps for efficiently finding and using mathlib lemmas, from understanding the mathematical need to proving it yourself if not found. ```text 1. Understand what you need mathematically 2. Identify keywords and type signature 3. Search using multiple strategies: - File organization (ls, find) - Keyword search (grep) - Naming conventions (grep with patterns) 4. Use Read tool to examine candidate files 5. Verify with #check 6. Import and use 7. If not found, search alternative phrasings 8. If still not found, prove it yourself (and consider contributing!) ``` -------------------------------- ### Quick Start: Basic Similarity with SequenceMatcher Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/invoice-fraud-detection/environment/skills/fuzzy-match/SKILL.md A minimal example showing how to compute string similarity using difflib.SequenceMatcher. The output is a ratio between 0 and 1, with 1 indicating identical strings. ```python from difflib import SequenceMatcher def similarity(a, b): return SequenceMatcher(None, a, b).ratio() print(similarity("Apple Inc.", "Apple Incorporated")) # Output: 0.7... ``` -------------------------------- ### Structure Matching with StructureMatcher Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/crystallographic-wyckoff-position-analysis/environment/skills/pymatgen/references/analysis_modules.md Use StructureMatcher to check if structures match, get mapping between structures, and group similar structures. The example shows the basic usage of fit, get_mapping, and group_structures methods. ```python from pymatgen.analysis.structure_matcher import StructureMatcher matcher = StructureMatcher() # Check if structures match is_match = matcher.fit(struct1, struct2) # Get mapping between structures mapping = matcher.get_mapping(struct1, struct2) # Group similar structures grouped = matcher.group_structures([struct1, struct2, struct3, ...]) ``` -------------------------------- ### Install Lean 4 Skills via Marketplace Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/README.md Commands to add the marketplace and install the core and optional plugins. The core plugin is required; the others are optional. ```bash # Via Marketplace (Recommended) /plugin marketplace add cameronfreer/lean4-skills /plugin install lean4-theorem-proving # Core (required) /plugin install lean4-subagents # Optional: specialized agents /plugin install lean4-memories # Optional: persistent memory ``` -------------------------------- ### Basic Setup Pattern for WorkflowEnvironment with Time-Skipping Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/fix-build-agentops/environment/skills/temporal-python-testing/resources/unit-testing.md Reusable pytest fixture that starts a time-skipping WorkflowEnvironment. Use this to test workflows with instant time progression. The fixture yields the environment and shuts it down after the test. ```python import pytest from temporalio.testing import WorkflowEnvironment from temporalio.worker import Worker @pytest.fixture async def workflow_env(): """Reusable time-skipping test environment""" env = await WorkflowEnvironment.start_time_skipping() yield env await env.shutdown() @pytest.mark.asyncio async def test_workflow_execution(workflow_env): """Test workflow with time-skipping""" async with Worker( workflow_env.client, task_queue="test-queue", workflows=[YourWorkflow], activities=[your_activity], ): result = await workflow_env.client.execute_workflow( YourWorkflow.run, "test-input", id="test-wf-id", task_queue="test-queue", ) assert result == "expected-output" ``` -------------------------------- ### uv vs poetry Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/fix-build-agentops/environment/skills/uv-package-manager/SKILL.md Compares the commands for initializing a project and adding dependencies with poetry versus uv, highlighting uv's speed advantage (6-7x faster). ```bash # poetry poetry init poetry add requests pandas poetry install # ~20 seconds # uv uv init uv add requests pandas uv sync # ~3 seconds (6-7x faster) ``` -------------------------------- ### Force ambient instance with @ notation Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/lean4-theorem-proving/references/instance-pollution.md Use @ notation to explicitly specify the ambient MeasurableSpace instance when defining sub-σ-algebras. This is a fallback when you cannot pin the instance at the start. The example shows type annotations and @ for complex cases. ```lean theorem test (Ω β : Type*) [inst : MeasurableSpace Ω] [MeasurableSpace β] (Z : Ω → β) (hZ : Measurable Z) (B : Set β) (hB : MeasurableSet B) : ... := by let mSub : MeasurableSpace Ω := MeasurableSpace.comap Z inferInstance -- ✅ Force ambient instance with @ notation have hBpre : @MeasurableSet Ω inst (Z ⁻¹' B) := hB.preimage hZ -- Type annotation on result is enough! -- For more complex cases, may need @ everywhere: have complex : @MeasurableSet Ω inst someset := @MeasurableSet.inter Ω inst s1 s2 hs1 hs2 ``` -------------------------------- ### Sign-safe encoding example with add_row Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/energy-unit-commitment/environment/skills/milp-solver-workflow/SKILL.md Write the intended inequality first, then move variable terms to the left-hand side. This example encodes x + y <= cap * u - reduction * start as a row with lower bound -INF and upper bound 0.0. Test with a tiny hand case, e.g., u=1, start=1 to verify startup capability, and u=1, start=0 to verify normal capacity. ```python # Intended: x + y <= cap * u - reduction * start # Row form: x + y - cap*u + reduction*start <= 0 add_row( [(x, 1.0), (y, 1.0), (u, -cap), (start, reduction)], lo=-INF, hi=0.0, ) ``` -------------------------------- ### File naming examples Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/lean4-proof/environment/skills/lean4-theorem-proving/references/mathlib-style.md Use UpperCamelCase.lean for all files. Good: Core.lean, DeFinetti.lean, ConditionallyIID.lean, ViaKoopman.lean. Bad: core.lean, de_finetti.lean. Exception: rare cases like lp.lean. ```lean -- ✅ GOOD Core.lean DeFinetti.lean ConditionallyIID.lean ViaKoopman.lean -- ❌ BAD core.lean de_finetti.lean ``` -------------------------------- ### Example workflow using jax-skills Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/jax-computing-basics/environment/skills/jax-skills/SKILL.md Complete workflow demonstrating loading an array, squaring elements, reducing along an axis, computing a logistic gradient, running an RNN scan, and saving the result. ```python import jax.numpy as jnp import jax_skills as jx # Load array arr = jx.load("data.npy") # Square elements arr2 = jx.map_op(arr, "square") # Reduce along axis mean_arr = jx.reduce_op(arr2, "mean", axis=0) # Compute logistic gradient grad_w = jx.logistic_grad(X_train, y_train, w_init) # RNN scan hseq = jx.rnn_scan(sequence, Wx, Wh, b) # Save result jx.save(hseq, "hseq.npy") ``` -------------------------------- ### Correct: better-all runs config and profile in parallel Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/fix-visual-stability/environment/skills/react-best-practices/rules/async-dependencies.md This example shows the correct pattern using `better-all`'s `all` function. It starts `fetchConfig` and `fetchProfile` in parallel, with `fetchProfile` waiting only for `user`. This maximizes parallelism and improves performance. ```typescript import { all } from 'better-all' const { user, config, profile } = await all({ async user() { return fetchUser() }, async config() { return fetchConfig() }, async profile() { return fetchProfile((await this.$.user).id) } }) ``` -------------------------------- ### Manual Time Control Example Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/fix-build-agentops/environment/skills/temporal-python-testing/resources/unit-testing.md Demonstrates manually advancing time with workflow_env.sleep() to control workflow execution. Starts a workflow, advances time by 1 hour, queries intermediate state, then advances 23 more hours to completion. ```python @pytest.mark.asyncio async def test_workflow_manual_time(workflow_env): """Manually advance time for precise control""" handle = await workflow_env.client.start_workflow( TimeBasedWorkflow.run, id="time-wf", task_queue="test", ) # Advance time by specific amount await workflow_env.sleep(timedelta(hours=1)) # Verify intermediate state via query state = await handle.query(TimeBasedWorkflow.get_state) assert state == "processing" # Advance to completion await workflow_env.sleep(timedelta(hours=23)) result = await handle.result() assert result == "completed" ``` -------------------------------- ### Reaction Computation with ComputedReaction Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/crystallographic-wyckoff-position-analysis/environment/skills/pymatgen/references/analysis_modules.md Computes a balanced reaction equation and reaction energy from reactant and product ComputedEntry objects. The example shows how to get the normalized representation and calculated reaction energy in eV per formula unit. ```python from pymatgen.analysis.reaction_calculator import ComputedReaction reactants = [ComputedEntry("Fe", -8.4), ComputedEntry("O2", -4.9)] products = [ComputedEntry("Fe2O3", -8.3)] rxn = ComputedReaction(reactants, products) # Get balanced equation balanced_rxn = rxn.normalized_repr # e.g., "2 Fe + 1.5 O2 -> Fe2O3" # Get reaction energy energy = rxn.calculated_reaction_energy # eV per formula unit ``` -------------------------------- ### Install uv and create a Python 3.11 environment Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/simpo-code-reproduction/environment/skills/nlp-research-repo-package-installment/SKILL.md Commands to install uv, create a Python 3.11.8 virtual environment, and upgrade pip/setuptools/wheel. Use when the repo expects a different Python version than the current one. ```bash # Install uv apt-get update apt-get install -y --no-install-recommends curl ca-certificates rm -rf /var/lib/apt/lists/* curl -LsSf https://astral.sh/uv/0.9.7/install.sh | sh export PATH="/root/.local/bin:$PATH" # Install Python + create a venv uv python install 3.11.8 uv venv --python 3.11.8 /opt/py311 # Use the new Python for installs/runs /opt/py311/bin/python -VV /opt/py311/bin/python -m pip install -U pip setuptools wheel ``` -------------------------------- ### Coordination Environment with LocalEnv Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/crystallographic-wyckoff-position-analysis/environment/skills/pymatgen/references/analysis_modules.md Use various neighbor algorithms (VoronoiNN, CrystalNN, MinimumDistanceNN, BrunnerNN_real) to find coordination environments. The example shows how to get neighbor info for a site and analyze all sites to compute coordination numbers. ```python from pymatgen.analysis.local_env import ( VoronoiNN, # Voronoi tessellation CrystalNN, # Crystal-based MinimumDistanceNN, # Distance cutoff BrunnerNN_real, # Brunner method ) # Voronoi nearest neighbors voronoi = VoronoiNN() neighbors = voronoi.get_nn_info(struct, n=0) # Neighbors of site 0 # CrystalNN (recommended for most cases) crystalnn = CrystalNN() neighbors = crystalnn.get_nn_info(struct, n=0) # Analyze all sites for i, site in enumerate(struct): neighbors = voronoi.get_nn_info(struct, i) coordination_number = len(neighbors) print(f"Site {i} ({site.species_string}): CN = {coordination_number}") ``` -------------------------------- ### Load SkillsBench bundle with skillrevise CLI Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/docs/benchmarks.md Loads the SkillsBench bundle from the repository root. The command must emit a valid harness trace and a validated receipt from the Harbor reward-file verifier, unless a separate authoritative --verifier-command is supplied. This is a bundle-loading example only; its bare template/heuristic generation defaults are intended for development or custom runs and are not paper evidence. ```bash skillrevise data/skillsbench/skillsbench_tasks.json \ --manifest-kind skillsbench \ --workspace-root . \ --harness-command "path/to/paper-compatible-harness" \ --executor-id "" ``` ```bash skillrevise data/skilllearnbench/skillsbench_tasks.json \ --manifest-kind skillsbench \ --workspace-root . \ --harness-command "path/to/paper-compatible-harness" \ --executor-id "" \ --max-heldout 0 ``` ```bash skillrevise data/swe-skills-bench/skillsbench_tasks.json \ --manifest-kind skillsbench \ --workspace-root . \ --harness-command "path/to/paper-compatible-harness" \ --executor-id "" ``` -------------------------------- ### Incorrect: Sequential awaits in API route Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/fix-visual-stability/environment/skills/react-best-practices/rules/async-api-routes.md This example shows a waterfall chain where each operation waits for the previous one: auth, then config, then data. This is inefficient because config and data could start earlier. Avoid this pattern in API routes and Server Actions. ```typescript export async function GET(request: Request) { const session = await auth() const config = await fetchConfig() const data = await fetchData(session.user.id) return Response.json({ data, config }) } ``` -------------------------------- ### Example workflow: load, generate, validate, save Source: https://github.com/hkust-knowcomp/skillrevise/blob/main/data/skillsbench/tasks/virtualhome-agent-planning/environment/skills/pddl-skills/SKILL.md Complete pipeline that loads a problem, generates a plan, validates it, and saves it. Raises ValueError if the generated plan is invalid. ```python # Load problem = load_problem("domain.pddl", "task01.pddl") # Generate plan plan = generate_plan(problem) # Validate plan if not validate(problem, plan): raise ValueError("Generated plan is invalid") # Save plan save_plan(plan, "task01.plan") ```