Skip to content

Instantly share code, notes, and snippets.

View blinkinglight's full-sized avatar

M blinkinglight

View GitHub Profile
Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 2 column 58
---
name: nats
description: Practical, production-minded NATS skill pack: Core NATS + JetStream + Go (nats.go) + Micro (service framework). Includes mental models, subject design, reliability patterns, security, ops, and copy‑paste Go snippets.
---

NATS SKILL

This is a high-signal field guide for building real systems with NATS:

  • Core NATS for low-latency messaging (pub/sub, request-reply, queue groups).
  • JetStream for persistence, replay, work-queues, KV, Object Store.
name description
templ
Compile-time HTML templating for Go using templ. Enforces type-safe components, layout composition, fragment rendering, and production-ready best practices for HTTP, SSE, and component-driven UI architectures.

SKILL.md — templ (https://templ.guide)

This SKILL document defines how Claude CLI and OpenCode CLI should reason about, generate, refactor, and review code that uses templ (https://templ.guide) for Go-based HTML templating.

The purpose is to ensure consistent, idiomatic, production-ready usage of templ across projects.

name description
datastar
Apply datastar best practices, idioms, and conventions from https://data-star.dev/reference/attributes. Use when writing, reviewing, or refactoring html/frontend code to ensure idiomatic, clean, and efficient implementations.

Datastar (data-star.dev) — Claude/OpenCode SKILL

Tikslas: šiame faile aprašyta, kaip teisingai ir produktyviai naudoti Datastar kuriant backend-driven (hypermedia-first) UI. Tekstas skirtas LLM „skill“ formato naudojimui: aiškios taisyklės, receptai, šablonai, „gotchas“, ir mini pavyzdžiai.

Kas yra Datastar (mentalus modelis)

@blinkinglight
blinkinglight / Caddyfile
Created January 19, 2026 07:18 — forked from vanodevium/Caddyfile
Caddy server: enable CORS for any domain
(cors) {
@cors_preflight method OPTIONS
header {
Access-Control-Allow-Origin "{header.origin}"
Vary Origin
Access-Control-Expose-Headers "Authorization"
Access-Control-Allow-Credentials "true"
}
@blinkinglight
blinkinglight / datastar-rc6-golang-prompt.md
Created November 19, 2025 23:35 — forked from njreid/datastar-rc6-golang-prompt.md
Datastar (data-star.dev) System Prompt for Version 1.0.0.RC6 with the Go SDK

Datastar + Go Development System Prompt

You are an expert in building modern web applications using Datastar (a hypermedia-driven reactive framework) with Go backends. You follow these principles and patterns:


Core Philosophy

Hypermedia-First Architecture: The backend drives the UI by sending HTML fragments and state updates over Server-Sent Events (SSE). There is NO separate REST API layer - all interactions happen through SSE streams.

@blinkinglight
blinkinglight / index.html
Last active July 25, 2025 05:57
fancy file uploader vanilla js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script src="script.js" defer type="module"></script>
</head>
<body>
@blinkinglight
blinkinglight / main.go
Last active June 17, 2025 17:09
bee in action
router.Get("/stream/{id}", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200)
id := chi.URLParam(r, "id")
sse := datastar.NewSSE(w, r)
_ = sse
ctx := bee.WithJetStream(r.Context(), js)
ctx = bee.WithNats(ctx, nc)
agg := &Aggregate{}
package replayhandler
import (
"context"
"fmt"
"log"
"time"
"github.com/ituoga/iot/gen"
"github.com/nats-io/nats.go"
package main
import (
"io"
"os/exec"
"github.com/nats-io/nats.go"
)
type NWriter struct {
@blinkinglight
blinkinglight / main.go
Last active March 16, 2025 13:27
something with events
package main
import (
"context"
"fmt"
"log"
"strings"
"time"
"github.com/ituoga/the-system/pkg/tools"