active-interleave

Active Interleave Skill

174 stars

Best use case

active-interleave is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Active Interleave Skill

Teams using active-interleave should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/active-interleave/SKILL.md --create-dirs "https://raw.githubusercontent.com/majiayu000/claude-skill-registry/main/skills/data/active-interleave/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/active-interleave/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How active-interleave Compares

Feature / Agentactive-interleaveStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Active Interleave Skill

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Active Interleave Skill

Interleaves context from recently active Claude/Amp threads into current activity via random walk.

## bmorphism Contributions

> *"all is bidirectional"*
> — [@bmorphism](https://gist.github.com/bmorphism/ead83aec97dab7f581d49ddcb34a46d4), Play/Coplay gist

**Active Inference Pattern**: The interleave implements [Active Inference in String Diagrams](https://arxiv.org/abs/2308.00861) epistemic foraging — actively sampling from recent contexts to minimize uncertainty about the current task. Each random walk step is an epistemic action that gathers information.

**Play/Coplay Duality**: The interleave embodies bmorphism's bidirectional principle:
- **Play** (action): Query recent threads, walk the awareness graph
- **Coplay** (perception): Integrate fragments, update current context

**GF(3) Balanced Exploration**: The triadic structure (MINUS/ERGODIC/PLUS) ensures balanced exploration — validation filters (MINUS), random walk explores (ERGODIC), and colored emission generates (PLUS). Conservation Σ = 0 maintains coherence.

## Activation

Load when context from recent work would help current task.

## Usage

```bash
# Interleave from last 24 hours
bb ~/.claude/skills/active-interleave/active.bb

# Interleave from last N hours
bb ~/.claude/skills/active-interleave/active.bb --hours 6

# Query-focused interleave
bb ~/.claude/skills/active-interleave/active.bb --query "aptos blockchain"

# JSON output
bb ~/.claude/skills/active-interleave/active.bb --json
```

## Behavior

1. **MINUS (-1)**: Validate recency window, filter to active threads only
2. **ERGODIC (0)**: Random walk through recent sessions following awareness edges  
3. **PLUS (+1)**: Emit interleaved fragments with GF(3) coloring

## GF(3) Conservation

Each interleave batch maintains Σ trits ≡ 0 (mod 3).

## Integration

Call from current thread to surface relevant recent context:

```clojure
;; In any bb script
(require '[babashka.process :refer [shell]])
(def context (-> (shell {:out :string} "bb" (str (System/getProperty "user.home") 
                 "/.claude/skills/active-interleave/active.bb") "--json")
                 :out))
```

## Schema

Reads from `~/worldnet/cognition.duckdb`:
- `messages` - Content with timestamps
- `sessions` - Session metadata  
- `awareness_edges` - Play/coplay graph
- `temporal_index` - Time-ordered index



## Scientific Skill Interleaving

This skill connects to the K-Dense-AI/claude-scientific-skills ecosystem:

### Graph Theory
- **networkx** [○] via bicomodule
  - Universal graph hub

### Bibliography References

- `general`: 734 citations in bib.duckdb



## SDF Interleaving

This skill connects to **Software Design for Flexibility** (Hanson & Sussman, 2021):

### Primary Chapter: 6. Layering

**Concepts**: layered data, metadata, provenance, units

### GF(3) Balanced Triad

```
active-interleave (−) + SDF.Ch6 (+) + [balancer] (○) = 0
```

**Skill Trit**: -1 (MINUS - verification)

### Secondary Chapters

- Ch4: Pattern Matching
- Ch7: Propagators
- Ch10: Adventure Game Example

### Connection Pattern

Layering adds metadata. This skill tracks provenance or annotations.
## Cat# Integration

This skill maps to **Cat# = Comod(P)** as a bicomodule in the equipment structure:

```
Trit: 0 (ERGODIC)
Home: Prof
Poly Op: ⊗
Kan Role: Adj
Color: #26D826
```

### GF(3) Naturality

The skill participates in triads satisfying:
```
(-1) + (0) + (+1) ≡ 0 (mod 3)
```

This ensures compositional coherence in the Cat# equipment structure.

Related Skills

ActiveRecord Query Patterns

181
from majiayu000/claude-skill-registry

Complete guide to ActiveRecord query optimization, associations, scopes, and PostgreSQL-specific patterns. Use this skill when writing database queries, designing model associations, creating migrations, optimizing query performance, or debugging N+1 queries and grouping errors.

activepieces

181
from majiayu000/claude-skill-registry

Self-hosted no-code automation platform with visual flow builder, type-safe custom pieces, API integrations, and event-driven triggers

activecampaign-email-marketing

181
from majiayu000/claude-skill-registry

Create, manage, and optimize email campaigns for Laguna Beach Tennis Academy using ActiveCampaign. Use when Claude needs to: (1) Create email campaigns for program launches, camps, or events, (2) Build automation workflows and nurture sequences, (3) Manage contact lists and segmentation, (4) Design luxury-branded email templates following LBTA brand guidelines, (5) Set up triggered emails for registrations or trials, (6) Analyze campaign performance or optimize email strategy.

active-record-db

181
from majiayu000/claude-skill-registry

This skill should be used when the user asks about Active Record models, database migrations, queries, associations (belongs_to, has_many, has_one, has_and_belongs_to_many), validations, callbacks, scopes, database schema design, SQL optimization, N+1 queries, eager loading, joins, or database-specific features (PostgreSQL, MySQL, SQLite). Also use when discussing ORM patterns, data modeling, or database best practices. Examples:

active-learning-system

181
from majiayu000/claude-skill-registry

Эксперт active learning. Используй для ML с участием человека, uncertainty sampling, annotation workflows и labeling optimization.

active-directory

181
from majiayu000/claude-skill-registry

Query and manage Active Directory: users, groups, computers, OUs, GPO status. Use when user asks about AD objects or domain information.

Active Directory Attacks

181
from majiayu000/claude-skill-registry

This skill should be used when the user asks to "attack Active Directory", "exploit AD", "Kerberoasting", "DCSync", "pass-the-hash", "BloodHound enumeration", "Golden Ticket", "Silver Ticket", "AS-REP roasting", "NTLM relay", or needs guidance on Windows domain penetration testing.

active-job-coder

174
from majiayu000/claude-skill-registry

Use when creating or refactoring Active Job background jobs. Applies Rails 8 conventions, Solid Queue patterns, error handling, retry strategies, and job design best practices.

chrome-debug

159
from majiayu000/claude-skill-registry

This skill empowers AI agents to debug web applications and inspect browser behavior using the Chrome DevTools Protocol (CDP), offering both collaborative (headful) and automated (headless) modes.

Coding & DevelopmentClaude

vly-money

159
from majiayu000/claude-skill-registry

Generate crypto payment links for supported tokens and networks, manage access to X402 payment-protected content, and provide direct access to the vly.money wallet interface.

Fintech & CryptoClaude

ontopo

159
from majiayu000/claude-skill-registry

An AI agent skill to search for Israeli restaurants, check table availability, view menus, and retrieve booking links via the Ontopo platform, acting as an unofficial interface to its data.

General Utilities

whisper-transcribe

159
from majiayu000/claude-skill-registry

Transcribes audio and video files to text using OpenAI's Whisper CLI, enhanced with contextual grounding from local markdown files for improved accuracy.

Media Processing