Skip to content
Back to skills

Hive Mapping

ASecurity

Schema mappings for auto-syncing embedded documents

  • 57 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 31, 2026
developmentjavascriptgojava

Security analysis

A100/100

Scanned May 31, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill hive-mapping --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Hive Mapping?

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

Security grade badge for Hive Mapping
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-hive-mapping/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-hive-mapping)

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: hive-mapping
description: Schema mappings for auto-syncing embedded documents
globs:
  - src/autoMap/schemaMappings.json
alwaysApply: false
---

# Schema Mappings

Auto-sync embedded references when source documents change.

Location: `/src/autoMap/schemaMappings.json`

## How It Works

1. You embed document references in schemas (e.g., `user: { _id, fullName }`)
2. You register the mapping in `schemaMappings.json`
3. When source document updates, all referencing documents sync automatically

## Config Format

```json
{
  "tasks": {
    "user": {
      "schema": "users"
    },
    "project": {
      "schema": "projects"
    }
  }
}
```

Means: In `tasks` collection, fields `user` and `project` reference `users` and `projects` collections.

## Example

**Schema with embedded reference:**
```javascript
// tasks.schema.js
project: z
  .object({
    _id: z.string(),
    name: z.coerce.string().nullable().optional(),
    logoUrl: z.coerce.string().nullable().optional(),
  })
  .nullable()
  .optional(),
```

**Mapping config:**
```json
{
  "tasks": {
    "project": {
      "schema": "projects"
    }
  }
}
```

**Result:** When project's `name` or `logoUrl` changes, all tasks with that project update automatically.

## Adding New Mapping

1. Define embedded reference in schema (include fields to sync)
2. Add entry to `schemaMappings.json`:

```json
{
  "yourResource": {
    "fieldName": {
      "schema": "sourceSchema"
    }
  }
}
```

## Rules

- Only fields defined in the embedded object shape are synced
- Works for both single references and arrays
- Changes sync on source document `updated` event

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.