home / skills / bdambrosio / cognitive_workbench / test-json-sql-filter
This skill analyzes internal test data, applies a where citations > 100 filter, and returns the high-cited items.
npx playbooks add skill bdambrosio/cognitive_workbench --skill test-json-sql-filterReview the files below or copy the command above to add this skill to your agents.
---
name: test-json-sql-filter
description: Tests filter-structured primitive (WHERE clause)
manual_only: true
---
# Test Filter-Structured Primitive
**Self-contained:** Creates test data internally
**Input:** Creates $papers collection (citations: 100, 250, 50, 180)
**Operation:** Filter where citations > 100
**Expected Output:** $high_cited collection with 2 items (Transformers: 250, Scaling Laws: 180)
This skill validates a structured filter primitive by running an end-to-end test that creates sample data and applies a WHERE-style condition. It focuses on filtering primitive fields (numeric comparisons) and confirming the resulting collection matches the expected subset. The test is self-contained and deterministic, making it ideal for CI checks of filtering logic.
The skill generates an internal collection named $papers with citation counts [100, 250, 50, 180] and associated titles. It applies a filter operation equivalent to WHERE citations > 100 and produces a $high_cited collection. The test then asserts that $high_cited contains exactly the two expected items (Transformers: 250, Scaling Laws: 180).
What does this test assert exactly?
It asserts that filtering $papers for citations > 100 yields a $high_cited collection with exactly two items: Transformers (250) and Scaling Laws (180).
Does the skill depend on external data or services?
No. The test is self-contained and creates its own $papers collection so it can run deterministically in any environment.