Skip to content
Back to skills

Create Collection

ASecurity

Create a Collection object and bind to variable

  • 10 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added June 6, 2026
researchpython

Security analysis

A100/100

Scanned June 6, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Create Collection?

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

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

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: create-collection
type: primitive
description: Create a Collection object and bind to variable
---

# Create-Collection

## INPUT CONTRACT

- `value` (required): One of:
  - Array of `$variables` (e.g. `["$note1", "$note2"]`)
  - Array of raw resource IDs (e.g. `["Note_42", "Note_43"]`)
  - A single `$variable` (e.g. `"$note"`)
  - Empty array `[]` (creates an empty Collection)
- `out` (required): `$variable` name for resulting Collection
- `name` (optional): Stable name for the Collection, enabling later `load` by name

**REQUIREMENTS:**
- `value` must be provided (can be empty array)
- `out` must be a `$variable`
- All elements of `value` (whether `$variables` or raw IDs) must resolve to existing Notes

**IMPORTANT:** The `name` parameter registers a persistent name for later retrieval via `load(target="my-name")`. Variable names like `$my_collection` in `out` are temporary bindings during plan execution — not persistent names.

**Code-block usage tip:** When filtering an existing Collection in a code block, you typically end up with a list of raw Note IDs from `get_items("$source_collection")`. Pass that list directly as `value` — there is no need to round-trip each ID through a `$variable`. Example:

```python
items = get_items("$titles_collection")
filtered = [tid for tid in items if not get_text(tid).startswith("[")]
tool("create-collection", value=filtered, out="$filtered_titles")
```

## EXAMPLES

```json
{"type": "create-collection", "value": ["$note1", "$note2"], "out": "$my_collection"}
```
```json
{"type": "create-collection", "value": ["Note_42", "Note_43"], "out": "$by_id"}
```
```json
{"type": "create-collection", "name": "research", "value": [], "out": "$papers"}
```
```json
{"type": "create-collection", "value": "$note", "out": "$single_item"}
```

## OUTPUT

Returns `success` with the created Collection's resource ID. The Collection is immediately available via the `$variable` bound in `out`.

## FAILURE SEMANTICS

- Missing `value` or `out` parameter
- Referenced `$variables` in the array do not exist

## ANTI-PATTERNS

- Confusing `name` (persistent identifier) with `out` (temporary binding)
- Using `create-collection` to inspect or read existing Collections — use `load` instead

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.