pisan-labs

Brocot Gear Finder — Productivity skill for Claude Code

Productivity community

Type a gear ratio such as 12, 2460 or sidereal time and get the most accurate 1 to 3 stage gear trains within your tooth limits, the continued fraction and Stern-Brocot path to it, an animated SVG tr.

How to install Brocot Gear Finder

This entry records only its repository, not the path inside it, so there is no exact command to give. Open pisan-labs/brocot-gear-finder and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Brocot Gear Finder does

Type a gear ratio such as 12, 24*60 or sidereal time and get the most accurate 1 to 3 stage gear trains within your tooth limits, the continued fraction and Stern-Brocot path to it, an animated SVG train and a drift dial. Built with Claude Code.

Alternatives in Productivity

  • Skill Context Detection — Auto-detect work context (Dev vs Knowledge) — use to tailor workflows based on current task type 2.8k ★
  • Maestro Knowhow — Intent-driven knowhow precipitation — describe what you want to capture (记一个关于X的决策 / 保存这段代码模板 / 写个部署配方 / 存个调试技 530 ★
  • Gm Brilliant Implementation — Run the complete 34-stage implementation workflow for a large, multi-system, multi-wave, or CPU-delegated 5 St 416 ★

README

Brocot Gear Finder

Real gears have whole numbers of teeth, so most ratios can only be approximated. Type a target reduction (input turns per one output turn: 12 for an hour hand, `24*60` for a daily dial on a 1 rpm motor, `365.2422/366.2422` for sidereal time) and the page lists the most accurate 1 to 3 stage gear trains inside your tooth range, shows the continued fraction and Stern-Brocot path toward the target, and animates the chosen train in SVG next to a dial that shows how far it drifts from an ideal hand.

Live: [brocot-gear-finder.hintwise.org](https://brocot-gear-finder.hintwise.org)

![Picking the moon-phase preset lists the most accurate 1 to 3 stage gear trains for 29.530589, then the chosen three-stage train turns in SVG and dragging the drift slider shows it 74 degrees ahead of an ideal hand after 100 million turns](demo.gif)

Built from idea 2026-10-05 n1 in [`pisanuw/daily-project-ideas`](https://github.com/pisanuw/daily-project-ideas).

![Sidereal-time search: best 1, 2 and 3 stage trains, the animated three-stage train, the drift dial and the convergent table](desktop.png)

What it does

  1. Target. Any arithmetic expression (+ - * / ^, parentheses) or a:b. No eval: a small recursive-descent parser. Targets below 1 are step-up trains (the output turns faster).
  2. Search. A compound train with k stages has k driving and k driven gears, and its reduction is prod(driven) / prod(driver). So N/D is buildable in k stages exactly when N and D are both products of k tooth counts in range. The search marks every such product once in a byte table (bit k-1 = "product of k teeth"), then for every possible driver product D tests the numerators nearest to target × D. One train is kept per reduced ratio (the fewest stages, then the fewest teeth), and the most even factorisation is chosen so you get 8→24 · 8→32 for 12, not 8→8 · 8→96. Sidereal time with 8 to 120 teeth and 3 stages checks about 25,000 candidate trai