pdlc-fix

pdlc-fix is a skill for Claude Code from kanfu-panda/pdlc-skills. It costs 25 tokens per session (7,848 once invoked), scanned A, original, MIT.

An automated bug-fixing workflow that locates a reported bug, reproduces it with a test, applies a minimal fix, runs tests, and updates the relevant documentation.

In plain words
What is it for?
Use it to investigate the cause and impact of a bug, add a failing reproduction test, implement and verify the fix, run the full test suite, and record the defect.
Why use it?
It takes the bug from a description to a verified correction without pausing for routine decisions. The regression test helps ensure the same problem does not return.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the pdlc plugin — 38 skills, 2 hooks shipped together

Good fit Use it to investigate the cause and impact of a bug, add a failing reproduction test, implement and verify the fix, run the full test suite, and record the defect.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kanfu-panda/pdlc-skills/pdlc-fix
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.

Any agent
npx skills add kanfu-panda/pdlc-skills --skill pdlc-fix
Clone the repo
git clone --depth 1 https://github.com/kanfu-panda/pdlc-skills

Made for: Claude Code.

Or install pdlc, the plugin that ships this one along with the rest of its 38 skills, 2 hooks.

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 pdlc-fix

README.md
[![agentmods](https://agentmods.dev/badge/skills/kanfu-panda/pdlc-skills/pdlc-fix/github.svg)](https://agentmods.dev/skills/kanfu-panda/pdlc-skills/pdlc-fix)
Your own site
<a href="https://agentmods.dev/skills/kanfu-panda/pdlc-skills/pdlc-fix"><img src="https://agentmods.dev/badge/skills/kanfu-panda/pdlc-skills/pdlc-fix/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pdlc-fix

Your own site · 80×15
<a href="https://agentmods.dev/skills/kanfu-panda/pdlc-skills/pdlc-fix"><img src="https://agentmods.dev/badge/skills/kanfu-panda/pdlc-skills/pdlc-fix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,848 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00025 $0.07848
Opus 5.5 $0.00010 $0.03139
Sonnet 5.5 $0.00005 $0.01570
Haiku 4.5 $0.00003 $0.00785

Measured 13d ago against content hash e3840b3fd243, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pdlc-fix 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 13d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/pdlc-advance.sh, scripts/pdlc-checks.sh, scripts/pdlc-state-lint.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/pdlc-fix/SKILL.md · 445 lines

How it starts

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

全自动 Bug 修复

⛔ IRON LAW · 不可违反的硬门禁

以下规则为不可协商的执行约束:

  1. 文件必须落盘:所有带编号(功能ID / 缺陷ID)的文档,必须作为实际文件写入磁盘,不可仅在对话中输出。
  2. 阶段必须落章:每个阶段完成后必须在状态机 docs/.pdlc-state/<feature-id>.json 追加 history,不可跳过。
  3. 测试必须存在:进入 /pdlc-implement 前,对应测试必须存在且处于红灯状态。违反则中止。
  4. 自检必须执行:段二自检为强制步骤,不得以"已经很好了"为由跳过。
  5. 防循环:段三修复为单次,不递归。无法自动修复的问题记录到报告,继续往下走。
  6. 状态必推进:成功执行某 phase 后 current_stage 必须变更。收尾时若发现 current_stage 未推进,视为失败并报错,不得静默返回(防止外层循环拿滞后的状态空转烧额度)。唯一例外:命中人工点主动 block 时,current_stage 保持不变但必须写 last_phase_result.ok=false + blocked_reason。

违反任一条 = 立即中止当前命令,输出违规详情,等待人工介入。

接收一句话 Bug 描述,全自动完成定位、复现、修复、测试、文档更新,中途不暂停、不询问用户。

执行规则

  • 全程自动:不在任何步骤暂停等待确认,遇到歧义自行做合理假设并在最终报告中说明
  • 严格顺序:必须按阶段一→二→三→四→五顺序执行,不得跳过
  • 最小改动原则:只修复 Bug 本身,不顺手重构或优化不相关代码
  • 测试验证才结束:全量测试通过后才输出最终报告

缺陷ID分配(必须执行)

  1. 获取当前日期与时分秒:date +%Y%m%d、date +%H%M%S
  2. 生成缺陷ID:B<YYYYMMDD>-<HHMMSS>(示例形如 B20260717-122801;用执行时的真实日期与时分秒)
  3. 本地防撞:若该 ID 已被占用(docs/ 或 docs/.pdlc-state/ 下已有同名前缀),重新读取 date +%H%M%S 重取(生成本身有耗时、通常已跨秒;若仍同秒则 sleep 1 后再读一次,不手算时分秒,天然处理跨天边界)
  4. 从 Bug 描述中提取功能名关键词(英文小写+连字符)

为什么用时分秒而非序号:多人 / 多 AI 并行时各自独立取「当日序号 max+1」会分到相同编号、合并冲突。改用创建时刻 HHMMSS 后各副本零协调也几乎不撞(仅同一秒才可能),文件名互异、git 自动合并。旧的 B<日期>-<NN> ID 仍有效、可解析。

注意:日期与时分秒使用执行时的实际值。


阶段一:问题定位

  1. 根据 Bug 描述,搜索相关代码文件,阅读并理解涉及的逻辑
  2. 查阅 docs/02_design/ 对应子目录下的设计文档,确认预期正确行为
  3. 明确根因:
    • 是代码逻辑错误、边界未处理、还是设计文档遗漏?
    • 影响范围:哪些模块/接口/数据受影响?
  4. 若 Bug 描述不足以定位,根据描述做最合理推断,在报告中说明

阶段二:回归测试(红灯)

  1. 编写一个能精确复现该 Bug 的测试用例,写到项目既有的测试布局里(定位规则见下):

测试代码在哪(布局无关的定位规则)

⚠️ 这条规则的要害:红灯守卫必须区分「项目没有测试」和「测试不在我预期的位置」。 前者才该拦;后者拦了就是误伤——真实项目的测试布局千差万别(单体 backend/tests/、 根级 tests/、Go 同包 *_test.go、Node 与源码同目录的 *.test.tsx…), 按一份写死的路径清单去找、找不到就拦,会让 pdlc 在大量正常项目上直接卡死。

Read the full file on GitHub · 445 lines

Files

What ships with it

3 files 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. 13d ago Changed · +25 lines e3840b3fd243
  2. 17d ago Changed 69fbedd59347
  3. 18d ago Changed · +1 lines bc423ee97de1
  4. 1mo ago Changed · +286 lines bc3d201580c3
  5. 1mo ago First seen · 133 lines · 25 tokens per session scan A febfc0209664

Subscribe to this mod's changes

pdlc-fix is a skill published in the GitHub repository kanfu-panda/pdlc-skills (18 stars, last pushed 13d ago), licensed MIT. It adds 25 tokens to every session and 7,848 once invoked, about $0.0001 per session on Opus 5.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

prove-checks

Prove a passing check was capable of failing before recording it as evidence. Use when a test, CI job, build-and-diff, smoke test or rehearsal comes back green and that green is about to be treated as proof - especially when the check depends on a setup mutation (a sed/awk rewrite, an env var, a secret, a fixture…

sergeyklay/.agents · 221 tokens

diagnose

Turn a bug symptom into a fix with a regression test that locks it down. If the user opens vague ("there's a bug", "/diagnose"), interview them one question at a time until you have enough to attempt a reproduction; if you still cannot reproduce, say so explicitly. Then drive the work through five phases — build a…

eduwxyz/my-awesome-skills · 0 tokens

test-failure-explorer

Import and query an existing Vitest 3.2 JSON report to explore test failures, file-level errors and original diagnostic evidence.

QwenLM/qwen-code · 32 tokens

developing-openrig

Use when changing OpenRig's own source in a clone of the openrig repository: finding which package or file owns a behaviour, choosing which tests to run, testing a change without disturbing the OpenRig daemon your own session runs on, judging whether a diff touches a high-risk area, or preparing a pull request. Not…

mvschwarz/openrig · 84 tokens

timescaledb-hyperfunctions

Use this skill when writing analytical SQL over time-series data with the TimescaleDB Toolkit (timescaledbtoolkit extension) hyperfunctions: approximate percentiles, statistical summaries, time-weighted averages, counter/gauge rates, uptime/heartbeat tracking, state durations, OHLC candlesticks, approximate distinct…

timescale/pg-aiguide · 298 tokens

design-postgis-tables

Comprehensive PostGIS spatial table design reference covering geometry types, coordinate systems, spatial indexing, and performance patterns for location-based applications.

timescale/pg-aiguide · 31 tokens