Skip to content
Back to skills

Pluck

ASecurity

Extract single field value from each Note in Collection

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

Security analysis

A100/100

Scanned June 6, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Pluck?

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

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

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: pluck
type: primitive
description: Extract single field value from each Note in Collection
---

# Pluck

## INPUT CONTRACT

- `target`: Collection (variable or ID)
- `field`: String path (supports dot notation like `metadata.uri`)
- `out`: Variable name

**REQUIREMENTS:**
- Collection MUST contain Notes (not Collections)
- Each Note MUST be dict/JSON object
- Field MUST exist as key in each Note

**NOT SUPPORTED:**
- ❌ Note containing array (use `split` first)
- ❌ Collection of arrays (must be dict Notes)

## OUTPUT

Returns Collection of Notes, each containing extracted scalar value. Notes missing field are excluded.

## FAILURE SEMANTICS

**Empty Collection = expected when:**
- Field missing in all Notes
- Type contract violated

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

**Actual failures:** Invalid target type or missing parameters.

## REPRESENTATION INVARIANTS

- Note containing JSON array ≠ Collection
- Use `split` to convert array → Collection
- `flatten` performs inverse (Collection → Note)

## CONTENT STRUCTURE

**For JSON Notes, content is a dict with fields:**
- Top-level fields: `text`, `format`, `char_count`
- Nested fields: `metadata.*` (e.g., `metadata.uri`, `metadata.title`, `metadata.year`)

**Example Note content structure (from semantic-scholar/search-web):**
```json
{
  "text": "Full text content...",
  "format": "paper",
  "metadata": {
    "title": "Paper Title",
    "uri": "https://example.com/paper.pdf"
  },
  "char_count": 5000
}
```

## FIELD ACCESS EXAMPLES

**Extract nested field:**
```json
{"type":"pluck","target":"$papers","field":"metadata.title","out":"$titles"}
```

**Extract top-level field:**
```json
{"type":"pluck","target":"$results","field":"text","out":"$texts"}
```

**Extract URI for fetching:**
```json
{"type":"pluck","target":"$search_results","field":"metadata.uri","out":"$urls"}
```

## ANTI-PATTERNS

❌ `pluck(target=$array_note)` → Use `split` first
❌ `pluck(target=$coll_of_arrays)` → Elements must be dicts
❌ 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.