writing-tests
Instructions and hints for writing tests.
- License 许可
- AGPL-3.0
- 最近更新
- 2026-11-12
- Stars
- ★ 2.9k
- Forks
- 150
01 前言 Front Matter
- name
- writing-tests
- description
- Instructions and hints for writing tests.
03 SKILL.md 正文
Testing Judgment
- Pick the lowest test layer that exercises the change, but do not stop below the layer where the bug could occur.
- When testing an early rejection, use input that would fail a later check. The test should still return the early error.
- Choose additional integration or end-to-end coverage when the regression can occur only across component or process boundaries.
Projection Refactors
A change to projection memory layout or storage must keep behavior equal to the target branch. Use these checks in addition to unit tests:
- Replay a copied EVT store (
CHATTO_BENCH_EVT_STORE_DIR) into the target branch and the changed branch. Compare the snapshot bytes of each changed projection. - Restore the snapshot of the target branch in the changed branch. Snapshot the restored projection again and compare the bytes.
- Compare one digest of all read results over the real data, both live and
after the restore. Put only values into the digest. Do not format pointers
or protobuf messages with
%v; marshal protobuf messages deterministically. - Run the digest twice on the target branch before you compare. A different result shows a harness defect, not a regression.
- Call
CompleteStartupReplaybefore you measure retained heap. Replay guards keep event IDs until replay completes. - Compare timings in interleaved runs of the two branches. Another load, such as a test run, can change a single measurement.
- Keep the copied store in
.context/and delete it after use. It contains real user data.
04 同仓库更多 Skills
update-project-dependencies
Update Chatto Go and frontend dependencies within their compatible version ranges, then run tests.
svelte-docs
Look up official Svelte, SvelteKit, and Svelte CLI documentation.
svelte-core-bestpractices
Guidance on writing fast, robust, modern Svelte code. Load this skill whenever in a Svelte project and asked to write/edit or analyze a Svelte component or module. Covers reactivity, event handling, styling, integration with libraries and more.
svelte-code-writer
CLI tools for Svelte 5 documentation lookup and code analysis. MUST be used whenever creating, editing or analyzing any Svelte component (.svelte) or Svelte module (.svelte.ts/.svelte.js). If possible, this skill should be executed within the svelte-file-editor agent for optimal results.
session-wrap-up
Review a completed, paused, or blocked coding-agent session to identify friction, mistakes, near misses, missing context, and opportunities to improve future work. Use when the user asks to wrap up, run a retrospective, explain what issues the agent faced, capture lessons learned, or recommend improvements to repository instructions, documentation, skills, tooling, tests, or workflows. Produce an evidence-based, propose-only report; do not apply follow-up changes unless the user asks.
pr-tour
A skill that provides a guided tour of a pull request, highlighting key changes, walking the developer through the code, and explaining the purpose of each modification.