filterql-builder
Skill4 starsChanged 7 months agoMITView on GitHub
Translate structured conditions into valid FilterQL expressions. Use when the user wants to write, build, or validate a FilterQL query or filter expression.
In this repository22 other files it gives its agents.
- account-syncSkill
- audience-advisorSkill
- audience-builderSkill
- audience-snapshotSkill
- campaign-flow-builderSkill
- connection-managerSkill
- data-health-monitorSkill
- entity-lookupSkill
- export-debuggerSkill
- flow-managerSkill
- integration-advisorSkill
- integration-setupSkill
- job-managerSkill
- lytics-agentSkill
- profile-explorerSkill
- profile-investigatorSkill
- schema-discoverySkill
- schema-managerSkill
- schema-optimizerSkill
- segment-managerSkill
- stream-inspectorSkill
- webhook-template-builderSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 62
NOT can wrap any single condition or group
- Distinctive: line 72
Keep it descriptive but concise
- Distinctive: line 97
If a field type is incompatible with the requested operator, suggest the correct operator
- Distinctive: line 98
If values contain quotes, escape them
- Distinctive: line 99
If the FilterQL is syntactically invalid, identify and fix the issue
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
FilterQL Builder
Purpose
Translate structured conditions into valid FilterQL syntax. Takes field/operator/value tuples with AND/OR grouping and produces a syntactically correct FilterQL string.
Environment
- None required (pure construction, no API calls)
Inputs
- Conditions: list of (field, operator, value) tuples
- Grouping: AND/OR/NOT composition
- Table: target table (default:
user) - Alias: segment slug name
Behavior
Step 1: Map Each Condition to FilterQL Syntax
For each condition, use the type-operator compatibility matrix from ../references/field-types.md:
| Field Type | Natural Language | FilterQL |
string | equals "X" | field = "X" |
string | not "X" | field != "X" |
string | contains "X" | field CONTAINS "X" |
string | like pattern | field LIKE "pattern*" |
string | one of A,B,C | field IN ("A", "B", "C") |
bool | is true | field = true |
bool | is false | field = false |
int/number | more than N | field > N |
int/number | at least N | field >= N |
int/number | less than N | field < N |
date | after N days ago | field > "now-Nd" |
date | before N days ago | field < "now-Nd" |
date | within last N hours | field > "now-Nh" |
[]string (set) | has "X" | field INTERSECTS ("X") |
[]string (set) | doesn't have "X" | field NOT INTERSECTS ("X") |
| any | has any value | EXISTS field |
| any | is empty | NOT EXISTS field |
Step 2: Compose Conditions
Wrap conditions in AND/OR/NOT:
FILTER AND (
condition1,
condition2,
OR (condition3, condition4)
) FROM table ALIAS slug_nameRules:
- Single condition:
FILTER condition FROM table ALIAS slug - Multiple conditions default to AND
- NOT can wrap any single condition or group
- Parentheses required for AND/OR groups
- Comma-separate conditions within groups
Step 3: Generate Slug Name
Convert the alias to a valid slug:
- Lowercase
- Replace spaces with underscores
- Remove special characters
- Keep it descriptive but concise
Step 4: Output
Return the complete FilterQL string:
FILTER AND (country = "US", visitct > 5) FROM user ALIAS us_active_visitorsDate Math Reference
| Period | Syntax | Example |
| Hours | "now-Nh" | "now-24h" = 1 day ago |
| Days | "now-Nd" | "now-30d" = 30 days ago |
| Weeks | "now-Nw" | "now-4w" = 4 weeks ago |
| Months | "now-NM" | "now-6M" = 6 months ago |
| Years | "now-Ny" | "now-1y" = 1 year ago |
Common conversions:
- 1 year =
"now-1y"or"now-8760h"or"now-365d" - 90 days =
"now-90d"or"now-2160h" - 1 week =
"now-1w"or"now-7d"or"now-168h"
Error Handling
- If a field type is incompatible with the requested operator, suggest the correct operator
- If values contain quotes, escape them
- If the FilterQL is syntactically invalid, identify and fix the issue
Dependencies
- References:
../references/filterql-grammar.md,../references/field-types.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

