persistent-homology

Detect persistent topological features in code across complexity filtrations.

60|13|Updated Dec 22, 2025
One-click install
npx skills add https://github.com/plurigrid/asi --skill persistent-homology
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: persistent-homology
Source: https://github.com/plurigrid/asi/tree/main/ies/music-topos/.codex/skills/persistent-homology
Command: npx skills add https://github.com/plurigrid/asi --skill persistent-homology

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill applies topological data analysis to identify features that persist across varying scales, enabling robust verification of structural invariants in code bases and data sets.

Core Features & Use Cases

  • Filtration construction: Build nested complexes by a chosen threshold.
  • Betti numbers across levels: Track components, loops, and voids.
  • Persistence diagrams: Birth-death pairs for features; identify long-lived structures.
  • Cross-domain application: Binary analysis, code complexity modeling, and graph-based analyses.

Quick Start

Run a persistence analysis on a codebase to extract stable features across complexity thresholds.

Frequently Asked Questions about persistent-homology

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does persistent homology detect stable structural features in code?

Persistent homology tracks topological features—components, loops, and voids—across nested complexity filtrations. It computes Betti numbers at each threshold and generates persistence diagrams showing birth-death pairs; features that persist across many levels are robust structural invariants, while short-lived features are noise.

Can I apply persistent homology to binary analysis and control flow graphs?

Yes. Persistent homology works across source code, binary analyses, and CFGs by constructing filtrations from cyclomatic complexity thresholds. It identifies stable structural holes and robustness metrics across all three domains, integrated with radare2 for binary code analysis.

What is a filtration in the context of code structure analysis?

A filtration is a nested sequence of complexes built by incrementally raising a complexity threshold. In code analysis, filtration by cyclomatic complexity creates successive layers of the codebase; topological features that survive across layers indicate structural resilience and meaningful invariants.

How do I extract persistent features from a codebase?

Run a persistence analysis by defining a complexity-based filtration on your codebase. The Skill computes Betti numbers at each level, generates persistence diagrams, and outputs stable features and comparative metrics showing which structures persist across thresholds.

What do Betti numbers tell me about code structure?

Betti numbers count topological features at each complexity level: the first Betti number counts connected components, the second counts loops, and the third counts voids. Tracking these across filtrations reveals how structural complexity and connectivity change, highlighting robust patterns and fragility points.

When should I use persistence diagrams over traditional code metrics?

Persistence diagrams capture multi-scale structural stability that cyclomatic complexity or coupling metrics alone miss. Use them when you need to identify which architectural features remain invariant under varying complexity thresholds—essential for verifying robustness and distinguishing signal from noise in large codebases.