Skip to content
Back to skills

Recursive String Diagrams

ASecurity

recursive-string-diagrams

  • 61 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 6, 2026
developmentpythongodatabase

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add plurigrid/asi --skill recursive-string-diagrams --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Recursive String Diagrams?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Recursive String Diagrams
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/plurigrid-recursive-string-diagrams-asi/badge)](https://www.skillsdirectory.com/skills/plurigrid-recursive-string-diagrams-asi)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: recursive-string-diagrams
description: recursive-string-diagrams
version: 1.0.0
---

# 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

```clojure
;; 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

```python
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

1. **Seed**: White trapezoid with `[inputs → outputs]`
2. **Recurse**: Apply random `{∘, ⊗, ↺}` up to depth
3. **Color**: Assign GF(3) trits, verify conservation
4. **Render**: ASCII or DisCoPy SVG
5. **Save**: Write to `~/.claude/skills/<name>/SKILL.md`

## Related

- `discopy` - String diagram library
- `acsets` - Algebraic databases
- `rama-gay-clojure` - Rama + GF(3) colors

## 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.

Files in this skill

  • CONCOMITANT_SKILLS.md1 KB
  • SKILL.md2.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.