Claude Code plugins for Godogen BDD development
npx claudepluginhub lukasngl/godogenBDD development tools for Godogen - analyze Gherkin feature files and Go step definitions
Now with Methods! 🎉
godogen is golang codegenerator, that allows you to colocate [godog] step definitions with their pattern.
This repository is organized as a monorepo containing multiple tools:
main.go + pkg/) - Code generator for godog step definitionsgodogen-lint/ - Standalone linter for validating godogen directivesgodogen-gcl/ - golangci-lint plugingodogen-language-server/ - LSP server for IDE integrationgo install github.com/lukasngl/godogen@latest
Or run directly:
go run github.com/lukasngl/godogen@latest
Similar to Java's Cucumber annotations, godogen allows you to colocate test step patterns with their implementations:
Java (Cucumber):
@Given("there are {int} godogs")
public void thereAreGodogs(int count) {
this.available = count;
}
Go (godogen):
//godogen:given ^there are (\d+) godogs$
func (s *GodogsState) thereAreGodogs(available int) {
s.available = available
}
This approach keeps your test definitions close to their patterns, making them easier to maintain and understand.
// file: godog_steps.go
package godogs
//go:generate go run github.com/lukasngl/godogen@latest
import (
"fmt"
"github.com/cucumber/godog"
)
type GodogsState struct {
available int
}
func InitializeScenario(ctx *godog.ScenarioContext) {
state := &GodogsState{available: 0}
InitializeGodogSteps(ctx, state)
}
//godogen:given ^there are (\d+) godogs$
func (s *GodogsState) thereAreGodogs(available int) {
s.available = available
}
//godogen:when ^I eat (\d+)$
func (s *GodogsState) iEat(num int) {
s.available -= num
}
//godogen:then ^there should be (\d+) remaining$
func (s *GodogsState) thereShouldBeRemaining(remaining int) error {
if s.available != remaining {
return fmt.Errorf("expected %d godogs, but there are %d", remaining, s.available)
}
return nil
}
will generate:
// file: godog_steps_initializer.go
package godogs
import "github.com/cucumber/godog"
// InitializeGodogSteps registers steps defined in "godog_steps.go" with the [godog.ScenarioContext].
func InitializeGodogSteps(ctx *godog.ScenarioContext, r1 *GodogsState) {
ctx.Given(`^there are (\d+) godogs$`, r1.thereAreGodogs)
ctx.When(`^I eat (\d+)$`, r1.iEat)
ctx.Then(`^there should be (\d+) remaining$`, r1.thereShouldBeRemaining)
}
godogen supports generic context structs. Type parameters are propagated to the generated initializer function and renamed to T1, T2, ... to avoid collisions:
type Suite[T any] struct{ state T }
//godogen:given ^I have (\d+) items$
func (s *Suite[T]) iHaveItems(count int) error {
return nil
}
generates:
func InitializeSteps[T1 any](sc *godog.ScenarioContext, r1 *Suite[T1]) {
sc.Given(`^I have (\d+) items$`, r1.iHaveItems)
}
The type declaration must be in the same file as the methods. For types declared elsewhere, use a type alias:
type MyConstraint = otherpackage.Constraint
type Suite[T MyConstraint] struct{ state T }
<FUNCTION>:
//godogen:step <PATTERN> will generate ctx.Step(<PATTERN>, <FUNCTION>)//godogen:given <PATTERN> will generate ctx.Given(<PATTERN>, <FUNCTION>)//godogen:when <PATTERN> will generate ctx.When(<PATTERN>, <FUNCTION>)//godogen:then <PATTERN> will generate ctx.Then(<PATTERN>, <FUNCTION>)//godogen:after will generate ctx.After(<FUNCTION>)//godogen:before will generate ctx.Before(<FUNCTION>)//godogen:after_step will generate ctx.StepContext().After(<FUNCTION>)//godogen:before_step will generate ctx.StepContext().Before(<FUNCTION>)InitializeGodogSteps functiongodogen includes a linter that validates your godogen directives and step definitions:
^ and $ (auto-fixable)Installation:
go install github.com/lukasngl/godogen/godogen-lint@latest
Usage:
godogen-lint [-fix] ./...
golangci-lint plugin:
# Build the plugin
cd godogen-gcl
go build -o godogen-gcl.so .
Claude Code marketplace entries for the plugin-safe Antigravity Awesome Skills library and its compatible editorial bundles.
Production-ready workflow orchestration with 84 marketplace plugins, 192 local specialized agents, and 156 local skills - optimized for granular installation and minimal token usage
Directory of popular Claude Code extensions including development tools, productivity plugins, and MCP integrations