Extract single field value from each Note in Collection
Scanned 6/6/2026
Install via CLI
openskills install bdambrosio/Cognitive_workbench---
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
No comments yet. Be the first to comment!
Designs system architecture, component specifications, and technical integration strategy. Use when: designing solutions, system architecture, technology stack, or integration approaches.
Generate a comprehensive VC investment assessment report for a company
Manage Globalize translation resources using the CLI. Use this skill when the user asks to create a translation project, add or remove languages, connect a GitHub or GitLab repository, manage glossaries or style guides, invite team members, manage API keys, or perform any Globalize platform operation. Also use when the user mentions managing translations, translation workflow, or wants to "set up translations for this repo." This skill assumes the CLI is already installed and authenticated — ...
Develop and operate a local Paperclip instance — start and stop servers, pull updates from master, run builds and tests, manage worktrees, back up databases, and diagnose problems. Use whenever you need to work on the Paperclip codebase itself or keep a running instance healthy.
Guide for creating, updating, and deprecating hybrid cloud RPC services in Sentry. Use when asked to "add RPC method", "create RPC service", "hybrid cloud service", "new RPC model", "deprecate RPC method", "remove RPC endpoint", "cross-silo service", "cell RPC", or "control silo service". Covers service scaffolding, method signatures, RPC models, cell resolvers, testing, and safe deprecation workflows.