install
source · Clone the upstream repo
git clone https://github.com/plurigrid/asi
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/plurigrid/asi "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/recursive-string-diagrams" ~/.claude/skills/plurigrid-asi-recursive-string-diagrams-4c8044 && rm -rf "$T"
manifest:
skills/recursive-string-diagrams/SKILL.mdsource content
recursive-string-diagrams
Recursive random string diagram generation with white trapezoid as the atomic skill primitive.
Primitives
| Symbol | Name | Meaning |
|---|---|---|
| White Trapezoid | Skill = morphism with typed ports |
| Compose | Sequential skill chaining |
| Tensor | Parallel skill execution |
| Trace | Feedback loop / recursion |
GF(3) Trit Assignment
Each white trapezoid carries a trit:
- MINUS (-1): Constraining/validating skill
- ERGODIC (0): Neutral/transforming skill
- PLUS (+1): Generating/expanding skill
Conservation:
Σ trits ≡ 0 (mod 3) across diagram
Usage
;; Generate random diagram depth 4 (random-diagram 0 4) ;; Render ASCII (render-ascii diagram 0)
Example Output
⊗ tensor ↺ trace[1] ◁═══▷ [3→2] ergodic ∘ compose ◁═══▷ [2→2] minus ◁═══▷ [3→3] plus
Semantics (Rama Connection)
| String Diagram | Rama Primitive |
|---|---|
| White Trapezoid | ETL topology |
| Compose (∘) | Depot chain |
| Tensor (⊗) | Parallel PStates |
| Trace (↺) | Recursive query |
DisCoPy Integration
from discopy import Ty, Box, Diagram # White trapezoid as Box skill = Box('skill', Ty('in'), Ty('out')) # Compose d1 >> d2 # Tensor d1 @ d2 # Trace d.trace(n)
Skill Creation Protocol
- Seed: White trapezoid with
[inputs → outputs] - Recurse: Apply random
up to depth{∘, ⊗, ↺} - Color: Assign GF(3) trits, verify conservation
- Render: ASCII or DisCoPy SVG
- Save: Write to
~/.claude/skills/<name>/SKILL.md
Related
- String diagram librarydiscopy
- Algebraic databasesacsets
- Rama + GF(3) colorsrama-gay-clojure
SDF Interleaving
This skill connects to Software Design for Flexibility (Hanson & Sussman, 2021):
Primary Chapter: 3. Variations on an Arithmetic Theme
Concepts: generic arithmetic, coercion, symbolic, numeric
GF(3) Balanced Triad
recursive-string-diagrams (−) + SDF.Ch3 (○) + [balancer] (+) = 0
Skill Trit: -1 (MINUS - verification)
Secondary Chapters
- Ch1: Flexibility through Abstraction
Connection Pattern
Generic arithmetic crosses type boundaries. This skill handles heterogeneous data.