Skip to content
Agentmart
Submit a tool

add-analysis-pass

Checklist and guide for adding a new analysis pass to the trait-based modular pipeline

Skill by robertolupi

IndexedAGPL-3.0★ 7
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/robertolupi-add-analysis-pass

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Checklist and guide for adding a new analysis pass to the trait-based modular pipeline

Use cases: data

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/add-analysis-pass

What's inside

Skill name
add-analysis-pass
Description
Checklist and guide for adding a new analysis pass to the trait-based modular pipeline
License
AGPL-3.0
Instructions
431 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Adding a New Analysis Pass

The analysis pipeline lives in `src-tauri/src/analysis/` and offers **two pass shapes**. Pick the right one before writing any code:

| Trait | When to use |
|-------|-------------|
| **`AnalysisPass`** | Per-track compute dominates (inference, DSP, API calls). The orchestrator drives the job loop, progress events, pause/resume, and metrics automatically. |
| **`BatchAnalysisPass`** | Either (a) the algorithm requires all data at once (clustering, nearest-neighbour indexing), or (b) the pass is I/O-bound and per-track SQLite round-trips are the bottleneck. You own the read-compute-write loop; the orchestrator calls `execute()` once. |

---

## Current pass priorities

> **Important:** Priorities do **not** determine the pipeline execution order. The execution order is the explicit call sequence in `PipelineManager::run()` in `analysis/mod.rs`. Priorities only control backfill ordering and the `reset_pass` tooling.

| Pass | Priority | Trait | File |
|------|----------|-------|------|
| `audio_analysis` | 10 | `AnalysisPass` | `analysis/audio.rs` |
| `sax` | 12 | `BatchAnalysisPass` | `analysis/sax.rs` |
| `sax_alignment` | 13 | `AnalysisPass` | `analysis/sax_alignment.rs` |
| `boundary_refine` | 14 | `AnalysisPass` | `analysis/boundary_refine.rs` |
| `bpm_correction` | 15 | `AnalysisPass` | `analysis/bpm_correction.rs` |
| `clap` | 20 | `AnalysisPass` | `analysis/clap.rs` |
| `essentia` | 30 | `AnalysisPass` | `analysis/essentia.rs` |
| `qwen` | 50 | `AnalysisPass` | `analysis/qwen.rs` |
| `bpm_refinement` | 55 | `AnalysisPass` | `analysis/bpm_refinement.rs` |
| `structure_cluster` | 55 | `BatchAnalysisPass` | `analysis/structure_cluster.rs` |
| `description_embed` | 60 | `AnalysisPass` | `analysis/description_embed.rs` |

Pick a priority that places your pass at the correct logical point relative to its dependencies. After choosing a priority, **also** add your pass call at the right place in `PipelineManager::run()` — that is what actually sets execution order.

---

## Adding a per-track pass (`AnalysisPass`)

### 1. DB Migration

Add columns to the `tracks` table or create new secondary tables in a new migration file:
```
src-tauri/migrations/NN_your_pass.sql
```
Register it in `src-tauri/src/database.rs`:
```rust
M::up(include_str!("../migrations/NN_your_pass.sql")),
```

### 2. Create the Pass Submodule

Create a new file `src-tauri/src/analysis/your_pass.rs`. 

1. Define a struct for your pass jobs and implement the `PassJob` trait:
```rust
pub struct YourJob {
    pub pass_id: i64,
    pub track_id: i64,
    // Add other fields you need spooled upfront
}

impl super::PassJob for YourJob {
    fn pass_id(&self) -> i64 { self.pass_id }
    fn track_id(&self) -> i64 { self.track_id }
}
```

2. Define a struct for your pass and implement the `AnalysisPass` trait:
```rust
use crate::database::pass_status;
use crate::scanner::sidecar::pass_version;
use rusqlite::Connection;

pub struct YourPass;

impl super::AnalysisPass for YourPass {
    type Job = YourJob;
    type Output = YourResultType;

    fn name(&self) -> &'static str {
        "your_pass_name"
    }

    fn priority(&self) -> i32 {
        60 // Select appropriate priority
    }

    fn version(&self) -> u32 {
        pass_version::YOUR_PASS // Add constant in scanner/sidecar.rs
    }

    fn dependencies(&self) -> &'static [&'static str] {
        &["clap"] // Declare upstream dependency pass names
    }

    fn owned_columns(&self) -> &'static [&'static str] {
        &["your_column_name"] // Columns to null out automatically on reset
    }

    fn owned_tables(&self) -> &'static [&'static str] {
        &[] // Secondary table rows to delete on reset
    }

    fn custom_reset(&self, conn: &Connection) -> Result<(), String> {
        // Optional custom reset hook
        Ok(())
    }

    fn load_jobs(&self, conn: &Connection) -> Result<Vec<Self::Job>, String> {
        // Spool all pending jobs upfront in a single clean query!
        let mut stmt = conn.prepare(
            "SELECT tp.id, tp.track_id FROM track_passes tp
             WHERE tp.status = ?1 AND tp.pass_name = 'your_pass_name'
             ORDER BY tp.id ASC",
        ).map_err(|e| e.to_string())?;

        let rows = stmt.query_map([pass_status::PENDING], |row| {
            Ok(YourJob {
                pass_id: row.get(0)?,
                track_id: row.get(1)?,
            })
        })

From robertolupi/deep-cuts, AGPL-3.0.

More from robertolupi/deep-cuts

Signals

Stars
7
Forks
1
Open issues
0
Last commit (this folder)
Jun 8, 2026 (4 months ago)
Last release
Jun 8, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
AGPL-3.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from robertolupi

Cite this page

add-analysis-pass skill. Agent Mart. https://agentmart.dev/skills/robertolupi-add-analysis-pass (last updated 2026-10-24)