Skip to content
Back to skills

Filter Structured

ASecurity

Filter Collection by field conditions (SQL WHERE)

  • 10 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 6, 2026
businesssql

Security analysis

A100/100

Scanned June 6, 2026

npx -y skills add bdambrosio/Cognitive_workbench --skill filter-structured --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Filter Structured?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Filter Structured
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bdambrosio-filter-structured/badge)](https://www.skillsdirectory.com/skills/bdambrosio-filter-structured)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: filter-structured
type: primitive
description: Filter Collection by field conditions (SQL WHERE)
---

# Filter-Structured

## INPUT CONTRACT

- `target`: Collection (variable or ID)
- `where`: SQL-like predicate string (e.g., `"year > 2020"`, `"score >= 0.5 AND year < 2025"`)
- `out`: Variable name

**REQUIREMENTS:**
- Collection MUST contain dict/JSON Notes
- WHERE clause uses field names (dot notation supported)
- Operators: `>`, `<`, `>=`, `<=`, `==`, `!=`, `AND`, `OR`

**NOT SUPPORTED:**
- ❌ Note (must be Collection)
- ❌ Collection of arrays (must be dict Notes)
- ❌ Text parsing (use `filter-semantic` tool for semantic filtering)

## OUTPUT

Returns Collection of Notes matching WHERE clause. Notes missing fields are excluded.

## FAILURE SEMANTICS

**Empty Collection = expected when:**
- No Notes match predicate
- Type contract violated

**Empty ≠ error** — indicates no matches, not failure.

**Actual failures:** Invalid target type, malformed WHERE clause, or missing parameters.

## REPRESENTATION INVARIANTS

- Note containing JSON array ≠ Collection
- Use `split` to convert array → Collection before filtering

## ANTI-PATTERNS

❌ `filter-structured(target=$note)` → Must be Collection
❌ `filter-structured(target=$coll_of_arrays)` → Elements must be dicts
❌ `filter-structured(target=$text_note)` → Use `filter-semantic` for semantic filtering
❌ Treating empty result as error → Empty = no matches

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.