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 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 3 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 perminder-klair 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Subwave Log Analysis AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

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

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

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,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Subwave Log Analysis。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Subwave Log Analysis 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 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.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Subwave Log Analysis AI 技能有什么作用?

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,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Subwave Log Analysis?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Subwave Log Analysis 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Subwave Log Analysis 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Subwave Log Analysis AI 技能免费吗?

是的。perminder-klair 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇