Agent skill
Format numbers
Format numbers using the formatNumber function from Shade whenever someone edits a TSX file.
Install this agent skill to your Project
npx add-skill https://github.com/TryGhost/Ghost/tree/main/.claude/skills/format-number
SKILL.md
Format Numbers
When editing .tsx files, ensure all user-facing numbers are formatted using the formatNumber utility from @tryghost/shade.
Import
import {formatNumber} from '@tryghost/shade';
When to use formatNumber
Use formatNumber() when rendering any numeric value that is displayed to the user, including:
- Member counts, visitor counts, subscriber counts
- Email engagement metrics (opens, clicks, bounces)
- Revenue amounts (combine with
centsToDollars()for monetary values) - Post analytics (views, link clicks)
- Any count or quantity shown in UI
Correct usage
<span>{formatNumber(totalMembers)}</span>
<span>{formatNumber(link.count || 0)}</span>
<span>{`${currencySymbol}${formatNumber(centsToDollars(mrr))}`}</span>
<span>{post.members > 0 ? `+${formatNumber(post.members)}` : '0'}</span>
Antipatterns to avoid
Do NOT use any of these patterns for formatting numbers in TSX files:
// BAD: raw .toLocaleString()
<span>{count.toLocaleString()}</span>
// BAD: manual Intl.NumberFormat
<span>{new Intl.NumberFormat('en-US').format(count)}</span>
// BAD: raw number without formatting
<span>{memberCount}</span>
// BAD: manual regex formatting
<span>{count.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')}</span>
Related utilities
formatPercentage()- for percentages (e.g., open rates, click rates)abbreviateNumber()- for compact notation (e.g., 1.2M, 50k)centsToDollars()- convert cents to dollars before passing toformatNumber
All are imported from @tryghost/shade.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
add-private-feature-flag
Use when adding a new private (developer experiments) feature flag to Ghost, including the backend registration and settings UI toggle.
Create database migration
Create a database migration to add a table, add columns to an existing table, add a setting, or otherwise change the schema of Ghost's MySQL database. Use this skill whenever the task involves modifying Ghost's database schema — including adding, removing, or renaming columns or tables, adding new settings, creating indexes, updating data, or any change that requires a migration file in ghost/core. Also use when the user references schema.js, knex-migrator, the migrations directory, or asks to "add a field" or "add a column" to any Ghost model/table. Even if the user frames it as a feature or Linear issue, if the implementation requires a schema change, this skill applies.
Add Admin API Endpoint
Add a new endpoint or endpoints to Ghost's Admin API at `ghost/api/admin/**`.
remotion-best-practices
Best practices for Remotion - Video creation in React
docs-demo
Add an interactive demo to the Remotion documentation. Use when creating a new <Demo> component for docs pages.
add-sfx
Add a new sound effect to @remotion/sfx
Didn't find tool you were looking for?