-
Notifications
You must be signed in to change notification settings - Fork 3
feat: improve mixpanelyst skill score 74% β 84% #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Custom Property Formula Reference | ||
|
|
||
| Formulas use a SQL-like expression language. Variables (A, B, _A, etc.) map to properties via `composedProperties`. | ||
|
|
||
| ## Variable Binding | ||
|
|
||
| `LET(name, expression, body)` β define intermediate results: | ||
| ``` | ||
| LET(raw, A, REGEX_REPLACE(raw, "pattern", "replacement")) | ||
| LET(x, A * B, IFS(x < 50, "low", x < 200, "mid", TRUE, "high")) | ||
| ``` | ||
|
|
||
| ## Conditionals | ||
|
|
||
| `IF(cond, then, else)`, `IFS(cond1, val1, cond2, val2, ..., TRUE, default)` | ||
|
|
||
| ## String Functions | ||
|
|
||
| `UPPER(s)`, `LOWER(s)`, `LEN(s)`, `LEFT(s, n)`, `RIGHT(s, n)`, `MID(s, start, count)`, `SPLIT(s, delim, n)`, `HAS_PREFIX(s, p)`, `HAS_SUFFIX(s, p)`, `PARSE_URL(s, "domain")` | ||
|
|
||
| ## Regex Functions (PCRE2 engine) | ||
|
|
||
| - `REGEX_MATCH(haystack, pattern)` β returns true/false | ||
| - `REGEX_EXTRACT(haystack, pattern, capture_group)` β returns match or capture group | ||
| - `REGEX_REPLACE(haystack, pattern, replacement)` β replaces all matches | ||
|
|
||
| ## Type Functions | ||
|
|
||
| `STRING(x)`, `NUMBER(x)`, `BOOLEAN(x)`, `DEFINED(x)` | ||
|
|
||
| ## Math | ||
|
|
||
| `+`, `-`, `*`, `/`, `%`, `MIN(a,b)`, `MAX(a,b)`, `FLOOR(n)`, `CEIL(n)`, `ROUND(n)` | ||
|
|
||
| ## Date | ||
|
|
||
| `DATEDIF(start, end, unit)` β units: D, M, Y, MD, YM, YD. `TODAY()` for current date. | ||
|
|
||
| ## List | ||
|
|
||
| `SUM(list)`, `ANY(x, list, expr)`, `ALL(x, list, expr)`, `FILTER(x, list, expr)`, `MAP(x, list, expr)` | ||
|
|
||
| ## Comparison, Logical & Constants | ||
|
|
||
| `==`, `!=`, `<`, `>`, `<=`, `>=` (case-insensitive for strings), `IN` for list membership. `AND`, `OR`, `NOT(x)`. Constants: `TRUE`, `FALSE`, `UNDEFINED`. | ||
|
|
||
| ## Examples | ||
|
|
||
| **CamelCase splitting:** `REGEX_REPLACE(text, "(?-i)([a-z])([A-Z])", "$1 $2")` β "ChickenSundaysApril" becomes "Chicken Sundays April" | ||
|
|
||
| **Multi-step cleanup** (campaign names from Braze): Chain `LET` + `REGEX_REPLACE` to strip date prefixes, targeting codes, channel suffixes, and underscores in a single formula. | ||
|
Comment on lines
+48
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The original file had the full |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original SKILL.md had an explicit warning about needing
\\\\for a literal\depending on how the formula is constructed (Python string β JSON β regex engine). This is a common stumbling block for agents writing formulas with literal backslashes, and it appears in neither the condensed SKILL.md regex-quirks block nor this reference file. Agents hitting this will get silent, hard-to-debug mismatch errors.