Ct Metrics Store

by jamiegrand

data

SQLite-based metrics storage for SEO time-series data

Skill Details

Repository Files

1 file in this skill directory


name: ct-metrics-store version: 1.0.0 description: SQLite-based metrics storage for SEO time-series data tags: [data, storage, metrics] status: active

Metrics Store

SQLite-based metrics storage skill for SEO time-series data. Provides persistent storage for audit results, keyword caches, and GSC snapshots with trend analysis capabilities.

Capabilities

  • Audit History (audit-history): Store and retrieve audit scores over time
  • Keyword Cache (keyword-cache): Cache keyword research data with TTL
  • GSC Snapshots (gsc-snapshots): Store Search Console data for trending
  • Trend Analysis (trend-analysis): Calculate score trends and changes

Database Location

.cleo-web/metrics.db

Schema

Audit Results Table

CREATE TABLE audit_results (
  id INTEGER PRIMARY KEY,
  page_path TEXT NOT NULL,
  url TEXT,
  audit_type TEXT NOT NULL,
  overall_score INTEGER,
  onpage_score INTEGER,
  eeat_score INTEGER,
  content_score INTEGER,
  ai_score INTEGER,
  linking_score INTEGER,
  multimedia_score INTEGER,
  target_keyword TEXT,
  findings_json TEXT,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX idx_audit_page ON audit_results(page_path);
CREATE INDEX idx_audit_date ON audit_results(created_at);

Keyword Cache Table

CREATE TABLE keyword_cache (
  keyword TEXT PRIMARY KEY,
  search_volume INTEGER,
  difficulty INTEGER,
  cpc REAL,
  competition TEXT,
  serp_features_json TEXT,
  paa_json TEXT,
  related_json TEXT,
  cached_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  expires_at DATETIME
);

CREATE INDEX idx_keyword_expires ON keyword_cache(expires_at);

GSC Snapshots Table

CREATE TABLE gsc_snapshots (
  id INTEGER PRIMARY KEY,
  snapshot_date DATE NOT NULL,
  page_path TEXT NOT NULL,
  query TEXT,
  impressions INTEGER,
  clicks INTEGER,
  position REAL,
  ctr REAL,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX idx_gsc_date ON gsc_snapshots(snapshot_date);
CREATE INDEX idx_gsc_page ON gsc_snapshots(page_path);

Inputs

Input Required Description
AUDIT_DATA For store Audit result object to store
KEYWORD_DATA For cache Keyword data to cache
GSC_DATA For snapshot GSC data to store
PAGE_PATH For query Filter by page path
DATE_RANGE No Date range for queries

Outputs

Audit History

{
  "page_path": "/blog/my-post",
  "history": [
    {
      "date": "2026-01-24",
      "overall_score": 72,
      "scores": { "onpage": 16, "eeat": 18, ... }
    },
    {
      "date": "2026-01-10",
      "overall_score": 65,
      "scores": { "onpage": 14, "eeat": 16, ... }
    }
  ],
  "trend": {
    "direction": "improving",
    "change": +7,
    "period": "14 days"
  }
}

Cache Status

{
  "keyword": "astro framework",
  "cached": true,
  "cached_at": "2026-01-23T10:00:00Z",
  "expires_at": "2026-01-30T10:00:00Z",
  "data": { ... }
}

Cache TTL Configuration

Data Type Default TTL Configurable
Keyword search volume 7 days Yes
SERP data 24 hours Yes
PAA questions 3 days Yes
Difficulty scores 14 days Yes
GSC snapshots Permanent No
Audit results Permanent No

Operations

Store Audit Result

// Internal operation
storeAudit({
  page_path: "/blog/post",
  overall_score: 72,
  scores: { onpage: 16, ... },
  findings: [...]
});

Get Audit Trend

// Returns score history for trend analysis
getAuditTrend("/blog/post", { days: 30 });

Cache Keyword Data

// Store with automatic TTL
cacheKeyword("astro framework", {
  volume: 12100,
  difficulty: 45
});

Query GSC History

// Get historical GSC data
getGSCHistory("/blog/post", {
  startDate: "2025-12-01",
  endDate: "2026-01-24"
});

Maintenance

Cleanup Expired Cache

# Run via /setup maintenance
sqlite3 .cleo-web/metrics.db "DELETE FROM keyword_cache WHERE expires_at < datetime('now')"

Backup Database

# Automatic backup before modifications
cp .cleo-web/metrics.db .cleo-web/metrics.db.bak

Example Usage

Get Page Score History

/metrics history /blog/my-post

Check Keyword Cache

/metrics cache "astro framework"

View Score Trends

/metrics trends --days 30

Clear Expired Cache

/setup maintenance --clear-cache

Integration

With ct-seo-auditor

Automatically stores all audit results:

  • Enables before/after comparisons
  • Powers trend analysis
  • Supports batch reporting

With ct-gsc-analyst

Caches GSC data for:

  • Faster repeated queries
  • Historical trend analysis
  • Offline reference

With ct-content-strategist

Caches keyword research:

  • Reduces API calls
  • Enables offline keyword lookup
  • Powers suggestion features

Dependencies

  • None (core storage skill)
  • Uses SQLite (bundled with system)

Related Skills

Xlsx

Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas

data

Clickhouse Io

ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.

datacli

Clickhouse Io

ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.

datacli

Analyzing Financial Statements

This skill calculates key financial ratios and metrics from financial statement data for investment analysis

data

Data Storytelling

Transform data into compelling narratives using visualization, context, and persuasive structure. Use when presenting analytics to stakeholders, creating data reports, or building executive presentations.

data

Kpi Dashboard Design

Design effective KPI dashboards with metrics selection, visualization best practices, and real-time monitoring patterns. Use when building business dashboards, selecting metrics, or designing data visualization layouts.

designdata

Dbt Transformation Patterns

Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.

testingdocumenttool

Sql Optimization Patterns

Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.

designdata

Anndata

This skill should be used when working with annotated data matrices in Python, particularly for single-cell genomics analysis, managing experimental measurements with metadata, or handling large-scale biological datasets. Use when tasks involve AnnData objects, h5ad files, single-cell RNA-seq data, or integration with scanpy/scverse tools.

arttooldata

Xlsx

Spreadsheet toolkit (.xlsx/.csv). Create/edit with formulas/formatting, analyze data, visualization, recalculate formulas, for spreadsheet processing and analysis.

tooldata

Skill Information

Category:Data
Version:1.0.0
Last Updated:1/25/2026