Przejdź do treści
Biblioteka skilli
Programowanie · Przegląd i audyt

no-more-implicit-fsms

/no-more-implicit-fsms

Szuka w kodzie ukrytych maszyn stanów, czyli logiki cyklu życia rozsianej po flagach i statusach, i ocenia wynikające z nich ryzyka.

Licencja
MIT
Ostatnia zmiana repozytorium
12.11.2026

Ocena i bezpieczeństwo

90/ 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ść25 / 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
18
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

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

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Szuka w kodzie ukrytych maszyn stanów, czyli logiki cyklu życia rozsianej po flagach i statusach, i ocenia wynikające z nich ryzyka.

Oryginalny opis (EN)

Audit a codebase for implicit state machines — lifecycle and mode logic spread across boolean flags, nullable fields, status strings, file locations and retry counters instead of one explicit state type — and grade the failure modes they create: wedges with no exit, lost updates, dual writes, expired-state drift and heuristic recovery. Use when asked to find implicit or hidden state machines, audit state/lifecycle/status logic, explain why something gets stuck or reaches an impossible state, review a diff that adds state fields, or before refactoring flag-heavy code — even if nobody says "stat

Jak działa

  1. Pre-flight
  2. Inclusion threshold — is it a machine?
  3. The audit loop
  4. Common mistakes
Sekcje z nagłówków SKILL.md, w oryginale · 116 linii, 797 słów
Podgląd SKILL.md
---
name: no-more-implicit-fsms
description: >
  Audit a codebase for implicit state machines — lifecycle and mode logic
  spread across boolean flags, nullable fields, status strings, file
  locations and retry counters instead of one explicit state type — and grade
  the failure modes they create: wedges with no exit, lost updates, dual
  writes, expired-state drift and heuristic recovery. Use when asked to find
  implicit or hidden state machines, audit state/lifecycle/status logic,
  explain why something gets stuck or reaches an impossible state, review a
  diff that adds state fields, or before refactoring flag-heavy code — even
  if nobody says "state machine". Do NOT use for building or designing a new
  state machine, statecharts/XState tutorials, or single-flag logic.
---

# No More Implicit FSMs

An **implicit state machine** is lifecycle logic no single type owns. Its
states live in boolean products (`busy` + `cancelling` + `pending`), nullable
fields whose presence encodes progress, status strings compared ad hoc, file
locations, retry counters and ordering rules kept only by call order. Each
one is a place where the code can reach a combination nobody designed — and
often one it cannot leave.

This is an audit. Read and report; change code only when the user asks. What
this skill adds over "find the flags": a named failure-mode bank
(`references/antipattern-bank.md`) covering crashes, concurrency, persistence
and time — not just impossible combinations.

## Pre-flight

Pick search tools → read `references/tooling.md` fully; it is the decision
table and it starts with the availability check. Minimum: recursive regex
search (ripgrep/grep). If no search tool can see the repo, stop and say so.

## Inclusion threshold — is it a machine?

Audit a candidate only when ALL hold:

1. ≥3 real states, or a boolean/nullable product of ≥3 fields read together
2. Behavior branches on the state (dispatch, gates, quotas)
3. Transitions are triggered by events, time or external effects — not only
   by the constructor
4. The state outlives one call: persistence, concurrency, or a multi-step
   protocol

Below threshold → not a machine; do not report it. A pure enum passed as an
argument is data, not a lifecycle. A pipeline that only moves data between
stages is dataflow, not a machine — audit a stage only if it has a
lifecycle of its own. This filter is what separates the audit from
flag-counting noise.

## The audit loop

### Step 1 — Inventory candidates

Sweep the whole repo, not one module. Skip build output, vendored and
generated code. Language-specific signatures → `references/lang/<language>.md`;
read every file matching a language present in the repo (mixed repos are
normal). Universal signatures live in `references/antipattern-bank.md`
§Finding candidates.

Cluster hits by owning type, table or file set. One lifecycle = one machine
even when its fields span several types (status field + lease map + journal
entry is ONE machine).

Checklist before moving on:

- [ ] Status/Phase/State/Mode fields and their write sites listed
- [ ] Boolean/nullable products on one type read or reset together
- [ ] File/directory location used as state (rename = transition)
- [ ] Retry/crash/cooldown counters and TTL/expiry fields found
- [ ] Explicit machines noted — then checked for bypass writes around them
- [ ] Reconcile/sweeper passes found (requeue|reconcile|reap|expire|gc) —
  their presence clears wedge hypotheses fast; absence on a durable
  machine is itself the finding
- [ ] States born outside transitions: schema DEFAULTs, migration/backfill
  UPDATEs, seeds, bulk imports

### Step 2 — Extract each machine

For every machine write the card defined in `references/method.md` §Card.
**Read `references/method.md` before extracting the first machine** — it
fixes the card schema, the CONFIRMED/POSSIBLE rule and the severity matrix
used at every later step.

Minimum per machine: real states (not possible combinations), transitions
(from → to via event @ writer), writers, persistence stores, concurrency
surface, recovery path after crash or restart.

### Step 3 — Classify failure modes

Match each card against every applicable class in
`references/antipattern-bank.md` (A graph → H operability). Answer each card's
auditor question from code, not intuition.

- **CONFIRMED** requires a traced sequence: events + writers + timing.
- Otherwise **POSSIBLE**: the code allows it, no trigger traced.
- Correct code is not a finding — name it in the summary as the pattern to
  copy. A machine matching a `good-pattern-bank.md` pattern consistently
  (transition table used everywhere, reconcile loop covering every durable
  state) clears in one line — spend the time on machines that fail checks.

### Step 4 — Grade and fix-sketch

Severity per `method.md` §Severity: wedge > data-loss > drift > cosmetic.
Every finding carries a fix sketch pointing into
`references/good-pattern-bank.md` — open it when writing recommendations; do
not invent framework rewrites.

### Step 5 — Report

Format per `method.md` §Report: findings ranked by severity × confidence,
each with file/line evidence and the sequence that reaches the bad state;
implicit-but-correct machines last. If the repo keeps a machine catalog, write
or update it so the next run diffs instead of re-auditing.

## Common mistakes

- **Reporting the cartesian product as "states".** List the states the code
  actually distinguishes; the unreachable product is the bug surface, not the
  machine.
- **Flagging a correct explicit machine.** A transition table used
  consistently is the goal, not a finding — name it as the pattern to copy.
- **POSSIBLE reported as CONFIRMED.** No traced sequence → POSSIBLE.
- **Fixing without asking.** The audit ends at ranked recommendations;
  refactoring is a separate instruction.
- **Language bias.** Go concurrency signatures miss `await`-boundary races in
  Python; load the right `lang/` files first.
Pliki w paczce (18)
  • .gitignore 1 KB
  • AGENTS.md 2 KB
  • CONTRIBUTING.md 1 KB
  • LICENSE 1 KB
  • README.md 4 KB
  • README.ru.md 5 KB
  • SECURITY.md 1 KB
  • SKILL.md 6 KB
  • skills.sh.json 1 KB
  • assets/readme/hero.gif 596 KB
  • references/antipattern-bank.md 18 KB
  • references/good-pattern-bank.md 5 KB
  • references/method.md 6 KB
  • references/tooling.md 5 KB
  • references/lang/go.md 3 KB
  • references/lang/python.md 3 KB
  • references/lang/rust.md 3 KB
  • references/lang/typescript.md 3 KB

Wersje

W bazie nie ma innych skilli o nazwie no-more-implicit-fsms.

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

Pobrania w ostatnich 30 dniach: 4 · ranking

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

Podobne skille

  • 100find-implicit-state-machines
    Szuka ukrytych maszyn stanów rozsianych po flagach, polach statusu, timerach i callbackach oraz sprawdza je pod kątem błędów.
  • 100state-machine-audit
    Audytuje tylko do odczytu obsługę stanów, wyścigi asynchroniczne i zapis w kodzie, a wynik zapisuje w raporcie REPORT.md.
  • 100forage
    Przegląda kod pod kątem ukrytych maszyn stanów i sekwencyjnych oczekiwań, które mogą zawiesić cały proces przy jednym zawieszonym elemencie.
  • 86install-implicit-statescript
    Dodaje plugin Oxlint implicit-statescript do repozytorium TypeScript, ustawia reguły na ostrzeżenia i uruchamia skan ukrytych stanów w flagach.
  • 100footguns
    Szuka pułapek w kodzie: ukrytych maszyn stanów i założeń, które kod zakłada, ale nie egzekwuje.
  • 90convert-state-machines-to-actors
    Przekształca niejawny automat stanów z bazy danych w aktora, który jako jedyny zapisuje dane, by usunąć wyścigi.

Uwagi i zgłoszenia

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