원클릭으로
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)
}
})
})
}