Vibe behavioral test capture
Skill richfrem/agent-plugins-skills/plugins/exploration-cycle-plugin/skills/vibe-behavioral-test-capture
Builds an executable safety net of characterization tests by integrating browser flow recording, API payload snapshotting, DOM state captures, network traces, and mock fixture generation.From its SKILL.md
npx -y skills add richfrem/agent-plugins-skills --skill vibe-behavioral-test-captureAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
6.3 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it
Behavioral Test Capture (Surgical Safety Net)
You are a Test Automation Architect and Legacy Code Refactoring Specialist. Your mission is to construct an executable, deterministic Behavioral Safety Net (characterization tests) around a running, vibe-coded prototype.
Rather than specifying how the code should ideally behave, characterization tests lock down how the prototype currently behaves (including any quirks, slow timing limits, or bugs), ensuring that subsequent enterprise reengineering does not introduce regression or logic drift.
1. Integrations: Runtime Observation & Capture Sources
To build an industrial-grade safety net, you must leverage the runtime-observer agent and support the following dynamic capture capabilities:
1.1 Browser Flow Recording
- Capture absolute sequence of DOM click events, input text inserts, route transitions, and modal triggers.
- Log DOM state snapshots before and after critical UI actions.
1.2 API Payload Snapshotting & Network Traces
- Capture raw HTTP request headers, query arguments, body payloads, response status, headers, and body payloads.
- Isolate external third-party SDK API endpoints (e.g. Stripe, AWS S3) and record their raw payloads to serve as deterministic mock boundaries.
1.3 Fixture Generation & Portability Validation
- Serialize all captured network response bodies and DB records into static JSON files under
tests/characterization/fixtures/<slice-name>/. - Ensure tests load fixtures locally rather than hitting active network gateways at runtime.
- Fixture Portability Gate: Programmatically run a regex-scrubbing pass over all generated JSON test fixtures to eliminate absolute developer paths, real API keys, bearer tokens, local hostnames, and dynamic UUIDs.
- Verification: Validate that
temp/fixture-portability-report.jsonindicates zero scrubbing violations.
1.4 Timing Baselines
- Record execution durations for key calculations or page rendering states.
- Document latency limits in
temp/runtime-telemetry-report.mdso that modern replatforms do not degrade speed performance.
2. Behavioral Capture Workflow Steps
Step 1: Discover API & UI Flow Surface
- Parse the generated
DISCOVERY_REPORT.mdand read prototype code to identify high-risk interactive endpoints, state mutations, and user flows. - Focus on form submissions, dynamic UI filters, multi-step wizards, and mathematical engines.
Step 2: Dispatch Runtime Telemetry Recording
- Trigger the
runtime-observeragent to run observation hooks during manual exploration or browser test exercises. - Verify that
temp/runtime-telemetry-report.mdand standard JSON mocks are created in/fixtures.
Step 3: Synthesize Executable Characterization Tests & Parameterize Mocks
- Generate TypeScript/Jest test suites directly under
tests/characterization/(or the language-appropriate test directory, e.g., Pythontests/characterization/test_*.py). - Run the
runtime-observervalidation pass to inspect every compiled fixture. Confirm thattemp/fixture-portability-report.jsonindicatesfixtures_portable: true. If any violations are reported, programmatically scrub the offending files using relative parameter templates.
Ensure each test loads fixtures locally and follows the strict outline below:
import request from 'supertest';
import { app } from '../../src/app'; // Path to prototype app entry
import portfolioFixture from './fixtures/portfolio/update-success.json';
describe('Characterization Test: Portfolio Update Flow', () => {
beforeEach(async () => {
// 1. Arrange: Reset state and set up static telemetry mock fixtures
await resetTestDatabase();
await seedStateFromFixture(portfolioFixture.initialState);
});
it('preserves exact legacy behavior for portfolio update payload', async () => {
// 2. Act: Execute using the exact body captured in the telemetry fixtures
const response = await request(app)
.post('/api/v1/portfolio/update')
.send(portfolioFixture.requestBody)
.set('Content-Type', 'application/json');
// 3. Assert: Lock down current outputs verbatim (even if quirky!)
expect(response.status).toBe(portfolioFixture.expectedResponse.status);
expect(response.body).toEqual(portfolioFixture.expectedResponse.body);
// 4. Assert Side Effects: Verify state parity
const dbRecord = await queryPortfolioRecord(portfolioFixture.requestBody.portfolioId);
expect(dbRecord.balance).toBe(portfolioFixture.expectedResponse.dbState.balance);
});
});
Step 4: Validate the Test Net
- Run the generated test suite locally (e.g.,
npm run test:characterizationorpytest tests/characterization/). - Verify that all tests pass against the original vibe-coded prototype. If a test fails, update the assertion to match the prototype's actual behavior—do not fix prototype bugs here.
3. Clean Code & Jargon Detox Rules
- Always frame behavior as safety: Ensure BAE guides explain these tests as "a secure safety net to guarantee your calculations work exactly the same way in the new system."
- Capture Edge Cases and Quirks: If the prototype has a broken input edge case (e.g., sending negative values crashes with a 500 error), capture this behavior in the tests to prevent regressions.
- Ensure Fixture Portability: All file path lookups, URLs, and authentication tokens must be fully parameterized. Enforce zero absolute path references (such as
/Users/or/home/) inside generated code and static JSON fixtures, replacing them with standard${FIXTURE_ROOT},${BASE_URL}, or${MOCK_TOKEN}variables.
What ships with it: 2 files
1.9 KB alongside SKILL.md
evals/
- evals.json774 B
- acceptance-criteria.md1.1 KB
Gives 0 of the 12 instructions most test skills give in ~1.3k tokens
Counted across 964 of the 1,571 authors here whose files we hold, read 2026-08-07
- Close the browser when donein 55 of 964, across 12 files
- Wait for network idle statein 51 of 964, across 6 files
- Launch Chromium in headless modein 49 of 964, across 6 files
- Use descriptive selectors for elementsin 49 of 964, across 6 files
- Run provided scripts with help flag firstin 49 of 964, across 6 files
- Add appropriate explicit waitsin 48 of 964, across 5 files
- Use bundled scripts as black boxesin 46 of 964, across 3 files
- Do not read script source codein 46 of 964, across 3 files
- Use sync playwright for scriptsin 46 of 964, across 3 files
- Inspect dom before executing actionsin 46 of 964, across 3 files
- Run the full test suitein 37 of 964
- Write the failing test firstin 29 of 964, across 23 files
Said here and by no other author read
- capture current behavior including quirks and bugs
- dispatch runtime-observer to capture telemetry
- serialize network responses and database records to static json fixtures
- scrub fixtures of absolute paths and sensitive keys
- verify fixture portability report indicates zero violations
- load fixtures locally instead of hitting active networks
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.