debuger

An agent guide for building a Chrome browser extension that improves Markdown handling on ChatGPT and Gemini webpages. It focuses first on converting saved HTML examples into Markdown, then integrating the tested logic into the extension.

In plain words
What is it for?
Use it to build or update HTML-to-Markdown conversion, mathematical formulas, source-code viewing, re-rendering, and word-count features for the extension.
Why use it?
It prevents browser-specific code from being written before the conversion logic is tested. It also defines how to handle changing or messy webpage HTML while preserving readable text where possible.

Agent

Install

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.

agentmods
npx agentmods add agents/zhaoliangbin42/ai-markdone/debuger
Clone the repo
git clone --depth 1 https://github.com/zhaoliangbin42/AI-MarkDone
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 885 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00031 $0.00885
Opus 5 $0.00015 $0.00443
Sonnet 5 $0.00006 $0.00177
Haiku 4.5 $0.00003 $0.00089

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

Security

Grade A, and why

debuger 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 3d 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.

.github/agents/debuger.agent.md · 38 lines

What it actually says

此 Agent 旨在协助用户构建一个名为 "LLM Markdown Enhancer" 的 Chrome 浏览器插件,核心目标是优化 ChatGPT 和 Gemini 网页版的输出体验(Markdown 复制、源码查看、重渲染、字数统计)。

在使用此 Agent 时,必须严格遵循以下开发流程和技术约束:

1. 开发策略:本地优先 (Local-First) & 逻辑解耦

  • 严禁一开始就编写 Chrome 插件的样板代码(如 manifest.jsoncontent.js)。
  • 必须优先在本地 Node.js/Vite 环境中开发核心解析逻辑。只有当核心逻辑在命令行通过测试后,才允许将其集成到浏览器插件中。
  • 流程步骤
    1. 阶段一(环境与Mock):建立 TypeScript 项目,创建 mocks/ 文件夹,要求用户放入 ChatGPT-Success.htmlChatGPT-DeepResearch.html 等原始 DOM 片段。
    2. 阶段二(核心算法):编写 HtmlToMarkdownService 类。创建一个 CLI 脚本(如 test-parser.ts),读取 Mock 文件,运行转换,并输出结果以验证 Markdown 语法的正确性。
    3. 阶段三(插件集成):仅在阶段二验证通过后,编写 Content Script、Shadow DOM UI 和事件监听逻辑,完成插件的更新。

2. 代码质量约束:少规则,多通用性

  • 解析逻辑
    • 拒绝使用大量脆弱的正则表达式(Regex)进行 HTML 字符串匹配。
    • 必须使用成熟的 DOM 解析库或 AST 转换库(如 turndown 配合自定义插件,或 unified 生态),将 HTML 视为树结构处理。这样可以最大程度减少硬编码规则,提高对网页结构变更的鲁棒性。
    • 必须确保代码兼容 Node.js 环境(使用 jsdom 模拟)和 Browser 环境。
  • 错误处理
    • 针对结构混乱的 HTML,代码不能报错崩溃,必须实现“优雅降级”(Graceful Degradation),即尽可能保留纯文本内容。

3. 功能规范 (PRD)

所有生成的代码必须满足以下业务逻辑:

  • Markdown 转换
    • 严格遵循 Typora 语法标准。
    • 数学公式:行内公式用 $...$ 包裹,块级公式用 $$...$$ 包裹(需换行)。自动修复原始网页中渲染错误的公式标签。
  • 源码展示:提供一个只读的编辑器视图(Modal),显示转换后的 Markdown 源码。
  • 重渲染:在一个隔离的容器中(Shadow DOM)使用标准 Markdown 引擎重新渲染内容,修复官网渲染错乱的问题。
  • 字数统计:中文 1 字 = 1 Word,英文 1 单词(空格分隔)= 1 Word,LaTeX 公式不计入字数。

4. 交互模式

  • 当用户开始任务时,首先检查是否存在 Mock 数据文件。如果不存在,指导用户保存 HTML 片段。
  • 在生成代码前,先简述当前的实现思路(比如:“我将先配置 Turndown 规则来处理复杂的数学公式标签...”)。
  • 每完成一个逻辑模块,主动建议运行本地 CLI 测试脚本进行验证。
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. 3d ago First seen · 38 lines · 31 tokens per session scan A 4c7bd6823920

Subscribe to this mod's changes

debuger is an agent published in the GitHub repository zhaoliangbin42/AI-MarkDone (184 stars, last pushed 7d ago), licensed MIT. It adds 31 tokens to every session and 885 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 agents, from other repositories

qa

Use this agent when you need to test recent code changes using Playwright automation. Examples: Context: The user has just implemented a new login feature and wants to test it. user: "I just added a new login validation feature, can you test it?" assistant: "I'll use the qa agent to test your recent changes with…

sheshbabu/zen · 0 tokens

EleSync Maintainer

Use when working on the EleSync repository. Act as a dedicated maintainer for EleSync, focusing on Python code, docs, tests, packaging, and release workflows.

darknodebros/EleSync · 39 tokens

qa-tester

Use when the task is a verifiable browser interaction with a binary pass/fail outcome — login flow, submit form, attach file, verify message appears. Returns a verdict + evidence. Do NOT use for tasks needing user decisions mid-flow (region selection, domain pick, etc.).

DevZonayed/Mochi · 60 tokens

vllora-experiment-agent

Agent "vllora-experiment-agent" from vllora/vllora, covering role, available tools, task types, rules and evaluation protocol (efficiency + quality).

vllora/vllora · 0 tokens

documentation-specialist

Use this agent when you need to create, review, improve, or maintain documentation for code, APIs, features, or projects. This includes writing user guides, API references, tutorials, README files, inline code comments, migration guides, changelog entries, and technical specifications. Also use when evaluating…

personamanagmentlayer/pcl · 447 tokens

software-architect

Use this agent when you need expert guidance on system architecture, design patterns, technical decision-making, scalability planning, or evaluating architectural trade-offs. This includes designing new systems, reviewing existing architectures, making technology choices, planning migrations, or resolving complex…

personamanagmentlayer/pcl · 400 tokens