↓ Skip to main content

Skill Analytics SQLite Schema Reference #

The Skill Analytics database (skill_analytics.db) is provisioned and maintained automatically by scripts/analyze.py. All tables, indexes, and analytical views are created during sync operations.


1. Relational Tables #

skills_inventory #

Stores every discovered skill across built-in, plugin, global, workspace, and catalog tiers along with its Tier-1 routing token footprint (name + description) and Tier-2 body metrics.

ColumnTypeConstraintsDescription
skill_nameTEXTPRIMARY KEYCanonical kebab-case skill identifier
source_tierTEXTNOT NULLInstallation tier (builtin, plugin, global, workspace, catalog)
source_originTEXTNOT NULLPlugin name, catalog repository, or scope origin
categoryTEXTSkill category (agents, analytics, coding, game-dev, media, writing)
versionTEXTSemantic version from frontmatter (0.5.0, unversioned)
descriptionTEXTFull Tier-1 routing description string
skill_pathTEXTLocal path or canonical remote URL
is_always_in_promptINTEGERNOT NULL, DEFAULT 01 if injected into the system prompt <skills> block on every turn; 0 if JIT-only
tier1_charsINTEGERNOT NULL, DEFAULT 0Character count of name + description
tier1_tokens_estINTEGERNOT NULL, DEFAULT 0Estimated Tier-1 routing token tax per turn
tier2_linesINTEGERNOT NULL, DEFAULT 0Line count of SKILL.md body
tier2_tokens_estINTEGERNOT NULL, DEFAULT 0Estimated Tier-2 instruction token count when loaded
synced_atTEXTNOT NULLISO-8601 UTC timestamp of inventory scan

conversations #

Stores conversation-level metadata across the union of conversation_summaries.db and brain/ transcript directories.

ColumnTypeConstraintsDescription
conversation_idTEXTPRIMARY KEYUUID of the agent conversation
titleTEXTConversation summary title
workspace_urisTEXTActive workspace URI(s)
git_origin_urlsTEXTParent conversation ID or git origin metadata
created_atTEXTISO-8601 creation timestamp
updated_atTEXTISO-8601 last modified timestamp
first_step_atTEXTTimestamp of earliest step in transcript
last_step_atTEXTTimestamp of latest step in transcript
total_stepsINTEGERDEFAULT 0Total steps parsed in transcript
user_input_stepsINTEGERDEFAULT 0Count of USER_INPUT steps
planner_stepsINTEGERDEFAULT 0Count of PLANNER_RESPONSE steps
has_transcriptINTEGERDEFAULT 01 if transcript.jsonl or transcript_full.jsonl exists on disk
has_summary_dbINTEGERDEFAULT 01 if indexed in conversation_summaries.db
ingested_atTEXTNOT NULLISO-8601 UTC ingestion timestamp

ingestion_state #

Tracks file size, modification timestamp (mtime_ns), and SHA-256 head watermarks per conversation for fast incremental syncing.

ColumnTypeConstraintsDescription
conversation_idTEXTPRIMARY KEYConversation UUID
transcript_pathTEXTNOT NULLPath to transcript file
file_size_bytesINTEGERNOT NULLCombined byte size of compact and full transcripts
file_mtime_nsINTEGERNOT NULLLatest modification time in nanoseconds
last_step_indexINTEGERNOT NULLHighest step_index ingested
sha256_headTEXTNOT NULLSHA-256 digest of leading 64 KB
updated_atTEXTNOT NULLISO-8601 UTC watermark update time

skill_events #

Stores every extracted skill activation, companion resource view, CLI subcommand execution, script run, and user prompt notation (::skill, //skill, :?, /skill).

ColumnTypeConstraintsDescription
idINTEGERPRIMARY KEY AUTOINCREMENTUnique event ID
conversation_idTEXTNOT NULLConversation UUID
step_indexINTEGERNOT NULLStep index within the transcript
step_created_atTEXTISO-8601 UTC step timestamp
step_typeTEXTNOT NULLUSER_INPUT or PLANNER_RESPONSE
invocation_kindTEXTNOT NULLdirect_skill_view, skill_resource_view, cli_invocation, or user_notation
notation_typeTEXTFor user_notation: modern_::, classic_//, find_:?
subcommandTEXTSubcommand or action (load, find, learn, run, script_exec, show, list, status, update, forget, catalog, view_file)
target_skillTEXTTarget skill name (or comma-joined list for rejected multi-skill batches)
raw_argsTEXTParsed CLI arguments or file path
subpath_or_scriptTEXTLoaded subpath (references/...), script name, --load, or search query
page_numberINTEGERDEFAULT 1Page number for paginated kungfu load -p N calls
trigger_modeTEXTDEFAULT 'autonomous'autonomous (frontmatter description match), user_explicit (::, //, /), or rule_driven
source_tierTEXTbuiltin, plugin, global, workspace, kungfu_cli, direct_script, user_prompt, repo_authoring
raw_snippetTEXTNOT NULLCommand line or prompt excerpt
is_self_testINTEGERDEFAULT 01 if development self-test or repo authoring inspection; 0 for production usage

state_telemetry_snapshot #

Stores a snapshot of ~/.config/kungfu/state.json history counters for drift comparison and deterministic backfilling.

ColumnTypeConstraintsDescription
skill_nameTEXTPRIMARY KEYSkill name in state.json
recorded_countINTEGERNOT NULLload_count in state.json
page_load_countINTEGERNOT NULL, DEFAULT 0Continuation page loads (-p 2+)
subpath_load_countINTEGERNOT NULL, DEFAULT 0Companion subpath loads (skill/references/...)
run_countINTEGERNOT NULL, DEFAULT 0Bundled script executions (kungfu run)
last_loaded_atTEXTNOT NULLlast_seen_at ISO-8601 timestamp
is_learnedINTEGERNOT NULL, DEFAULT 01 if currently installed in global or workspace scope
snapshot_atTEXTNOT NULLISO-8601 UTC snapshot timestamp

2. Analytical SQL Views #

View NameDescription
v_skill_roiJoins skills_inventory and skill_events to compute Context-Tax vs. Activation ROI (SHELFWARE_CANDIDATE, LOW_ROI_GLOBAL, PROMOTE_TO_GLOBAL, ACTIVE_GLOBAL, HEALTHY_JIT).
v_trigger_attributionBreaks down activations per skill by autonomous_activations, explicit_activations, rule_activations, autonomous_share_pct, and trigger_health (NEEDS_DESCRIPTION_TUNING, WEAK_AUTONOMOUS_TRIGGER, HEALTHY_TRIGGER).
v_daily_invocationsDaily time-series of events grouped by day, invocation_kind, and action.
v_subcommand_summaryAggregate counts, production vs. self-test split, conversation reach, and first/last seen timestamps by invocation_kind and action.
v_search_gapsRanks kungfu find and :? search queries by whether they led to a subsequent skill load (led_to_load_count).
v_skill_telemetry_driftCompares state.json load_count against mined CLI primary loads, learn --load, and direct SKILL.md views with diagnostic classifications.
kungfu_invocationsCompatibility projection over skill_events.