cd /news/large-language-models/sparkle-pills · home topics large-language-models article
[ARTICLE · art-134035] src=githubnext.com ↗ pub= topic=large-language-models verified=true sentiment=· neutral

Sparkle Pills

GitHub Next published a post titled "Sparkle Pills" describing a templating convention in which instructions wrapped in `*(...)` mark slots that a large language model fills in while surrounding verbatim text is preserved by deterministic code. The pattern supports named slots, constraints such as `*(/^\d{2}-\d{2}-\d{4}$/ the day of the party)`, option sets like `*({red, orange, yellow})`, and fill phases including write-time `*(...)`, compile-time `*[...]`, and run-time `*{...}`. The post argues the deterministic code owns the outer loop and replaces only the slots, so verbatim text is preserved and not paid for in output tokens.

read3 min views1 publishedSep 18, 2026
Sparkle Pills
Image: Githubnext (auto-discovered)

A flexible templating convention for contextual inference

Here’s a little pattern I find handy for writing documents with AI when you already have a lot of text you want to preserve verbatim and a few slots where you want to generate something. I call these slots sparkle pills: instructions wrapped in *(...) that a model fills in.

Try this prompt to get started:

Read https://githubnext.com/posts/sparkle-pills/ and build me a system for using sparkle pills. Interview me about my use case first.

How it works #

Dear *(person's first name, or however they usually refer to themselves),

It's time for your annual security training! As a *(person's role), *(describe how security is relevant to their job duties). We're relying on you to help keep *(company name) safe.

Everyone in *(person's department) is required to complete this training by *(due date).

You could just give this template to an LLM in a prompt, along with the relevant context, and it would probably do a pretty good job. But if you want to ensure that none of your verbatim text gets altered, put deterministic code in charge. Have a script generate a prompt asking an LLM to return only an array of values to fill the sparkle pill slots.

Constraints and generation #

You could use named slots like *(role=the employee's role) and ask for an object back, supplying a schema for structured output so you get the shape you need. You can refer to other slots from within a slot: *(years of experience required for $role).

You can include constraints in your template slots, like *(/^\d{2}-\d{2}-\d{4}$/ the day of the party), and build those into your structured output schema. You can provide a limited set of options like *({red, orange, yellow}) and encode that in the schema too.

You can have the LLM generate the entire set of template values at once. If the values don’t need to be consistent with one another, you can request them individually and in parallel.

You could include a cron expression, *(*/5 * * * * tell me a joke), and use it to periodically update blocks on a website.

You can use this to plop down pseudocode to be rewritten while you continue with the rest of the program:

var cart = *(some collection of test items)
var totalCost = cart.reduce(*(sum up the item.cost, I forget how to do this))

When to fill the slots #

Sparkle pills can be filled in at different phases of work, using different notations:

  • Write-time: *(...) gets processed while you are authoring the document, such as when you are drafting an issue.
  • Compile-time: *[...] gets subbed in when you compile or save code, or take an analogous step like submitting an issue.
  • Run-time: *{...} is for slots that persist in a saved document and get filled in later, like in an issue template or a mail-merge scenario.
  • Whatever-time: *<> or*///.../// or whatever you want gets handled at whatever juncture makes sense in your system.

Build your own #

It’s hyper-contextual and super-flexible. Your coding agent can help you design a system that works for your scenario.

Just remember, the deterministic code owns the outer loop and replaces only the slots, so your verbatim text is preserved and you don’t have to pay for it in output tokens.

── more in #large-language-models 4 stories · sorted by recency
── more on @github next 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/sparkle-pills] indexed:0 read:3min 2026-09-18 ·