reference-field-manager

Community

Safely manage embedded model references.

Authorspuneiartur
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This skill ensures data integrity by managing the full lifecycle of embedded reference fields between two Express.js + MongoDB resources. When a referencing model uses fields from a referenced model, missing any part of the reference lifecycle (schemas, validation, trails, usage checks) can lead to hard-to-trace data inconsistencies.

Core Features & Use Cases

  • Generate and wire Mongoose ref schemas (models/schemas) and Yup ref schemas for the referenced entity.
  • Update the referencing model validation and trails to propagate changes when the referenced document is updated or deleted.
  • Add usage checks and route groundwork (normalization) to prevent orphaned references across controllers.
  • Real-world use: connect Product and Category by embedding a category reference with id, name, and slug, and keep all dependent docs in sync.

Quick Start

Identify the Referencing model (A) and Referenced model (B), then generate the ref schemas, trail functions, and controller wiring following the workflow.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: reference-field-manager
Download link: https://github.com/spuneiartur/claude-agent-specs/archive/main.zip#reference-field-manager

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.