agentleFS
process-streetprocess-street/ps-skills/skills/build/logic-rules/SKILL.md

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".

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
  1. Very specific:

    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 …

    line 51
  2. Very specific:

    If unsure, fetch one working rule via getWorkflowRevisionLogicRule from a similar workflow and mirror its shape.

    line 64
  3. Very specific:

    Delete duplicates via deleteWorkflowRevisionLogicRule, keep oldest

    line 92
  4. Very specific:

    If a rule conditions on a Dropdown/Select field value, the option string in value must exactly match the option's display label (not …

    line 99
  5. Distinctive:

    If you're adding logic rules immediately after writing a code task widget, wait 2–5s before publishing.

    line 105
  6. Distinctive:

    After any rule write/edit, return:

    line 111

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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"}. (or of and groups.)
  • targets is an object — {"taskIds": [...], "widgetIds": [...]}. widgetIds is REQUIRED even when empty — omitting it is a 400.
  • action — Show or Hide only.
  • Logic rules can't target content widgets — targets.widgetIds only 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.

OperatorNotes
IsExact match (for Select, match the option name)
IsNotInverse
HasAnyValuePresence check — replaces "Is not empty". No value needed
HasNoValueAbsence check — replaces "Is empty". No value needed
IsGreaterThanNumber fields — Number can drive logic
IsLessThanNumber 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

  1. Resolve IDs — get subjectId (form field) and taskIds (targets) via ps-audit (or the CLI template-export) or the CLI template-fields (lists fields + IDs)
  2. List existing rules — listWorkflowRevisionLogicRules — check for duplicates first
  3. Create — createWorkflowRevisionLogicRule with confirmed shape above
  4. Verify — re-fetch the rule, confirm the API echoed back what you sent

Fix a Rule

  1. Get current rule — getWorkflowRevisionLogicRule
  2. Identify the break — usually one of:
    • Wrong operator (UI string like "Is equals" instead of the enum Is/IsNot/etc.)
    • targets flattened instead of object-wrapped, or missing widgetIds: []
    • Wrong subjectId (field was renamed or moved)
    • Stale rule referencing deleted task/field
  3. Update — updateWorkflowRevisionLogicRule (full body, not patch)
  4. Re-verify

Dedupe Rules

  1. listWorkflowRevisionLogicRules
  2. Group by (condition, targets, action) — duplicates have identical bodies
  3. Delete duplicates via deleteWorkflowRevisionLogicRule, keep oldest
  4. 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 CLI template-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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.