David Khourshid

A state machines consultant who wrote the library

For products whose logic outgrew a pile of booleans: checkouts, editors, real-time collaboration, onboarding, workflow engines and AI agents. Get the architecture right while it’s still cheap to change.

Available worldwide. On-site or remote. Travel and lodging are billed on top of the fee.

david David Khourshid
I review the logic. You keep the team, the stack and the credit.

Is this a good fit?

Probably, if bugs cluster around flows, async work and edge cases; if you use or are evaluating XState, statecharts or a workflow engine; or if you need an agent loop that behaves the same way twice.

Probably not, if you need a team to build the whole thing for you. I advise and pair; your engineers ship.

What you walk away with

  • Clear models of your critical flows, as diagrams you can run
  • A written, prioritized plan your team can execute without me
  • Direct access to the person who designed XState’s internals

What does advisory cost?

USD, before VAT. Scoped work is priced from the figure shown. Retainers are paid in advance.

  • Expert hour

    60-minute minimum. Architecture questions, code walkthroughs, second opinions.

    $750per hour, prepaid

    Get a proposal
  • Architecture review

    Deep review of your state architecture. Written report with prioritized recommendations. Readout call with your team.

    from $15,000fixed scope, ~2 weeks

    Get a proposal
  • Advisory day

    A full day working directly with your team. Design sessions, pairing, decision records.

    $6,000remote, or $8,000 on-site + travel

    Get a proposal
  • Advisor retainer

    Async access over Slack or email. Two 45-minute calls per month. Billed quarterly in advance.

    from $5,000per month, 3-month minimum

    Get a proposal
  • Embedded architect

    ~20 hours per month. Hands-on design and code review. Joins your planning rituals.

    from $15,000per month, 3-month minimum

    Get a proposal
  • Enterprise XState support

    SLA and priority issue handling. Upgrade and migration guidance. Delivered through Stately (stately.ai).

    from $25,000per year, via Stately

    Get a proposal

Just need an hour? Request an expert hour by email.

What engineers say about XState

“We’ve been using XState for our new payments product. Shout out to the team that is making designing complex front-end flows a dream.”

“We use XState to implement business workflows as statecharts. The visualizer helps us collaborate more closely with customers, the ability to externalize workflows as JSON configuration makes complex workflow changes surprisingly simple to roll out, and test case generation makes it easier than ever to move forward with confidence.”

“XState naturally separates the logic and makes it simple to mock out API calls, so it’s easier to test the code and organize it!”

Questions people ask before booking

What does a state machine consultant actually do?

I review how your application models behavior (UI flows, workflows, sync, agents), find the places where implicit state causes bugs and slow delivery, and help your team restructure that logic into explicit, testable state machines and statecharts, with or without XState.

What is included in an architecture review?

A fixed-scope engagement of about two weeks: codebase and design review, interviews with key engineers, a written report with prioritized recommendations and example models, and a readout call. Reviews start at $15,000 (typically $15,000–$25,000 depending on scope).

Can I just book an hour?

Yes. Expert hours are $750, prepaid, with a 60-minute minimum. Individuals can also book a 30-minute call for $400 on the Learn page.

How do retainers work?

The advisor retainer ($5,000/month) includes async access over Slack or email and two 45-minute calls per month. The embedded architect retainer ($15,000/month) covers roughly 20 hours a month. Both have a 3-month minimum and are billed in advance.

Do you offer enterprise support for XState?

Yes, through Stately: SLA-backed support, priority issues and upgrade/migration guidance start at $25,000 per year.

Get a second opinion from the source

Tell me what you’re building, where it hurts, your timeline and your budget.