solar

Coding rules for Solar, a browser-based interface framework that runs without a build or compilation step.

In plain words
What is it for?
They are for building browser interfaces with Solar through a CDN or npm, including typed component properties, rendering, registration, and mounting.
Why use it?
They give AI-generated code a consistent way to define, register, and display interface components using Solar.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/stahlwalker/framework-solar/solar
Clone the repo
git clone --depth 1 https://github.com/Stahlwalker/framework-solar
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,283 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01283
Opus 5 $0.00000 $0.00642
Sonnet 5 $0.00000 $0.00257
Haiku 4.5 $0.00000 $0.00128

Measured yesterday against content hash 0527cb1b1872, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

solar scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/solar.mdc · 191 lines

How it starts

The opening of the file, as written. The whole thing — 191 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Solar Framework Rules

Solar (solarbuild) is a no-build, browser-native UI framework designed for AI-generated code. It runs directly in the browser via CDN or npm — no bundler, no JSX, no compile step.

Installation

<!-- CDN (browser) -->
<script type="module">
  import { defineComponent, mountComponent, h, registry, Types } from 'https://cdn.jsdelivr.net/npm/solarbuild/framework/index.js'
</script>
// npm
import { defineComponent, mountComponent, h, registry, Types } from 'solarbuild'

Core pattern

Always use defineComponent() to define components — never plain functions. Always register with registry.register() before mounting.

import { defineComponent, mountComponent, h, registry, Types } from 'solarbuild'

const Button = defineComponent({
  name: 'Button',
  props: {
    label: { type: Types.string, required: true },
    onClick: { type: Types.function, required: true },
  },
  render({ label, onClick }) {
    return h('button', { onclick: onClick }, label)
  },
})

registry.register(Button)
mountComponent(Button, { label: 'Click me', onClick: () => alert('hi') }, document.getElementById('app'))

Types

Available types from Types: string, number, boolean, function, object, array, any, slot

Props can be:

  • { type: Types.string, required: true } — required
  • { type: Types.string, default: 'hello' } — optional with default
  • { type: Types.string, enum: ['sm', 'md', 'lg'] } — enum constraint

Structured errors

When props are wrong, Solar throws a ContractError with a fix field — always read and act on it:

try {
  mountComponent(Button, { label: 42 }, el)
} catch (e) {
  if (e.name === 'ContractError') {
    console.log(e.fix) // "Pass a string value for 'label'"
    // correct the props and retry
  }
}

Registry and agent discovery

Agents should call registry.manifest() to discover available components and their prop schemas before mounting:

const manifest = registry.manifest() // returns JSON string
const components = JSON.parse(manifest)
// [{ name: 'Button', props: { label: { type: 'string', required: true }, ... } }]

Read the full file on GitHub · 191 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 191 lines · 0 tokens per session scan A 0527cb1b1872

Subscribe to this mod's changes

solar is a cursor rule published in the GitHub repository Stahlwalker/framework-solar (2 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,283 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.