本文へ移動
cccskills
無料GitHub で公開

add-assertion

Add new assertion function with comprehensive tests following TDD

インストール方法を見る

含まれるファイル(1)

  • SKILL.md1.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Add Assertion Skill

Add a new assertion function to bashunit following strict TDD methodology.

Prerequisites

  1. Task file must exist — create .tasks/YYYY-MM-DD-add-assertion-name.md
  2. Study patterns — read tests/unit/assert_test.sh and src/assertions.sh

Workflow

1. Plan

Ask user: assertion name, parameters, success/failure behavior, error messages.

Document acceptance criteria and test inventory in task file.

2. Study Existing Patterns

Read src/assertions.sh and tests/unit/assert_test.sh to understand:

  • Parameter validation, assertion logic, error message format
  • Return codes (0 = success, 1 = failure)
  • How tests verify both success and failure cases

3. TDD Cycles

For each test in inventory, follow RED -> GREEN -> REFACTOR:

  1. Basic success case — assertion passes with valid input
  2. Failure case — assertion fails correctly: capture its output and compare it with bashunit::console_results::print_failed_test (there is no assert_fails)
  3. Edge cases — empty input, special characters, nested structures, malformed data

4. Integration

  • Source new file in src/bashunit.sh if created
  • export -f the assertion function
  • Run full test suite: ./bashunit tests/
  • Quality checks: make sa && make lint

5. Documentation

  • Add function header with Arguments/Returns/Example
  • Update CHANGELOG.md
  • Update user-facing docs if applicable

Final Checklist

  • All tests passing (success, failure, edge cases)
  • Function documented and exported
  • Quality gate passes
  • CHANGELOG updated
  • Task file completed

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Analyze test coverage and identify untested code paths

日本語の概要は準備中です。原文の説明を表示しています。

TypedDevs/bashunit4342026年10月10日 更新

commit

無料

Stage and commit changes using conventional commits format

日本語の概要は準備中です。原文の説明を表示しています。

TypedDevs/bashunit4342026年10月10日 更新

fix-test

無料

Debug and fix failing tests systematically

日本語の概要は準備中です。原文の説明を表示しています。

TypedDevs/bashunit4342026年10月10日 更新

gh-issue

無料

Fetch GitHub issue, create branch, plan and implement with TDD, then open PR

日本語の概要は準備中です。原文の説明を表示しています。

TypedDevs/bashunit4342026年10月10日 更新

gh-issues

無料

Walk over all open GitHub issues that are unassigned or assigned to the current user, and process each one via the /gh-issue skill, sequentially.

日本語の概要は準備中です。原文の説明を表示しています。

TypedDevs/bashunit4342026年10月10日 更新

pr

無料

Push branch and create a GitHub PR with concise, issue-linked description

日本語の概要は準備中です。原文の説明を表示しています。

TypedDevs/bashunit4342026年10月10日 更新

TypedDevs のスキルをすべて見る

このスキルの問題を報告する