small-business / cash-flow-snapshot: confidence band flips or collapses when net cash is negative or near zero

Aperta Adatta ai principianti
#1,308 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
markdown

Direzione di ricerca

Leggi plugins/small-business/skills/cash-flow-snapshot/SKILL.md, in particolare i passaggi 4 e 5 e la riga della tabella che descrive la banda di confidenza. Verifica come la formula gestisce un flusso di cassa netto negativo, prossimo allo zero e pari a zero rispetto all’intento dichiarato secondo cui l’incertezza è una percentuale degli afflussi previsti. Il lavoro è completo quando il calcolo documentato mantiene il valore basso e quello alto nell’ordine corretto e rappresenta l’incertezza degli afflussi in tutti e tre i casi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

small-business / cash-flow-snapshot: confidence band flips or collapses when net cash is negative or near zero

Plugin: small-business v1.35.1 Skill: skills/cash-flow-snapshot Checked against: anthropics/knowledge-work-plugins main, commit 02ffa99 (11 Oct 2026). Bug is present.

Summary

Step 4 of SKILL.md scales the confidence band by the net cash figure:

band_pct = weighted_avg_stddev_days / avg_payment_lag_days
low  = net_cash × (1 − band_pct)
high = net_cash × (1 + band_pct)

The band measures uncertainty in when customers pay, so it belongs on expected inflows. Multiplying it by net cash breaks in three ways:

  1. Negative net: low and high swap. "Low" comes out less negative than "high", so the pessimistic case looks better than the expected case.
  2. Net near zero: the band collapses. A window with large inflows and matching outflows gets a band of almost zero, even though every inflow is uncertain.
  3. Net of exactly zero: no band at all.

The table one row above the formula already describes the intended behavior ("± weighted average payment variance as a % of expected inflows"). The formula doesn't follow it.

Why it matters

Negative and near-zero windows are the cases the skill exists for ("will I make payroll", "cash crunch"). Step 5 tells the model to flag risks when the low-band estimate goes negative. With the formula as written, a negative window reports a low band that is better than expected, so the shortfall risk is understated at exactly the moment it matters.

Reproduction

Band of 9.7% in each case except the last row.

Case | Inflows | Outflows | Net | Low / High as written | Low / High on inflows -- | -- | -- | -- | -- | -- Negative net | 53,200 | 64,420 | −11,220 | −10,132 / −12,308 (flipped) | −16,380 / −6,060 Zero net | 50,000 | 50,000 | 0 | 0 / 0 (no band) | −4,850 / +4,850 Repo worked example, 0–30d (band 28.3%) | 22,600 | 22,000 | +600 | 430 / 770 | −5,796 / +6,996

To reproduce in a session: run cash-flow-snapshot on any CSV where one window's outflows exceed its inflows, and follow Step 4 literally.

The worked example contradicts the formula

reference/examples/worked-example.md doesn't follow the rule either, and its two rows use different methods:

  • 0–30d: net +600, band 28.3%, shown as −5,928 / +7,128. That is a wide range, which an inflow-based band produces. The formula as written gives 430 / 770. The figures also don't exactly match the inflow-based result (−5,796 / +6,996), so the example has an arithmetic slip as well.
  • 31–60d: net +2,320, shown as 1,670 / 2,970. That is net × (1 ∓ 0.28), the formula as written.

A model following the skill gets two conflicting examples and has to guess.

Suggested fix

Apply the band to expected inflows, as the Step 4 table already says:

 Confidence band formula:
 ```
 band_pct = weighted_avg_stddev_days / avg_payment_lag_days
-low  = net_cash × (1 − band_pct)
-high = net_cash × (1 + band_pct)
+low  = net_cash − (band_pct × expected_inflows)
+high = net_cash + (band_pct × expected_inflows)
 ```

Then regenerate the worked example's forecast table and chat summary with the corrected formula so both rows use one method.

Smaller issues found nearby

  • "Round band_pct to one decimal place" is unclear. If band_pct is a fraction, one decimal place turns 0.283 into 0.3 (30%). The example shows 28.3%, so the intent is probably "one decimal place as a percentage." Worth saying so.
  • The band is a percentage of the payment lag, used as a percentage of the cash amount. Std dev ÷ mean lag measures how much timing varies, not how much money is at risk. It works as a rough proxy, but a better model would move each receipt by ±1 std dev of lag and re-bucket it into windows (a late payer slipping out of the 30-day window entirely). The skill's own late-payer risk flag already reasons this way.
  • Forecast covers booked work only. The 60- and 90-day windows include only open AR, booked jobs, AP and fixed costs. For any business that keeps invoicing new work, those windows trend negative by construction, and the skill doesn't tell the model to say so. A one-line caveat in the output template would prevent owners from reading a cliff that isn't there.
Lingua principale
Python
Stelle
36.8k
Fork
4.1k
Merge medio
1g 23h
PR unite (30g)
17

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di anthropics/knowledge-work-plugins

Tutte le issue di anthropics/knowledge-work-plugins

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.