task-titles
Checks task title helpers in the app. Use when writing or reviewing a task title helper. Not for file names (file-naming).
- License 许可
- MIT
- 最近更新
- 2026-10-22
- Stars
- ★ 13
- Forks
- 2
01 前言 Front Matter
- name
- task-titles
- description
- Checks task title helpers in the app. Use when writing or reviewing a task title helper. Not for file names (file-naming).
02 资源文件 9
- 参考文档examples/worked.md107 B
- 参考文档references/guide.md96 B
- 脚本scripts/check-lib.mjs699 B
- 脚本scripts/check-titles.mjs369 B
- 脚本scripts/selftest.mjs171 B
- 脚本templates/src/features/tasks/task-title.ts120 B
- 参考文档tests/fixtures/bad-clock/EXPECT.txt25 B
- 脚本tests/fixtures/bad-clock/src/a.ts41 B
- 脚本tests/fixtures/good/src/a.ts33 B
03 SKILL.md 正文
Task titles
Keeps task title helpers pure and proves it with a checker.
Rules that must hold
- Named exports only. A default export lets every importer rename the function, so searches miss call sites.
- No clock in title helpers. Reading
Date.now()makes the same task render different titles in tests and on devices.
Workflow
- Read references/guide.md before writing the helper.
- Copy
templates/src/features/tasks/task-title.tsand compare it with examples/worked.md. - Run
node ${CLAUDE_SKILL_DIR}/scripts/check-titles.mjs .and fix every FAIL line.
Definition of done
- [ ] The helper has named exports only.
- [ ]
node ${CLAUDE_SKILL_DIR}/scripts/check-titles.mjs .printsRESULT: PASS
Anti-patterns
- Silencing the checker. Fix the helper instead; the check exists because the mistake is easy to make.
Files in this skill
| File | What it is | Read/run when |
|---|---|---|
| references/guide.md | The rules and a worked example | Workflow step 1 |
| examples/worked.md | A finished helper | Workflow step 2 |
templates/src/features/tasks/task-title.ts |
The helper template | Workflow step 2 |
scripts/check-titles.mjs |
The checker | Workflow step 3 |
scripts/selftest.mjs |
Proves the checker | After changing it |
scripts/check-lib.mjs |
Shared script helper (synced) | Never by hand |
tests/fixtures/ |
Self-test inputs | When adding a rule |
Related skills
file-naming- naming files and exports.
04 同仓库更多 Skills
demo
Planted skill folder (never scanned).
demo
Planted installed skill (its files must never be scanned).
web-support
Ships the web build of an Expo app: platform files, APIs missing in react-native-web, expo-sqlite headers. Use when adding web, a .web.tsx file or expo export --platform web. Not for responsive layout (adaptive-layout).
value-objects-money-and-units
Stores money as ISO 4217 minor units, quantities in canonical units, instants as epoch ms. Use when adding a price, currency, tax, split, unit or timestamp, or a total is a cent off. Not for calendar days (dates-streaks-and-statistics).
unit-and-component-tests
Sets up Jest, checks unit, component and route tests (RNTL 14, renderWithProviders, SDK mocks, fakes, fast-check, Stryker). Use when writing a test or mock, or Jest fails or flakes. Not for goldens (golden-and-snapshot-tests).
ui-states-and-feedback
Builds loading, empty, failed and offline states, delayed skeletons, toasts, banners, confirms, Undo. Use when a screen loads data, shows a spinner, toast, retry or delete prompt. Not for failure values (error-handling-typed-results).