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

Abierto Apto para principiantes
#1,308 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
75/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
markdown

Línea de trabajo

Lee plugins/small-business/skills/cash-flow-snapshot/SKILL.md, especialmente los pasos 4 y 5 y la fila de la tabla que describe la banda de confianza. Comprueba cómo trata la fórmula el efectivo neto negativo, cercano a cero y nulo respecto a la intención indicada de que la incertidumbre sea un porcentaje de las entradas esperadas. El trabajo estará terminado cuando el cálculo documentado mantenga el valor bajo y el alto en el orden correcto y represente la incertidumbre de las entradas en los tres casos.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Python
Estrellas
36.8k
Forks
4.1k
Merge medio
1 d 23 h
PR fusionados (30 d)
17

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de anthropics/knowledge-work-plugins

Todos los issues de anthropics/knowledge-work-plugins

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.