Skip to content
Back to skills

Telescope Slots

ASecurity

Use this skill when a user wants to build a night's observing schedule from telescope time requests: fit prioritised requests (priority 1-3, minutes wanted) into the dark period (nightMinutes) and produce observing-plan.csv plus a list of requests that did not fit (not-scheduled.json). Not for general calendar or meeting scheduling.

  • 24 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 6, 2026
toolsgo

Works with

  • cursor

Security analysis

A100/100

Scanned December 6, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill telescope-slots --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Telescope Slots?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Telescope Slots
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-telescope-slots-60ba7809/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-telescope-slots-60ba7809)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: telescope-slots
description: "Use this skill when a user wants to build a night's observing schedule from telescope time requests: fit prioritised requests (priority 1-3, minutes wanted) into the dark period (nightMinutes) and produce observing-plan.csv plus a list of requests that did not fit (not-scheduled.json). Not for general calendar or meeting scheduling."
---

# Telescope slots

Turn `input.json` (night length + prioritised requests) into a back-to-back observing plan and a list of dropped targets. Work by reading and writing files only; no commands are needed.

## Inputs
`input.json` in the working folder:
- `nightMinutes`: integer, length of the dark period.
- `requests`: array of `{target, priority, minutes}` in submission order. Priority is 1 (highest), 2 or 3. Target names are unique.

If `input.json` is missing or unparseable, say so and stop; do not invent data.

## Algorithm
1. Number requests `i = 0..n-1` in the order listed in the file (submission order).
2. Sort by priority ascending (1, then 2, then 3); ties keep submission order (stable). Do NOT sort by minutes or name.
3. Set `cursor = 0`. Go through the sorted list once, in order:
   - If `cursor + minutes <= nightMinutes`: schedule it with `start = cursor`, `end = cursor + minutes`, then `cursor = end`.
   - Otherwise: skip it (not scheduled) and keep going. A later, shorter request may still fit. A request ending exactly at `nightMinutes` fits.
4. Scheduled rows are in sorted (priority, then submission) order, with no gaps: each start equals the previous end.
5. The not-scheduled list contains skipped targets in **submission order** (original file order), not priority order.

Edge cases:
- `minutes` of 0 fits whenever `cursor <= nightMinutes`; it yields `start == end`.
- `nightMinutes <= 0` or negative: nothing fits except zero-minute requests when `nightMinutes == 0`; negative means all are skipped.
- A request with `minutes` greater than `nightMinutes` is simply skipped.
- Empty `requests`: CSV is header only, JSON is `[]`.
- Unexpected priority values: treat by numeric value (lower first) and mention it in your reply.

## Outputs (beside input.json)
`observing-plan.csv`: header line exactly `target,start,end`, then one row per scheduled target, integers without decimals, `\n` line endings, trailing newline. If a target name contains a comma or double quote, wrap it in double quotes and double any inner quotes.

`not-scheduled.json`: a JSON array of target-name strings, 2-space indent, e.g. `[]` when empty.

## Worked example
nightMinutes 200; requests in order: Capella p1 80, Arcturus p2 60, Mizar p3 70, Sirius p1 90, Spica p2 40, Polaris p3 30.

Sorted: Capella, Sirius, Arcturus, Spica, Mizar, Polaris.
- Capella 0-80, Sirius 80-170; Arcturus 170+60=230 > 200 skip; Spica 210 > 200 skip; Mizar 240 skip; Polaris 170-200 fits.

```csv
target,start,end
Capella,0,80
Sirius,80,170
Polaris,170,200
```
not-scheduled.json (submission order): `["Arcturus","Mizar","Spica"]` written one name per line.

## Check before finishing
- Every target appears exactly once, in the CSV or in the JSON.
- Last `end` is <= `nightMinutes`; starts/ends are contiguous.
- Re-read both written files.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.