# @lokascript/domain-flow

Source: https://glimind.com/server/npm%2F-lokascript%2Fdomain-flow
Registry id: `npm/-lokascript/domain-flow`
Status: unknown

## Install

```json
{
  "mcpServers": {
    "lokascript-domain-flow": {
      "command": "npx",
      "args": [
        "-y",
        "@lokascript/domain-flow"
      ]
    }
  }
}
```

Claude Code:

```sh
claude mcp add lokascript-domain-flow -- npx -y @lokascript/domain-flow
```

## Tools (80)

- `addition`: Addition operator for numbers or string concatenation
- `analyze_complexity`: Calculate numeric complexity scores for hyperscript: cyclomatic, cognitive, and Halstead metrics. Use for code review when deciding if code is too complex.
- `analyze_metrics`: Detect code smells and quality issues in hyperscript. Returns patterns, problems (too many commands, missing error handling), and quality scores. More detailed 
- `and`: Logical AND operator
- `array-literal`: Array literal using bracket notation
- `attribute-ref`: Reference to a DOM attribute using @ prefix
- `behavior`: Define a reusable behavior that can be installed on elements
- `boolean-literal`: Boolean true/false value
- `closest`: Find the nearest ancestor element matching a selector
- `compile_auto`: Auto-detect domain and compile in one shot. Returns compiled output along with the detected domain name.
- `compile_composite`: Compile multi-line input where each line may belong to a different domain.
- `contains`: Check if a string or array contains a value
- `convert_format`: Convert between explicit bracket syntax, LLM JSON, and InterchangeNode AST without compilation.
- `debug_analyze_snapshot`: Analyze a HyperFixi debug snapshot. Given the current command, element, variables, and execution depth, explains what the command does, what state is available,
- `debug_explain_handler`: Explain a hyperscript event handler step-by-step. Given the full handler code, breaks down what each command does, identifies potential issues (null references,
- `debug_suggest_fix`: Given a debug snapshot where something went wrong (unexpected variable value, wrong element, error), analyze the state and suggest likely causes and fixes. Comb
- `debug_trace_variable`: Given an array of debug snapshots (execution history) and a variable name, trace how that variable changed over time. Shows each step where the variable was mod
- `def`: Define a reusable function
- `destination`: Where the action targets or where something ends up. Intentionally broad: DOM element, URL, or variable. Disambiguated by value type per command.
- `detect_domain`: Auto-detect which registered domain handles the input. Tries all domains (sql, todo, behaviorspec, llm, flow, voice, learn) and returns the best match by confid
- `diff_behaviors`: Compare two hyperscript inputs at the behavior level. Returns whether they are semantically identical, trigger diffs, and per-operation diffs. Works across lang
- `division`: Division operator
- `equals`: Equality comparison
- `event`: The trigger event for an event handler.
- `event-handler`: Handle DOM events with the "on" keyword
- `event-modifiers`: Modify event handling with .once, .prevent, .stop, .debounce(N), .throttle(N)
- `exists`: Check if an element or value exists (is not null/undefined)
- `explain_code`: Generate a plain English explanation of hyperscript code for humans. Use when a user asks "what does this code do?" Supports beginner/intermediate/expert audien
- `first`: Get the first item from a collection
- `from_envelope`: Unwrap an LSE v1.2 envelope into its constituent semantic nodes and metadata.
- `function-call`: Call a JavaScript function or method
- `get_command_docs`: Get documentation for a specific hyperscript command. Returns syntax, description, and usage details.
- `get_expression_docs`: Get documentation for hyperscript expression types. Returns description, category, operators, and examples.
- `grail_check`: Evaluate GRAIL conditions and show available/blocked affordances.
- `grail_info`: Return the full GRAIL workflow graph: conditions with descriptions,
- `grail_list`: List all condition names and affordance names in the GRAIL configuration.
- `grail_plan`: Compute a dependency-ordered plan to make a goal affordance feasible.
- `grail_run`: Execute a GRAIL affordance. Checks preconditions first — blocks if unmet.
- `greater-than`: Greater than comparison
- `has`: Check if an element has a class or attribute
- `init`: Initialization block that runs once on load
- `install`: Install a behavior onto an element
- `is-empty`: Check if a value is empty (empty string, null, undefined, empty array)
- `its`: Possessive form of 'it' for accessing properties of the previous result
- `last`: Get the last item from a collection
- `less-than`: Less than comparison
- `lse_pattern_stats`: Return pattern hit-rate statistics: success rates by command and language, top diagnostic failures, and outcome distribution.
- `lse_validate_and_feedback`: Validate LSE input and return structured feedback with machine-actionable hints, corrected examples, and schema context for LLM self-correction.
- `matches`: Check if an element matches a CSS selector
- `modulo`: Modulo (remainder) operator
- `multiplication`: Multiplication operator
- `next`: Get the next sibling element matching a selector
- `not`: Logical NOT operator
- `not-equals`: Inequality comparison
- `number-literal`: Numeric literal value (integer or decimal)
- `object-literal`: Object literal using brace notation
- `parent`: Reference to the parent element
- `parse_composite`: Parse multi-line input where each line may belong to a different domain. Skips blank and comment lines (//, --, #). Returns per-line results with domain, action
- `patient`: The entity undergoing the action — what is being acted upon. The most common role, used by 25+ commands.
- `possessive`: Access element properties using possessive syntax (element's property)
- `previous`: Get the previous sibling element matching a selector
- `property-access`: Direct property access using dot notation
- `query-reference`: CSS selector query for DOM elements. Use # for ID, . for class, <tag/> for tag
- `query_inventory`: Search and filter within previously scanned inventory results.
- `recipient`: Who receives what the action transfers — the far end of a transfer.
- `recognize_intent`: Classify what hyperscript code does: returns intent labels (dom-manipulation, form-handling, data-fetching, animation, etc.) with confidence scores. Use to cate
- `result`: Alias for 'it' — the result of the previous command
- `scan_inventory`: Scan a project directory for all hyperscript (_=), htmx (hx-*), and fixi (fx-*)
- `search_language_elements`: Search across all hyperscript language elements (commands, expressions, keywords, features, special symbols, semantic roles). Useful for discovering available f
- `source`: Where something originates from — the origin of data or the element to act on.
- `string-literal`: String literal value enclosed in quotes
- `style-ref`: Reference to a CSS style property using * prefix
- `subtraction`: Subtraction operator
- `suggest_best_practices`: Analyze hyperscript code and suggest improvements based on patterns and common best practices.
- `time-expression`: Time duration literal (ms, s, seconds, etc.)
- `to_envelope`: Wrap one or more protocol JSON nodes into an LSE v1.2 envelope with version metadata and feature flags.
- `validate_explicit`: Validate explicit bracket syntax like `[toggle patient:.active]` without full compilation. Faster than validate_and_compile. Use ONLY for bracket syntax input, 
- `validate_protocol`: Validate a protocol JSON node (v1.1/v1.2). Returns diagnostics for any structural issues.
- `worker`: Run code in a web worker for background processing
- `you`: Reference to the element that triggered the event (e.g., clicked element in delegated events)

Measured by Glimind (https://glimind.com): MCP handshake + tool list only, no tool is ever called. CC BY 4.0.
