create-entity-selection

create-entity-selection is a command for coding agents from Ganbin/4d-development-skill. It costs 0 tokens per session (513 once invoked), scanned A, original, MIT.

A database command that creates an editable selection of entities from the records currently selected in a 4D table. An entity selection is a group of database objects representing matching records.

In plain words
What is it for?
Use it to work with the current records through a dataclass, preserving their order when the table selection is sorted.
Why use it?
It connects 4D's table-based records with its data-model objects without rebuilding the selection manually.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/ganbin/4d-development-skill/create-entity-selection
Clone the repo
git clone --depth 1 https://github.com/Ganbin/4d-development-skill

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for create-entity-selection

README.md
[![agentmods](https://agentmods.dev/badge/commands/ganbin/4d-development-skill/create-entity-selection.svg)](https://agentmods.dev/commands/ganbin/4d-development-skill/create-entity-selection)
Your own site
<a href="https://agentmods.dev/commands/ganbin/4d-development-skill/create-entity-selection"><img src="https://agentmods.dev/badge/commands/ganbin/4d-development-skill/create-entity-selection.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 513 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00513
Opus 5 $0.00000 $0.00257
Sonnet 5 $0.00000 $0.00103
Haiku 4.5 $0.00000 $0.00051

Measured yesterday against content hash 7bf1a9766b6c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

create-entity-selection scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/create-entity-selection.md · 53 lines

How it starts

The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Parameter Type Description
dsTable Table Table in the 4D database whose current selection will be used to build the entity selection
settings Object Build option: context
Function result 4D.EntitySelection Entity selection matching the dataclass related to the given table

Description

The Create entity selection command builds and returns a new, alterable entity selection related to the dataclass matching the given dsTable, according to the current selection of this table.

If the current selection is sorted, an ordered entity selection is created (the order of the current selection is kept). If the current selection is unsorted, an unordered entity selection is created.

If the dsTable is not exposed in ds, an error is returned. This command cannot be used with a Remote datastore.

In the optional settings parameter, you can pass an object containing the following property:

Property Type Description
context Text Label for the optimization context applied to the entity selection.

Example

var $employees : cs.EmployeeSelection
ALL RECORDS([Employee])
$employees:=Create entity selection([Employee])
// The $employees entity selection now contains a set of reference
// on all entities related to the Employee dataclass

See also

USE ENTITY SELECTIONdataClass.newSelection()

Properties

Read the full file on GitHub · 53 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 53 lines · 0 tokens per session scan A 7bf1a9766b6c

Subscribe to this mod's changes

create-entity-selection is a command published in the GitHub repository Ganbin/4d-development-skill (9 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 513 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.