Xpersona
S

self-improving-analytics

CLAWHUB · Unverified

Captures data quality issues, metric drift, pipeline failures, misleading visualizations, metric definition mismatches, and data freshness problems to enable continuous analytics improvement. Use when: (1) An ETL/ELT pipeline fails, (2) A metric value shows anomalous behavior, (3) Two teams define the same metric differently, (4) A dashboard shows wrong or misleading data, (5) A data freshness SLA is missed, (6) A schema change breaks downstream consumers.

62
Rank
84
Safety
1.0k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17bzpdy0evfmqz6nx069npr3n84p7f2:self-improving-analytics
  1. Install using `clawhub skill install s17bzpdy0evfmqz6nx069npr3n84p7f2:self-improving-analytics` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/jose-compu/self-improving-analytics before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-jose-compu-self-improving-analytics/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

145,147 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: self-improving-analytics
description: "Captures data quality issues, metric drift, pipeline failures, misleading visualizations, metric definition mismatches, and data freshness problems to enable continuous analytics improvement. Use when: (1) An ETL/ELT pipeline fails, (2) A metric value shows anomalous behavior, (3) Two teams define the same metric differently, (4) A dashboard shows wrong or misleading data, (5) A data freshness SLA is missed, (6) A schema change breaks downstream consumers."
---

# Self-Improving Analytics Skill

Log analytics-specific learnings, data issues, and feature requests to markdown files for continuous improvement. Captures data quality problems, metric drift, pipeline failures, misleading visualizations, metric definition mismatches, and data freshness breaches. Important learnings get promoted to data dictionaries, metric definitions, pipeline runbooks, dashboard standards, or data quality SLAs.

## First-Use Initialisation

Before logging anything, ensure the `.learnings/` directory and files exist in the project or workspace root. If any are missing, create them:

```bash
mkdir -p .learnings
[ -f .learnings/LEARNINGS.md ] || printf "# Analytics Learnings\n\nData quality patterns, metric drift insights, pipeline reliability findings, visualization best practices, and governance lessons.\n\n**Categories**: data_quality | metric_drift | pipeline_failure | visualization_mislead | definition_mismatch | freshness_issue\n**Areas**: ingestion | transformation | modeling | reporting | visualization | governance | data_catalog\n\n---\n" > .learnings/LEARNINGS.md
[ -f .learnings/DATA_ISSUES.md ] || printf "# Data Issues Log\n\nPipeline failures, data quality problems, metric anomalies, visualization errors, and schema drift.\n\n---\n" > .learnings/DATA_ISSUES.md
[ -f .learnings/FEATURE_REQUESTS.md ] || printf "# Feature Requests\n\nAnalytics tools, BI capabilities, data quality automation, and governance improvements.\n\n---\n" > .learnings/FEATURE_REQUESTS.md
```

Never overwrite existing files. This is a no-op if `.learnings/` is already initialised.

Do not log connection strings, database credentials, API keys, or PII. Prefer short summaries or redacted excerpts over raw query results or full table dumps.

If you want automatic reminders, use the opt-in hook workflow described in [Hook Integration](#hook-integration).

## Quick Reference

| Situation | Action |
|-----------|--------|
| ETL/ELT pipeline fails | Log to `.learnings/DATA_ISSUES.md` with pipeline name and error |
| Metric value anomaly (spike/drop) | Log to `.learnings/DATA_ISSUES.md` with statistical context |
| Two teams define metric differently | Log to `.learnings/LEARNINGS.md` with category `definition_mismatch` |
| Dashboard shows wrong or misleading data | Log to `.learnings/LEARNINGS.md` with category `visualization_mislead` |
| Data freshness SLA missed | Log to `.learnings/DATA_ISSUES.md` with SLA threshold and actual delay |
| Schema c

_meta.json

{
  "ownerId": "kn78jat5kd20evgyxzp9dmryax84qap0",
  "slug": "self-improving-analytics",
  "version": "1.1.2",
  "publishedAt": 1790688113300
}

references/examples.md

# Entry Examples

Concrete examples of well-formatted analytics entries with all fields.

## Learning: Data Quality (NULL Values After Migration)

```markdown
## [LRN-20250415-001] data_quality

**Logged**: 2025-04-15T10:30:00Z
**Priority**: high
**Status**: pending
**Area**: ingestion

### Summary
NULL values in user_id column after source system migration from Oracle to PostgreSQL

### Details
Source system migration changed the user table's primary key generation strategy. The Oracle
sequence-based IDs were replaced with PostgreSQL UUIDs, but the ETL pipeline's NOT NULL
validation was applied after a type-cast step that silently converted empty strings to NULLs.
The old Oracle export never produced empty strings for user_id, so the pipeline had no guard
against this scenario. 14,000 rows (2.3% of daily load) arrived with NULL user_id over 3 days
before the freshness monitor caught the downstream impact.

### SQL Example

**Before (no guard):**
\`\`\`sql
INSERT INTO warehouse.dim_users (user_id, name, email)
SELECT
    CAST(src.user_id AS VARCHAR(64)),
    src.name,
    src.email
FROM staging.users_raw src
\`\`\`

**After (with validation):**
\`\`\`sql
INSERT INTO warehouse.dim_users (user_id, name, email)
SELECT
    CAST(src.user_id AS VARCHAR(64)),
    src.name,
    src.email
FROM staging.users_raw src
WHERE src.user_id IS NOT NULL
    AND TRIM(src.user_id) <> ''
\`\`\`

### Suggested Action
Add NOT NULL and non-empty validation at ingestion layer before any transformations.
Add a dbt test `not_null` on user_id in the staging model. Set up NULL rate alerting
with threshold >0.1% for key identifier columns.

### Metadata
- Source: etl_failure
- Pipeline: Airflow DAG `ingest_users_daily`
- Warehouse: Snowflake
- Related Tables: staging.users_raw, warehouse.dim_users
- Tags: null, migration, oracle, postgresql, data-quality, ingestion
- Pattern-Key: data_quality.null_after_migration

---
```

## Learning: Definition Mismatch (Active User)

```markdown
## [LRN-20250416-001] definition_mismatch

**Logged**: 2025-04-16T09:00:00Z
**Priority**: high
**Status**: pending
**Area**: governance

### Summary
Marketing defines "active user" as any login within 30 days; Product uses 7-day window

### Details
Executive dashboard showed 420K "active users" (Marketing's number) while the Product
team reported 185K to the board. The discrepancy caused a board-level escalation. Root
cause: two independent dbt models (`mart_marketing.active_users` and `mart_product.active_users`)
use different lookback windows without documenting the distinction. Marketing counts
any user who logged in within 30 days. Product counts users with at least one
feature-interaction event within 7 days. Neither model's documentation specified the
window, and both were labeled "Active Users" in Looker.

### SQL Example

**Marketing definition:**
\`\`\`sql
SELECT COUNT(DISTINCT user_id) AS active_users
FROM events.logins
WHERE login_at >= CURRENT_DATE - INTERVAL '30 days'
\`\`\`

**Product

references/hooks-setup.md

# Hook Setup Guide

Configure automatic analytics self-improvement triggers for AI coding agents.

## Overview

Hooks enable proactive analytics-pattern capture by injecting reminders at key moments:
- **UserPromptSubmit**: Reminder after matching prompts to evaluate analytics learnings
- **PostToolUse (Bash)**: Error detection when pipeline commands, SQL queries, or data tools fail

## Claude Code Setup

### Option 1: Project-Level Configuration

Create `.claude/settings.json` in your project root:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "ETL|pipeline|metric|dashboard|freshness|schema|lineage|warehouse",
        "hooks": [
          {
            "type": "command",
            "command": "./skills/self-improving-analytics/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

### Option 2: User-Level Configuration (discouraged)

Do **not** install this hook globally. User-level hooks persist across all repositories and sessions. Keep hooks project-scoped. The example below is shown only so you can recognize and remove it:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "ETL|pipeline|metric|dashboard|freshness|schema|lineage|warehouse",
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/skills/self-improving-analytics/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

### Minimal Setup (Activator Only)

For lower overhead, use only the UserPromptSubmit hook:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "ETL|pipeline|metric|dashboard|freshness|schema|lineage|warehouse",
        "hooks": [
          {
            "type": "command",
            "command": "./skills/self-improving-analytics/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

## Codex CLI Setup

Codex uses the same hook system. Create `.codex/settings.json`:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "ETL|pipeline|metric|dashboard|freshness|schema|lineage|warehouse",
        "hooks": [
          {
            "type": "command",
            "command": "./skills/self-improving-analytics/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

## GitHub Copilot Setup

Copilot doesn't support hooks. Add guidance to `.github/copilot-instructions.md`:

```markdown
## Analytics Self-Improvement

After solving non-obvious data issues, consider logging to `.learnings/`:
- Pipeline failures, data quality issues, metric anomalies → DATA_ISSUES.md
- Metric drift, definition mismatches, visualization issues → LEARNINGS.md
- Tool/capability requests → FEATURE_REQUESTS.md

Promote recurring patterns to data dictionaries, pipeline runbooks, or dashboard standards.
```

## Verification

### Test Activator Hook

1. Enable the hook configuration
2. Start a new Claude Code session
3. Send a prompt that matches the domain matcher
4. Verify you see `<analytics-self-improve

references/openclaw-integration.md

# OpenClaw Integration

Complete setup and usage guide for integrating the self-improving-analytics skill with OpenClaw.

## Overview

OpenClaw uses workspace-based prompt injection combined with event-driven hooks. Context is injected from workspace files at session start, and hooks can trigger on lifecycle events.

## Workspace Structure

```
~/.openclaw/
├── workspace/                   # Working directory
│   ├── AGENTS.md               # Multi-agent coordination patterns
│   ├── SOUL.md                 # Behavioral guidelines and personality
│   ├── TOOLS.md                # Tool capabilities and gotchas
│   ├── MEMORY.md               # Long-term memory (main session only)
│   └── memory/                 # Daily memory files
│       └── YYYY-MM-DD.md
├── skills/                      # Installed skills
│   └── self-improving-analytics/
│       └── SKILL.md
└── hooks/                       # Custom hooks
    └── self-improving-analytics/
        ├── HOOK.md
        └── handler.ts
```

## Quick Setup

### 1. Install the Skill

```bash
clawdhub install self-improving-analytics
```

Or copy manually:

```bash
cp -r self-improving-analytics ~/.openclaw/skills/
```

### 2. Install the Hook (Optional)

```bash
mkdir -p .openclaw/hooks
cp -r hooks/openclaw .openclaw/hooks/self-improving-analytics
```

### 3. Create Learning Files

```bash
mkdir -p ~/.openclaw/workspace/.learnings
```

## Promotion Targets (Analytics-Specific)

When analytics learnings prove broadly applicable, promote them to workspace files:

| Learning Type | Promote To | Example |
|---------------|------------|---------|
| Metric definitions | Data dictionary | "Active user = login within 7 days, feature interaction" |
| Pipeline failure patterns | Pipeline runbooks | "DST partition handling for hourly ingestion" |
| Visualization standards | Dashboard style guide | "Absolute value charts must start Y-axis at zero" |
| Data quality rules | Data quality SLAs | "NULL rate in key columns must be <0.1%" |
| Governance patterns | `AGENTS.md` | "New metrics require data dictionary entry before dashboard" |
| Tool configuration | `TOOLS.md` | "dbt source freshness checks required on all external sources" |

### Promotion Decision Tree

```
Is the learning project-specific?
├── Yes → Keep in .learnings/
└── No → Is it a metric definition?
    ├── Yes → Promote to data dictionary
    └── No → Is it a pipeline reliability pattern?
        ├── Yes → Promote to pipeline runbook
        └── No → Is it a visualization standard?
            ├── Yes → Promote to dashboard style guide
            └── No → Promote to data quality SLAs or TOOLS.md
```

## Analytics-Specific Detection Triggers

| Trigger | Action | Target |
|---------|--------|--------|
| ETL/ELT job failure | Log data issue | DATA_ISSUES.md |
| Data freshness breach | Log data issue with SLA details | DATA_ISSUES.md |
| Metric value anomaly | Log data issue with statistical context | DATA_ISSUES.md |
| NULL rate spike | Log data is

Sponsored

Ads related to self-improving-analytics and adjacent AI workflows.