Index of every page on this site: llms.txt
All skills
aktsmm avatar

/write-tests

@9bedf91
by yamapanaktsmm/agent-skills27 stars
5
Run it yourself

コードを分析し、テストを段階的に生成・実行

Use this Skill: https://skilld.dev/gh/aktsmm/agent-skills/write-tests

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈19 tokens for metadata: the name and description. ≈570 when used: this file.

How this Skill uses context

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

This Skill turns off automatic use in Claude Code. Its description stays out of the automatic Skill list by default.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

<!-- syncToGlobal: true --> <!-- author: aktsmm --> <!-- repository: https://github.com/aktsmm/Agent-Customization --> <!-- license: CC BY-NC-SA 4.0 --> <!-- copyright: Copyright (c) 2025 aktsmm -->

write tests

対象コードを分析し、テストを段階的に生成・実行する。

対象(必須)

  • ファイル: (ファイルを添付 or パスを記載)
  • フレームワーク: pytest / jest / vitest / 他(指定なければ自動検出)
  • 対象ファイルまたはパスが無い場合は、広い範囲を推測せず確認して停止する

指示

Step 1: 分析(SRP)

  • テスト対象の責務を特定する(何をする関数/クラスか)
  • 入出力のパターンを洗い出す
  • 既存テストがあれば確認し、重複を避ける

Step 2: 計画(Transparency)

テストケースを書く前に計画を示す:

ケース 入力例 期待結果 優先度
正常系 ... ... 高
異常系 ... ... 中
境界値 ... ... 中

Step 3: 実装(Iterative)

  1. 1 ケースずつテストを書く
  2. 各テストは AAA パターン(Arrange / Act / Assert)
  3. テスト名は既存 repo と framework の命名規則を最優先する
    • pytest の例: test_<何を>_<どんな条件で>_<期待結果>
    • Jest / Vitest: 既存の describe / it / test の文体と粒度に合わせる

Step 4: 検証(Feedback Loop)

  • テストを実行して全て PASS するか確認
  • 表示文言を検証するテストが複数 locale を持つ製品では、各 locale で実行する(英語文言だけを期待する assertion は他 locale で落ちる)
  • VS Code の task 実行(runTask)は使わない(確認待ちを避けるため、powershell で非対話・単発で実行する)
  • テスト実行は execute/runInTerminal を利用可(非対話・単発・timeout 指定を推奨)
  • 失敗したらその場で修正
  • カバレッジを確認(可能なら)

オプション

  • フレームワーク: pytest / jest / 他
  • モック対象: 外部 API / DB など
  • 既存テストファイル: パスを記載

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts12d3 checks · Risk SAFE
  • Gen Agent Trust Hub12d

    This skill provides a structured workflow for analyzing source code and generating/executing software tests. It uses standard terminal tools for execution and does not contain malicious patterns or external dependencies.

  • Socket12d

    No alerts

  • Snyk12d

    Risk: LOW · No issues

Signed by skilld at 9bedf91. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 15 hours ago.

Activeupdated last month
disable-model-invocation
true
user-invocable
true
metadata
{
  "author": "yamapan (https://github.com/aktsmm)"
}

README badge

README badge for aktsmm/agent-skills/write-tests