Subwave Log Analysisのロゴ

Subwave Log Analysis

コミュニティ人気
perminder-klair
subwave-log-analysis

Analyse the SUB/WAVE radio station's unified event log (state/logs/events-*.jsonl) and give the operator a diagnostic report on how the station is behaving — Navidrome/ Subsonic API call patterns, the DJ picker's behaviour and music-library coverage, and runtime health anomalies. Use this skill whenever the user wants to understand or get feedback on what the radio is doing under the hood: how Navidrome calls are being made and how often, why the picker keeps choosing certain tracks or artists, whether the library pool is too narrow, whether traces are failing or running slow, or asks things like "analyse the subwave logs", "check the radio's behaviour", "what is the picker doing", "why does it keep playing the same artists", "is the station healthy", "how are the navidrome calls looking", "give me feedback on the event log". Trigger this skill even if the user does not name the log file or the script — any request to diagnose, audit, review, or get feedback on SUB/WAVE's runtime behaviour from its logs belongs here.

概要

公開者perminder-klair
リポジトリsubwave
スキル名subwave-log-analysis
スター
1.4K
フォーク
122
同梱ファイル
3
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 3個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    perminder-klairがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Subwave Log Analysis」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/perminder-klair/subwave/tree/develop/.claude/skills/subwave-log-analysis
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/perminder-klair/subwave.git /tmp/subwave
mkdir -p .claude/skills
cp -r /tmp/subwave/.claude/skills/subwave-log-analysis .claude/skills/subwave-log-analysis
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでSubwave Log Analysisを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にSubwave Log Analysisを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Subwave Log Analysisは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

SUB/WAVE log analysis

What this is

The SUB/WAVE controller writes a unified, append-only event log to state/logs/events-YYYY-MM-DD.jsonl — one JSON object per line. It is the station's flight recorder: every LLM call, every agent tool call, every Navidrome/Subsonic API call, plus track plays and session boundaries. Events made inside one DJ decision share a traceId, so a decision and the calls it triggered read back as a single trace.

This skill turns that raw stream into a written diagnostic report for the operator, covering three lenses: Navidrome usage, picker/DJ quality, and health & anomalies. The job is to diagnose and recommend — describe what the logs show, then suggest concrete changes with reasoning.

A bundled script does the aggregation; your job is interpretation. Do not re-derive numbers by hand or eyeball the JSONL — run the script and reason about its output.

Step 1 — Run the analysis script

bash
python3 scripts/analyze_events.py [--state-dir DIR] [--since 24h] [--day YYYY-MM-DD]
  • --state-dir — path to the SUB/WAVE state/ directory. Omit it and the script auto-detects ./state or ../state, so from the subwave repo root it usually needs no argument. Pass it explicitly if the repo is elsewhere.
  • --since — narrow to a recent window: 6h, 24h, 3d, 1w. Use this when the user asks about "today", "the last few hours", "this week". Omit it to analyse everything on disk.
  • --day — pin to a single day's file.

The script prints a sectioned digest. Read all of it before writing anything.

If the script reports no events files: the unified log is written by the controller, and it is a recent addition — it only exists once the controller has been rebuilt with observability/events.js and has run. A controller restart is not enough; its source is baked in at build time. Tell the operator this rather than guessing. If the file exists but is nearly empty, the station simply hasn't been on air long — say so and analyse what little there is.

Step 2 — Interpret the digest

The digest is descriptive; the value you add is judgement. For each lens, here is what healthy looks like and why deviations matter.

Navidrome usage

The picker memoises most Subsonic calls for 30 minutes, so call volume is naturally bursty around decisions and quiet between them.

  • Error rate. Anything above ~0 warrants a look. A cluster of errors on one endpoint — especially upstream 522 — almost always means the controller's NAVIDROME_URL points at a Cloudflare-fronted public origin rather than the internal/Tailscale address. Liquidsoap works around this with a curl-based subhttp: protocol, but the controller's Subsonic API client does not — it should talk to Navidrome directly.
  • Latency. getSimilarSongs2 is the slowest Subsonic call by nature and is not memoised (it is per-track). If it dominates avg/p95 ms, that is expected — but if it also dominates decision latency (see picker section), the agent may be leaning on the similarSongs tool too hard.
  • Pool breadth. "Most-returned songs" is the key signal. A long, flat tail means the picker sees a wide slice of the library. A short, steep head — a handful of songs returned hundreds of times — means the candidate pool is narrow, which is the root cause of audible repetition.
  • Repeated identical calls. Within a 30-minute window these are cache misses or non-memoised calls (getSimilarSongs), which is normal. The same search3 with identical params fired many times in a short burst is different — it means the agent keeps re-searching the same terms within one decision, a sign of a confused tool loop.
  • Inside-a-trace ratio. A few untraced calls at the start are boot/context warm-up — expected. Ongoing untraced calls mean something outside a DJ decision is hitting Navidrome.

Picker / DJ quality

  • Navidrome & tool calls per decision. Two to five tool calls per pick is the designed range. Far more suggests the agent is thrashing; far fewer (and a high fallback rate) suggests it is not really exploring.
  • Decision latency. A pick fires when a track starts and must land before that track ends (~3–4 min). Sub-second to a few seconds is healthy. p95 or max creeping toward a minute is a dead-air risk — usually a slow LLM provider or slow Navidrome.
  • Agent vs fallback. agent succeeded should dominate. A high agent → fallback rate means the conversational picker keeps erroring or returning invalid track ids — cross-reference the failed-LLM errors in the health section. Frequent fallback means the agent is paying its cost without delivering; the model or provider may be too weak, or settings.llm.pickerAgent could be turned off to just use the reliable pool picker.
  • Tool mix. A wildly skewed mix (one tool doing everything) hints the agent has a blind spot — e.g. never using tracksByMood may mean mood tags are sparse, so that tool returns nothing and the agent learned to avoid it.
  • Repetition — the audible quality signal. "Artist repeated within 3 plays" and "most-aired artists" are what a listener actually notices. The agent is fed recent plays via the session window and is told not to repeat artists back-to-back, so persistent repetition is rarely the agent ignoring instructions — it is the candidate pool being too narrow to obey them. Trace it back to pool breadth in the Navidrome section.
  • Transitions. Printed only when the controller keeps the seam record. "Seams armed" is how each track came in, as the controller armed it. "After jingle/bed/break" means something played between the two songs and owned that seam. "DJ asked for" is the model's choice before any strip. "Dropped" pairs each lost effect with a reason code.
    • pair-fit dominating: the model is choosing effects the measured pair does not support. The coaching and the data disagree.
    • variety dominating: the model is stuck on one favourite effect.
    • switched-off: the operator turned an effect off that the model still asks for.
    • jingle-seam: chosen effects lost to a jingle placed between the songs.
    • Asks almost all normal: effects are offered but not used.

Health & anomalies

  • Failed traces / LLM calls. Read the error text. ECONNREFUSED on the Ollama host means the LLM box is down or unreachable. Auth/4xx errors point at provider keys in controller/.env.
  • Structured-output recoveries. A few are harmless — the recovery path salvaged malformed JSON. Many means the model is weak at structured output; a more capable model would cut them.
  • Slow decisions / slow Navidrome calls. Outliers worth naming, especially if they correlate with the failed or near-miss traces.

If the user wants to drill into one specific decision, every event in a trace shares a traceId — grep the JSONL for it to see that decision end to end.

Step 3 — Write the report

Deliver the findings as a written report in the conversation (no files). Lead with a short plain-language summary, then one section per lens. Under each finding that warrants action, give a recommendation with its reasoning — the operator wants to know why, not just what. Use this shape:

**SUB/WAVE log analysis — <time span, from the digest>**

<2–4 sentence summary: overall health, and the single most important thing
to address.>

### Navidrome usage
<Findings, quoting real figures from the digest.>
**Recommendation:** <concrete change + why. Omit if nothing is wrong.>

### Picker / DJ quality
<Findings.>
**Recommendation:** <...>

### Health & anomalies
<Findings, or "Nothing failing in this window.">
**Recommendation:** <...>

Ground every claim in the digest — quote the actual numbers. Do not invent metrics the script did not print. If a lens looks genuinely healthy, say so plainly rather than manufacturing a concern.

Recommendation playbook

Map common findings to the knob that addresses them. These are starting points — reason from the specific data, do not paste them verbatim.

FindingLikely causeRecommendation
Errors clustered on a Navidrome endpoint (esp. 522)Controller's NAVIDROME_URL is the Cloudflare originPoint NAVIDROME_URL in controller/.env at the internal/Tailscale Navidrome address
Narrow pool: short head of most-returned songs, few distinct artistsLibrary small, or mood tags sparse, or pool sources thinCheck library size; run the library tagger (npm run tag) so tracksByMood has data; review the 7 picker pool sources in music/picker.js
High artist repetition despite a wide libraryCandidate pool narrow at decision timeSame as above — broaden the pool; verify the recently-played exclusion window isn't starving choices
High agent → fallback rateAgent erroring or returning invalid idsRead the failed-LLM errors; consider a stronger model/provider in settings.llm, or disable settings.llm.pickerAgent to rely on the pool picker
Decision latency p95 approaching track lengthSlow LLM provider or slow NavidromeFaster provider/model; or reduce tool calls per decision
Many ai-sdk:recovery eventsModel weak at structured JSON outputSwitch to a more capable model in settings.llm
ECONNREFUSED / connection errors to the LLM hostOllama box down or wrong URLCheck the LLM host is up and settings.llm (provider/model/URL) is correct
Same search3 params repeated within one decisionAgent re-searching the same terms — confused tool loopNote it; if persistent, the picker prompt/tools in llm/tools.js may need tightening
Auto-playlist refresh dominating Navidrome volumeRefresh interval too aggressiveRaise AUTO_QUEUE_REFRESH_MINUTES in controller/.env (default 60)

Notes

  • This skill only reads logs — it never changes the running station.
  • The event log rotates daily; without --since or --day the script reads every events-*.jsonl on disk, so a long history is analysed at once. Use --since to keep a report focused on a recent window.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Subwave Log Analysis」では何ができますか?

Analyse the SUB/WAVE radio station's unified event log (state/logs/events-*.jsonl) and give the operator a diagnostic report on how the station is behaving — Navidrome/ Subsonic API call patterns, the DJ picker's behaviour and music-library coverage, and runtime health anomalies. Use this skill whenever the user wants to understand or get feedback on what the radio is doing under the hood: how Navidrome calls are being made and how often, why the picker keeps choosing certain tracks or artists, whether the library pool is too narrow, whether traces are failing or running slow, or asks thing...

TypingMindでSubwave Log Analysisを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Subwave Log Analysisはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにSubwave Log Analysisをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/perminder-klair/subwave/tree/develop/.claude/skills/subwave-log-analysisを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Subwave Log Analysisを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Subwave Log Analysisで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもSubwave Log Analysisを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Subwave Log Analysis」は無料ですか?

はい。perminder-klairがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇