team-okrs
Quarterly banner + 3 objectives + KR progress bars + owner + status pill
1How It Works & Mechanism
This skill is not an executable program, but a template for html-anything: a directory (SKILL.md + example.html[/example.md]) scanned and read from disk at runtime by loader.ts—adding a template merely means adding a directory, without modifying any TypeScript code.
Adding a template = adding a folder. No TS code change required; the API
Frontmatter serves as metadata for the selector/API (zh_name/en_name/emoji/description/category/scenario/aspect_hint/featured/recommended/tags), mapped into SkillMeta by fmToMeta(); the body following the frontmatter constitutes the actual specification provided to the model.
zhName: fm.zh_name ?? fm.name ?? id,
During generation, the template body serves as the prompt body: /api/convert uses assemblePrompt() to concatenate 'global design directives + this template body + user content' into a single prompt, passes it to the host's local agent CLI, and streams back the HTML captured from stdout.
prompt = assemblePrompt({ body: skill.body, content, format });
Above the template body sits a set of global prefix instructions (SHARED_DESIGN_DIRECTIVES) that uniformly enforce technical and content discipline across every template—the external CDN and font links commonly seen in example HTML originate here (injected by the host wrapper, not required by the template itself).
通过 CDN 引入 Tailwind v3 Play (https://cdn.tailwindcss.com) 与所需的 Google Fonts。
Output is returned as stdout text: global directives explicitly prohibit the agent from accessing the file system, leaving persistence to the front end—thus the template directory has neither scripts nor disk-writing capabilities.
**禁止使用 Write / Edit / MultiEdit / Bash / Create / 任何文件系统工具**。
example.html is a pre-rendered example bundled within the package: /api/templates/<id>/preview returns it as text/html directly to an iframe (for inline selector preview), while /api/templates/<id>/example returns both example.md and example.html together.
return new Response(skill.exampleHtml, {
The body fixes the page into four sections using a [Layout] list: a quarterly banner, 3 objective columns (each with a set of KRs), KR progress bar + value + owner + status pill for each entry, and a right-hand summary column.
- 3 个 objectives 列, 每个含一组 KR
The example realizes the specification as a static board with a tri-state state machine: KR rows include progress bars and owner avatars, and status pills feature three color schemes for on-track, at-risk, and off-track.
<span class="pill on-track"><span class="dot"></span>On track</span>
The example is a zero-external-link static file: no <script> tags, no CDN or font links in the head, uses system font stacks, and can be opened offline with a double-click.
--display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
The CLI side features a direct keyword matching channel: skills-matcher.ts maps keywords in user content directly to this template id; a hit assigns confidence = hit count * 2 + 3, and reaching the threshold of 3 triggers local rules without asking the model to select a template.
[["OKR", "KR", "关键结果", "objectives", "季度目标", "key results"], "team-okrs"],
Threshold constants used for CLI fallback matching: content length must exceed 60 characters to enable AI summary matching; the strong signal threshold is 3.
const MIN_CONTENT_LENGTH_FOR_AI = 60;
The host wrapper renders examples and artifacts inside an iframe with sandbox="allow-scripts allow-same-origin" (allowing scripts and same-origin)—this is an architectural trade-off of the product shell noted under risks and does not affect this skill's safety rating.
sandbox="allow-scripts allow-same-origin"
2Core Capabilities
4Recommended Governance & Evidence
- SKILL.md: Pure prompt directives and rule text, without script execution or external side effects
5Second-Pass Verification
- [ok] skill 目录文件清单 — find 只有 SKILL.md + example.html,无 scripts/references/模板/数据文件。
- [ok] external_deps 为空 — 对两文件 grep 'https?://' 零命中;head 无 <link>、无 <script src>。
- [ok] 无脚本执行 — grep -c "<script" example.html = 0;SKILL.md 无任何命令行/脚本指令。
- [ok] frontmatter 字段与 loader 白名单对齐 — name/zh_name/en_name/emoji/description/category/scenario/aspect_hint/tags 全在 SkillFrontmatter 类型内,可被 parseFrontmatter 正确解析。
- [ok] 「3 个 objectives」与示例一致 — 示例 meta 行自述 3 objectives · 9 key results,页面含 9 条 KR(.kr 计数 9)。
- [ok] CLI 匹配器路由 — cli/src/skills-matcher.ts 存在 [["OKR", "KR", "关键结果", "objectives", "季度目标", "key results"], "team-okrs"] 行;测试 skills-matcher.test.ts 断言匹配到 team-okrs。
- [ok] 判级 green 自证 — 目录零脚本/零凭证/零写盘、无端点;宿主壳的 Tailwind/字体注入与 iframe sandbox 均写在 reason 说明中,不计档。
- [ok] official_desc 逐字 — meta.official_desc 取自 frontmatter description 原文「季度 banner + 3 个目标 + KR 进度条 + owner + 状态 pill」。
6Verdict & Scenarios
fe13926b690c2c2a…