一键导入
fix
Fix bugs and issues — reproduce, find root cause, minimal fix with regression test. Use when something is broken.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Fix bugs and issues — reproduce, find root cause, minimal fix with regression test. Use when something is broken.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Kandev release & versioning conventions — single SemVer across npm, Homebrew, GitHub release. Use when cutting a release, debugging release artifacts, or answering questions about version channels.
Review changed code for quality, security, and architecture compliance. Use after implementing features or before opening PRs.
Diagnose Kandev bugs, running-instance issues, UI/browser failures, and runtime behavior. Use when the user reports unexpected behavior, asks to investigate, asks to add logs/instrumentation, or when a fix needs root-cause evidence before implementing. Triage first, gather evidence safely, then hand off to /fix or /tdd for code changes.
Write and run web E2E tests (Playwright) using TDD — locations, patterns, commands, and debugging.
Ensures UI feature work ships with desktop and mobile parity, responsive behavior, and mobile Playwright E2E coverage. Use when implementing, planning, reviewing, or testing any new feature, page, component, workflow, form, dialog, sidebar, navigation, dashboard, or visual UI change; if work touches frontend or user-facing UI, this skill must run even when user mentions only desktop or says "new feature".
Create a committed implementation plan from a feature spec. Explores the codebase, designs the approach, and produces docs/plans/<feature>/plan.md plus individual task files. Use after writing a spec and before implementing.
| name | fix |
| description | Fix bugs and issues — reproduce, find root cause, minimal fix with regression test. Use when something is broken. |
Systematic bug fixing: reproduce the problem, find the root cause, apply a minimal fix with a regression test.
/tdd — Use for implementing the fix with a regression test (Red-Green-Refactor)./e2e — Use when the bug is in a user-facing flow and needs a Playwright regression test./verify — Run after fixing to ensure nothing else broke./record — Record architectural decisions or insights discovered during the fix.The artifacts for a bug fix are:
/record decision) IF the fix encoded a new project-wide convention (e.g., "GC code must fail-closed", "all repo deletes must be transactional"). Most fixes don't need one.A bug fix does not produce a spec. Specs describe product features; bugs are corrections to existing features and are tracked in tests + commits.
Create these tasks immediately (use your task/todo tracking tool if available):
Then start with task 0 when the bug is issue-sourced, otherwise task 1. Mark each task in_progress when you begin it and completed when you finish it. Do not skip ahead — fixing without reading the source issue (when one exists) or reproducing leads to patches that don't address the real problem. Fixing without understanding the root cause leads to whack-a-mole.
Mark task 0 as in_progress (skip this phase if there is no issue tracker source — e.g. a locally discovered bug with no linked issue).
When the bug originates from an issue tracker, fetch the canonical issue and view every image attachment before hypothesizing. Handed-down restatements (Kandev task/subtask text, Slack paste, PR description) are leads only — verify against the source.
gh issue view <N> --repo <owner/repo> --json title,body,comments
curl -sL "https://github.com/user-attachments/assets/<id>" -o /tmp/issue-<N>-<n>.png # then Read the local file
Mark task 0 as completed.
Mark task 1 as in_progress.
Before anything else, reproduce the bug reliably. Pick the right method based on where the bug lives:
go test -v -run TestName ./path/.../e2e that navigates to the page and triggers the bug. Run with make test-e2e to verify.If it can't be reproduced, add logging/assertions to gather more info — don't guess at a fix. Find the minimal reproduction case: strip away everything that isn't needed to trigger the bug.
For flaky Playwright failures, do not stop after one clean focused run. Use the
/e2e flake reproduction flow: run the exact CI shard in
ghcr.io/kdlbs/kandev-ci:runtime-latest with CI=true, then add resource
limits such as --cpus=2 --memory=4g --memory-swap=4g and repeat the failing
test or full spec file. Preserve nearby test ordering when a single-test repeat
passes, and inspect error-context.md from the failed repeat before fixing.
Mark task 1 as completed.
Mark task 2 as in_progress.
Don't guess and patch — systematically narrow the scope:
Trace the code path: Follow the data from input to the failure point. Add assertions or logging at the midpoint of the call chain. Is the data correct there? If yes, the bug is downstream. If no, upstream. Repeat until you find the exact line where things go wrong.
Narrow the input: What's the smallest input that triggers the bug? What's the largest input that succeeds? Strip away everything that isn't needed to trigger it.
Check history (only if it used to work): If a feature regressed, use git bisect to find the commit that broke it. Skip this for bugs that were always present.
Before proceeding, state the root cause clearly:
If you can't state this clearly, you haven't found the root cause yet — keep investigating. Present your root cause analysis to the user before fixing.
Mark task 2 as completed.
Mark task 3 as in_progress.
Follow /tdd:
Mark task 3 as completed.
Mark task 4 as in_progress.
/verify to ensure nothing else brokeMark task 4 as completed.
Mark task 5 as in_progress.
Two questions, in order:
1. Did the fix expose a requirement gap in an existing spec?
A bug can mean the spec was wrong, ambiguous, or silent about the scenario that broke. Ask: "If someone re-implemented this feature from the spec alone, would they reproduce this bug?" If yes, the spec is incomplete.
docs/specs/<slug>/spec.md (check docs/specs/INDEX.md).Do NOT create a new spec for the bug fix itself. Bugs aren't features.
2. Did the fix encode a new project-wide convention?
If the root cause exposed an architectural gap, a non-obvious constraint, or a rule that should bind future code (e.g., "GC code must fail-closed", "all bulk deletes must be transactional"), run /record decision to capture it as an ADR.
If neither question applies, skip this phase.
Mark task 5 as completed.