Documentation
¶
Overview ¶
scripts/restructure-by-construct/main.go reorganizes dsl/<domain>/*.memql so that each construct kind lives in its own file:
dsl/<domain>/concepts.memql dsl/<domain>/queries.memql dsl/<domain>/mutations.memql dsl/<domain>/shapes.memql dsl/<domain>/specs.memql dsl/<domain>/traits.memql dsl/<domain>/automations.memql dsl/<domain>/logic.memql dsl/<domain>/builtins.memql dsl/<domain>/tools.memql dsl/<domain>/prompts.memql dsl/<domain>/providers.memql dsl/<domain>/policies.memql
Each existing .memql file in a domain may carry multiple construct kinds today (a per-entity bundle holds concept + queries + mutations + shape + specs for the entity). The script extracts every top-level construct, preserves the @-attribute + comment preamble above it, and routes the slice to the target per-kind file.
Files starting with `_` (e.g. _unsorted.memql) and .tmpl files are skipped. The `policies/` and `providers/` domains roll up to a single `policies.memql` / `providers.memql` file each.
Run from the repo root:
go run ./scripts/restructure-by-construct
The script is idempotent: re-running on an already-restructured tree is a no-op.