Skip to content

Guide · Agent skill

How to use the ETE Toolkit 4 tree analysis agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The etetoolkit skill teaches an AI agent to work with existing phylogenetic and other hierarchical trees using the ETE 4 Python library. It is for biologists, students and developers who already have a tree file and want help reading, cleaning, comparing, annotating or plotting it. After this guide you will know what the skill does, how to install it, how to phrase requests so the agent uses it, and what it needs and cannot do.

ETE Toolkit 4 Tree AnalysisK-Dense-AI/scientific-agent-skills · MIT

Quick start

  1. 1Check Python and install ETE 4. Confirm Python 3.10 or newer is available. Then run the pinned uv install for ete4.
  2. 2Install the skill folder. Unzip the downloaded ZIP so the etetoolkit folder with SKILL.md sits in ~/.claude/skills/ or a project's .claude/skills/, or upload it under Settings → Capabilities → Skills.
  3. 3Prepare your tree file. Gather a Newick or Nexus file. Know whether internal nodes carry names or support values so the parser choice is correct.
  4. 4Ask for one tree task. Describe the goal in plain language, such as pruning, rooting, comparing or plotting, and name the file.
  5. 5Review the output. Check the leaf names, branch lengths and any event or distance results against your own knowledge before using them.

What the etetoolkit skill lets the agent do

An agent skill is a folder of instructions and reference files that an AI agent loads when a task matches it. This one covers ETE 4 tree work: reading Newick and Nexus files, inspecting and editing topology, pruning and rooting, writing trees back out, and comparing two trees.

It also covers gene-tree analysis with duplication and speciation events, looking up NCBI or GTDB taxonomy, exploring large trees in SmartView, and rendering publication figures.

  • Read, edit, root, prune and write Newick trees
  • Compare topologies with Robinson-Foulds distances
  • Detect duplication and speciation events in gene trees
  • Query local NCBI or GTDB taxonomy databases
  • Open interactive views or export PNG, PDF or SVG figures

What the skill does not do

The skill does not build trees from raw sequences. It does not perform alignment or tree inference. For raw DNA or protein data, first run an aligner such as MAFFT, then an inference tool such as IQ-TREE 2 or FastTree, and load the resulting tree into the skill.

Install the etetoolkit skill

Download the skill ZIP from the page where you found this guide and unzip it. Place the etetoolkit folder, the one containing SKILL.md, in either your personal skills directory at ~/.claude/skills/ or a project's .claude/skills/ folder.

If you use the Claude apps instead, upload the skill under Settings → Capabilities → Skills.

  • Personal install: ~/.claude/skills/
  • Project install: .claude/skills/ inside your project
  • Claude apps: Settings → Capabilities → Skills

Install the ETE 4 Python package

The skill needs Python 3.10 or newer and the pinned ete4 package. Install the base package first. Add the visualization extras only if your work needs them: render-sm for SmartView PNG screenshots, and treeview for the Qt renderer that produces PNG, PDF and SVG.

Static PNG rendering also needs Chrome or Chromium.

  • Base package: ete4 pinned to 4.4.0
  • Optional render-sm extra for SmartView PNG screenshots
  • Optional treeview extra for Qt PNG, PDF and SVG rendering
uv pip install "ete4==4.4.0"

How to trigger the skill with natural requests

You do not need special syntax. Describe the tree task in plain language and name your file or format, such as Newick or Nexus. Mention the goal too, such as cleaning, comparing or plotting, so the agent knows which part of the skill applies.

Examples of requests that match the skill's scope:

  • Prune my Newick tree to these five species and keep the branch lengths between tips.
  • Compare these two trees with Robinson-Foulds distance and tell me which leaves are shared.
  • Find duplication and speciation events in this gene tree, using species names before the pipe character.
  • Look up the NCBI taxonomy for these organism names and draw the topology.
  • Make a PNG of this tree with support values, and open an interactive view if I want to explore it.

Compare two trees with Robinson-Foulds distance

The Robinson-Foulds comparison uses shared leaf labels, so the names must be meaningful and preferably unique. If the maximum is zero, the normalized distance is undefined rather than a sign of agreement. Decide whether a rooted or unrooted comparison suits your question.

from ete4 import Tree tree_a = Tree("((A,B),(C,D));") tree_b = Tree("((A,C),(B,D));") rf, max_rf, common_leaves, edges_a, edges_b, discarded_a, discarded_b = tree_a.robinson_foulds(tree_b) normalized_rf = rf / max_rf if max_rf > 0 else None print(rf, max_rf, normalized_rf, sorted(common_leaves))

Safety notes: scripts, network and disk space

The skill runs scripts and uses the network. Public NCBI and GTDB taxonomy workflows download data, which can take several gigabytes of disk space, so read the taxonomy reference before your first update. No credentials are required.

The skill includes scripts/tree_operations.py and scripts/quick_visualize.py. Read a script before letting the agent run it on files you care about, and do not assume the taxonomy guard has been run against your own database snapshot.

  • Network access is needed for taxonomy downloads
  • Several GB of free disk space may be needed for NCBI or GTDB data
  • Species-overlap calls are inferences from your tree and naming function, not proof of orthology
  • Do not use outputs as clinical or legal conclusions about ancestry or orthology

What people use it for

  • Pruning a large species tree down to the taxa in a study and keeping pairwise branch lengths
  • Comparing two inferred trees from different methods with Robinson-Foulds distance
  • Annotating tips with host or group labels and exporting a Newick file with those properties
  • Scanning a gene tree for duplication and speciation events using species names in the leaf labels
  • Making a PNG or vector figure of a tree for a manuscript

Frequently asked questions

Is the etetoolkit skill free and what licence does it use?

The listing gives the licence as MIT, but the SKILL.md frontmatter says GPL-3.0-or-later. These conflict, so check the repository's licence file before reusing or redistributing the skill. The source material does not state any price.

What do I need to run the etetoolkit skill?

You need Python 3.10 or newer and the ete4 package pinned to 4.4.0. Static PNG rendering needs the render-sm extra and Chrome or Chromium, and PDF or SVG rendering needs the treeview extra. NCBI and GTDB taxonomy need internet access and several gigabytes of disk space.

Can the etetoolkit skill build a phylogenetic tree from DNA or protein sequences?

No. The skill works on existing trees and does not perform alignment or tree inference. Use an aligner such as MAFFT, then an inference tool such as IQ-TREE 2 or FastTree, and load the resulting tree into ETE.

What are alternatives to the etetoolkit skill for tree work?

For alignment and inference, the source names MAFFT, IQ-TREE 2 and FastTree. For tree manipulation, you could use ETE 4 directly in Python without the skill, which the skill's reference files document. The source does not compare other tree libraries.

Why does my Newick file fail to load with a NewickError?

A parser mismatch is the most common cause of NewickError, lost internal labels, or support values being read as names. Choose the parser deliberately, using the parser setting that matches whether your internal nodes carry names or support values. The API reference explains the options.

Can I port old ETE 3 code with this skill?

Yes, the skill includes a migration reference for moving ETE 3 code to ETE 4. Key changes include importing from ete4 instead of ete3, using parser= instead of format=, and using tree["name"] instead of tree & "name". Test the ported code, since the API is a breaking revision.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you already have phylogenetic tree files and need help cleaning, comparing, annotating or plotting them with ETE 4, or porting ETE 3 code. Pick another route if you need to build trees from raw sequences, since you will need separate alignment and inference tools for that.

Download the skill