Cosmic Code Lab
A learning objective → a self-contained, auto-checkable coding lab with a
space-science backdrop.
Purpose
Space data makes great programming practice (orbital math, image stats, light
travel time, catalog parsing). This skill produces a complete lab — a clear
problem, runnable starter code, a hidden test suite, and a reference solution —
so an educator or platform can drop it into a course without writing the
scaffolding by hand.
When it fires
- Keyword triggers:
code lab, coding challenge, exercise, kata,
tutorial, cosmic code
- File triggers:
labs/**, *.lab.md, test_*.py, *.test.js
- Command triggers:
/cosmic-code-lab
Inputs
| Input |
Required |
Notes |
objective |
yes |
The concept/skill to teach (e.g. "parse a star catalog"). |
language |
no |
python (default) or javascript. |
level |
no |
intro, intermediate (default), advanced. |
Workflow
- Frame the problem — a concrete, space-flavored task that isolates the
objective. State inputs, outputs, and constraints precisely. ✅ Check: a
competent student could implement it from the statement alone.
- Write starter code — minimal scaffold with a clearly marked TODO and a
stable function signature.
- Write hidden tests — a runnable suite (pytest / a tiny JS harness) covering
the happy path, an edge case, and an error case. Tests must pass on the
solution and fail on the empty starter.
- Write the reference solution — clean, idiomatic, commented at decision points.
- Add the science note — 2–3 lines on the real astronomy behind the problem,
factually correct.
- Self-verify — confirm the solution passes the tests and the starter does not.
Output contract
{
"title": "string",
"language": "python | javascript",
"problem_statement": "string",
"starter_code": "string",
"tests": "string — runnable test source",
"solution": "string",
"science_note": "string"
}
Tools & MCP
- Tools:
Write (lab files), Bash (run the tests to self-verify).
- MCP dependencies: none required.
Quality bar
Example
See examples/example-01.md.
Built on SIP — Starlight Intelligence Protocol
Substrate: starlightintelligence.org/protocol v1.1.0
Layers used: [file-contract, attestation, sovereignty]
Vertical: starlight-agent-skills · portable capability layer
1---2name: cosmic-code-lab3description: Generate a runnable, space-themed coding lab — a problem statement, starter code, hidden tests, and a worked solution — in Python or JavaScript. Use when creating coding exercises, a 'code lab', an interactive tutorial, or a space/astronomy programming challenge.4---56# Cosmic Code Lab78> A learning objective → a self-contained, auto-checkable coding lab with a9> space-science backdrop.1011## Purpose1213Space data makes great programming practice (orbital math, image stats, light14travel time, catalog parsing). This skill produces a complete lab — a clear15problem, runnable starter code, a hidden test suite, and a reference solution —16so an educator or platform can drop it into a course without writing the17scaffolding by hand.1819## When it fires2021- Keyword triggers: `code lab`, `coding challenge`, `exercise`, `kata`,22 `tutorial`, `cosmic code`23- File triggers: `labs/**`, `*.lab.md`, `test_*.py`, `*.test.js`24- Command triggers: `/cosmic-code-lab`2526## Inputs2728| Input | Required | Notes |29|-------|----------|-------|30| `objective` | yes | The concept/skill to teach (e.g. "parse a star catalog"). |31| `language` | no | `python` (default) or `javascript`. |32| `level` | no | `intro`, `intermediate` (default), `advanced`. |3334## Workflow35361. **Frame the problem** — a concrete, space-flavored task that isolates the37 `objective`. State inputs, outputs, and constraints precisely. ✅ Check: a38 competent student could implement it from the statement alone.392. **Write starter code** — minimal scaffold with a clearly marked TODO and a40 stable function signature.413. **Write hidden tests** — a runnable suite (pytest / a tiny JS harness) covering42 the happy path, an edge case, and an error case. Tests must pass on the43 solution and fail on the empty starter.444. **Write the reference solution** — clean, idiomatic, commented at decision points.455. **Add the science note** — 2–3 lines on the real astronomy behind the problem,46 factually correct.476. **Self-verify** — confirm the solution passes the tests and the starter does not.4849## Output contract5051```json52{53 "title": "string",54 "language": "python | javascript",55 "problem_statement": "string",56 "starter_code": "string",57 "tests": "string — runnable test source",58 "solution": "string",59 "science_note": "string"60}61```6263## Tools & MCP6465- Tools: `Write` (lab files), `Bash` (run the tests to self-verify).66- MCP dependencies: none required.6768## Quality bar6970- [ ] Solution passes the tests; empty starter fails them.71- [ ] Problem statement is implementable from text alone.72- [ ] Tests cover happy path + at least one edge + one error case.73- [ ] Science note is factually correct.7475## Example7677See [`examples/example-01.md`](examples/example-01.md).7879---8081Built on SIP — Starlight Intelligence Protocol82Substrate: starlightintelligence.org/protocol v1.1.083Layers used: [file-contract, attestation, sovereignty]84Vertical: starlight-agent-skills · portable capability layer