AGENT SKILL

writing-tests

Instructions and hints for writing tests.

适用职业内容创作者
使用场景写作与文案
License 许可
AGPL-3.0
所属仓库
chattocorp/chatto
最近更新
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 CompleteStartupReplay before 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

chattocorp
chattocorp/chatto

update-project-dependencies

Update Chatto Go and frontend dependencies within their compatible version ranges, then run tests.

前端开发
★ 2.9k
chattocorp
chattocorp/chatto

svelte-docs

Look up official Svelte, SvelteKit, and Svelte CLI documentation.

★ 2.9k
chattocorp
chattocorp/chatto

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.

★ 2.9k
chattocorp
chattocorp/chatto

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.

开发工程师Skill与智能体开发
★ 2.9k
chattocorp
chattocorp/chatto

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.

★ 2.9k
chattocorp
chattocorp/chatto

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.

开发工程师
★ 2.9k