xiaohongshu
xiaohongshu
delta-derivation
Extract information delta between Claude.ai conversation exports using ACSets morphisms and bisimulation verification
Full skill instructions
Trit: -1 (MINUS - Validator) Color: #007FFF (Cold Blue) Role: Extract and verify conversation export deltas
# 1. Extract conversations from exports
unzip -o "$RECENT_ZIP" conversations.json -d /tmp/recent_export
unzip -o "$PREVIOUS_ZIP" conversations.json -d /tmp/previous_export
# 2. Extract conversation IDs
jq -r '.[].conversation_id' /tmp/recent_export/conversations.json | sort > /tmp/recent_ids.txt
jq -r '.[].conversation_id' /tmp/previous_export/conversations.json | sort > /tmp/prev_ids.txt
# 3. Compute delta (new conversations)
comm -23 /tmp/recent_ids.txt /tmp/prev_ids.txt > /tmp/new_ids.txt
# 4. Bisimulation check (mutations in shared conversations)
jq -r '.[] | "\(.conversation_id) \(.current_node)"' /tmp/recent_export/conversations.json | sort > /tmp/recent_states.txt
jq -r '.[] | "\(.conversation_id) \(.current_node)"' /tmp/previous_export/conversations.json | sort > /tmp/prev_states.txt
comm -3 /tmp/recent_states.txt /tmp/prev_states.txt > /tmp/mutated.txt
(def ConversationACSet
{:objects #{:Conversation :Message :Node}
:morphisms {:has_mapping [:Conversation :Node]
:parent_of [:Node :Node]
:contains [:Node :Message]}
:attributes {:conversation_id [:Conversation :String]
:title [:Conversation :String]
:create_time [:Conversation :Timestamp]
:update_time [:Conversation :Timestamp]
:current_node [:Conversation :UUID]}})
(defn delta-morphism [recent previous]
"Compute injective morphism from previous → recent"
(let [shared (set/intersection (ids recent) (ids previous))
new-convos (set/difference (ids recent) (ids previous))
removed (set/difference (ids previous) (ids recent))]
{:type :injection
:shared (count shared)
:new (count new-convos)
:removed (count removed)
:new-ids new-convos}))
(defn bisimilar? [conv1 conv2]
"Check if two conversations are observationally equivalent"
(and (= (:conversation_id conv1) (:conversation_id conv2))
(= (:current_node conv1) (:current_node conv2))
(= (count (:mapping conv1)) (count (:mapping conv2)))))
(defn find-mutations [recent previous]
"Find conversations that exist in both but have diverged"
(let [shared-ids (set/intersection (ids recent) (ids previous))]
(filter (fn [id]
(not (bisimilar? (get-conv recent id)
(get-conv previous id))))
shared-ids)))
(defn extract-skill-mentions [conversations]
"Find skill invocations in conversation content"
(let [patterns [#"/(\w+)" ; slash commands
#"skill[:\s]+[\"']?(\w+)" ; skill mentions
#"(\w+-\w+(?:-\w+)*)"]] ; hyphenated skill names
(->> conversations
(mapcat :messages)
(mapcat (fn [msg]
(for [p patterns
m (re-seq p (:content msg ""))]
(second m))))
frequencies
(sort-by val >))))
#!/usr/bin/env bash
# delta-derive.sh - Extract conversation export delta
set -euo pipefail
RECENT="$1"
PREVIOUS="$2"
OUTPUT="${3:-/tmp/delta_analysis.json}"
# Extract
unzip -qo "$RECENT" conversations.json -d /tmp/recent_export
unzip -qo "$PREVIOUS" conversations.json -d /tmp/previous_export
# Compute delta
jq -s '
(.[0] | map({key: .conversation_id, value: .}) | from_entries) as $recent |
(.[1] | map({key: .conversation_id, value: .}) | from_entries) as $prev |
{
recent_count: (.[0] | length),
previous_count: (.[1] | length),
new_conversations: [.[0][] | select(.conversation_id | in($prev) | not) | {
id: .conversation_id,
title: .title,
created: .create_time,
nodes: (.mapping | length)
}],
mutated_conversations: [.[0][] |
select(.conversation_id | in($prev)) |
select(.current_node != $prev[.conversation_id].current_node) |
{
id: .conversation_id,
title: .title,
old_node: $prev[.conversation_id].current_node,
new_node: .current_node,
node_delta: ((.mapping | length) - ($prev[.conversation_id].mapping | length))
}
],
delta_size_bytes: ((.[0] | tostring | length) - (.[1] | tostring | length))
}
' /tmp/recent_export/conversations.json /tmp/previous_export/conversations.json > "$OUTPUT"
echo "Delta saved to $OUTPUT"
jq -r '"New: \(.new_conversations | length), Mutated: \(.mutated_conversations | length)"' "$OUTPUT"
| Stream | Role | Analysis |
|---|---|---|
| MINUS (-1) | Validator | Bisimulation check, mutation detection |
| ERGODIC (0) | Coordinator | Merge results, compute frequencies |
| PLUS (+1) | Generator | Extract new conversations, skill mentions |
(defn triadic-delta [recent previous]
"Run delta derivation with GF(3) balanced agents"
(let [minus (future (find-mutations recent previous))
ergodic (future (compute-frequencies recent previous))
plus (future (extract-new-convos recent previous))]
{:mutations @minus
:frequencies @ergodic
:new-convos @plus
:gf3-sum 0}))
just delta-derive RECENT.zip PREVIOUS.zip # Full delta analysis
just delta-new RECENT.zip PREVIOUS.zip # List new conversations only
just delta-mutated RECENT.zip PREVIOUS.zip # List mutated conversations
just delta-skills RECENT.zip PREVIOUS.zip # Extract skill frequencies
just delta-bisim RECENT.zip PREVIOUS.zip # Run bisimulation check
# Delta derivation commands
delta-derive recent previous:
@~/.claude/skills/delta-derivation/delta-derive.sh "{{recent}}" "{{previous}}"
delta-new recent previous:
@unzip -qo "{{recent}}" conversations.json -d /tmp/r && \
unzip -qo "{{previous}}" conversations.json -d /tmp/p && \
comm -23 <(jq -r '.[].conversation_id' /tmp/r/conversations.json | sort) \
<(jq -r '.[].conversation_id' /tmp/p/conversations.json | sort)
delta-skills recent previous:
@~/.claude/skills/delta-derivation/delta-derive.sh "{{recent}}" "{{previous}}" && \
jq '.new_conversations[].title' /tmp/delta_analysis.json
acsets-relational-thinking (-1): Schema modelingbisimulation-game (0): Equivalence verificationtemporal-coalgebra (-1): Stream observationcompression-progress (0): Information gain measurementBase directory: ~/.claude/skills/delta-derivation
This skill connects to the K-Dense-AI/claude-scientific-skills ecosystem:
general: 734 citations in bib.duckdbThis 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
The skill participates in triads satisfying:
(-1) + (0) + (+1) ≡ 0 (mod 3)
This ensures compositional coherence in the Cat# equipment structure.
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