Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AMAP ML SkillClaw Dashboard Ingest

From Leeroopedia
Knowledge Sources
Domains Dashboard, Skill_Evolution, Data_Pipeline
Last Updated 2026-10-22 00:00 GMT

Overview

Concrete snapshot builder that collects skills, sessions, validation jobs, and version history from local and shared storage into a unified dashboard snapshot dictionary.

Description

The dashboard_ingest module provides the `build_dashboard_snapshot()` function, the data pipeline for the SkillClaw dashboard. It orchestrates three parallel data collection paths: (1) `_load_local_skills()` reads `SKILL.md` files from the local skills directory, parsing YAML frontmatter and bundle metadata; (2) `_load_local_sessions()` reads Cursor transcript JSONL files and conversation records from the state directory, merging trajectory and conversation data; (3) `_load_shared_skills()` fetches skills, sessions, and validation jobs from remote object storage via `SkillHub` and `ValidationStore`. The snapshot merges local and shared skill data, computes usage statistics (injection/read/modify counts), builds session-skill link relationships, and returns a unified dictionary with `skills`, `sessions`, `validation_jobs`, `session_skill_links`, and `meta` sections.

Usage

Import this module when you need to:

  • Build a dashboard snapshot for SQLite projection: `build_dashboard_snapshot(config)`
  • Understand how local skills are parsed from `SKILL.md` bundles with YAML frontmatter
  • Trace the session loading pipeline (Cursor transcripts + conversation records + trajectory JSON)
  • Merge local and shared skill data into a unified view
  • Compute skill usage statistics from session turn annotations

Code Reference

Source Location

  • Repository: SkillClaw
  • File: `skillclaw/dashboard_ingest.py:L1-1375`

Signature

def build_dashboard_snapshot(config: SkillClawConfig) -> dict[str, Any]:
    """Build a complete dashboard snapshot from local and shared storage.

    Returns a dict with keys:
      - generated_at: ISO timestamp
      - meta: warnings, sharing config, paths
      - skills: list of normalized skill dicts
      - sessions: list of session summary dicts
      - session_skill_links: list of {session_id, skill_id, relation, count}
      - validation_jobs: list of validation job dicts
    """

def _load_local_skills(config: SkillClawConfig, warnings: list[str]) -> dict[str, dict[str, Any]]:
    """Read all local SKILL.md files, parse frontmatter, compute hashes and stats."""

def _load_local_sessions(config: SkillClawConfig, warnings: list[str]) -> list[dict[str, Any]]:
    """Load sessions from state dir (trajectories + transcripts) and conversation records."""

def _load_shared_skills(
    config: SkillClawConfig,
    warnings: list[str],
) -> tuple[dict, list, list, dict]:
    """Fetch shared skills, sessions, validation jobs from object storage."""

Import

from skillclaw.dashboard_ingest import build_dashboard_snapshot

I/O Contract

Inputs

Name Type Required Description
config SkillClawConfig Yes SkillClaw configuration with skills_dir, sharing settings, record_dir
config.skills_dir str Yes Local skills directory path
config.sharing_enabled bool No Whether shared storage is enabled
config.dashboard_include_shared bool No Whether to include shared data in snapshot
config.record_dir str No Directory containing conversations.jsonl
SkillHub.from_config(config) SkillHub No Shared skill hub (when sharing enabled)
ValidationStore.from_config(config) ValidationStore No Validation job store (when sharing enabled)

Outputs

Name Type Description
returns dict[str, Any] Complete snapshot with skills, sessions, validation_jobs, links, meta
snapshot["skills"] list[dict] Normalized skill dicts sorted by session_count desc
snapshot["sessions"] list[dict] Session summaries sorted by timestamp desc
snapshot["session_skill_links"] list[dict] Session-skill relationship counts
snapshot["validation_jobs"] list[dict] Validation jobs with results and decisions
snapshot["meta"]["warnings"] list[str] Non-fatal errors during collection

Usage Examples

Build and Store Snapshot

from skillclaw.config import SkillClawConfig
from skillclaw.dashboard_ingest import build_dashboard_snapshot
from skillclaw.dashboard_store import DashboardStore

config = SkillClawConfig.from_env()
snapshot = build_dashboard_snapshot(config)

store = DashboardStore(config.dashboard_db_path)
summary = store.replace_snapshot(snapshot)
print(f"Snapshot: {summary['skills']} skills, {summary['sessions']} sessions")

Inspect Snapshot Contents

from skillclaw.config import SkillClawConfig
from skillclaw.dashboard_ingest import build_dashboard_snapshot

config = SkillClawConfig.from_env()
snapshot = build_dashboard_snapshot(config)

# Check warnings from data collection
for warning in snapshot["meta"]["warnings"]:
    print(f"WARNING: {warning}")

# List skills with local+remote sync status
for skill in snapshot["skills"]:
    source = skill.get("source", "local")
    version = skill.get("current_version", 0)
    print(f"  {skill['name']} (v{version}, {source})")

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment