sample-skill
Checks sample modules for Pocket Arcade. Use when writing or reviewing a sample module. Not for naming (other-skill).
- License 许可
- MIT
- 最近更新
- 2026-11-05
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- sample-skill
- description
- Checks sample modules for Pocket Arcade. Use when writing or reviewing a sample module. Not for naming (other-skill).
02 资源文件 8
- 参考文档examples/worked.md56 B
- 参考文档references/guide.md60 B
- 脚本scripts/check-sample.mjs129 B
- 脚本scripts/selftest.mjs171 B
- 脚本templates/apps/__GAME_ID__/sample.ts107 B
- 参考文档tests/fixtures/bad-default/EXPECT.txt31 B
- 脚本tests/fixtures/bad-default/src/a.ts18 B
- 脚本tests/fixtures/good/src/a.ts20 B
03 SKILL.md 正文
Sample skill
Keeps sample modules pure and proves it with a checker.
Rules that must hold
- Named exports only, because renames break search.
- No clock in rules.
Workflow
- Read references/guide.md before writing the module.
- Copy
templates/apps/__GAME_ID__/sample.tsand replace__GAME_ID__with the game id; compare with examples/worked.md. - Run
node ${CLAUDE_SKILL_DIR}/scripts/check-sample.mjs .and fix every FAIL line.
Definition of done
- [ ] The module has named exports only.
- [ ]
node ${CLAUDE_SKILL_DIR}/scripts/check-sample.mjs .printsRESULT: PASS
Anti-patterns
- Silencing the checker. Fix the module 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 module | Workflow step 2 |
templates/apps/__GAME_ID__/sample.ts |
The module template | Workflow step 2 |
scripts/check-sample.mjs |
The checker | Workflow step 3 |
scripts/selftest.mjs |
Proves the checker | After changing it |
tests/fixtures/ |
Self-test inputs | When adding a rule |
Related skills
other-skill- naming files and exports.
04 同仓库更多 Skills
unit-and-component-tests
Sets up Jest and writes Pocket Arcade test code - three projects, RNTL 14 async via renderWithShell, root SDK mocks, fakes, fast-check, coverage, Stryker. Use when a test needs the Shell wrapper, a mock or a fake, or Jest fails. Not for the red-green loop (tdd-workflow) or goldens (golden-tests).
typescript-and-lint-rules
Enforces Pocket Arcade's strict TypeScript 6 tsconfigs, ESLint 9 flat config, Prettier and size limits. Use when writing or splitting .ts/.tsx or fixing a tsc or lint error. Not for gate wiring (quality-gates), names (naming-conventions) or import zones (architecture-and-boundaries).
demo-skill
Builds a demo. Use when testing the pitfall checker.
demo-skill
Builds a demo. Use when testing the pitfall checker.
troubleshooting-playbook
Diagnoses and fixes Pocket Arcade failures with a catalogue of 300+ known ones (symptom, cause, fix). Use when something errors, crashes, hangs or renders wrong, or an error or log needs explaining. Not for gate setup (quality-gates) or running builds (ios-simulator-build, ios-release-testflight).
toybox-visual-parity
Proves a built Pocket Arcade screen matches its Toybox design screenshot (light/dark, en/fa) and drives the fixes: capture, element gates, sheets, sign-off. Use when any screen is built or changed, or for visual parity, design match, screenshot compare. Not for building screens (toybox-screens).