Agent skill

Transit Least Squares

by benchflow-ai in benchflow-ai/skillsbench

Transit Least Squares (TLS) algorithm for detecting exoplanet transits in light curves.

Apache-2.0Auto-check passed

Install Transit Least Squares

skills CLI
$ npx skills add benchflow-ai/skillsbench --skill transit-least-squares -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install benchflow-ai/skillsbench transit-least-squares --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/benchflow-ai/skillsbench.git skills-src && mkdir -p .claude/skills && cp -r skills-src/tasks/exoplanet-detection-period/environment/skills/transit-least-squares .claude/skills/transit-least-squares && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
transit-least-squares
GitHub stars
1.8k
Token cost
~2k tokens
SKILL.md length
583 words
Files
1
Skills in repo
189
Repo updated
First seen
Licence
Apache-2.0

At a glance

Transit Least Squares (TLS) algorithm for detecting exoplanet transits in light curves.

  • Works in 3 steps: Initial search finds candidate at ~3.2… → Refine by searching narrower range… → Narrower range → finer grid → better…
  • Searching for transiting exoplanets specifically
  • SKILL.md covers Overview, Installation, Basic Usage and Period Refinement Strategy, plus 10 more sections
  • Calls pip

What it does

Transit Least Squares is an agent skill from benchflow-ai/skillsbench. Transit Least Squares (TLS) algorithm for detecting exoplanet transits in light curves. Use when searching for transiting exoplanets specifically, as TLS is more sensitive than Lomb-Scargle for transit-shaped signals. Based on the transitleastsquares Python package.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with Python. The repository describes itself as: SkillsBench evaluates how well skills work and how effective agents are at using them. The licence is Apache-2.0.

When your agent uses it

  • Searching for transiting exoplanets specifically
  • As TLS is more sensitive than Lomb-Scargle for transit-shaped signals

Example prompts

  • “/transit-least-squares”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Initial search finds candidate at ~3.2 days
  2. Refine by searching narrower range (e.g., 3.0-3.4 days)
  3. Narrower range → finer grid → better precision

What it can do on your machine

Read from SKILL.md and the folder at commit 9a1f4dd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • lightkurve.github.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Transit Least Squares loads about 2k tokens when it runs. Until then it costs about 72 tokens; SKILL.md has 583 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~72
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from benchflow-ai/skillsbench at commit 9a1f4dd, republished under its Apache-2.0 licence (© benchflow-ai). 583 words, ~1,971 tokens.

Download SKILL.mdSave it as .claude/skills/transit-least-squares/SKILL.md (or your agent's skills folder).
name
transit-least-squares
description
Transit Least Squares (TLS) algorithm for detecting exoplanet transits in light curves. Use when searching for transiting exoplanets specifically, as TLS is more sensitive than Lomb-Scargle for transit-shaped signals. Based on the transitleastsquares Python package.

Transit Least Squares (TLS)

Transit Least Squares is a specialized algorithm optimized for detecting exoplanet transits in light curves. It's more sensitive than Lomb-Scargle for transit-shaped signals because it fits actual transit models.

Overview

TLS searches for periodic transit-like dips in brightness by fitting transit models at different periods, durations, and epochs. It's the preferred method for exoplanet transit detection.

Installation

bash
pip install transitleastsquares

Basic Usage

CRITICAL: Always include flux_err (flux uncertainties) for best results!

python
import transitleastsquares as tls
import lightkurve as lk
import numpy as np

# Example 1: Using Lightkurve (recommended)
lc = lk.LightCurve(time=time, flux=flux, flux_err=error)
lc_clean = lc.remove_outliers(sigma=3)
lc_flat = lc_clean.flatten()

# Create TLS object - MUST include flux_err!
pg_tls = tls.transitleastsquares(
    lc_flat.time.value,      # Time array
    lc_flat.flux.value,      # Flux array
    lc_flat.flux_err.value   # Flux uncertainties (REQUIRED!)
)

# Search for transits (uses default period range if not specified)
out_tls = pg_tls.power(
    show_progress_bar=False,  # Set True for progress tracking
    verbose=False
)

# Extract results
best_period = out_tls.period
period_uncertainty = out_tls.period_uncertainty
t0 = out_tls.T0                    # Transit epoch
depth = out_tls.depth               # Transit depth
snr = out_tls.snr                   # Signal-to-noise ratio
sde = out_tls.SDE                   # Signal Detection Efficiency

print(f"Best period: {best_period:.5f} ± {period_uncertainty:.5f} days")
print(f"Transit epoch (T0): {t0:.5f}")
print(f"Depth: {depth:.5f}")
print(f"SNR: {snr:.2f}")
print(f"SDE: {sde:.2f}")
Example 2: With explicit period range
python
# Search specific period range
out_tls = pg_tls.power(
    period_min=2.0,      # Minimum period (days)
    period_max=7.0,      # Maximum period (days)
    show_progress_bar=True,
    verbose=True
)

Period Refinement Strategy

Best Practice: Broad search first, then refine for precision.

Example workflow:

  1. Initial search finds candidate at ~3.2 days
  2. Refine by searching narrower range (e.g., 3.0-3.4 days)
  3. Narrower range → finer grid → better precision

Why? Initial searches use coarse grids (fast). Refinement uses dense grid in small range (precise).

python
# After initial search finds a candidate, narrow the search:
results_refined = pg_tls.power(
    period_min=X,  # e.g., 90% of candidate
    period_max=Y   # e.g., 110% of candidate
)

Typical refinement window: ±2% to ±10% around candidate period.

Advanced Options

For very precise measurements, you can adjust:

  • oversampling_factor: Finer period grid (default: 1, higher = slower but more precise)
  • duration_grid_step: Transit duration sampling (default: 1.1)
  • T0_fit_margin: Mid-transit time fitting margin (default: 5)
Advanced Parameters
  • oversampling_factor: Higher values give finer period resolution (slower)
  • duration_grid_step: Step size for transit duration grid (1.01 = 1% steps)
  • T0_fit_margin: Margin for fitting transit epoch (0 = no margin, faster)

Phase-Folding

Once you have a period, TLS automatically computes phase-folded data:

python
# Phase-folded data is automatically computed
folded_phase = out_tls.folded_phase      # Phase (0-1)
folded_y = out_tls.folded_y              # Flux values
model_phase = out_tls.model_folded_phase # Model phase
model_flux = out_tls.model_folded_model # Model flux

# Plot phase-folded light curve
import matplotlib.pyplot as plt
plt.plot(folded_phase, folded_y, '.', label='Data')
plt.plot(model_phase, model_flux, '-', label='Model')
plt.xlabel('Phase')
plt.ylabel('Flux')
plt.legend()
plt.show()

Transit Masking

After finding a transit, mask it to search for additional planets:

python
from transitleastsquares import transit_mask

# Create transit mask
mask = transit_mask(time, period, duration, t0)
lc_masked = lc[~mask]  # Remove transit points

# Search for second planet
pg_tls2 = tls.transitleastsquares(
    lc_masked.time,
    lc_masked.flux,
    lc_masked.flux_err
)
out_tls2 = pg_tls2.power(period_min=2, period_max=7)

Interpreting Results

Signal Detection Efficiency (SDE)

SDE is TLS's measure of signal strength:

  • SDE > 6: Strong candidate
  • SDE > 9: Very strong candidate
  • SDE < 6: Weak signal, may be false positive
Signal-to-Noise Ratio (SNR)
  • SNR > 7: Generally considered reliable
  • SNR < 7: May need additional validation
Common Warnings

TLS may warn: "X of Y transits without data. The true period may be twice the given period."

This suggests:

  • Data gaps may cause period aliasing
  • Check if period * 2 also shows a signal
  • The true period might be longer

Model Light Curve

TLS provides the best-fit transit model:

python
# Model over full time range
model_time = out_tls.model_lightcurve_time
model_flux = out_tls.model_lightcurve_model

# Plot with data
import matplotlib.pyplot as plt
plt.plot(time, flux, '.', label='Data')
plt.plot(model_time, model_flux, '-', label='Model')
plt.xlabel('Time [days]')
plt.ylabel('Flux')
plt.legend()
plt.show()
Show full SKILL.md (261 more words)Show less

Workflow Considerations

When designing a transit detection pipeline, consider:

  1. Data quality: Filter by quality flags before analysis
  2. Preprocessing order: Remove outliers → flatten/detrend → search for transits
  3. Initial search: Use broad period range to find candidates
  4. Refinement: Narrow search around candidates for better precision
  5. Validation: Check SDE, SNR, and visual inspection of phase-folded data
Typical Parameter Ranges
  • Outlier removal: sigma=3-5 (lower = more aggressive)
  • Period search: Match expected orbital periods for your target
  • Refinement window: ±2-10% around candidate period
  • SDE threshold: >6 for candidates, >9 for strong detections

Multiple Planet Search Strategy

  1. Initial broad search: Use TLS with default or wide period range
  2. Identify candidate: Find period with highest SDE
  3. Refine period: Narrow search around candidate period (±5%)
  4. Mask transits: Remove data points during transits
  5. Search for additional planets: Repeat TLS on masked data

Dependencies

bash
pip install transitleastsquares lightkurve numpy matplotlib

References

When to Use TLS vs. Lomb-Scargle

  • Use TLS: When specifically searching for exoplanet transits
  • Use Lomb-Scargle: For general periodic signals (rotation, pulsation, eclipsing binaries)

TLS is optimized for transit-shaped signals and is typically more sensitive for exoplanet detection.

Common Issues

"flux_err is required"

Always pass flux uncertainties to TLS! Without them, TLS cannot properly weight data points.

Period is 2x or 0.5x expected

Check for period aliasing - the true period might be double or half of what TLS reports. Also check the SDE for both periods.

Low SDE (<6)
  • Signal may be too weak
  • Try different preprocessing (less aggressive flattening)
  • Check if there's a data gap during transits

© benchflow-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in tasks/exoplanet-detection-period/environment/skills/transit-least-squares of benchflow-ai/skillsbench.

Open the folder on GitHubat commit 9a1f4dd

Compare with similar skills

Transit Least Squares next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Transit Least Squares compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Transit Least Squares this skillbenchflow-ai/skillsbench1.8k—~2kAutomated safety check: PassApache-2.0
MCP Server Builderanthropics/skills180k63 repos~2.3kAutomated safety check: PassApache-2.0
PDF Processinganthropics/skills180k47 repos~2kAutomated safety check: PassProprietary
NotebookLM Research AssistantPleasePrompto/notebooklm-skill7.8k14 repos~2.4kAutomated safety check: NotesMIT
Manim Video Productionbrowser-use/video-use29k6 repos~3kAutomated safety check: PassMIT
PPT Masterhugohe3/ppt-master59k1 repos~2.5kAutomated safety check: PassMIT

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 63 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • PDF Processing

    anthropics/skills

    Official

    Handles everyday PDF jobs in Python and on the command line: extract text and tables, merge, split, rotate, watermark, fill forms, encrypt and OCR.

    180k GitHub starsUsed in 47 repos~2k tokens
    Documents & OfficeAuto-check passed
  • NotebookLM Research Assistant

    PleasePrompto/notebooklm-skill

    Lets Claude Code ask questions of your Google NotebookLM notebooks through browser automation and return answers grounded in your uploaded sources.

    7.8k GitHub starsUsed in 14 repos~2.4k tokens
    Knowledge ManagementAuto-check: notes
  • Manim Video Production

    browser-use/video-use

    Produces math and technical explainer videos with Manim Community Edition: concept animations, equation derivations, algorithm walkthroughs and data stories.

    29k GitHub starsUsed in 6 repos~3k tokens
    Media & CreativeAuto-check passed
  • PPT Master

    hugohe3/ppt-master

    Generates editable PowerPoint decks, rebuilds slides from images, fills .pptx templates and polishes existing presentations through routed workflows.

    59k GitHub starsUsed in 1 repo~2.5k tokens
    Documents & OfficeAuto-check passed
  • Scikit Learn

    zLanqing/codex-claude-academic-skills

    Machine learning in Python with scikit-learn. An agent skill from zLanqing/codex-claude-academic-skills.

    4.7k GitHub starsUsed in 16 repos~3.9k tokens
    Data & AnalyticsAuto-check passed

More from benchflow-ai/skillsbench

All 189 skills in this repo
  • Lean4 Memories

    benchflow-ai/skillsbench

    This skill should be used when working on Lean 4 formalization projects to maintain persistent memory of successful proof patterns, failed approaches, project conventions, and user preferences…

    1.8k GitHub stars~3.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Senior Data Engineer

    benchflow-ai/skillsbench

    World-class data engineering skill for building scalable data pipelines, ETL/ELT systems, real-time streaming, and data infrastructure.

    1.8k GitHub stars~5.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Ac Branch Pi Model

    benchflow-ai/skillsbench

    AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching acopf-math-model.md and MATPOWER branch fields.

    1.8k GitHub stars~1.1k tokensUpdated 2 mo ago
    Auto-check passed
  • Civ6lib

    benchflow-ai/skillsbench

    Civilization 6 district mechanics library. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed
  • D3 Visualization

    benchflow-ai/skillsbench

    Build deterministic, verifiable data visualizations with D3.js (v6).

    1.8k GitHub stars~1.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Dc Power Flow

    benchflow-ai/skillsbench

    DC power flow analysis for power systems. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~717 tokensUpdated 2 mo ago
    Auto-check passed

Works with

Questions about Transit Least Squares

What does Transit Least Squares do?

Transit Least Squares (TLS) algorithm for detecting exoplanet transits in light curves. Transit Least Squares is an agent skill from benchflow-ai/skillsbench. Transit Least Squares (TLS) algorithm for detecting exoplanet transits in light curves.

When should I use Transit Least Squares?

Transit Least Squares fits situations like: searching for transiting exoplanets specifically; as TLS is more sensitive than Lomb-Scargle for transit-shaped signals.

How do I install Transit Least Squares in Claude Code?

Run `npx skills add benchflow-ai/skillsbench --skill transit-least-squares -a claude-code`. Or copy the skill folder (tasks/exoplanet-detection-period/environment/skills/transit-least-squares in benchflow-ai/skillsbench) into .claude/skills/transit-least-squares in your project. Claude Code loads it when a task matches its description.

How do I install Transit Least Squares in Codex?

Run `npx skills add benchflow-ai/skillsbench --skill transit-least-squares -a codex`. Or copy the skill folder (tasks/exoplanet-detection-period/environment/skills/transit-least-squares in benchflow-ai/skillsbench) into .agents/skills/transit-least-squares in your project. Codex loads it when a task matches its description.

Can I use Transit Least Squares in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add benchflow-ai/skillsbench --skill transit-least-squares -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/transit-least-squares, .gemini/skills/transit-least-squares, .github/skills/transit-least-squares and .opencode/skills/transit-least-squares in your project.

What does Transit Least Squares need to run?

Going by SKILL.md and its folder, Transit Least Squares needs the command-line tools its instructions call (pip). Our summary lists: Python 3.

Does Transit Least Squares access the network?

SKILL.md names 2 domains. As links in the text: github.com and lightkurve.github.io. This is read from the text; nothing was executed.

Is Transit Least Squares safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Transit Least Squares use?

Transit Least Squares is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Transit Least Squares use?

About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Transit Least Squares?

Skills that share tags, products or a category with Transit Least Squares: MCP Server Builder (anthropics/skills, 180k stars), PDF Processing (anthropics/skills, 180k stars), NotebookLM Research Assistant (PleasePrompto/notebooklm-skill, 7.8k stars) and Manim Video Production (browser-use/video-use, 29k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Transit Least Squares?

benchflow-ai (a GitHub organization) maintains it in benchflow-ai/skillsbench, which has 1,835 GitHub stars. The repository holds 189 skills in this directory. The repository was last updated on July 23, 2026.

Source: benchflow-ai/skillsbench on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.