ワンクリックで
crucible
Write solid unit tests for TypeScript projects using property-based testing and mutation testing.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Write solid unit tests for TypeScript projects using property-based testing and mutation testing.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | crucible |
| description | Write solid unit tests for TypeScript projects using property-based testing and mutation testing. |
| compatibility | Designed for TypeScript projects. |
| metadata | {"disable-model-invocation":"false"} |
When asked to write, fix, or audit unit tests on TypeScript projects.
When writing end-to-end, integration, UI, or simulation tests.
Before activating, check whether the project has opted out of this skill. Look for any of the following:
If any opt-out signal is found, do not activate automatically; only apply this skill if the user explicitly requests it in this conversation.
pnpm, but always use the project's package manager.Unit tests should:
test.fails/.skip; this makes it less obvious to the user that attention is required, so tests passing when they shouldn't is the highest-priority error to avoid.Check branch coverage and run tests: pnpm exec vitest run src/foo.test.ts --coverage
Check for surviving mutants on the code being tested: pnpm exec stryker run --mutate "src/foo.ts"
vitest fast-check @stryker-mutator/core @stryker-mutator/vitest-runner @stryker-mutator/typescript-checkerclear-text reporter (other reporters optional).When asked to write new tests, DO NOT MODIFY APPLICATION CODE OR EXISTING TESTS.
First, assess existing tests by following Assessing a module. Create a new debrief file using the template and record the initial coverage and mutation scores there.
Second, write tests following this process exactly:
Do the following for each function/method in the module's interface, finishing one function before starting the next:
fast-check, create property-based test stubs with arbitraries that cover all possible parameters and implicit inputs to the function. Use fc.asyncProperty + await fc.assert(...) when the function under test is async. If in doubt, err on the side of making arbitraries too broad and mention this in the debrief so the user can fix them. Name tests as descriptions of desired behavior.
b. Using vitest, write assertions within the stubs covering any returned values and side effects such as throwing exceptions, mutating inputs, mutating/reassigning variables from outer scopes, etc. Make sure tests assert desired behavior, catching the faulty assumptions/bugs identified earlier and failing accordingly.pnpm exec vitest run src/foo.test.ts --coveragepnpm exec stryker run --mutate "src/foo.ts:<startLine>-<endLine>"After writing tests for all functions, double-check that you added sections to the debrief for each function and finish writing the summary section.
If prompted to audit the project as a whole, check project-wide code coverage and mutation scores, and recommend areas for more detailed audits or for adding/updating tests. Bias recommendations towards the most important and bug-prone areas of the codebase - core business logic, event-driven code, and complex functions.
If prompted to audit a part of the project, look for modules or functions (within the scope of the prompt) that don't have tests and report these to the user in the post-audit debrief.
For each module within scope of the prompt that has tests, follow Assessing a module. Then, if any test criteria are still unmet after the assessment fixes, follow Writing Tests to fill the remaining gaps.
Use this process whenever you need to evaluate an existing test file against the test criteria — both before writing new tests and when auditing.
pnpm exec vitest run src/foo.test.ts --coverage.pnpm exec stryker run --mutate "src/foo.ts".Format debriefs per the template below. If there is nothing to report in a function subsection, simply write "n/a". Output the debrief into a Markdown file in debriefs/.
Coverage (branch) Before: X% → After: Y% Lines that could not be covered: {line ranges}
Mutation score (total) Before: X% → After: Y%
{bullet list of faulty assumptions, bugs found, issues found in tests, and failing tests. Each list item should begin with the project-root relative path to the file and line number(s) where the issue was found}
Function purpose {one sentence describing what the function is supposed to do} (confidence: high | uncertain) {if uncertain: what's unclear and why}
Faulty assumptions found
Bugs found in implementation
Issues found in pre-existing tests
Test cases written
Failing tests
Unkillable mutants