Bug Reproduce logo

Bug Reproduce

OrganizationPopular
Prismer-AI
bug-reproduce

Turn a known bug into a tight, red-capable reproducer, then prove the reproducer locks that bug with a reversal negative control (reintroduce the bug → reproducer must go red again). Use at the start of a bugfix, before theorizing about the cause.

Overview

PublisherPrismer-AI
RepositoryPrismerCloud
Skill namebug-reproduce
Stars
1.6K
Forks
17
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Prismer-AI on GitHub. Read the source before you install it.

Installation

Install the Bug Reproduce AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Prismer-AI/PrismerCloud/tree/main/sdk/apc/skills/bug-reproduce
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Prismer-AI/PrismerCloud.git /tmp/PrismerCloud
mkdir -p .claude/skills
cp -r /tmp/PrismerCloud/sdk/apc/skills/bug-reproduce .claude/skills/bug-reproduce
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Bug Reproduce in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Bug Reproduce on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Bug Reproduce is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

bug-reproduce

把一个已知 bug 变成紧、可变红的复现器(失败测试 / 脚本),然后用反转负控证明这个复现器真的锁住了那个 bug——不是恰好绿着(apc/05 §2 S1 · apc/12 bug-reproduce 行;纪律移植自 built-in diagnosing-bugs 的 Phase 1 复现 loop)。

什么时候用:一个 bugfix task 开工的第一步——在读代码建假设之前。diagnosing-bugs 的铁律:没有一个能对这个 bug 变红的信号,再多盯代码也没用。本 skill 只补 diagnosing-bugs 缺的那一环:负控——把 fix 撤掉/把 bug 注入回去,复现器必须变红。

铁律:一个复现器只有走完 RED → GREEN → 反转 RED 才算数。只到 GREEN 不算——一个无论 bug 在不在都绿的"复现器"是开卷考试,不是复现(apc/12 §0 负控纪律)。

复现器四判据(照 diagnosing-bugs Phase 1 完成标准)

一个复现器必须是:

判据含义
red-capable它驱动真正的 bug 代码路径、断言用户描述的确切症状——能对这个 bug 变红,修好后变绿。不是"没崩就算过"。
deterministic同一输入每次同一结论(非确定 bug:钉时间/种 RNG/隔离 FS,把复现率拉到可调试)。
fast秒级不是分钟级。
agent-runnable你能无人值守跑;一条命令(脚本/测试/curl)能贴出调用 + 输出。

Procedure

1. 钉环境 + 建复现器(RED)

在一个干净的、确定性的 workspace 里写出最小失败测试/脚本,然后跑它,看它变红:

bash
d=.e2e-tmp/apc/bug-reproduce && rm -rf "$d" && mkdir -p "$d"    # repo-relative,已在 .gitignore
# …在 "$d" 里写 subject + repro…
node "$d"/repro.mjs; echo "exit=$?"     # 或 apc test --tier=<T> --json / pytest / go test …

隔离场景的临时目录用 repo-relative 的 .e2e-tmp/…,不要用 mktemp -d:复现器本身就是证据,判据在你跑完之后把你引用的 path:line 读回磁盘——/tmp 从仓库根不可解析、收尾 rm -rf 更是把唯一产物销毁(test204「证据销毁反 pattern」的同一个坑)。本地真仓库里的 bug 则直接在真路径上做。

  • 复现器必须断言用户描述的症状本身(clamp(-5,0,10) 应得 0 而非 -5),不是"没抛异常"。
  • 记下确切症状:断言消息、错误、非零退出码。这就是 RED。
  • 真仓库里的 bug:复现命令可以是选层的 apc test --tier=<T> --json(读 exitCode:0 绿 · 1 SUT 红 · 78 env_blocked)。env_blocked 不是复现——是环境红,先 apc env doctor。

2. 最小 fix(GREEN)

打最小修复(只改让复现器变绿所需的那一点),重跑复现器,看它变绿(exit=0)。不顺手清理别的——本步只证明"这个 fix 让这个复现器绿"。

3. 反转负控(承重——RED again)

这是本 skill 的命根子。 把 fix 撤掉——把 bug 注入回去,重跑同一条复现器命令:

bash
# 首选:直接编辑源文件,把 buggy 的那一行 body 原样写回去
node "$d"/repro.mjs; echo "exit=$?"     # 必须再次 RED(非零退出 / AssertionError)

反转手法只有一个首选:直接编辑源文件把 bug 写回去。

⚠️ git stash / git checkout 在共享工作树里是有害指令,默认不许用。 本仓库常态是多个并发 session 共用一个 working tree、几百个未提交改动同时在飞——git stash 会把别人正在做的改动一起卷走,git checkout <file> 会丢掉别人对同一文件的未提交编辑。这类操作不可逆地毁坏他人工作,代价远大于它省下的那一次手工编辑。

只有在你独占这个 working tree(自己的 worktree / 一次性容器)且已确认 git status 干净时,git stash 才是等价手法;否则一律手工反转。反转的语义(把 bug 放回去)才是承重的,用什么手法不是。

  • 复现器必须再次变红。 这证明它红在这个 bug 上,不是恒绿的摆设。
  • 若撤掉 fix 后复现器仍然绿 → 复现器是假的,任务失败(apc/12 bug-reproduce 负控)。不许放松断言让它"看起来锁住了"。

4. 恢复 + 收尾(不要删证据)

把 fix 放回去,确认最后一次 GREEN(exit=0)。复现器留在盘上别删——判据是在你跑完之后才读盘复核你引用的行的,rm -rf 掉复现器 = 自毁唯一产物。

5. 写 BugfixCard(repro 阶段)

复现 + 反转都拿到证据后,把这一阶段落成一张 BugfixCard——repro 是 BugfixCard 的首阶段,段锚是 <h2 id="stage-repro">(src/lib/apc-cards/card-profile.ts 的 BUGFIX_STAGES[0].name = 'repro')。

⚠️ 段名是 repro,不是 reproduce。 docs/apc/12 那行写的 stage-reproduce 在实现里不存在,写成它会被 card-stage-invalid / card-stage-section-missing 挡下。以代码为准。

  • card frontmatter:{ kind: 'bugfix', stage: 'repro', taskId: <真 task id>, schemaRev: 1 }——taskId 必填,无 task 上下文时不要伪造绑定:如实报告"本轮没有 task,卡未写",别硬造一张。
  • repro 阶段的证据要求是 asset:段内要有 prismer://…/asset/<id> 链接,挂复现器本体 + RED 输出 + 反转 RED 输出三份证据(先 cloud asset upload 拿 id)。
  • 段序检查只对已过阶段要求证据,当前阶段进行中不强求;但首阶段段锚 stage-repro 必须在场。

输出契约(机器判据按这个复验,别自由发挥格式)

旧判据全是关键词匹配("报告里出现过 node/assert/exit=1/revert 这些词")——一篇一条命令都没跑过的报告照样满分。现在多一条判据(cited-evidence)把复现器读回磁盘复核:复现器不存在、引用的行不存在、或者引用的行根本不含被测符号,当场判红。

① 复现器锚点声明(一行;符号会被复核确实出现在该文件里):

CHANGE-POINT: <被测符号> @ <复现器/被测文件的 repo-relative 路径>

② RED→GREEN→反转 RED 相位表(markdown 表,首列是 path:line):每相位一行,首列是该相位转在哪一行上。判据要求 ≥3 行带可复核引用,且 ≥2 条引用所在的那一行真的含被测符号。

| path:line | phase | command | exit | observed |
| --- | --- | --- | --- | --- |
| .e2e-tmp/apc/bug-reproduce/repro.mjs:3 | 1 RED (buggy) | node .e2e-tmp/apc/bug-reproduce/repro.mjs | 1 | AssertionError: clamp must respect lower bound |
| .e2e-tmp/apc/bug-reproduce/clamp.mjs:1 | 2 GREEN (fixed) | node .e2e-tmp/apc/bug-reproduce/repro.mjs | 0 | REPRO OK |
| .e2e-tmp/apc/bug-reproduce/repro.mjs:3 | 3 REVERSAL RED | node .e2e-tmp/apc/bug-reproduce/repro.mjs | 1 | AssertionError: clamp must respect lower bound |

行号照抄 cat -n / rg -n 的真实输出,不许凭印象写。引用必须 repo-root-relative(绝对路径与 /tmp/... 一律判红——这也是上面要求复现器落 .e2e-tmp/ 且不删的原因)。产物存可引用的扩展名:引用解析器只认固定后缀集(ts/tsx/js/jsx/mjs/cjs/prisma/sql/md/json/sh/py/yml/yaml),存成 .txt/.log 的引用不会被解析。

产出(副作用 oracle,报告里必须给)

  1. 复现器命令:你真跑过的那一条(node repro.mjs / apc test --tier=… / pytest…),可贴调用。
  2. 初始 RED:buggy 代码下复现器失败(AssertionError + 非零退出码)。
  3. fix 后 GREEN:exit=0。
  4. 反转 RED(承重):把 bug 注入回去后复现器再次变红(非零退出码)——这是"锁住了"的唯一证明。
  5. 复现器本体留在盘上(repo-relative 路径),锚点声明 + 相位表的每条引用都能读回。 6.(有 task 上下文时)BugfixCard stage-repro 段:三份证据 asset link 挂上,卡可回读。

不许:只报到 GREEN 就收工(没有反转 = 没证明锁住);放松断言让恒绿脚本冒充复现器;把 env_blocked(exit 78)当作 bug 复现上报;凭推理宣称"应该能复现"而没真跑;跑完 rm -rf 掉复现器(证据必须留到判据读盘之后);在共享工作树里用 git stash/git checkout 做反转(会卷走别人的未提交改动)。

诚实边界

  • 本 skill 不保证任何 bug 都能建出紧复现器:跨进程时序、真机才暴露、非确定性极低复现率的 bug,可能只能拉高复现率而非稳定复现(diagnosing-bugs Phase 1)。建不出就显式停手说清楚、列出试过什么、要人给可复现环境/捕获产物——不许无复现器就跳去建假设。
  • 反转负控证明的是"复现器红在这个 bug 上",不是"这个 fix 是最终正解"——正解由后续 fix + 评审 + test-runner 兜。
  • 共享工作树是常态:本仓库经常多个 session 同时在同一个 working tree 上飞着几百个未提交改动。因此反转 fix 默认手工编辑源文件;git stash/git checkout 只在你确认独占该工作树、且 git status 干净时才等价可用。这不是洁癖——stash 卷走别人的改动是不可逆的破坏。
  • BugfixCard 的段名以实现为准(repro):docs/apc/12 里写的 stage-reproduce 是文档漂移,代码 src/lib/apc-cards/card-profile.ts 的 BugfixCard 首阶段叫 repro。无 PRISMER_TASK_ID 时 card.taskId 无法合法填写——如实报告"卡未写",不要伪造一个绑定去凑一张卡。

调用回执(APC 平台方运营纪律 · 自动注入,勿手改)

执行本 skill 的第一步,先落一条调用回执:

bash
cloud skill ack bug-reproduce --task "$PRISMER_TASK_ID"

按退出码分流(这条命令的退出码是承重信息,禁止用 || 兜底、; true、 set +e 或重定向把它抹掉):

exit含义你要做的
0回执已落库(im_task_logs.action='skill_ack')继续执行本 skill
3无 task 上下文——本次运行没有 task,产不出回执继续执行本 skill;但本次运行没有回执,任何报告里都不得声称已 ack
4你不是该 task 的 assignee,服务端拒绝停下并上报:回执只能由执行该 task 的 agent 产生
1其它失败(网络 / 服务端)重试一次;仍失败则继续执行,并在结果里显式标注「回执缺失」

回执只证明本 skill 被调度,不证明执行正确——效果证明由本 skill 自己的 acceptanceCriteria 副作用断言承担(apc/04 §2 层 1 诚实标注)。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Bug Reproduce AI skill do?

Turn a known bug into a tight, red-capable reproducer, then prove the reproducer locks that bug with a reversal negative control (reintroduce the bug → reproducer must go red again). Use at the start of a bugfix, before theorizing about the cause.

Why use Bug Reproduce on TypingMind?

Because you install it once and use it with any model. Bug Reproduce is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Bug Reproduce in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Prismer-AI/PrismerCloud/tree/main/sdk/apc/skills/bug-reproduce. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Bug Reproduce?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Bug Reproduce?

As many as you like. As long as a model supports skills, you can use Bug Reproduce with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Bug Reproduce AI skill free?

Yes. It is published on GitHub by Prismer-AI under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇