# Flatten

> Flatten Collection to single Note

- Skill: `bdambrosio/flatten` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add bdambrosio/flatten`
- Raw SKILL.md: https://api.skillmd.com/api/skills/bdambrosio/flatten/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: bdambrosio (https://skillmd.com/u/bdambrosio)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/bdambrosio/flatten

---


# Flatten

## INPUT CONTRACT

- `target`: Collection (variable or ID)
- `out`: Variable name

**REQUIREMENTS:**
- `target` MUST be Collection

**NOT SUPPORTED:**
- ❌ Note (use `split` to convert Note → Collection first)

## OUTPUT

Returns single Note containing merged content from all Collection items.

## FAILURE SEMANTICS

**Returns `failed` when:**
- Target is Note (not Collection)
- Missing parameters

**Empty Note ≠ error** — indicates empty Collection, not failure.

## REPRESENTATION INVARIANTS

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

## ANTI-PATTERNS

❌ `flatten(target=$note)` → Must be Collection
❌ Expecting structured output → Returns merged content, structure may be lost

