/prometheus-skill-pack:bdd-cucumber-rsfrom prometheus-skill-pack
Author, run, and maintain BDD integration tests in Rust using the cucumber 0.23 crate with async World, tokio + reqwest for HTTP scenarios, and thirtyfour for browser-driven scenarios. Use when writing behavior tests, integration tests, feature files, or step definitions for any Rust crate or workspace.
Ships in prometheus-skill-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
author-only <contract-reference> <scenario-IDs> consumes only adopted IDs
and writes features, real assertions, steps and configuration under governing
authoring policy. Read the author-only procedure.
Do not execute/import generated test code, run dry-run/build/lint/typecheck,
install dependencies or modify protected scenarios in this mode.execute <contract-reference> <scenario-IDs> is a separate request. Read
value-scenario-verify from the installed testing skills and require the
complete agreed value-phase production plus current boundary authority before
using any runner/build command below. A task/hour/commit/reviewer request is
not that boundary; process exit zero is not an assertion observation.Under VLBV (the pack's single method; boundaries in
kbd-process-orchestrator/references/boundaries.md), define acceptance/scenarios
before generation, and author executable features/steps only after the complete
agreed production implementation, with no runs until the boundary packet (B4).
A different cadence exists only as a signed per-phase KBD-METHOD deviation. Missing/unknown scenario adoption
blocks; available tools or example commands are not execution permission. Reuse
existing owner-reviewed calibration rather than requesting the same approval.
Record contract/scenario/assertion/oracle source and excluded false positive;
report authored-only artifacts as NOT_EXERCISED until real authorized execution.
Author and run BDD integration tests for any Rust project. This skill is
crate-agnostic. Pair it with bdd-lifecycle-loop for the author → run →
triage → maintain workflow, and with bdd-video-proof for certification
bundles.
cucumber 0.23.0 (crates.io, ~230k downloads/month, MSRV 1.88)tokio 1.x — async runtimereqwest 0.12+ — HTTP client for API scenariosthirtyfour 0.37.2 — primary WebDriver-based browser driverffmpeg (system) — optional MP4 remux for video-proof bundlesAlternative browser drivers documented in
references/browser-drivers.md:
fantoccini (older, more stars) and headless_chrome (Chrome-only, CDP).
Cucumber-rs conventionally puts feature files under tests/features/ at the
crate root, and step definitions in a binary at tests/features.rs:
crate-root/
├── Cargo.toml
├── src/
│ └── ...
└── tests/
├── features/ ← Gherkin .feature files
│ ├── api/
│ └── ui/
├── features.rs ← Cucumber entrypoint (main)
├── steps/ ← Step modules
│ ├── api.rs
│ ├── ui.rs
│ └── common.rs
└── support/
└── world.rs ← World type
Cargo.toml:
[dev-dependencies]
cucumber = "0.23"
tokio = { version = "1", features = ["full"] }
reqwest = { version = "0.12", features = ["json"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thirtyfour = { version = "0.37", optional = true }
[[test]]
name = "features"
harness = false # cucumber owns the runner
[features]
ui = ["thirtyfour"] # gate browser tests behind a feature
| Style | When to pick | Runtime |
|---|---|---|
| HTTP-only (@api) | Testing REST/gRPC/CLI, no browser needed | cargo test --test features -- --tags @api — fast (~ms) |
| Browser (@ui) | Rendering, forms, navigation, visual proof | cargo test --features ui --test features -- --tags @ui — slower (seconds), requires running WebDriver (chromedriver / geckodriver) |
No more #[async_trait]. Since 0.21 the World trait uses native
async fn in traits (MSRV bumped to 1.88 in 0.22). Steps are plain
async fn; #[given] / #[when] / #[then] macros wire them up.
// tests/features.rs
use cucumber::{given, then, when, World};
#[derive(Debug, Default, World)]
pub struct AuthWorld {
pub base_url: String,
pub email: Option<String>,
pub password: Option<String>,
pub response: Option<reqwest::Response>,
pub body: Option<serde_json::Value>,
}
#[given(regex = r"^the auth service is reachable at \"([^\"]+)\"$")]
async fn service_up(w: &mut AuthWorld, url: String) {
w.base_url = url;
}
#[given(regex = r"^a registered user \"([^\"]+)\" with password \"([^\"]+)\"$")]
async fn user(w: &mut AuthWorld, email: String, password: String) {
w.email = Some(email);
w.password = Some(password);
}
#[when(regex = r"^they POST to \"([^\"]+)\" with those credentials$")]
async fn post(w: &mut AuthWorld, path: String) {
let url = format!("{}{}", w.base_url, path);
let resp = reqwest::Client::new()
.post(&url)
.json(&serde_json::json!({
"email": w.email,
"password": w.password,
}))
.send()
.await
.expect("request failed");
w.body = Some(resp.json().await.expect("bad json"));
}
#[then(regex = r"^the response body contains a non-empty \"([^\"]+)\" field$")]
async fn field_present(w: &mut AuthWorld, field: String) {
let val = w.body.as_ref().and_then(|b| b.get(&field));
assert!(val.is_some() && !val.unwrap().as_str().unwrap_or("").is_empty());
}
#[tokio::main]
async fn main() {
AuthWorld::run("tests/features").await;
}
tests/features/api/sign-in.feature:
@api
Feature: Auth service returns a token on valid credentials
Scenario: Happy path
Given the auth service is reachable at "http://localhost:3000"
And a registered user "[email protected]" with password "hunter2"
When they POST to "/api/auth/sign-in" with those credentials
Then the response body contains a non-empty "token" field
Run: cargo test --test features
For @ui scenarios, extend World with a WebDriver handle. Requires
chromedriver or geckodriver running on localhost:4444 (default port
of the W3C WebDriver spec).
use cucumber::{given, then, when, World};
use thirtyfour::{DesiredCapabilities, WebDriver};
#[derive(Debug, Default, World)]
pub struct UiWorld {
pub driver: Option<WebDriver>,
pub base_url: String,
}
#[given(regex = r"^the app is running at \"([^\"]+)\"$")]
async fn app_up(w: &mut UiWorld, url: String) {
w.base_url = url;
let caps = DesiredCapabilities::chrome();
w.driver = Some(
WebDriver::new("http://localhost:4444", caps)
.await
.expect("could not start WebDriver"),
);
}
#[when(regex = r"^they navigate to the sign-in page$")]
async fn goto_signin(w: &mut UiWorld) {
let driver = w.driver.as_ref().expect("driver not initialized");
driver
.goto(format!("{}/sign-in", w.base_url))
.await
.expect("navigation failed");
}
#[then(regex = r"^they land on the dashboard$")]
async fn on_dashboard(w: &mut UiWorld) {
let driver = w.driver.as_ref().unwrap();
let url = driver.current_url().await.unwrap();
assert!(url.as_str().contains("/dashboard"));
}
Teardown the WebDriver in an #[after] hook so it disconnects cleanly:
use cucumber::gherkin::Scenario;
// In main:
UiWorld::cucumber()
.after(|_, _, _, _, w| {
Box::pin(async move {
if let Some(driver) = w.and_then(|w| w.driver.take()) {
let _ = driver.quit().await;
}
})
})
.run("tests/features")
.await;
# HTTP-only scenarios (@api)
cargo test --test features -- --tags @api
# Browser scenarios (@ui) — requires chromedriver / geckodriver
cargo test --features ui --test features -- --tags @ui
# All adopted scenarios (no flake exclusions: nondeterminism is declared in the
# contract's stochastic block and sampled, never skipped or retried)
cargo test --test features
# Verbose Gherkin output
cargo test --test features -- --format=libtest --show-output
thirtyfour (WebDriver) does not natively record video. Two workable paths:
ffmpeg; wrap cargo test in a script that starts and stops the
recorder around each scenario. See bdd-video-proof for the pattern.selenium/video Docker image alongside
chromedriver for automatic per-session MP4s.For CDP-based video (Chrome only) see references/browser-drivers.md.
docs/future-work/02-bdd-testing-evolution/BDD-005-testid-drift-detection.mddocs/future-work/02-bdd-testing-evolution/BDD-006-immutable-tests-rule.mddocs/future-work/02-bdd-testing-evolution/BDD-007-candidate-test-drafts.mdSTATUS.md — BDD-* implementation matrixreferences/author-only.md (opens in a new tab)references/browser-drivers.md (opens in a new tab)references/examples/README.md (opens in a new tab)references/examples/api-http-only/Cargo.toml (opens in a new tab)references/examples/api-http-only/tests/features.rs (opens in a new tab)references/examples/api-http-only/tests/features/sign-in.feature (opens in a new tab)references/examples/ui-thirtyfour/Cargo.toml (opens in a new tab)references/examples/ui-thirtyfour/tests/features.rs (opens in a new tab)references/examples/ui-thirtyfour/tests/features/sign-in.feature (opens in a new tab)references/migration-from-0.20.md (opens in a new tab)scripts/smoke-test.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub prometheus-ags/prometheus-skill-system --plugin prometheus-skill-pack218 skills in this plugin
/actor-modelTokio-native actor model pattern for Prometheus AGS projects. Implements actors as tokio tasks communicating via mpsc channels with a typed message enum, enabling safe concurrent state management without shared locks. Used in UAR session management, pk-librarian event broadcasting, and parking-lot scheduler design. Use when a component needs to own state exclusively while serving concurrent callers.
/adversarial-reviewIsolated, cross-model adversarial review of KBD artifacts and change diffs. Dispatches a fresh-context LLM judge over an OpenAI-compatible REST gateway (openai-proxy or `liter-llm api`) with an explicit mandate to find problems — the model that produced an artifact or change is never the model that reviews it. Runs as a pipeline stage inside kbd-assess/analyze/plan (artifact mode) and kbd-execute's single phase-boundary QA step (diff mode, once over the whole phase diff). Findings are severity-bucketed (CRITICAL/WARNING/SUGGESTION) and the judge's own report is screened by sycophancy-correction before it is surfaced.
/agent-team-creatorCreate, revise, package, and deploy agent-team definitions with staged questions and native exports for UAR, Codex, Claude Code, Copilot, Kimi Code, MiniMax CLI, OpenCode and DeepSeek. Use for team definition and catalog lifecycle; use agent-team-manage for active runtime task state.Other plugins' skills for the same job
2 plugins in one repository ship this exact skill · first indexed Nov 27, 2026