Skip to content

feat(find-free-cash): add the find-free-cash skill (v0.6.52) - #97

Merged
l3a0 merged 2 commits into
mainfrom
claude/find-free-cash
Nov 9, 2026
Merged

l3a0 merged 2 commits into
mainfrom
claude/find-free-cash

Conversation

@l3a0

@l3a0 l3a0 commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Why

The find-free-cash skill works out how much cash in a linked brokerage account is free to spend without margin. A broker's cash balance counts money already promised elsewhere, so a figure read straight off it can lead to buying on margin. The skill lived only in the owner's home folder. On 2026-11-09 the owner chose this plugin as its home, in reply to the review of l3a0/ithildin-runtime#68 ("Use the plugin."), so it loads as /l3a0:find-free-cash in every repository.

What

  • skills/find-free-cash/SKILL.md holds the procedure. It reads an account through the read-only SnapTrade tools, open orders first, judges each account's freshness by its prices, reads the latest fills, runs the script, and reports.
  • skills/find-free-cash/scripts/free_cash.py pairs every short option with its cheapest cover and keeps the lowest of three figures: the broker's cash minus holds, the broker's own buying power, and thinkorswim's Option Buying Power minus the loan value of holdings. It stops without a figure on an uncovered short call, on a negative loan value, and on input that would drop a hold.
  • New here: working sell orders count as filled. The owner ruled on this in feat(skills): add the find-free-cash skill ithildin-runtime#68 ("Yes."). The script takes a working_orders input and works out the free cash as if every working sell order fills. It prints the figure with none filled beside it. A working sale thinkorswim already holds is not subtracted from its figure twice. A working spread is entered as its short leg, which holds the full strike rather than the width.
  • New here: skills/find-free-cash/scripts/latest_fills.py reads the saved executed-orders result and prints the latest fills. Each run used to write that script by hand.
  • tests/test_free_cash.py pins both scripts to values worked out by hand, and CI runs it. tests/mutate_free_cash.py <copy> applies 46 mutants to the two scripts, and every one fails the tests.
  • SECURITY.md gives the skill a scope entry.
  • The plugin's version moves to 0.6.52, which scripts/next_version.py named as the next free one. plugin.json, both descriptions in marketplace.json and the README's ## Skills section now name the skill.

Privacy

This repository is public. The skill names no account and asks which account is in question. Every balance, strike and fill in its examples and tests is invented.

Notes

  • Closes no issue.
  • feat(skills): add the find-free-cash skill ithildin-runtime#68 is closed without merging, because the skill lives here now.
  • The owner's home-folder copy, ~/.claude/skills/find-free-cash/, should go once this merges. It still loads under the plain name, holds real figures, and subtracts no working orders. Until then, call the skill by its full name, /l3a0:find-free-cash.
  • Three descriptions were stale before this change and are left for the owner: the repository's About text on GitHub names only kindle-highlights, and this repository's CLAUDE.md says two skills ship and, in its "Status" paragraph, that the repository has no test suite.

🤖 Generated with Claude Code

The skill works out how much cash in a linked brokerage account is free
to spend without margin, after what short puts, spreads, open buy orders
and working sell orders hold back, and how many shares that cash buys.
It lived only in the owner's home folder. The owner chose the plugin as
its home on 2026-11-09, so it loads in every repository.

It comes from l3a0/ithildin-runtime#68, where a team review fixed the
script and added its tests. This change also counts working sell orders
as filled, on the owner's ruling in that pull request, and adds
scripts/latest_fills.py for reading the saved executed-orders result.

Every account, balance and trade in the skill and its tests is invented.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Working orders: a fill that leaves a spread and the share count after
  every fill now have tests. A working sale thinkorswim already holds is
  not subtracted from its figure twice. A negative addition stops.
- The skill reads open orders before positions, writes each order's
  open_quantity, says how to enter a working spread, and says the orders
  tool returns only the last 30 days.
- latest_fills.py has tests for the --since boundary, --limit, a partial
  fill and the exact price.
- tests/mutate_free_cash.py reruns the 46 mutants, and every one fails
  tests/test_free_cash.py.
- SECURITY.md gives the skill a scope entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@l3a0

l3a0 commented Nov 9, 2026

Copy link
Copy Markdown
Owner Author

Review complete

Round 1 of the review of 1cb3318 against main at 6e878c4. The repository has no docs/team-charter.md, so each role used its agent file's defaults. This round read what changed since the review of l3a0/ithildin-runtime#68. Four reviewers ran blind:

  • Two team roles from /l3a0:ask-team: the test engineer and the risk engineer.
  • Two lenses: completeness and over-reach.

The main thread confirmed each veto and must-fix by running it. No separate verifier ran. The fixes are in e039ba3.

Found and fixed

  1. Veto from the test engineer: a working order whose fill leaves a spread had no test. Dropping the spread term from what working orders add survived the suite and overstated free cash by $1,000 on a hand-made case. A test now pins that case at $1,000 and $99,000.
  2. Veto from the test engineer: the share count after every working order fills had no test. Counting shares from the figure where nothing fills survived, and it showed 1,000 shares against $40,000 free. A test now pins 400 shares.
  3. Must fix: four refusals had no test. They cover working shares above zero, half a working contract, zero working contracts, and a working field that is not an object. Removing the first check survived and raised free cash by $500. Each now has a test.
  4. Must fix: the orders tool returns only the last 30 days. A saved history of a years-old account covered 28 days, so a working good-till-cancelled sale placed earlier can be missing and make the figure too high. The skill now says so, and says to check the broker's list. It no longer calls the executed history "whole".
  5. Should fix: positions were read before open orders. A sale that filled between the two reads appeared in neither. Open orders are now read first, so the same race counts the sale twice, which holds too much rather than too little.
  6. Should fix: a working sale that thinkorswim already holds was subtracted twice. That also printed a mismatch with no fix. When thinkorswim's gap equals exactly what the working orders add, the script now says so and takes nothing more off thinkorswim's figure. Two tests pin both cases.
  7. Should fix: a working spread order had no way in. The skill and docstring now say to enter its short leg, which holds the full strike, and that the report names the overstatement.
  8. Should fix: no stop if working orders ever lowered the holds. main now stops on that, which load should make impossible.
  9. Should fix: latest_fills.py mutants survived on the --since boundary, --limit, a partial fill's quantity and the price format. Each now has a test.
  10. Should fix: SECURITY.md gave the skill no scope entry. It has one now.
  11. Notes:
    • The report section now names working sell orders and both figures.
    • The docstring lists every stop.
    • The README names the negative-loan-value stop.
    • The PR body names the mutant runner and every stale description.

tests/mutate_free_cash.py reruns all 46 mutants of the two scripts, and every one fails tests/test_free_cash.py.

Refuted or left alone

  1. The risk engineer's subset check found nothing. Across 3,000 random accounts, no partial set of fills held more than all of them, so counting every working order as filled is the worst case.
  2. Treating sales to close like sales to open goes past the ruling's words. The over-reach lens judged that it stays inside the ruling's reason, because such a fill also borrows. Kept.
  3. A working sale that would leave a call uncovered gives no figure at all, not even the none-filled one. It needs a sale the broker would usually block, and it stops on the safe side. The skill now says no figure is given in that case.
  4. latest_fills.py, the version bump and the wiring were judged inside the change.

For the owner

  1. Delete ~/.claude/skills/find-free-cash/ once this merges.

    • Why: it still loads under the plain name, holds real figures, and subtracts no working orders.
    • Until it is gone: use /l3a0:find-free-cash.
  2. Three descriptions were stale before this change:

    • the repository's About text on GitHub
    • the two-skills count in CLAUDE.md
    • the "no test suite" line in its Status paragraph

    They are the owner's to change.

Cost

The four reviewers cost at least 4.11 US dollars: 4.5M tokens over 52 turns, almost all cache reads. The main thread's confirmations and fixes ran in its own context and are not counted. The pull request closes no issue, so the cost goes here.

Skill proposal

Two procedures recurred in this session, and this change already builds both into the skill:

  • the latest-fills reader, scripts/latest_fills.py
  • the mutant runner, tests/mutate_free_cash.py

Nothing else qualifies.

🤖 Generated with Claude Code

@l3a0
l3a0 merged commit 5b9a966 into main Nov 9, 2026
12 checks passed
@l3a0
l3a0 deleted the claude/find-free-cash branch November 9, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant