Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

pstack-bug-fix

/pstack-bug-fix

Prowadzi naprawę błędu według metody pstack: odtwarza usterkę, znajduje przyczynę, dodaje nieprzechodzący test i weryfikuje poprawkę.

Licencja
AGPL-3.0
Ostatnia zmiana repozytorium
09.11.2026

Ocena i bezpieczeństwo

95/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść30 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 09.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

AGPL-3.0, copyleft: przeróbki udostępniane innym muszą mieć tę samą licencję.

Co robi i kiedy

Prowadzi naprawę błędu według metody pstack: odtwarza usterkę, znajduje przyczynę, dodaje nieprzechodzący test i weryfikuje poprawkę.

Oryginalny opis (EN)

pstack bug-fix playbook: reproduce a defect, root-cause it with runtime evidence, land a failing test before the smallest fix, and verify on the same surface. Use for /pstack-bug-fix or when asked to fix a bug the pstack way.

Jak działa

  1. Steps
  2. Reply
Sekcje z nagłówków SKILL.md, w oryginale · 67 linii, 700 słów
Podgląd SKILL.md
---
name: pstack-bug-fix
description: "pstack bug-fix playbook: reproduce a defect, root-cause it with runtime evidence, land a failing test before the smallest fix, and verify on the same surface. Use for /pstack-bug-fix or when asked to fix a bug the pstack way."
metadata:
  workflow: bug-fix
---

# Bug fix (pstack)

Adapted from the pstack bug-fix playbook (https://github.com/cursor/plugins/tree/main/pstack, MIT, © 2026 Lauren Tan).

**You own this task. Plan, verify, report.** Be scientific. Every shipped line traces to runtime evidence. Belt-and-suspenders that "might help" is a hypothesis, not a fix. It does not ship. When evidence refutes a hypothesis, revert what it motivated. The smallest change the evidence justifies ships, nothing more.

## Steps

### 1. 复现 (reproduce)

Reproduce it yourself on the surface the user named, using the exact command or input they gave. If it won't reproduce directly, synthesize the trigger, tighten conditions, or instrument until it fires. Ask the user only with a specific reason the surface cannot be reached, after driving it as far as it goes.

Keep the exact repro command or input and the intended output, so the fix can be tested against the same case.

Done when: the repro is stable (for example 3/3), and its output shows the bug.

### 2. 二分定位 (bisect)

Binary-search the cause. Form candidate hypotheses, then rule them out until one survives. Seed them by reading the affected code and its history (`git log -p`, `git bisect` against a known-good commit). Each pass, take the split that cuts the most remaining problem space, get runtime evidence, eliminate. When program state is unclear, add temporary logging and read it as the code runs. Don't guess.

Done when: the surviving mechanism is confirmed with runtime evidence, not only by reading code. Remove temporary logging before moving on.

### 3. 设计修复 (plan-fix) — optional

If the fix crosses a function boundary, sketch the caller's usage, the types, and which module owns the change before writing code. A fix contained inside one function skips this step.

Done when: the fix scope and any interface change are written down.

### 4. 红灯测试 (red)

Write the smallest focused regression test that would have caught the bug, using the project's existing test runner and style. It encodes intended behavior, not the current implementation. Run it before touching production code and confirm it fails for the intended reason. If it passes or fails for an unrelated reason, fix the test first. Commit the failing test on its own (`git commit`), so the failing repro lands before the fix in history.

If a failing test is impractical (expensive, integration-heavy, unclear), say why in the `note` and use the closest executable check instead.

Done when: the new test fails on the current code for the intended reason and is committed.

### 5. 修复 (fix)

Make the smallest production change the evidence justifies. Preserve nearby contracts. Do not change the test to match the code. A fix larger than a few lines goes to a `subagent` with a specific scope: file paths, the confirmed mechanism, the failing test to make pass, and the success criterion.

Done when: the change covers only what the evidence supports.

### 6. 同界面验证 (verify)

Verify on the same surface. Rerun the original repro command with the same input, then the new test, then the whole existing test suite. "Inconclusive" or wrong-surface is not a pass. Unit tests show branch behavior, not bug absence.

If the repro still gives the wrong output, return to `fix` when the mechanism is known and the fix is incomplete, or to `bisect` when the cause remains unexplained. Make the change there, then repeat the same-surface verification.

Done when: the original repro shows the intended output and the suite passes. Keep the failing-before and passing-after output.

### 7. 对抗审查 (interrogate) — optional

For a non-trivial diff, spawn a `subagent` told to try to break the change and report only findings it proved by running a command. Rerun each finding yourself and keep only the ones that reproduce. A one-line fix with a regression test skips this step.

Done when: every finding has a repro command, or there are none.

### 8. 开 PR/MR (pr)

Load `pstack-opening-a-pr` through the `skill` tool. Keep the failing regression test in the first commit, with the fix on top.

Done when: the commits are in place and the reply below is written.

## Reply

What was broken, the root cause, the fix, and how you verified it. Paste the failing-then-passing repro output verbatim.

Wersje

W bazie nie ma innych skilli o nazwie pstack-bug-fix.

Migawka bazy z 13.11.2026 · wersja paczki c0a3f915dc3e (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 96fix-bug
    Naprawia usterkę: odtwarza ją, pisze nieprzechodzący test, znajduje przyczynę, poprawia kod i zapisuje wniosek.
  • 100bug-fix
    Naprawia błędy zgłoszone w projekcie Device: odtwarza je, pisze mały test, znajduje przyczynę i potwierdza poprawkę.
  • 100tdd-pstack
    Pisze nieudany test regresyjny przed poprawką błędu, gdy użytkownik prosi o TDD albo ma tani lokalny test.
  • 100fix-bug
    Odtwarza błąd, znajduje przyczynę, naprawia ją w miejscu i sprawdza poprawkę na tym samym odtworzeniu.
  • 90pb-bug-fix
    Zamienia zgłoszenie z GitHuba w przetestowaną poprawkę na gałęzi z otwartym PR: znajduje przyczynę, pisze najpierw nieprzechodzący test, poprawia, weryfikuje i otwiera PR dopiero po GO.
  • 90poteto-mode
    Uruchamia playbooki inżynierskie pstack do badania, implementacji, przeglądu i weryfikacji.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.