用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/dhth/hours --skill write-tests命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | write-tests |
| description | Use this skill when creating or updating tests in this repository. |
mise run test.mise run update-snapshots.testify/assert alongside source filesgo-snaps); snapshots in internal/ui/__snapshots__/internal/types has a TimeProvider interface for mocking time in teststests/cli with snapshots in tests/cli/__snapshots__/tests/cli (file-per-command is preferred)TestMain builds the hours binary once per package run and is shared by all tests in the packageNewFixture(t, testBinaryPath) gives each test a t.TempDir() workspace (auto-cleaned)cmd.UseDB() to append a per-test DB path under the fixture temp dirRunCmd executes with timeout and deterministic env (HOME set to fixture temp dir, PATH propagated, explicit overrides via SetEnv)All tests in this codebase should follow the Given-When-Then (GWT) pattern to improve readability and maintainability. This structure makes tests self-documenting and helps both humans and AI agents quickly understand:
Format:
func TestSomething(t *testing.T) {
// GIVEN
// ... setup code, test data, initial state
// WHEN
// ... the action being tested
// THEN
// ... assertions and expected outcomes
}
go-snaps wherever it makes sense, especially for: