logic-rules
Skill1 starsChanged 5 months agoMITView on GitHub
Build, edit, debug, and dedupe conditional logic rules inside a Process Street workflow revision — using the exact API shape confirmed to work (operator enum casing, targets-is-an-object with required widgetIds, FormField-only targets, dedupe flow). Use when someone says "add logic rule", "fix logic rule", "logic rule", "why isn't this rule firing", "conditional logic", "hide task when", "show task when", or "dedupe logic rules".
In this repository12 other files it gives its agents.
- data-setSkill
- demo-buildSkill
- chrome-recording-to-workflowSkill
- ps-auditSkill
- ps-buildSkill
- ps-editSkill
- ps-organizeSkill
- workflow-designSkill
- integration-scopingSkill
- ps-searchSkill
- ps-best-practicesSkill
- ps-helpSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 51
Only these six are valid. The old UI-string operators (Is equals, Is not equals, Contains, Does not contain, Is empty, Is not empty, Is …
- Very specific: line 64
If unsure, fetch one working rule via getWorkflowRevisionLogicRule from a similar workflow and mirror its shape.
- Very specific: line 92
Delete duplicates via deleteWorkflowRevisionLogicRule, keep oldest
- Very specific: line 99
If a rule conditions on a Dropdown/Select field value, the option string in value must exactly match the option's display label (not …
- Distinctive: line 105
If you're adding logic rules immediately after writing a code task widget, wait 2–5s before publishing.
- Distinctive: line 111
After any rule write/edit, return:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
PS Logic Rules Skill
Purpose
Build, edit, debug, and dedupe conditional logic rules inside a Process Street workflow revision. Logic rules are the highest-error-rate PS surface in field experience — this skill encodes the exact patterns confirmed to work.
When to Use
- Adding new conditional show/hide/require rules to a workflow
- Debugging "why isn't this task showing up"
- Cleaning up duplicate rules from prior builds
- Translating a business rule ("if county is Berkeley, route to inspector A") into the right API shape
Reference
- the API reference (
reference/api-reference.md) — endpoint list and confirmed revision-API patterns
Rule Anatomy (Confirmed Shape)
Verified against the live spec. Older anatomy (
conditions/subjectType/subjectId, UI operator strings like"Is not equals"/"Contains") is stale and will 400. The live shape is below, confirmed by the API reference (reference/api-reference.md).
{
"action": "Hide",
"condition": { "or": [ { "and": [ { "widgetId": "<form-field-id>", "operator": "IsNot", "value": "Berkeley" } ] } ] },
"targets": { "taskIds": ["<task-id-to-hide>"], "widgetIds": [] }
}Key points:
condition(singular) — top level is{"or": [...]}, each entry is{"and": [ ... ]}, each leaf is{"widgetId", "operator", "value"}. (orofandgroups.)targetsis an object —{"taskIds": [...], "widgetIds": [...]}.widgetIdsis REQUIRED even when empty — omitting it is a 400.action—ShoworHideonly.- Logic rules can't target content widgets —
targets.widgetIdsonly resolves FormField widgets; Text/Embed/Image are rejected as "not found". Gate at task level, or add the rule in the UI.
Operators (API enum — exact, verified 2026-06-16)
Only these six are valid. The old UI-string operators (Is equals, Is not equals, Contains, Does not contain, Is empty, Is not empty, Is before, Is after) all return 400.
| Operator | Notes |
Is | Exact match (for Select, match the option name) |
IsNot | Inverse |
HasAnyValue | Presence check — replaces "Is not empty". No value needed |
HasNoValue | Absence check — replaces "Is empty". No value needed |
IsGreaterThan | Number fields — Number can drive logic |
IsLessThan | Number fields |
There is no Contains / DoesNotContain and no dedicated date before/after operator — all rejected. For substring/date-range branching, gate via a Date field constraint or a code task instead.
If unsure, fetch one working rule via getWorkflowRevisionLogicRule from a similar workflow and mirror its shape.
Standard Flow
Add a Rule
- Resolve IDs — get
subjectId(form field) andtaskIds(targets) viaps-audit(or the CLItemplate-export) or the CLItemplate-fields(lists fields + IDs) - List existing rules —
listWorkflowRevisionLogicRules— check for duplicates first - Create —
createWorkflowRevisionLogicRulewith confirmed shape above - Verify — re-fetch the rule, confirm the API echoed back what you sent
Fix a Rule
- Get current rule —
getWorkflowRevisionLogicRule - Identify the break — usually one of:
- Wrong operator (UI string like
"Is equals"instead of the enumIs/IsNot/etc.) targetsflattened instead of object-wrapped, or missingwidgetIds: []- Wrong
subjectId(field was renamed or moved) - Stale rule referencing deleted task/field
- Wrong operator (UI string like
- Update —
updateWorkflowRevisionLogicRule(full body, not patch) - Re-verify
Dedupe Rules
listWorkflowRevisionLogicRules- Group by
(condition, targets, action)— duplicates have identical bodies - Delete duplicates via
deleteWorkflowRevisionLogicRule, keep oldest - Republish if workflow was live
Select Widget Options Gotcha
If a rule conditions on a Dropdown/Select field value, the option string in value must exactly match the option's display label (not internal id). Verify by reading the widget's options array first.
Trailing CT Race
If you're adding logic rules immediately after writing a code task widget, wait 2–5s before publishing. There is a known race where the rule references a widget the publish step can't yet see.
Output
After any rule write/edit, return:
- Rule ID
- Confirmed echo from API (proves shape was accepted)
- Affected task names (resolved from IDs for readability)
- Warnings (duplicates found, stale references, etc.)
Related Skills
ps-audit(or the CLItemplate-export) — find existing rules + IDs to reference- the CLI
template-fields(lists fields + IDs) — resolve form field IDs by label ps-build— for fresh builds where rules are added in bulk
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.

