Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

validate-session-schemas

БесплатноБез исполняемых скриптовНе проверен

Loop over recent local AI-coding session log files for every supported file-based platform (Copilot Chat, Copilot CLI, JetBrains, Claude Code, Gemini CLI…

rajbosот rajbos★ 127 звёзд на GitHub

Об этом скилле

Validate Session Schemas Skill

Validates that recent session log files on the current machine still match the schema our parsers expect, per supported platform, and surfaces new fields that appeared on disk but aren't documented/used yet.

It answers two questions in one pass:

  1. Did anything break? — Drift detection against a small set of fields our parsers actually depend on ("contracts"). A missing required field on an observed record type is a DRIFT failure.
  2. Is there new information to use? — Any field observed on disk that is not in the known baseline ("knownFields") is reported as a new field. These are candidates for new features or better token attribution (e.g. real token counts, new model metadata, new event types).

Why this skill exists

The pre-existing copilot-log-analysis skill (analyze-session-schema.ps1) only covered VS Code Copilot Chat JSON + Copilot CLI JSONL + OpenCode, with crude substring-based "new field" detection. It did not loop per supported platform, had no recency window, and didn't cover JetBrains, Claude Code, Gemini CLI, or Antigravity. This skill closes that gap.

Platforms covered

The source of truth for supported platforms is src/adapters/adapterRegistry.ts. This skill validates the file-based JSON/JSONL ecosystems that have schema docs under docs/logFilesSchema/:

Platform id Editor / tool Format Discovery root
copilot-chat VS Code Copilot Chat json / jsonl VS Code variants workspaceStorage/*/chatSessions, globalStorage
copilot-cli Copilot CLI jsonl ~/.copilot/session-state/
jetbrains JetBrains Copilot jsonl ~/.copilot/jb/{uuid}/partition-*.jsonl
claude-code Claude Code jsonl ~/.claude/projects/{hash}/*.jsonl
gemini-cli Gemini CLI jsonl ~/.gemini/tmp/*/chats/session-*.jsonl
antigravity Antigravity jsonl ~/.gemini/antigravity/brain/*/.system_generated/logs/transcript.jsonl
opencode OpenCode json / jsonl <xdg-data>/opencode/storage/session/**/ses_*.json; also opencode.db (SQLite, via node:sqlite)
mistral-vibe Mistral Vibe (CLI + Vibe Desktop) json <VIBE_HOME or ~/.vibe>/logs/session/*/meta.json and .../unified/<uuid>/meta.json (only meta.json; messages.jsonl is never read). Desktop sessions are the unified ones with runtime_path: "session_api"

Not validated by this skill (DB / binary formats that need the adapters' own parsers, so a generic JSON walker can't read them): crush (SQLite), visual-studio (MessagePack), continue, claude-desktop.

OpenCode's opencode.db is opened read-only. Only the DB sessions that land in the platform's --days / --max window (ranked together with legacy JSON sessions; a session in both stores is analyzed once, from the DB) are exported, as temporary JSONL files in a fresh oc-dbses-* directory under the OS temp dir. That directory is removed when the run ends — in a finally, so also on errors, and before exiting on Ctrl-C / SIGTERM / SIGHUP. Other sessions are counted, not copied. The report labels exported entries …/opencode.db [session <id>]. Recent sessions whose id fails validation are skipped and noted; if nothing recent is left to analyze, the platform reports INCONCLUSIVE. They are listed in the report under "Not validated" so coverage is never silently overstated. If you add a new file-based adapter, add a discovery function + a schema-baselines.json entry here too.

Usage

# Validate every platform's recent sessions (last 30 days, 5 files each)
node .github/skills/validate-session-schemas/validate-session-schemas.js

# Widen the window and look at more files
node .github/skills/validate-session-schemas/validate-session-schemas.js --days 60 --max 10

# One platform only
node .github/skills/validate-session-schemas/validate-session-schemas.js --platform claude-code

# Machine-readable output (for CI / further processing)
node .github/skills/validate-session-schemas/validate-session-schemas.js --json

# Refresh the "known fields" snapshot from what's on disk (does NOT touch contracts)
node .github/skills/validate-session-schemas/validate-session-schemas.js --update-baseline

# Include truncated example values (may contain user content — off by default)
node .github/skills/validate-session-schemas/validate-session-schemas.js --include-examples

Options

Flag Meaning
--days N Only consider files modified within the last N days (default 30; 0 = no limit)
--max N Analyze at most N most-recent files per platform (default 5)
--platform <id> Validate a single platform
--update-baseline Rewrite knownFields from observed fields; never modifies contracts
--include-examples Capture truncate
Полный SKILL.md на GitHub

Установить validate-session-schemas в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл validate-session-schemas?

Loop over recent local AI-coding session log files for every supported file-based platform (Copilot Chat, Copilot CLI, JetBrains, Claude Code, Gemini CLI, Antigravity, OpenCode, Mistral Vibe) and validate they still match the documented schema, while surfacing newly-discovered fields we could start using. Use after an editor/CLI update, when adding a parser, or on a schedule to catch schema drift early.

Как установить скилл validate-session-schemas?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл validate-session-schemas запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить validate-session-schemas с