Build a nightly observatory observing plan from input.json (nightMinutes plus requests with target, priority 1-3, minutes). Writes observing-plan.csv and not-scheduled.json beside input.json. Use whenever the user mentions observing requests, telescope time slots, a night schedule, or input.json with nightMinutes and requests, even if they don't name this skill.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Telescope Slots?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/gabrielmoreira-telescope-slots-af63ff33)
---
name: telescope-slots
description: Build a nightly observatory observing plan from input.json (nightMinutes plus requests with target, priority 1-3, minutes). Writes observing-plan.csv and not-scheduled.json beside input.json. Use whenever the user mentions observing requests, telescope time slots, a night schedule, or input.json with nightMinutes and requests, even if they don't name this skill.
---
# telescope-slots
You cannot run code, so do this by hand, carefully. Read `input.json` (same folder as the outputs).
## Algorithm
1. Number the requests 1..N in the order listed in the file (submission order).
2. Make the processing order: sort by priority ascending (1 is most important), and within the same priority keep submission order.
3. Walk that order with a running `used = 0`. For each request:
- If `used + minutes <= nightMinutes`, schedule it: start = `used`, end = `used + minutes`, then `used = end`.
- Otherwise skip it (not scheduled) and **keep going**. A later, shorter request may still fit, even if it has lower priority. Do not stop at the first misfit and do not backtrack.
- A request that exactly fills the remaining time fits (`<=`).
4. Scheduled slots are back to back with no gaps, in processing order (priority, then submission). The first starts at 0.
## Outputs (same folder as input.json)
**observing-plan.csv**: header `target,start,end`, then one line per scheduled target in processing order. No quoting, no spaces after commas, no extra columns, trailing newline. Write target names exactly as given (names with spaces such as `NGC 7000` stay unquoted).
```
target,start,end
NGC 7000,0,90
M42,90,190
Vega,190,250
```
**not-scheduled.json**: JSON array of skipped target names, in **original submission order** (not priority order), 2-space indented, one name per line. If nothing was skipped write `[]`. If a name contains a comma or quote, still follow JSON string escaping rules.
```json
[
"Arcturus",
"Mizar",
"Spica"
]
```
If nothing is scheduled, the CSV contains only the header line.
## Check before finishing
- Every request appears in exactly one of the two files.
- Last `end` is <= nightMinutes; each slot's end - start equals its requested minutes.
- Re-add the minutes yourself to verify the arithmetic.
- Plan order follows priority; the skipped list follows submission order.
## Worked check (200 min night)
Capella p1 80, Arcturus p2 60, Mizar p3 70, Sirius p1 90, Spica p2 40, Polaris p3 30.
Order: Capella, Sirius, Arcturus, Spica, Mizar, Polaris. Capella 0-80, Sirius 80-170, Arcturus 230>200 skip, Spica 210>200 skip, Mizar 240>200 skip, Polaris 170-200 fits.
Plan: Capella, Sirius, Polaris. Not scheduled (submission order): Arcturus, Mizar, Spica.