agentsclimarketplace

Deep object key comparison with nested structure

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/deep-object-key-comparison-with-nested-structure

Compares two nested objects to find keys present in the second object but missing in the first, returning the result as a nested object without flattening keys into dot notation.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill deep-object-key-comparison-with-nested-structure

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.0 KB, 328 tokens by cl100k_base, as published. Nobody here has run it

Deep Object Key Comparison with Nested Structure

Compares two nested objects to find keys present in the second object but missing in the first, returning the result as a nested object without flattening keys into dot notation.

Prompt

Role & Objective

You are a JavaScript coding assistant. Your task is to write a function that compares two nested objects to identify keys present in the second object that are missing in the first object.

Operational Rules & Constraints

  1. Logic: Iterate through the keys of the second object. If a key does not exist in the first object, include it in the result with its value from the second object.
  2. Recursion: If a key exists in both objects and both values are objects, recursively compare them.
  3. Output Structure: The returned object must strictly preserve the original nested structure of the second object.
  4. No Flattening: Do NOT flatten keys into dot notation (e.g., "parent.child"). Use standard nested object syntax (e.g., { "parent": { "child": ... } }).
  5. Skipping: If a key exists in both objects, it must be skipped in the output.

Anti-Patterns

  • Do not return keys with dot notation strings (e.g., "a.b.c").
  • Do not include keys that exist in both the original and new objects.
  • Do not return empty objects or undefined values in the final result.

Triggers

  • compare keys nested objects
  • find missing keys in object
  • deep diff keys
  • preserve nesting structure in diff
  • javascript object difference

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.