Skip to content
cccskills
FreePublished on GitHub

clj-kondo-3color

clj-kondo linter with Gay.jl 3-color integration for GF(3) conservation in Clojure code analysis.

The English summary is being prepared. Showing the original description.

Run score Not tested

See how to install

Files included (2)

  • SKILL.md6.9 KB
  • CONCOMITANT_SKILLS.md3.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

clj-kondo 3-Color Integration

"A linter for Clojure code that sparks joy — now with deterministic color-coded diagnostics."

Overview

clj-kondo is a static analyzer and linter for Clojure. This skill integrates Gay.jl's 3-color streams for:

  1. Diagnostic classification via GF(3) trit assignment
  2. Parallel linting with SPI-compliant color forking
  3. Visual feedback with deterministic color palettes
  4. Plurigrid/ASI alignment for safety-aware linting

Diagnostic Trit Mapping

TritLevelColor Rangeclj-kondo Level
-1MINUSCold (blue):error
0ERGODICNeutral (green):warning
+1PLUSWarm (red):info

GF(3) Conservation: For any 3 consecutive diagnostics:

trit(d₁) + trit(d₂) + trit(d₃) ≡ 0 (mod 3)

Configuration

.clj-kondo/config.edn

{: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}}

Plurigrid/ASI Safety Hooks

;; .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}))))

Integration with SplitMixTernary

(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)))))

Parallel Linting with SPI Guarantee

(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))))

Emacs Integration

;; 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 ASI Safety Integration

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))

Visual Output

┌─────────────────────────────────────────────────────────────────┐
│  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)          │
└─────────────────────────────────────────────────────────────────┘

Commands

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

References

REPL atlas

Part of: repl-commons. Family canonical: clojure.

Para(Optic) atlas

Part of: para-mensch-commons.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Model ElevenLabs voice synthesis as an ACSet schema with Unison ability handlers for typed voice operations. Use when integrating ElevenLabs TTS into category-theoretic pipelines, building typed voice synthesis workflows, or managing multi-voice narration with GF(3) conservation.

The English summary is being prepared. Showing the original description.

plurigrid/asi70Updated Jul 10, 2026

Systematic process for analyzing and modernizing legacy applications to comply with the 12-Factor App methodology. Covers code analysis, configuration externalization, dependency management, and container/Kubernetes best practices.

The English summary is being prepared. Showing the original description.

plurigrid/asi70Updated Jul 10, 2026

13c0e3

Free

Gay MCP skill at invocation 26

The English summary is being prepared. Showing the original description.

plurigrid/asi70Updated Jul 10, 2026

19d57d

Free

Gay MCP skill at invocation 5

The English summary is being prepared. Showing the original description.

plurigrid/asi70Updated Jul 10, 2026

1ea91a

Free

Gay MCP skill at invocation 27

The English summary is being prepared. Showing the original description.

plurigrid/asi70Updated Jul 10, 2026

1eab21

Free

Gay MCP skill at invocation 3

The English summary is being prepared. Showing the original description.

plurigrid/asi70Updated Jul 10, 2026

See all skills by plurigrid

Report a problem with this skill