Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/lawofall/agentcore/frontend-previewgit clone --depth 1 https://github.com/Lawofall/AgentCoreWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00139 | $0.01717 |
| Opus 5 | $0.00069 | $0.00859 |
| Sonnet 5 | $0.00028 | $0.00343 |
| Haiku 4.5 | $0.00014 | $0.00172 |
Grade A, and why
frontend-preview 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 32 lines — stays where its author put it; the contents beside it link to each section on GitHub.
前端离线预览与截图自检
桌面渲染层几乎就是个普通 Vite + React 网页:把仓库里那批 conformance 向量(pnpm conformance 同一份)经真实 dispatchSSEEvent 回放进真实组件,即可离线复现每种 AI 态——零后端、零 LLM、零 token、永不 drift。改完前端别再去跑真实 AI 看效果。
本页是 AI 自检渲染。给人录产品演示(真实运行 → 磁带 → 真实桌面壳按原节奏可控重放)是另一套 →
demos/README.md。
三个入口
| 谁 | 怎么进 |
|---|---|
| 人·应用内 | 命令面板(Ctrl/Cmd+K)搜「前端预览」→ #/preview;深链单场景 #/preview?s=<场景名>;工具栏帧滑块拖动看流式中间态(深链 ?k=<n>) |
| 人·纯浏览器 | pnpm -C apps/desktop dev:web → 开 http://localhost:5199/index.web.html#/preview |
| AI·截图自检 | pnpm -C apps/desktop shoot [场景名过滤] → 逐场景出图到 shoot-out/<name>.png,SHOOT_FRAMES=N 连中间帧,读图核对。同族独立预览:首启体验 #/preview/onboarding + shoot:onboarding(草稿空态两态 + composer 生成中插话态,平台代付无接入门;非 conformance 向量、纯 UI 场景);产品手册 shoot:manual(四章代表场景,含机制真图与辩论室/拍板卡嵌入预览;改手册内容源 pages/toolbox/manual/content/ 或手册渲染器后必跑) |
| AI·协作图视口探针 | pnpm -C apps/desktop shoot:graph-probe -- <场景名> [输出前缀] → 对聊天内联 / 全屏两入口量 emptyTopRatio · fullyInside · 裁切数并出截图/JSON 到 shoot-out-graph-probe/;改图宿主/布局/fit/视口后必跑(辩论场景 multi_agent_debate、multi_agent_debate_multibeat) |
| AI·协作图掉帧探针 | 离线:shoot:graph-perf(#/preview,≤9 节点、不触发 ELK)。真实掉帧用 shoot:graph-perf-live:先 electron-vite dev --remoteDebuggingPort=9222,再 CDP 连运行中应用;报告 shoot-out-graph-perf/live-*.json(实测刷新率;遮挡 1Hz 限流秒剔除)。长任务里跑了什么用 shoot:graph-perf-trace(同 CDP;Chrome trace 拆 Layout/Style/Paint/GC/JS 并点名函数;相位表证伪「不动也卡」;不依赖 __graphPerf,可测生产构建)→ trace-*.json。不入 CI |
纪律
- 改桌面组件/样式/布局 →
pnpm shoot <场景名过滤>→ 读shoot-out/*.png自检,形成「改→截→看→迭代」紧回路。默认带场景过滤:无过滤的全量(数百张,随向量数增长)约 4 分钟(4 worker),只在发布门禁跑(→verify-scope.mdc)。 - 改交互相关代码(发消息 / 审批卡 / 开工·checkpoint resume / 协作图入口 / AuthGate·会话切换等用户操作链路)→
pnpm -C apps/desktop e2e(mock 后端 + webapp 壳 + Playwright;失败留e2e-results/截图与 trace)。与「改渲染 →pnpm shoot」并列,别靠跑真实 AI / 活后端验点击行为。 pnpm shoot是渲染冒烟门禁(ci.ymlfrontend job 在跑;近期风险是 CI 红如 Lint,早失败则 shoot 等后续 skipped):任一场景渲染崩(未捕获报错 /#/preview挂不上)即红。发布前本地必跑pnpm shoot/release:gate。- 滚动条占位类 bug(内容被切一截 / 行「上浮」留白)测不出:
pnpm shoot与任何 headless Chromium 用 overlay 滚动条、不占位,必假绿。症状对得上就改用chromium.launch({ headless: false })(或真实 Electron)复现——全局globals.css给每个滚动容器留 10px 槽,固定高的 chrome 行(tab 条)会被切。 - 新 AI 态补向量:后端
conformance/vectors/加场景 →cd apps/server && uv run python -m agentcore.conformance.export重导 fixture →#/preview与pnpm conformance同步刷新。改 UI 时别忘了向量的description也是文本:曾出现multi_agent_coordination_wait的 description 还在描述早已删掉的 StatusStrip 分支,测试才是准的那一侧。 - 「否决手写 mock 态」只管
#/preview回放面,别推广到组件单测。components/chat/__tests__/StatusStrip.*那批手搓ExecutionPlan+RunFrame的用例是已定案例外,禁止改成loadFixtures回放:约半数断言是负向 chrome(「条上不准出现 X」),向量不编码这类事实,改回放后断言照样手写;而 payload 形状已由 TS 类型守住,换来的只是把组件单测耦到数百行向量上、失败定位变差。既有回放先例(debatePreviewMount.fixture.test.ts等)针对的是「整回合 fold 后的呈现」,不是状态条的负向断言。
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.
- 2d ago First seen · 32 lines · 139 tokens per session scan A 8422bfc7b6d6
frontend-preview is a cursor rule published in the GitHub repository Lawofall/AgentCore (78 stars, last pushed 2d ago), licensed MIT. It adds 139 tokens to every session and 1,717 once invoked, about $0.0007 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.
Other cursor rules, from other repositories
code-patterns
Python code style and recurring patterns (config, logging, errors, paths).
project-overview
Core project architecture, patterns, and conventions for the AI Documentation Generator.
cursorrules
You are an AI agent building the module: {{MODULENAME}} This module is part of the Mnemosyne Neural OS ecosystem by XPACEGEMS LLC.
backend-python
Python and FastAPI standards for the backend.
core-project-context
Canonical project context and ownership rules.
dashboard-typescript
React and TypeScript standards for the operator dashboard.