home / skills / bdambrosio / cognitive_workbench / test-json-sql-project

test-json-sql-project skill

/src/saved_plans/test-json-sql-project

This skill validates a test-json-sql-project by generating sample papers and projecting only title and year for verification.

npx playbooks add skill bdambrosio/cognitive_workbench --skill test-json-sql-project

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
417 B
---
name: test-json-sql-project
description: Tests project primitive (SELECT fields)
manual_only: true
---

# Test Project Primitive

**Self-contained:** Creates test data internally

**Input:** Creates $papers collection (4 papers with id, title, year, citations, venue)

**Operation:** Project only title and year fields

**Expected Output:** $projected collection with 4 items, each containing only {title, year}

Overview

This skill verifies a project's ability to select specific fields from a dataset. It creates a small internal collection of paper records and asserts that a projection operation returns only the title and year fields for each record. The skill is self-contained and requires no external data.

How this skill works

The skill generates four paper documents with id, title, year, citations, and venue fields. It performs a primitive SELECT-like projection that keeps only the title and year fields. The output is validated as a collection of four items where each item contains only title and year.

When to use it

  • Validate a query engine or transformation that supports field projection
  • Smoke-test a data pipeline step that should remove extra fields
  • Confirm project/SELECT behavior in unit tests for a data processing component
  • Demonstrate minimal end-to-end test for schema-reduction logic

Best practices

  • Keep the input dataset small and deterministic to make failures easy to reproduce
  • Explicitly assert both presence of required fields and absence of removed fields
  • Use this skill as part of a broader test suite that covers other primitives (filter, group, join)
  • Run tests in isolation to avoid side effects from shared state

Example use cases

  • Testing a SQL-to-JSON translator's handling of SELECT field lists
  • Verifying that a data-transform microservice strips sensitive fields before forwarding
  • Unit tests for a query planner that optimizes away unused columns
  • CI check to ensure a refactor didn't change projection behavior

FAQ

Does the skill require external datasets?

No. The skill is self-contained and creates the four test paper records internally.

What exactly is asserted in the output?

The output must be a collection of four items where each item contains only the title and year fields, and no other fields.