bugfix-worktree

bugfix-worktree is a skill for Codex from midFang/ai-agent-skills-workflow. It costs 144 tokens per session (4,686 once invoked), scanned A, original, MIT.

A procedure for fixing one tracked bug in its own Git worktree, which is a separate working copy tied to a branch. It includes self-checking the fix and building an Android APK for human testing.

In plain words
What is it for?
Claiming a bug, creating or restoring its branch and worktree, making the fix, running AI checks, building a test APK, and optionally installing it with adb, the Android device command-line tool.
Why use it?
It keeps changes for separate bugs isolated and records their progress in the issues table. It also prevents installation or merging before the relevant verification step is requested or completed.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions AGENTS.md; mentions Codex; $skill-name invocation.

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 skills/midfang/ai-agent-skills-workflow/bugfix-worktree
Any agent
npx skills add midFang/ai-agent-skills-workflow --skill bugfix-worktree
Clone the repo
git clone --depth 1 https://github.com/midFang/ai-agent-skills-workflow

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bugfix-worktree

README.md
[![agentmods](https://agentmods.dev/badge/skills/midfang/ai-agent-skills-workflow/bugfix-worktree.svg)](https://agentmods.dev/skills/midfang/ai-agent-skills-workflow/bugfix-worktree)
Your own site
<a href="https://agentmods.dev/skills/midfang/ai-agent-skills-workflow/bugfix-worktree"><img src="https://agentmods.dev/badge/skills/midfang/ai-agent-skills-workflow/bugfix-worktree.svg" alt="Measured on agentmods" height="20"></a>
Per session 144 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,686 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.1 $0.00144 $0.04686
Opus 5 $0.00072 $0.02343
Sonnet 5 $0.00029 $0.00937
Haiku 4.5 $0.00014 $0.00469

Measured 5d ago against content hash 6b2b8a5498d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

bugfix-worktree 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 5d 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.

bugfix-worktree/SKILL.md · 402 lines

How it starts

The opening of the file, as written. The whole thing — 402 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Bugfix Worktree

目的

建立一个半自动 bug 修复流程:一个 bug 对应一个分支、一个 worktree、一个独立修复窗口。

issues/<版本>/*.csv 是任务控制表,放在要修复的业务项目根目录里,例如 /path/to/business-project/issues/2026-06-25-test/bug_batch.csv。它不要放进任何单个 bug 的 worktree,也不要放到全局 skill 项目里。

单个 bug 的详细过程记录放在外部版本目录,例如 issues/<版本>/tasks/BUG-013-TASK.md。不要只放在 worktree 里,因为 worktree 是临时代码现场,合并后还可能需要回看任务记录。

这个 skill 不负责把模糊 bug 猜成真相。优先使用用户已经人工确认过的描述和明确的验证方法。

职责边界:本 skill 主要负责领取 bug、创建 worktree、修复、AI 自证验证、构建待验证 APK、按需安装。用户验证通过后的合并和 worktree 清理,优先交给 $bugfix-done

Issues 表

推荐文件位置:

issues/<版本>/bug_batch.csv

例如:

issues/2026-06-24/bug_batch.csv

推荐列:

  • bug_id
  • 标题title
  • 问题描述
  • 人工确认描述
  • 状态
  • branch
  • worktree_path
  • base_repo
  • target_branch
  • 复现场景
  • 验收标准
  • ai_verify_plan
  • ai_verify_cmd
  • ai_verify_result
  • ai_verify_evidence
  • apk_path
  • install_device
  • human_verify_result
  • human_verify_note
  • commit
  • task_file
  • 备注

推荐状态:

draft, ready, needs_info, in_progress, fixed, ai_verified, apk_built, installed, human_verified, merged, integration_verified, worktree_removed, blocked

如果 CSV 缺少流程列,先备份,再补列。保留原始 bug 字段,不要破坏用户从腾讯文档导出的内容。

写入 CSV 前,在同目录创建简单锁文件,例如 <csv>.lock。如果锁文件很新,停止并提示可能有另一个窗口正在更新。只有确认锁已陈旧时,才说明原因后移除。

准备阶段

$bugfix-worktree 不应该在真正开始修 bug 时才频繁追问用户。应在从 $bug2csv 导出文件生成 issues/<版本>/bug_batch.csv 时,先把每条 bug 整理到可执行状态。

准备阶段推荐做法:

  1. 保留原始 问题描述
  2. 用户或 AI 补充 人工确认描述,尽量写清楚真实复现过程。
  3. AI 根据人工确认描述生成 复现场景验收标准 草案。
  4. 用户只需要确认明显不对或缺关键条件的行。
  5. 信息足够开始修的行标记为 ready
  6. 信息明显不足、会导致 AI 猜测的行标记为 needs_info,先不要领取修复。

字段含义:

  • 复现场景:这个 bug 在什么条件下发生。写设备、系统、账号状态、连接方式、前置操作等。它回答“在哪里、怎么触发”。
  • 验收标准:修好后怎样算通过。写可观察结果,例如“只出现一个弹窗”“点击后跳到系统权限页”“PC 端持续有声音”。它回答“怎么判断修好了”。

示例:

bug_id,人工确认描述,复现场景,验收标准,状态
BUG-013,等待接收设备同意超时会出现两个弹窗,安卓发起端向 PC 接收端发起投屏,PC 不点击同意,等待请求超时,超时后安卓端只出现一个超时提示,不同时出现普通超时弹窗和连接失败超时弹窗,ready

单 bug TASK 文件

每个 bug 必须维护一个单 bug 过程记录文件,放在当前版本目录:

issues/<版本>/tasks/<bug_id>-TASK.md

例如:

issues/2026-06-24/tasks/BUG-013-TASK.md

Read the full file on GitHub · 402 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 402 lines · 144 tokens per session scan A 6b2b8a5498d7

Subscribe to this mod's changes

bugfix-worktree is a skill published in the GitHub repository midFang/ai-agent-skills-workflow (2 stars, last pushed 2mo ago), licensed MIT. It adds 144 tokens to every session and 4,686 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-31.

Related

Other skills, from other repositories

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

systematic-debugging

Use when debugging a failing test, build error, or runtime issue that isn't immediately obvious. Guides a 4-phase root cause analysis instead of random fix attempts.

open-metadata/OpenMetadata · 37 tokens

diagnose

Trace from a reproduced symptom to the source code that causes it. Pin the specific file and approximate line, rate confidence in the cause and clarity of the fix independently, and always propose a concrete fix.

emdash-cms/emdash · 43 tokens

azsdk-common-pipeline-analysis

Analyze Azure SDK CI/CD pipeline failures into a structured diagnosis, and define the required output format. Load this skill before calling azsdkanalyzepipeline, which returns raw failure data that this skill interprets and formats. USE FOR: "pipeline failed", "build failure", "CI check failing", "tests failing in…

Azure/azure-sdk-for-net · 192 tokens

repro-admin

Reproduce an EmDash admin UI bug. Attach a container, start the demo dev server, drive the admin with agent-browser using the dev-bypass session, and capture the reproduction as screenshots plus a replayable transcript.

emdash-cms/emdash · 48 tokens

log-error-digest

Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or…

zebbern/claude-code-guide · 71 tokens