fix

GitHub

系统化缺陷修复技能,遵循证据收集、根因分析、规范修订、计划制定及TDD实现的严谨流程。旨在通过可审查的工件和明确的阶段检查点,确保修复质量与回归测试覆盖,避免盲目修改代码。

.agents/skills/fix/SKILL.md kdlbs/kandev

Trigger Scenarios

诊断并修复软件缺陷 处理Issue Tracker中的Bug报告 执行基于TDD的代码修正

Install

npx skills add kdlbs/kandev --skill fix -g -y
More Options

Non-standard path

npx skills add https://github.com/kdlbs/kandev/tree/main/.agents/skills/fix -g -y

Use without installing

npx skills use kdlbs/kandev@fix

指定 Agent (Claude Code)

npx skills add kdlbs/kandev --skill fix -a claude-code -g -y

安装 repo 全部 skill

npx skills add kdlbs/kandev --all -g -y

预览 repo 内 skill

npx skills add kdlbs/kandev --list

SKILL.md

Frontmatter
{
    "name": "fix",
    "description": "Diagnose a bug, update its behavioral spec, create reviewable fix plan and task files, then hand off for explicit implementation with TDD."
}

Fix

Use the same durable, reviewable workflow as feature work. Diagnose first, then produce the spec amendment, fix plan, and task files before changing production code. The user reviews those artifacts, switches the main session if desired, and sends a later explicit implementation request. Native subagents still require explicit authorization.

Core Flow

Evidence -> Root cause -> Spec amendment -> Fix plan + tasks -> Design-package handoff -> Explicit implementation request -> TDD implementation -> PR AI review

Do not patch production code before the planning checkpoint unless the user explicitly opts out of the workflow.

Phase 0: Evidence And Root Cause

When a bug originates from an issue tracker, read the canonical issue and every image attachment before hypothesizing. Reproduce with existing tests, a read-only trace, or a minimal throwaway repro. Do not add production code during this phase.

State the root cause before planning:

  • what is actually wrong, not only the symptom;
  • why it happens and under which conditions;
  • the smallest reliable reproduction; and
  • the intended regression-test level and path.

If the problem cannot be reproduced or the cause remains unclear, stop and ask the user rather than guessing at a fix.

Phase 1: Fix Specification

Before implementation, find the affected durable spec under docs/specs/<slug>/spec.md and amend its behavior or GIVEN/WHEN/THEN scenario to cover the regression. If no relevant spec exists, create a concise repair spec at docs/specs/<fix-slug>/spec.md that states the broken behavior, desired behavior, regression scenario, out-of-scope work, and any relevant contract or persistence constraint.

This spec is the reviewable expected behavior; it is not an incident report.

Phase 2: Fix Plan And Task Files

Create docs/plans/<fix-slug>/plan.md and sibling docs/plans/<fix-slug>/task-<NN>-<short-slug>.md files before implementation. Follow the /plan structure, with these fix-specific requirements:

  • Link the amended repair spec and state the confirmed root cause.
  • Include the regression test that must fail before the code change and pass afterward.
  • Name exact files, dependencies, acceptance criteria, and targeted commands.
  • Use dependency waves and mark parallel-safe only for disjoint tasks with no shared schema, migration, generated contract, lockfile, or package config.
  • Keep parallelism: sequential by default in each task; waves are a human decision aid, not authorization to delegate.

Phase 3: Design-Package Handoff

Before changing production or permanent test code, present:

  • root-cause summary and reproduction evidence;
  • amended/new spec path;
  • fix plan and task-file paths;
  • task waves, parallel candidates, and exact validation commands; and
  • risks and out-of-scope work.

End the turn after this handoff. Do not call ask_user_question_kandev (or an equivalent approval prompt) to ask the user to approve the package or switch models. The user reviews the files, switches the main session if desired, and sends a later explicit implementation request. The files may remain draft/pending; do not wait for a separate approval marker. Do not infer subagent authorization from the plan.

Phase 4: Implement With TDD After Handoff

After the user explicitly asks to implement, execute the tasks sequentially by default:

  1. Mark the task in_progress.
  2. Write and run the regression test; confirm it fails for the expected reason.
  3. Implement the minimal fix.
  4. Run the task's exact targeted unit, integration, or E2E command.
  5. Mark the task done and update plan.md status in the primary session.

For persisted defaults or coupled settings, audit every write/reset path for explicit empty or null values. Add the smallest invalid-pair regression, including fixture coverage, and verify normalized read-back plus existing validation.

When the user explicitly authorizes subagents, follow /planner-orchestration: native delegation only, current user-selected model, fork_turns: "none", compact task-file handoffs, no recursive spawning, and runtime usage-metadata confirmation. Only launch tasks marked parallel-safe.

Phase 5: PR Review

After all task checks pass, commit, push, and open the PR. Do not run automatic local simplify, QA, code/security review, or broad verification. The two configured PR AI reviewers are the semantic-review gate. Use /pr-fixup only for CI failures or actionable reviewer findings, rerunning only the affected task check after remediation.

Stop Conditions

Stop and ask the user when the root cause is uncertain, the repair changes an architecture/public-contract/persistence/security boundary, the spec and code disagree, or the same targeted check fails three times.

Final Report

Report the root cause, spec/plan/task paths, design-package handoff, subagents explicitly authorized (if any), changed files, tests run, and current PR-review status.

Version History

  • 1578843 Current 2026-08-16 08:47

    从简单的复现修复升级为包含规范修订、详细计划文件生成及设计包移交的系统化工作流;明确禁止在规划检查点前修改生产代码,强调根因分析与回归测试前置。

  • b4239d8 2026-07-24 17:32

Same Skill Collection

.agents/skills/acp-debug/SKILL.md
.agents/skills/add-integration/SKILL.md
.agents/skills/clean-branches/SKILL.md
.agents/skills/code-review/SKILL.md
.agents/skills/commit/SKILL.md
.agents/skills/context-engineering/SKILL.md
.agents/skills/create-kandev-plugin/SKILL.md
.agents/skills/debug/SKILL.md
.agents/skills/docs-maintainer/SKILL.md
.agents/skills/e2e/SKILL.md
.agents/skills/harness-improvement/SKILL.md
.agents/skills/interview-me/SKILL.md
.agents/skills/plan/SKILL.md
.agents/skills/planner-orchestration/SKILL.md
.agents/skills/playwright-cli/SKILL.md
.agents/skills/pr-fixup/SKILL.md
.agents/skills/pr/SKILL.md
.agents/skills/product-demo-seeding/SKILL.md
.agents/skills/product-video-capture/SKILL.md
.agents/skills/push/SKILL.md
.agents/skills/qa/SKILL.md
.agents/skills/release/SKILL.md
.agents/skills/runtime-feature-flags/SKILL.md
.agents/skills/simplify/SKILL.md
.agents/skills/spec-driven-development/SKILL.md
.agents/skills/spec/SKILL.md
.agents/skills/tdd/SKILL.md
.agents/skills/using-agent-skills/SKILL.md
.agents/skills/verify/SKILL.md
.agents/skills/mobile-parity/SKILL.md
.agents/skills/record/SKILL.md

Metadata

Files
0
Version
1578843
Hash
20480f07
Indexed
2026-07-24 17:32

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-16 20:11
浙ICP备14020137号-1 $mapa de visitantes$