first-class-collection

Installation
SKILL.md

First Class Collection

A first-class collection gives a collection a domain name and keeps collection rules in one place.

Rule

The wrapper should own one collection field and behavior around that collection. Extra unrelated fields usually mean it is an entity or aggregate instead.

Workflow

  1. Find repeated collection operations, filters, totals, limits, ordering, or validation.

  2. Name the collection as a domain concept.

  3. Move rules into methods on the wrapper.

  4. Keep the internal collection immutable or defensively copied.

  5. Expose intention-revealing operations instead of raw mutation.

Installs
14
Repository
j5ik2o/ai-tools
GitHub Stars
27
First Seen
May 3, 2026
first-class-collection — j5ik2o/ai-tools