Test Writing Workflow
iOfficeAI/AionUi
Sets the test-writing workflow for the repository: risk-first scenario lists, behavior-focused Vitest tests, a full run before each commit and a coverage target.
应用具备仓库感知能力的 TypeScript 测试设计、行为依据、隔离性与 mock 边界标准。用于编写或评审单元测试时。
$ npx skills add shinpr/ai-coding-project-boilerplate --skill typescript-testing -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install shinpr/ai-coding-project-boilerplate typescript-testing --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/shinpr/ai-coding-project-boilerplate.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills-zh-CN/typescript-testing .claude/skills/typescript-testing && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "typescript-testing" agent skill from https://github.com/shinpr/ai-coding-project-boilerplate/tree/main/.claude/skills-zh-CN/typescript-testing into .claude/skills/typescript-testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typescript-testing", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/shinpr/ai-coding-project-boilerplate/tree/main/.claude/skills-zh-CN/typescript-testingType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add shinpr/ai-coding-project-boilerplate --skill typescript-testing -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install shinpr/ai-coding-project-boilerplate typescript-testing --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/shinpr/ai-coding-project-boilerplate.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills-zh-CN/typescript-testing .agents/skills/typescript-testing && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "typescript-testing" agent skill from https://github.com/shinpr/ai-coding-project-boilerplate/tree/main/.claude/skills-zh-CN/typescript-testing into .agents/skills/typescript-testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typescript-testing", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add shinpr/ai-coding-project-boilerplate --skill typescript-testing -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install shinpr/ai-coding-project-boilerplate typescript-testing --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/shinpr/ai-coding-project-boilerplate.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills-zh-CN/typescript-testing .cursor/skills/typescript-testing && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "typescript-testing" agent skill from https://github.com/shinpr/ai-coding-project-boilerplate/tree/main/.claude/skills-zh-CN/typescript-testing into .cursor/skills/typescript-testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typescript-testing", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/shinpr/ai-coding-project-boilerplate.git --path .claude/skills-zh-CN/typescript-testing--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add shinpr/ai-coding-project-boilerplate --skill typescript-testing -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install shinpr/ai-coding-project-boilerplate typescript-testing --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/shinpr/ai-coding-project-boilerplate.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills-zh-CN/typescript-testing .gemini/skills/typescript-testing && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "typescript-testing" agent skill from https://github.com/shinpr/ai-coding-project-boilerplate/tree/main/.claude/skills-zh-CN/typescript-testing into .gemini/skills/typescript-testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typescript-testing", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install shinpr/ai-coding-project-boilerplate typescript-testingInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add shinpr/ai-coding-project-boilerplate --skill typescript-testing -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/shinpr/ai-coding-project-boilerplate.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills-zh-CN/typescript-testing .github/skills/typescript-testing && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "typescript-testing" agent skill from https://github.com/shinpr/ai-coding-project-boilerplate/tree/main/.claude/skills-zh-CN/typescript-testing into .github/skills/typescript-testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typescript-testing", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add shinpr/ai-coding-project-boilerplate --skill typescript-testing -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install shinpr/ai-coding-project-boilerplate typescript-testing --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/shinpr/ai-coding-project-boilerplate.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills-zh-CN/typescript-testing .opencode/skills/typescript-testing && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "typescript-testing" agent skill from https://github.com/shinpr/ai-coding-project-boilerplate/tree/main/.claude/skills-zh-CN/typescript-testing into .opencode/skills/typescript-testing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typescript-testing", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
typescript-testing应用具备仓库感知能力的 TypeScript 测试设计、行为依据、隔离性与 mock 边界标准。用于编写或评审单元测试时。
Typescript Testing is an agent skill from shinpr/ai-coding-project-boilerplate. 应用具备仓库感知能力的 TypeScript 测试设计、行为依据、隔离性与 mock 边界标准。用于编写或评审单元测试时。
Its SKILL.md is about 830 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Testing & QA. It works with TypeScript and Vitest. The repository describes itself as: Agentic coding TypeScript boilerplate for Claude Code: sub-agent workflows with built-in quality checks and context engineering. The licence is MIT.
3 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 56913a2. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Typescript Testing loads about 832 tokens when it runs. Until then it costs about 20 tokens; SKILL.md has 184 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from shinpr/ai-coding-project-boilerplate at commit 56913a2, republished under its MIT licence (© shinpr). 184 words, ~832 tokens.
.claude/skills/typescript-testing/SKILL.md (or your agent's skills folder).在选择测试框架或命令之前,先检查 package.json、锁文件、测试配置以及现有测试的导入方式。仅当配置了 Vitest 时才应用 Vitest 专属规则;否则使用仓库已配置的 TypeScript 测试工具,同时保留以下关于行为、隔离性与依据的规则。如果无法确认可运行的测试工具,请报告已检查的路径以及缺失的命令或配置。
import { describe, it, expect, beforeEach, vi } from 'vitest'vi.mock()单元测试
集成测试
跨功能验证
__tests__/ 目录中{target-file-name}.test.ts{target-file-name}.int.test.ts保持每个已提交的测试处于有效状态。当测试保护的是当前行为时应修复它;只有在其对应行为已不再被要求、且源需求或实现契约确认该行为可移除时,才能删除该测试。
在覆盖正常路径的同时,包含边界值与错误场景。
使用与实现计算过程无关的预期值:直接将契约的值写成字面量,或从独立的权威 fixture 或规范中获取。若预期值与被测对象使用相同的常量或公式计算得出,即便两者都错了测试依然会通过。当输入由 mock 提供时,只要实现对输入做了转换,预期值就应与 mock 的返回值不同。
验证结果,而非调用顺序或调用次数。
每个测试都应断言其使用方所依赖的属性,以及该操作所建立的状态,而不仅仅是断言“有返回值”。
用于检查某项功能是否可用的探测,只有在通过使用方边界进行检查,并断言使用方所需的确切属性时才算通过。
命令的退出状态、成功的导入以及对象的存在性只能说明该事物是可访问的,因此应将它们视为探测的前置条件,而将面向使用方的属性放入断言中。
| 探测意图 | 准备阶段的证据(单独不足以证明) | 应改为断言 |
|---|---|---|
| 模块可用 | import 解析成功、expect(mod).toBeDefined() | 通过使用方的入口点调用导出的函数,并断言其返回值或产生的效果 |
| 命令可用 | 退出码为 0 | 调用方使用的输出、文件或状态变化 |
| 配置已生效 | 配置文件解析成功 | 该配置本应改变的可观测行为 |
| 迁移已执行 | 命令报告成功 | 通过真实引擎查询返回迁移后的数据结构 |
对于协作关系正被测试的每个进程内组件,使用真实实现。当测试的目标是更高层的行为时,替换直接的外部 I/O 依赖;当外部适配器、查询、迁移或服务契约本身就是测试目标时,使用真实引擎或与生产环境等效的测试实例。进行替换时,仍需断言被测对象发送的请求以及它所接受的响应结构,以确保边界契约得到验证。
当设计文档的验收标准带有 Property 标注时,使用 fc.assert(fc.property(...)) 形式的 fast-check。
将 mock 的类型限定为被测对象实际使用的接口部分——即 Pick<T, 'usedMethod'>——而非完整接口,这样未被使用的方法即便发生变化也不会破坏测试,而被使用的方法发生变化则会。使用 satisfies 针对该 picked 类型约束 mock 对象字面量,使多余或命名错误的属性在编译期就会报错。
Mock 验证的是调用模式,因此以下数据层属性在仅使用 mock 的测试中会被漏检:
判定规则:当这些属性中的某一项本身就是测试目标——包括仓储层或数据访问实现本身——时,应按照下方的分级方案对真实引擎进行验证。当数据访问只是一个依赖而非测试目标时,使用 mock 是正确的做法:例如接收数据的业务逻辑(mock 仓储层,测试服务层)、错误处理路径(连接失败、超时),以及数据层本身不是测试目标的单元测试。
针对真实数据库引擎验证数据层正确性的可选方案:
按以下顺序选择第一个符合仓库现有依据的选项:
当以上都不可用而数据层正确性又是测试目标时,应停止并报告缺失的环境前提条件。仅凭 mock 得出的结果不能作为查询、schema、约束或迁移正确性的依据。
生成的数据访问代码可能在语法上正确,却引用了并不存在的 schema 元素,而基于 mock 的测试无论如何都会通过。因此设计文档应包含明确的 schema 引用,以便评审时可以将文档记录的 schema 与数据访问代码进行交叉核对。
© shinpr, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/skills-zh-CN/typescript-testing of shinpr/ai-coding-project-boilerplate.
Open the folder on GitHubat commit 56913a2
Typescript Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Typescript Testing this skillshinpr/ai-coding-project-boilerplate | 233 | — | ~832 | Automated safety check: Pass | MIT | |
| Test Writing WorkflowiOfficeAI/AionUi | 33k | 1 repos | ~1.2k | Automated safety check: Pass | Apache-2.0 | |
| Creating A Packagec15t/c15t | 1.9k | — | ~913 | Automated safety check: Pass | Apache-2.0 | |
| Svelte Testingspences10/sveltest | 113 | — | ~579 | Automated safety check: Pass | MIT | |
| Effect TStellahq/opensession | 392 | — | ~3.7k | Automated safety check: Pass | MIT | |
| Ha Frontend Testinghome-assistant/frontend | 5.7k | — | ~1.7k | Automated safety check: Pass | Apache-2.0 |
iOfficeAI/AionUi
Sets the test-writing workflow for the repository: risk-first scenario lists, behavior-focused Vitest tests, a full run before each commit and a coverage target.
c15t/c15t
Scaffold a new workspace package in the c15t monorepo. An agent skill from c15t/c15t.
spences10/sveltest
Fix and create Svelte 5 tests with vitest-browser-svelte and Playwright.
tellahq/opensession
Write idiomatic Effect v4 TypeScript verified against the pinned effect@4.0.0-rc.112 source.
home-assistant/frontend
Home Assistant frontend testing and validation workflow. An agent skill from home-assistant/frontend.
antfu-collective/eslint-vitest-rule-tester
Help users test ESLint rules with Vitest, supporting snapshot testing and custom assertions
shinpr/ai-coding-project-boilerplate
Selects and designs the smallest integration/E2E test set that proves accepted behavior at an observable boundary.
shinpr/ai-coding-project-boilerplate
Evaluates and optimizes skill file quality using 9 content patterns and 10 editing principles.
shinpr/ai-coding-project-boilerplate
Defines React environment, component architecture, state/data flow, build verification, and frontend non-functional criteria from repository evidence.
shinpr/ai-coding-project-boilerplate
Applies React/TypeScript type safety, component design, and state management rules.
shinpr/ai-coding-project-boilerplate
Selects implementation strategy (vertical slice, horizontal, or hybrid) with risk assessment.
shinpr/ai-coding-project-boilerplate
Coordinates subagents through scale-based planning, approval, implementation, verification, and escalation flows.
Works with
Categories
应用具备仓库感知能力的 TypeScript 测试设计、行为依据、隔离性与 mock 边界标准。用于编写或评审单元测试时。. Typescript Testing is an agent skill from shinpr/ai-coding-project-boilerplate.
Typescript Testing fits situations like: testing & QA work in your project.
Run `npx skills add shinpr/ai-coding-project-boilerplate --skill typescript-testing -a claude-code`. Or copy the skill folder (.claude/skills-zh-CN/typescript-testing in shinpr/ai-coding-project-boilerplate) into .claude/skills/typescript-testing in your project. Claude Code loads it when a task matches its description.
Run `npx skills add shinpr/ai-coding-project-boilerplate --skill typescript-testing -a codex`. Or copy the skill folder (.claude/skills-zh-CN/typescript-testing in shinpr/ai-coding-project-boilerplate) into .agents/skills/typescript-testing in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add shinpr/ai-coding-project-boilerplate --skill typescript-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/typescript-testing, .gemini/skills/typescript-testing, .github/skills/typescript-testing and .opencode/skills/typescript-testing in your project.
SKILL.md names no scripts, command-line tools or credentials: Typescript Testing is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Typescript Testing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 832 tokens (SKILL.md is roughly 3.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Typescript Testing: Test Writing Workflow (iOfficeAI/AionUi, 33k stars), Creating A Package (c15t/c15t, 1.9k stars), Svelte Testing (spences10/sveltest, 113 stars) and Effect TS (tellahq/opensession, 392 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
shinpr (a GitHub user) maintains it in shinpr/ai-coding-project-boilerplate, which has 233 GitHub stars. The repository holds 41 skills in this directory. The repository was last updated on October 4, 2026.
Source: shinpr/ai-coding-project-boilerplate on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.