Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add BryceByeongchan/rubato-skills --skill "rubato-qe-plotbands"
Install specific skill from multi-skill repository
# Description
Plot band structure from Quantum Espresso bands.x XML output
# SKILL.md
name: rubato-qe-plotbands
user-invokable: true
description: Plot band structure from Quantum Espresso bands.x XML output
argument-hint: "
Plot band structure from a Quantum ESPRESSO bands.x XML output file.
Prerequisites
pip install numpy matplotlib
Usage
rubato:qe-plotbands <xml_file> [--labels "G M K G"] [--erange -4 4] [--out bands.png] [--title "Title"] [--spin 0]
Arguments
| Argument | Description | Default |
|---|---|---|
xml |
Path to QE bands XML file | required |
--labels |
High-sym k-point labels, space-separated | none |
--erange |
Energy window in eV | -4 4 |
--out |
Output PNG filename | <xml_stem>_bands.png |
--title |
Plot title | none |
--spin |
Spin channel: 0=up, 1=dn (spin-polarized only) | 0 |
Label shorthand
G or GAMMA β Ξ. All standard k-point symbols are supported as-is (M, K, A, L, H, X, β¦).
Execution
Run the bundled Python script:
python {skill_dir}/qe_plotbands.py <xml> [options]
Workflow
When the user asks to plot a band structure:
- Identify the XML file (look for
*.xmlin the current directory if not specified; prefer files inbands/or*/bands.save/) - Ask the user for k-path labels if not provided (e.g.,
"G M K G") - Run:
bash python {skill_dir}/qe_plotbands.py <xml> --labels "<labels>" [--erange <emin> <emax>] [--out <png>] [--title "<title>"] - Report the output PNG filename
Examples
# Basic β no labels
python {skill_dir}/qe_plotbands.py bands/pwscf.xml
# With k-path labels
python {skill_dir}/qe_plotbands.py bands/pwscf.xml --labels "G M K G A L H A"
# Custom energy window and output
python {skill_dir}/qe_plotbands.py bands/pwscf.xml --labels "G M K G" --erange -6 4 --out ws2_bands.png --title "2H-WS2"
# Spin-down channel
python {skill_dir}/qe_plotbands.py bands/pwscf.xml --labels "G M K G" --spin 1
Output
Saves a <name>_bands.png figure (200 dpi, 3.3Γ3.3 in) with:
- Bands aligned to Fermi energy (E β E_F)
- Vertical lines at high-sym k-points
- Dashed horizontal line at E = 0
Rules
- Always ask for k-path labels if not provided. The plot is much more useful with labeled high-symmetry points.
- Show the output PNG path after plotting so the user can open it.
- If the XML file is not found, search for
*.xmlin common locations (bands/,*/bands.save/,./out/). - For spin-polarized calculations, inform the user that
--spin 0(up) is default and--spin 1plots down channel. - If
calc_idcontext is available, look for the XML file incalc_db/{calc_id}/output/or similar paths.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.