AvailableWrite & ThemeThe Song Planner

Hymn Library Loop

Research a hymn and store its public-domain lyrics + reusable research in the library — once, for every project.

Who it's for

Anyone building hymn-based song projects who wants the lyrics, history, and meaning researched a single time and reused across every genre version.

A hymn becomes many songs — a hip-hop version, a country version, an ethereal one. This loop makes sure the work that's the SAME for all of them — the original lyrics and the research (history, meaning, themes, the modern doorway, suggested genres and voices) — is done once and stored in a shared library, so every project pulls from one source instead of redoing it.

It runs once per hymn and writes to the hymn reference store (separate from the songs themselves). The store keeps a clean split: research can be written in one pass and the lyrics added in another, and neither clobbers the other.

One hard rule it enforces: only **public-domain** hymns get their original lyrics stored. The ingest tool refuses any lyric text unless the record is explicitly flagged public-domain — so copyrighted hymns get research only, never their words.

Skills & actions it uses

The concrete, reusable skills this loop calls to actually do the work.

  • scripts/ingest-hymns.mjsThe ingest tool — reads a hymn record (number, title, research, and PD-only lyrics) and MERGE-upserts it via hymns:upsertHymns. Idempotent; a research pass and a lyrics pass don't overwrite each other.
  • /api/hymnsRead the library back: /api/hymns?number=259 returns a hymn's full record; the list endpoint shows which hymns have lyrics vs research.
  • the genre encyclopediaResearch the sub-genres the hymn's emotional register maps to, to fill suggestedGenres.

The loop

  1. 1

    Pick the hymn

    Take the hymn number, title, and text author. Confirm whether the text is public domain before going further.

  2. 2

    Research it

    Study the hymn for what a song needs — not the doctrine lecture, the emotional shape.

    • History: who wrote the text, roughly when, the context
    • Themes, the central image, the central tension
    • The modern mirror — a present-day situation with the same emotional shape (the doorway for an original song)
    • Suggested genres + artist voices to channel (voices inform the writing, never appear in a generator prompt)
  3. 3

    Get the lyrics — public domain only

    Source the original lyric text ONLY if the hymn is genuinely public domain (typically published before 1929, or the author long deceased). Skip the lyric text entirely for anything still in copyright — store research only.

    • Verify PD status before sourcing the text — when unsure, treat it as in-copyright and store research only
    • The ingest tool refuses lyrics unless the record sets isPublicDomain: true — a safety net, not a substitute for checking
  4. 4

    Format the lyrics for reuse

    Clean the text so any downstream create loop sings it right: keep the verse/chorus structure, respell hard proper nouns phonetically, and expand archaic contractions.

    • Respell hard names (Ephraim → 'Ee-fraim', Moroni → 'Moe-roh-nye')
    • Expand archaic/hymn contractions (e'en → even, o'er → over, 'tis → it is, heav'n → heaven)
    • Preserve verse / chorus / refrain labels and line breaks
  5. 5

    Write the record and ingest

    Build the record — { number, title, author, year, isPublicDomain, originalLyrics, history, themes, centralImage, centralTension, modernMirror, suggestedGenres, suggestedVoices, sources } — and run the ingest script. It MERGE-upserts by number, so you can add research now and lyrics later without losing either.

    • node scripts/ingest-hymns.mjs path/to/hymns.json
    • Re-running is safe: only the fields you include are written
  6. 6

    Verify and reuse

    Read it back (/api/hymns?number=259) to confirm lyrics + research landed. From then on, any hymn song project — every genre version — pulls this one record instead of re-researching.

Then run it again for the next song, chapter, or track.

You end with

  • A hymn in the library with its public-domain lyrics + reusable research
  • One source every genre version of that hymn pulls from
  • Copyrighted hymns safely stored as research-only (no lyric text)

Skip this loop if…

  • The hymn is still under copyright and you want its full lyrics stored — only research is allowed for those.
  • You only need a one-off song and won't reuse the source across projects.

How it connects

Pairs with

Commonly run just before or after this one in the pipeline.