plugins/tools/cortex/skills/cortex-dashboard/SKILL.md
--- name: cortex-dashboard description: 渲染仪表盘 — 读 frontmatter view_query (dict) 查记忆/知识库/cron 数据源, 渲染 KPI + 图表 + Top-N + Legend, 注入 DASH:BEGIN/END 区, 不破坏正文。触发: "build dashboard" / "刷新仪表盘" / "仪表盘" / "dashboard" / daily cron。 disable-model-invocation: true allowed-tools: Bash Read Write Edit Glob --- # cortex-dashboard 读 `仪表盘/<page>.md` frontmatter `view_query` (dict) → 走对应 Bash 数据查询 → 按 `view_chart` 渲染 (KPI callout + chart + Top-N + Legend) → 注入 `<!-- DASH:BEGIN -->...<!-- DASH:END -->` 区, 不动正文与
npx skillsauth add lazygophers/ccplugin plugins/tools/cortex/skills/cortex-dashboardInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
读 仪表盘/<page>.md frontmatter view_query (dict) → 走对应 Bash 数据查询 → 按 view_chart 渲染 (KPI callout + chart + Top-N + Legend) → 注入 <!-- DASH:BEGIN -->...<!-- DASH:END --> 区, 不动正文与其他 frontmatter 字段。
单一真相: 本 SKILL 是 cron + slash 唯一规范, scripts/cron/dashboard.sh 与 commands/dashboard.md 只 thin 委托。
dashboard.sh (02:30) 或用户显式 "build dashboard" / "刷新仪表盘" / "/cortex:dashboard"Glob "仪表盘/*.md" (cap 20)view_query{kind, level?, limit?, window?} + view_chart + view_kpi[] + view_legend + view_stale_after (默认 24h)rendered_at, now - rendered_at < stale_after → skip (除 --force)view_query.kind 走 references/data-sources.md 8 种枚举 (memory / knowledge / ledger / cron / bridge / distribution / promotion / warden)N/A / — / 占位<!-- DASH:BEGIN rendered_at=<ISO> query_hash=<sha-8> -->...<!-- DASH:END --> 整段; 不存在则末尾追加{refreshed:[...], skipped:N, errors:[{path,reason}]}auto 后缀)--force=false (stale 跳过), cap=20, 数据源缺 → errors[] continue 不阻断| 文件 | 内容 |
|---|---|
| references/data-sources.md | 8 种 view_query.kind 对应的 Bash 查询模板 |
| references/chart-templates.md | pie/sankey/heatmap/timeline/mindmap/table/grid 6 种 chart 模板 + fallback |
| references/dash-section.md | DASH:BEGIN/END 区完整结构 + query_hash 计算 + AUTO_MODE 流程细节 |
~/.cache/cortex/ 例外, 仅 cron kind)development
Go 数据库规范——GORM Model 命名 ModelXxx、表名单数、枚举 uint8 + 常量、索引 idx_ 前缀 + deleted_at leading column、禁 time.Time 统一 int64 unix、禁指针/nullable 字段、TEXT/BLOB/JSON 禁 default、AutoMigrate 禁改主键。设计 DB model、写 GORM tag、建索引、做 migration 审查时触发。
development
Go HTTP API 规范——响应始终 200 + body code 字段、路由 /api/* 全 POST 单段 <Action><Model>、中间件逐路由注册禁 Group(prefix,mw...)、handler 仅返回 (rsp,error)、认证走 header。设计 HTTP API、写路由/handler/中间件时触发。
development
Go 项目结构规范——三层架构(API → Impl → State)、全局状态模式、internal/ 私有包、cmd/ 仅 main.go、go.work 多模块、禁止 Repository 接口和 DI 容器、struct 公共字段开头全 omitempty、handler var rsp 顶声明、禁 legacy migration。设计项目骨架、新建目录、组织包、做架构评审时触发。
development
Go 命名规范——Id/Uid 字段(非 ID)、IsActive/HasMFA 布尔前缀、CreatedAt 时间字段、接收者统一用 p、包名全小写无下划线、泛型类型参数描述性命名、集合字段 xxx_list 禁 xxxs 复数、Enum 0 值 XxxNil 禁 Unknown、禁 Status 统一 State、Set/Update 语义区分。定义结构体字段、函数、变量、包、接收者名、泛型、枚举时触发。