ワンクリックで
bdd-test
Create Go tests from BDD feature specifications.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Create Go tests from BDD feature specifications.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
End-to-end workflow to implement a new feature: clarify, spec, plan, implement, test, refactor, docs.
Create BDD feature specifications in Gherkin format for the current project.
Create or update a README for the current project based on its code, CLI help, and configuration.
Refactor the current codebase for simplicity, readability, and consistency while preserving all functionality.
| name | bdd-test |
| description | Create Go tests from BDD feature specifications. |
Generate Go test files from Gherkin feature specifications stored in features/*.spec.
Each test class is named after the feature and contains nested test functions
representing rules and scenarios.
features/*.specfeatures/<feature_name>_test.got.Run to nest background, rules, and scenariosCreate test class:
func TestFeature<FeatureName>(t *testing.T) { ... }
Add feature comment directly before test class (no blank line):
// Feature: <name> — <description>
func TestFeature<FeatureName>(t *testing.T) {
Add background comment directly at the beginning of the test class:
func TestFeature<FeatureName>(t *testing.T) {
// Background: <background description>
Add rules and scenarios as nested t.Run:
t.Run("Rule: <rule name>", func(t *testing.T) {
t.Run("Scenario: <scenario name>", func(t *testing.T) {
// Given/When/Then steps
})
})
Add the comments before the implementation or concrete assertion.
Implement steps (use comments matching the step text):
Given/And → setup fixtures, mock responsesWhen → call the function under testThen/And/But → assertionsgo build . to confirm no compilation errorsgo test ./... to confirm tests passFeature file (features/calculator.spec):
Feature: Calculator
Simple arithmetic operations
Background:
Given a calculator instance
Rule: Addition
Scenario: Adding two positive numbers
Given the numbers 2 and 3
And the operation is addition
When adding
Then the result is 5
But the display shows "5"
Generated test (features/calculator_test.go):
package main
// Feature: Calculator — Simple arithmetic operations
func TestFeatureCalculator(t *testing.T) {
// Background: a calculator instance
t.Run("Rule: Addition", func(t *testing.T) {
t.Run("Scenario: Adding two positive numbers", func(t *testing.T) {
// Given the numbers 2 and 3
calc := NewCalculator()
a, b := 2, 3
// And the operation is addition
op := "addition"
// When adding
result := calc.Add(a, b)
// Then the result is 5
if result != 5 {
t.Errorf("expected 5, got %d", result)
}
// But the display shows "5"
display := calc.Display()
if display != "5" {
t.Errorf("expected display \"5\", got %q", display)
}
})
})
}