xiaohongshu
xiaohongshu
clj-kondo-3color
clj-kondo linter with Gay.jl 3-color integration for GF(3) conservation in Clojure code analysis.
Full skill instructions
"A linter for Clojure code that sparks joy — now with deterministic color-coded diagnostics."
clj-kondo is a static analyzer and linter for Clojure. This skill integrates Gay.jl's 3-color streams for:
| Trit | Level | Color Range | clj-kondo Level |
|---|---|---|---|
| -1 | MINUS | Cold (blue) | :error |
| 0 | ERGODIC | Neutral (green) | :warning |
| +1 | PLUS | Warm (red) | :info |
GF(3) Conservation: For any 3 consecutive diagnostics:
trit(d₁) + trit(d₂) + trit(d₃) ≡ 0 (mod 3)
{:linters
{:unresolved-symbol {:level :error}
:unused-binding {:level :warning}
:type-mismatch {:level :error}}
;; Gay.jl color integration
:gay-colors
{:enabled true
:seed 0x42D
:trit-mapping {:error -1, :warning 0, :info 1}
:conservation :strict}}
;; .clj-kondo/hooks/gay_safety.clj
(ns hooks.gay-safety
(:require [clj-kondo.hooks-api :as api]))
(defn check-gf3-conservation
"Verify GF(3) conservation across findings."
[{:keys [findings]}]
(let [trits (map #(case (:level %)
:error -1
:warning 0
:info 1) findings)
sum (reduce + 0 trits)]
(when-not (zero? (mod sum 3))
(api/reg-finding!
{:message "GF(3) conservation violated"
:type :gay-conservation
:level :warning}))))
(ns music-topos.clj-kondo-gay
(:require [clj-kondo.core :as clj-kondo]))
(def GOLDEN 0x9E3779B97F4A7C15)
(def MIX1 0xBF58476D1CE4E5B9)
(def MIX2 0x94D049BB133111EB)
(def MASK64 0xFFFFFFFFFFFFFFFF)
(defn splitmix64 [state]
(let [s (bit-and (+ state GOLDEN) MASK64)
z (bit-and (* (bit-xor s (unsigned-bit-shift-right s 30)) MIX1) MASK64)
z (bit-and (* (bit-xor z (unsigned-bit-shift-right z 27)) MIX2) MASK64)]
{:state s :value (bit-xor z (unsigned-bit-shift-right z 31))}))
(defn color-at [seed idx]
(loop [s seed i idx]
(if (zero? i)
(let [{:keys [value]} (splitmix64 s)]
{:L (+ 10 (* 85 (/ (double (bit-and value 0xff)) 255)))
:C (* 100 (/ (double (bit-and (unsigned-bit-shift-right value 8) 0xff)) 255))
:H (* 360 (/ (double (bit-and (unsigned-bit-shift-right value 16) 0xffff)) 65535))})
(recur (:state (splitmix64 s)) (dec i)))))
(defn color-finding [seed finding idx]
(let [color (color-at seed idx)
trit (case (:level finding) :error -1 :warning 0 :info 1)]
(assoc finding
:gay-color color
:gay-trit trit
:gay-hex (lch-to-hex (:L color) (:C color) (:H color)))))
(defn lint-with-colors [paths seed]
(let [result (clj-kondo/run! {:lint paths})
findings (:findings result)]
(assoc result
:findings (map-indexed (fn [i f] (color-finding seed f i)) findings)
:gf3-sum (reduce + 0 (map :gay-trit findings)))))
(defn parallel-lint-files
"Lint files in parallel with deterministic coloring."
[files seed]
(let [child-seeds (for [i (range (count files))]
(bit-xor seed (* i GOLDEN)))]
(pmap (fn [[file child-seed]]
(lint-with-colors [file] child-seed))
(map vector files child-seeds))))
;; flycheck-clj-kondo-gay.el
(require 'flycheck)
(require 'gay)
(defun flycheck-clj-kondo-gay-colorize (errors)
"Colorize flycheck errors with Gay.jl colors."
(let ((idx 0))
(dolist (err errors)
(let* ((color (gay-color-at gay-seed-default idx))
(hex (gay-color-to-hex color)))
(overlay-put (flycheck-error-overlay err)
'face `(:background ,hex)))
(cl-incf idx))))
(add-hook 'flycheck-after-syntax-check-hook
#'flycheck-clj-kondo-gay-colorize)
Plurigrid provides programmable guardrails for AI safety. clj-kondo integration:
(ns music-topos.plurigrid-lint
(:require [music-topos.clj-kondo-gay :as linter]))
(defn safety-aware-lint
"Lint with ASI safety awareness."
[paths seed safety-config]
(let [result (linter/lint-with-colors paths seed)
findings (:findings result)]
;; Check for unsafe patterns
(doseq [f findings]
(when (and (= (:level f) :error)
(contains? (:unsafe-patterns safety-config) (:type f)))
(println "⚠️ ASI Safety Alert:" (:message f))))
result))
┌─────────────────────────────────────────────────────────────────┐
│ CLJ-KONDO 3-COLOR REPORT │
├─────────────────────────────────────────────────────────────────┤
│ File: src/music_topos/core.clj │
│ │
│ ██ L1:15 :unresolved-symbol 'foo' trit: -1 (MINUS) │
│ ██ L5:22 :unused-binding 'x' trit: 0 (ERGODIC) │
│ ██ L8:10 :type-mismatch int/str trit: -1 (MINUS) │
│ │
│ GF(3): -1 + 0 + (-1) = -2 ≡ 1 (mod 3) ⚠️ │
│ Conservation: VIOLATED (adjust via info diagnostics) │
└─────────────────────────────────────────────────────────────────┘
just clj-kondo-3color # Lint with 3-color output
just clj-kondo-gay-conservation # Check GF(3) conservation
just clj-kondo-parallel # Parallel lint with SPI
just clj-kondo-asi-check # Run with ASI safety hooks
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience