New constraint

From FgForrest/evitaDB · View interactive version

New constraint is an AI agent skill from the GitHub repository FgForrest/evitaDB. Plans and executes implementation of a new evitaDB query constraint (filter, order, or require). Produces a task checklist covering all layers — query model, EvitaQL grammar, engine translator, Kryo serializer, external APIs, tests, and documentation — with exact file paths. Use when adding new filt

How to use this skill

Skill file

Planning New Constraint

Produces an implementation plan for adding a new query constraint to evitaDB.

Procedure

Step 1: Gather requirements

Ask the user (if not already clear):

  1. Constraint type: filter, order, or require
  2. What it does: behavior, parameters, return semantics
  3. Supported domains: ENTITY, REFERENCE, INLINE_REFERENCE, FACET, etc.
  4. Does it need a new formula? Or reuses existing infrastructure

Step 2: Find the closest existing constraint

Search the codebase for the most similar existing constraint to use as a template:

| If the new constraint is... | Study this template |

|-----------------------------------|--------------------------------------------------------|

| Filter leaf, entity property | EntityPrimaryKeyInSet, EntityPrimaryKeyGreaterThan |

| Filter leaf, attribute comparison | AttributeGreaterThan, AttributeBetween |

| Filter leaf, price | PriceBetween, PriceInCurrency |

| Filter container | And, ReferenceHaving, HierarchyWithin |

| Order leaf | EntityPrimaryKeyNatural, AttributeNatural |

| Require leaf | Page, PriceContent |

| Require container | EntityFetch, ReferenceContent |

Step 3: Trace the template through all layers

For the chosen template, search for every file that references it. This reveals the exact set of files the new constraint must touch:

rg "TemplateConstraintName" --type java -l

Cross-reference the results against the full checklist in LAYERS.md to ensure nothing is missed.

Step 4: Produce the plan

For each item in the checklist from LAYERS.md:

Step 5: Save the plan

Write to docs/plans/YYYY-MM-DD-{constraint-name}.md with this structure:

# [Constraint Name] Implementation Plan

**Goal:** [One sentence]
**Template constraint:** [Name of template being followed]
**Architecture:** [2-3 sentences about approach]

---

## Task N: [Layer/component name]

**Files:**
- Create: `exact/path/to/NewConstraint.java` (template: `exact/path/to/TemplateConstraint.java`)
- Modify: `exact/path/to/Registry.java` (add after `TemplateConstraint.class`)

**Key differences from template:**
- [What's different about the new constraint vs the template]

Critical rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.