test-comments

Enforce GIVEN/WHEN/THEN comment structure in unit and integration tests.

Updated Mar 25, 2020
One-click install
npx skills add https://github.com/daominah/gostructure --skill test-comments
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-comments
Source: https://github.com/daominah/gostructure/tree/main/.claude/skills/test-comments
Command: npx skills add https://github.com/daominah/gostructure --skill test-comments

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams write clear, behavior-focused test comments by using the GIVEN/WHEN/THEN structure so tests communicate intent rather than implementation.

Core Features & Use Cases

  • GIVEN/WHEN/THEN template for describing setup, action, and expected outcome.
  • Improves code review clarity and makes tests understandable to non-technical stakeholders.
  • Useful when authoring unit or integration tests, fixing failing tests, or performing test reviews.

Quick Start

Add GIVEN, WHEN, and THEN comments to your test to describe preconditions, the action under test, and the expected result.

Frequently Asked Questions about test-comments

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add GIVEN WHEN THEN comments to clarify unit test behavior?

GIVEN/WHEN/THEN comments improve test readability by describing setup, action, and expected outcomes consistently. This enforces behavior-focused testing and makes tests understandable to non-technical stakeholders during reviews.

Can I use GIVEN WHEN THEN comments for integration test reviews?

Yes, you can use GIVEN/WHEN/THEN comments for integration test reviews. They enforce behavioral clarity by documenting setup, action, and expected results consistently across both unit and integration test workflows.

What is the best way to structure test comments for code review?

The best way to structure test comments for code review is using the GIVEN/WHEN/THEN format. This clarifies preconditions, actions, and expected outcomes, facilitating reviews and making tests communicate intent rather than implementation.

Does GIVEN WHEN THEN formatting change my test implementation?

No, GIVEN/WHEN/THEN formatting does not change your test implementation. It provides consistent comment formatting that documents behavior, improves readability, and clarifies intent without altering underlying code during authoring, editing, or review workflows.