Adding a tool to the hub
The hub is a registry plus a page. If you touched more than two files, check why.
Everything about a tile — its title, blurb, icon, status pill, accent, and where it points — is
one entry in site/src/tools.ts. Home.tsx maps over TOOLS to draw the grid; App.tsx holds
the routes. Nothing else enumerates tools, so never add a second list.
All commands run from site/, not the repo root.
1. The registry entry
// site/src/tools.ts — TOOLS is the single source of truth
{
slug: 'kelly', // unique; matches the route/folder name
title: 'Kelly Stake Sizer',
blurb: 'One or two sentences, present tense, no marketing.',
icon: Calculator, // a LucideIcon, imported at the top of the file
href: '/kelly',
kind: 'route', // 'route' | 'static' | 'external'
status: 'live', // 'live' | 'wip' | 'soon'
accent: 'teal', // must exist in ACCENT in Home.tsx
tag: 'Calculator', // optional short category label on the tile
}
Then, by kind — each one obliges exactly one more thing:
kind |
href |
You must also |
Rendered as |
route |
/slug |
add <Route path="/slug" element={<Page />} /> in App.tsx and import the page |
<Link>, client-side |
static |
/slug/index.html — the explicit file |
drop the page under site/public/slug/ |
<a>, full page load |
external |
the absolute URL |
nothing |
<a target="_blank" rel="noopener noreferrer"> |
[!WARNING]
A static tool's href must name index.html. Vite's dev server does not auto-serve a
public/ directory index, so /spectrum/ 404s locally while working fine on Vercel — a break
that only shows up for whoever runs npm run dev next. /spectrum/index.html resolves
identically in both. This is written into the comment above the spectrum entry; keep it there.
2. The accent must be a literal
ACCENT in site/src/pages/Home.tsx is a Record<Accent, …> of fully spelled-out Tailwind
class strings. Tailwind v4's JIT scans source text — it cannot see text-${color}-400. A new
accent needs three things or the tile renders unstyled:
- the key added to the
Accent union in tools.ts,
- a row in the literal
ACCENT map with icon, corner and hoverBorder spelled out in full,
- no interpolation anywhere in between.
The seven that exist — sky emerald violet amber rose teal cyan — cover more tools
than the hub has. Reuse one before adding one. The STATUS map right below it works the same
way and already covers live / wip / soon; a tool that is not ready ships as soon, it does
not ship absent.
3. Building a route page
New calculator pages follow the two that exist — read pages/OddsConverter.tsx before writing a
third. The pattern and its reuse rules are in
references/page-patterns.md.
The short version:
- Math goes in a pure module, never in the component.
src/odds.ts already holds American /
decimal / fractional / implied conversion, three de-vig methods (multiplicative, power, Shin)
and parlay joint-probability math, with zero imports so scripts/check-odds.ts can assert
against it. Reuse it. Re-deriving a conversion inside a page puts it outside the guard.
- Chrome goes in
components/CalcUi.tsx — Panel, Select, Stat are shared by both
calculator pages.
- New non-trivial math earns a
check:* script and a line in .github/workflows/ci.yml.
That is the house convention, not an optional extra: every other module of real logic has one.
4. Routes that are not tools
/setup is a <Route> in App.tsx with no TOOLS entry — it is the self-hosting page, linked
from the Home hero, not a tile. That is deliberate and it is the precedent: a page that is not a
tool gets a route and stays out of the registry. <Route path="*"> falls back to Home, so a
typo'd href silently renders the hub instead of 404ing — click the tile after adding it.
Deep links work in production because vercel.json rewrites /((?!api/).*) to /index.html. If a
new client route 404s on Vercel but works in dev, that rewrite is the first place to look.
5. Checklist
- One entry in
TOOLS — slug unique, blurb factual, tag short.
- Branch on
kind (§1). route → <Route> + import. static → public/<slug>/ + an
index.html href. external → done.
- Accent exists as a literal in
Home.tsx (§2) — or reuse one of the seven.
- Math in a pure module, chrome from
CalcUi.tsx (§3).
- New logic gets a
check:* script wired into CI.
npm run lint — tsc --noEmit catches an accent key that is not in the union.
npm run dev and click the tile, then reload on the deep link. The * fallback hides a
bad href behind a working-looking page.
- Update
AGENTS.md's layout block if the tool added a directory.
6. Anti-patterns
- A second list of tools. Nav, footer, sitemap — all of them map over
TOOLS.
- An interpolated Tailwind class (
text-${accent}-400). JIT never emits it.
href: '/spectrum/' for a static tool. Works on Vercel, 404s in dev.
- Math inside the page component. It escapes
check:odds.
- Trusting the tile to prove the route.
<Route path="*"> renders Home for anything.
- Shipping a half-finished tool by leaving it out of
TOOLS. Mark it soon.
- Running
npm at the repo root. The whole app is in site/.
Related
| For |
See |
The calculator page pattern, odds.ts and CalcUi reuse |
references/page-patterns.md |
The 187-record dataset behind the /spectrum static tool |
the edge-spectrum-dataset skill |
| Adding an API endpoint a new tool needs |
the edge-spectrum-endpoint skill |
| Branch flow, preview deploys, CI gate order |
the repo's AGENTS.md |
1---2title: "🔌 edge-spectrum-hub-tool"3name: edge-spectrum-hub-tool4description: >-5 Add, change, retire or debug a tool on the Edge Spectrum hub — the `TOOLS` registry in6 site/src/tools.ts, the three `kind` branches (route / static / external) and what each one7 obliges you to wire, the literal `ACCENT` map Tailwind's JIT depends on, and the calculator8 page pattern built on src/odds.ts and components/CalcUi.tsx. Use for "add a tool to the hub",9 "new calculator page", "new tile", "the tile links nowhere", "the accent colour renders10 unstyled", "the static page 404s in dev but works on Vercel", "deep link reloads to the home11 page", "mark a tool as WIP / soon", "remove a tool", and any work on Home.tsx, App.tsx, the hub12 nav, or a page under site/src/pages/.13tags: ["skill","platform-integrations","edge-spectrum","agent-skills"]14upstream:15 match: exact16 repo: ai-automation-tools/agent-skills17 path: skills/projects/edge-spectrum/edge-spectrum-hub-tool/SKILL.md18 ref: abbfc6537c23437de45c2d1ec602364e52cc6a2a19 checked: 2026-10-2320metadata:21 source: https://skillmd.com/skills/michaelschecht/edge-spectrum-hub-tool22---2324# Adding a tool to the hub2526**The hub is a registry plus a page. If you touched more than two files, check why.**2728Everything about a tile — its title, blurb, icon, status pill, accent, and where it points — is29one entry in `site/src/tools.ts`. `Home.tsx` maps over `TOOLS` to draw the grid; `App.tsx` holds30the routes. Nothing else enumerates tools, so **never add a second list.**3132All commands run from **`site/`**, not the repo root.3334---3536## 1. The registry entry3738```ts39// site/src/tools.ts — TOOLS is the single source of truth40{41 slug: 'kelly', // unique; matches the route/folder name42 title: 'Kelly Stake Sizer',43 blurb: 'One or two sentences, present tense, no marketing.',44 icon: Calculator, // a LucideIcon, imported at the top of the file45 href: '/kelly',46 kind: 'route', // 'route' | 'static' | 'external'47 status: 'live', // 'live' | 'wip' | 'soon'48 accent: 'teal', // must exist in ACCENT in Home.tsx49 tag: 'Calculator', // optional short category label on the tile50}51```5253Then, **by `kind`** — each one obliges exactly one more thing:5455| `kind` | `href` | You must also | Rendered as |56|:---|:---|:---|:---|57| `route` | `/slug` | add `<Route path="/slug" element={<Page />} />` in `App.tsx` **and** import the page | `<Link>`, client-side |58| `static` | `/slug/index.html` — **the explicit file** | drop the page under `site/public/slug/` | `<a>`, full page load |59| `external` | the absolute URL | nothing | `<a target="_blank" rel="noopener noreferrer">` |6061> [!WARNING]62> **A `static` tool's `href` must name `index.html`.** Vite's dev server does *not* auto-serve a63> `public/` directory index, so `/spectrum/` 404s locally while working fine on Vercel — a break64> that only shows up for whoever runs `npm run dev` next. `/spectrum/index.html` resolves65> identically in both. This is written into the comment above the spectrum entry; keep it there.6667## 2. The accent must be a literal6869`ACCENT` in `site/src/pages/Home.tsx` is a `Record<Accent, …>` of **fully spelled-out Tailwind70class strings**. Tailwind v4's JIT scans source text — it cannot see `text-${color}-400`. A new71accent needs three things or the tile renders unstyled:72731. the key added to the `Accent` union in `tools.ts`,742. a row in the literal `ACCENT` map with `icon`, `corner` and `hoverBorder` spelled out in full,753. no interpolation anywhere in between.7677The seven that exist — `sky` `emerald` `violet` `amber` `rose` `teal` `cyan` — cover more tools78than the hub has. **Reuse one before adding one.** The `STATUS` map right below it works the same79way and already covers `live` / `wip` / `soon`; a tool that is not ready ships as `soon`, it does80not ship absent.8182## 3. Building a `route` page8384New calculator pages follow the two that exist — read `pages/OddsConverter.tsx` before writing a85third. The pattern and its reuse rules are in86[`references/page-patterns.md`](references/page-patterns.md).8788The short version:8990- **Math goes in a pure module, never in the component.** `src/odds.ts` already holds American /91 decimal / fractional / implied conversion, three de-vig methods (multiplicative, power, Shin)92 and parlay joint-probability math, with **zero imports** so `scripts/check-odds.ts` can assert93 against it. Reuse it. Re-deriving a conversion inside a page puts it outside the guard.94- **Chrome goes in `components/CalcUi.tsx`** — `Panel`, `Select`, `Stat` are shared by both95 calculator pages.96- **New non-trivial math earns a `check:*` script** and a line in `.github/workflows/ci.yml`.97 That is the house convention, not an optional extra: every other module of real logic has one.9899## 4. Routes that are not tools100101`/setup` is a `<Route>` in `App.tsx` with **no** `TOOLS` entry — it is the self-hosting page, linked102from the Home hero, not a tile. That is deliberate and it is the precedent: a page that is not a103*tool* gets a route and stays out of the registry. `<Route path="*">` falls back to `Home`, so a104typo'd `href` silently renders the hub instead of 404ing — **click the tile after adding it.**105106Deep links work in production because `vercel.json` rewrites `/((?!api/).*)` to `/index.html`. If a107new client route 404s on Vercel but works in dev, that rewrite is the first place to look.108109---110111## 5. Checklist1121131. **One entry in `TOOLS`** — `slug` unique, `blurb` factual, `tag` short.1142. **Branch on `kind`** (§1). `route` → `<Route>` + import. `static` → `public/<slug>/` + an115 `index.html` href. `external` → done.1163. **Accent exists as a literal** in `Home.tsx` (§2) — or reuse one of the seven.1174. **Math in a pure module**, chrome from `CalcUi.tsx` (§3).1185. **New logic gets a `check:*` script** wired into CI.1196. `npm run lint` — `tsc --noEmit` catches an accent key that is not in the union.1207. `npm run dev` and **click the tile**, then reload on the deep link. The `*` fallback hides a121 bad `href` behind a working-looking page.1228. Update `AGENTS.md`'s layout block if the tool added a directory.123124---125126## 6. Anti-patterns127128- **A second list of tools.** Nav, footer, sitemap — all of them map over `TOOLS`.129- **An interpolated Tailwind class** (`text-${accent}-400`). JIT never emits it.130- **`href: '/spectrum/'` for a static tool.** Works on Vercel, 404s in dev.131- **Math inside the page component.** It escapes `check:odds`.132- **Trusting the tile to prove the route.** `<Route path="*">` renders `Home` for anything.133- **Shipping a half-finished tool by leaving it out of `TOOLS`.** Mark it `soon`.134- **Running `npm` at the repo root.** The whole app is in `site/`.135136---137138## Related139140| For | See |141|:---|:---|142| The calculator page pattern, `odds.ts` and `CalcUi` reuse | [`references/page-patterns.md`](references/page-patterns.md) |143| The 187-record dataset behind the `/spectrum` static tool | the `edge-spectrum-dataset` skill |144| Adding an API endpoint a new tool needs | the `edge-spectrum-endpoint` skill |145| Branch flow, preview deploys, CI gate order | the repo's `AGENTS.md` |