hassanzohdy/collection/transforming
Claude Code and agent skill by hassanzohdy/collection
- community
Checking that the SKILL.md file is still in the repository.
Tutorial-style guide to reshaping collection items — `map`, `pluck`, `select`, `groupBy`, `unique`, `uniqueList`, `flat`, `flatMap`, `collectFrom`, `collectFromKey`, `partition`. Covers column projection, dot-notation paths, flattening nested fields, splitting into two pipelines, and the `groupBy` → `items` sub-array convention.
Install
npx vskill@latest install hassanzohdy/collection/transformingSKILL.md
Transforming a Collection
How to use
map — project to a new shape
Returns a new collection of the mapped values. The generic type changes when you supply an explicit type parameter.
pluck — extract a single field (or subset of fields)
select — keep only specific keys on each item
groupBy — bucket items by a field value
Returns a collection of group objects. Each group has the grouping key(s) as properties plus an items array containing the members.
To operate on the sub-arrays as collections, wrap them:
unique — deduplicate by identity or key
unique("key")returns the VALUES at that key (viapluck+Set). For deduped OBJECTS (one per unique key value), useuniqueList(key)instead.
uniqueList — keep first occurrence (as objects) per key value
Returns the original item objects — one per unique key value, in source order:
flat / flatMap — flatten nested arrays
collectFrom — hoist a nested array field up
Iterates items, pulls the value at key, and if it is an array, spreads it into the result collection. Useful for flattening one level of nested collections.
partition — split into two collections
Returns a tuple [matching, notMatching]:
select columns then chain
Key details / Pitfalls
- All transform methods return a new collection; the original is untouched.
groupByuses@mongez/reinforcements'groupByinternally and always names the sub-array property"items".pluckwith a string key delegates to reinforcements'pluck— it usesget(item, key)so dot-notation paths work.map<NewType>changes the TypeScript generic type; downstream chained methods will reflect the new type.collectFrom(key)spreads array values but pushes scalar values as-is — useful only when the nested property is reliably an array.- Keyed string operations (
appendString,prependString,replaceString, etc.) usecloneForSetinternally to shallow-clone plain objects before mutating the key, so the original items are not modified. However, class instances and nested objects are passed through by reference.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/transforming/SKILL.md
Popularity
- Repository stars
- 4
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hassanzohdy/collection/transforming)