KLineChartQuant: Skill for OpenCode

.opencode/skills/kline-blur-regression/SKILL.md

kline-blur-regression is a skill for OpenCode from 363045841/KLineChartQuant. It costs 47 tokens per session (857 once invoked), scanned A, original, MIT.

A debugging guide for blurry financial line charts drawn on HTML canvas. A K-line chart is a candlestick-style price chart used in trading software.

In plain words
What is it for?
Use it to investigate blur regressions, compare a working and broken commit, inspect canvas sizing and device-pixel-ratio handling, and test a small rendering fix.
Why use it?
It narrows the investigation to selected commits and focuses on how canvas pixels map to screen pixels, especially when browser scaling is fractional or developer tools change the window size.

Skill for OpenCode

Written for OpenCode: installed under .opencode/.

This is 363045841/KLineChartQuant's own configuration. It tells OpenCode how to work on KLineChartQuant itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything KLineChartQuant configures →

Reuse

Borrowing it

Nothing to install: this file belongs to 363045841/KLineChartQuant. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/363045841/KLineChartQuant/main/.opencode/skills/kline-blur-regression/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/363045841/KLineChartQuant

Made for: OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kline-blur-regression

README.md
[![agentmods](https://agentmods.dev/badge/skills/363045841/klinechartquant/kline-blur-regression/github.svg)](https://agentmods.dev/skills/363045841/klinechartquant/kline-blur-regression)
Your own site
<a href="https://agentmods.dev/skills/363045841/klinechartquant/kline-blur-regression"><img src="https://agentmods.dev/badge/skills/363045841/klinechartquant/kline-blur-regression/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kline-blur-regression

Your own site · 80×15
<a href="https://agentmods.dev/skills/363045841/klinechartquant/kline-blur-regression"><img src="https://agentmods.dev/badge/skills/363045841/klinechartquant/kline-blur-regression.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 857 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00047 $0.00857
Opus 5 $0.00023 $0.00428
Sonnet 5 $0.00009 $0.00171
Haiku 4.5 $0.00005 $0.00086

Measured 9d ago against content hash 4f155d2882ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

kline-blur-regression scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.opencode/skills/kline-blur-regression/SKILL.md · 94 lines

What it actually says

K-line Blur Regression Skill

Goal

快速定位并修复这类回归:

  • 正常时清晰,打开控制台/调整窗口后变糊;
  • 多见于非整数 DPR(如 1.25, 1.5, 1.75);
  • 用户要求“只在指定提交范围内找问题”。

When to use

触发关键词:

  • “打开控制台后 K 线模糊/发糊”
  • “DevTools 打开后变虚”
  • “非整数 DPR 模糊”
  • “只在某几个提交中排查”

Core principles

  1. 先定界再分析:严格按用户给的 commit 范围排查,不扩面。
  2. 优先查像素映射链路:Canvas backing store 尺寸、CSS 尺寸、ctx.scale(dpr,dpr) 是否一致。
  3. 最小修复:只改引入回归的 hunk,避免连带“优化”。

Investigation checklist

1) Build bounded diff

  • 列出 commit 区间变更文件:
    • git diff --name-only <good_commit>..<bad_commit>
  • 先看渲染核心路径:
    • src/core/paneRenderer.ts
    • src/core/chart.ts
    • src/core/renderers/yAxis.ts
    • src/utils/kLineDraw/axis.ts
    • src/core/renderers/Indicator/scale/*.ts

2) Prioritize high-risk patterns

重点检索以下改动:

  • canvas.width/heightstyle.width/height 计算方式变化;
  • Math.round(...) 替换 roundToPhysicalPixel(...)
  • setTransform/scale 调用顺序变化;
  • 轴宽来源从配置改为 canvas.width / dpr(或反之)。

3) Validate with minimal A/B

  • 在 bad commit 复现;
  • 只回滚单个可疑 hunk 再验证;
  • 若恢复清晰,确认根因成立。

Known fix pattern (this repo)

本仓库一次已验证根因:PaneRenderer.resize() 中 CSS 尺寸策略改变导致非整数 DPR 下重采样风险上升。
修复方式(最小回退)是恢复:

plotCanvas.style.width = `${plotCanvas.width / dpr}px`
plotCanvas.style.height = `${plotCanvas.height / dpr}px`
yAxisCanvas.style.width = `${yAxisCanvas.width / dpr}px`
yAxisCanvas.style.height = `${yAxisCanvas.height / dpr}px`

而不是固定写逻辑尺寸:

plotCanvas.style.width = `${width}px`
plotCanvas.style.height = `${height}px`

Guardrails

  • 不要把“用户限定范围外”的问题混入本次结论。
  • 不要顺手改 unrelated 文件。
  • 不要在未复现时给出肯定根因。

Verification steps

  1. 在非整数 DPR 环境(或系统缩放 125%/150%)运行。
  2. 记录打开 DevTools 前后 K 线清晰度是否变化。
  3. 触发一次 resize(拖动窗口/切换布局)。
  4. 确认修复后仍清晰,且无新错位(右轴/十字线/网格)。

Response template

  • 先给“结论 + 文件行位点”;
  • 再给“为什么只改这处”;
  • 最后给“如何验证复现已消失”。
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 94 lines · 47 tokens per session scan A 4f155d2882ba

Subscribe to this mod's changes

kline-blur-regression is a skill published in the GitHub repository 363045841/KLineChartQuant (24 stars, last pushed today), licensed MIT. It adds 47 tokens to every session and 857 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

update-skills

Create or update repository skills and instructions when major learnings are discovered during a session. Use when the user says "learn!", when a significant pattern or pitfall is identified, or when reusable domain knowledge should be captured for future sessions.

microsoft/vscode · 51 tokens

github-copilot-upgrader

Use this to update the Github Copilot CLI/SDK.

microsoft/vscode · 18 tokens

commit

Commit staged or unstaged changes with an AI-generated commit message that matches the repository's existing commit style. Use when the user asks to 'commit', 'commit changes', 'create a commit', 'save my work', or 'check in code'.

microsoft/vscode · 52 tokens

sync

Sync the current session branch with its upstream branch, or publish the current session branch to a remote. Use when the user asks to sync a branch, pull latest changes, rebase onto upstream, push current branch, publish branch, or set upstream.

microsoft/vscode · 52 tokens

merge

Merge changes from the topic branch to the merge base branch. Use when the user wants to merge their session's work back to the base branch.

microsoft/vscode · 31 tokens

draft-release-notes

Author the committed release-notes file for a Prisma 8 release (stable or 8.0.0-rc.N) by enumerating the merged PRs since the previous release v tag (stable or -rc.N), resolving opaque TML-NNNN: titles via Linear context (never copied verbatim), triaging public-worthiness, and writing categorized notes — breaking…

prisma/orm · 174 tokens