Ui context

From allthingsida/idasql-skills · View interactive version

Ui context is an AI agent skill from the GitHub repository allthingsida/idasql-skills. Capture live IDA UI context. Use when the user references what's on screen, what's selected, or asks about the current view in IDA's GUI.

How to use this skill

Skill file


Primary Query

Use this function to capture active UI state:

SELECT get_ui_context_json();

Capture once per user question, then reuse that snapshot while answering.

Capture again only when the user asks to refresh/re-check, or when a new UI-referential question starts.


Trigger Patterns

Use this skill for prompts like:


Capture Policy

  1. Call get_ui_context_json() before answering UI-referential prompts.
  2. Extract view info: widget type/title and custom-view state.
  3. Extract selection info when present: begin/end and preview text lines.
  4. Extract code anchor info when present: address, function, segment.
  5. If has_address: false, explain limits and do not invent code context.

Widget Fields (`focused_widget` / `main_viewer`)

main_viewer carries the same widget fields except is_chooser_like (the main viewer is always a viewer, not a chooser).


Temporal Reference Rules


Runtime Availability and Fallback

plugin returns live UI state.

available:false / capture.source:"cli" (no error, just no UI). So available

is the reliable GUI-vs-CLI discriminator in both directions — key on it.

binary is database metadata only; it is not a UI context replacement.


Response Template

Use this fixed shape after reading UI context:


Examples

1) "What am I looking at?"

SELECT get_ui_context_json();

Answer with the template fields above. Include focused widget title/type and current anchor address if present.

2) "Look at what I'm doing"

SELECT get_ui_context_json();

Summarize active view and selection first, then propose the next action tied to that context (for example, decompile current function).

3) "What's selected right now?"

SELECT get_ui_context_json();

Prioritize selection begin/end and preview text. Explicitly state when there is no active selection.

4) "Explain this function"

  1. Capture UI context.
  2. If function/address context exists, pivot to decompiler.
SELECT get_ui_context_json();
SELECT decompile(0x401000);

Replace 0x401000 with the captured function/address anchor.

5) Follow-up: "What about that function?"

Reuse the most recent snapshot from the same flow (do not auto-refresh unless asked), then continue analysis from that stored anchor.

6) Non-address view (for example Local Types chooser)

SELECT get_ui_context_json();

If has_address: false, report chooser selection details and state there is no code address anchor in this view.

7) Plugin API unavailable (CLI/idalib)

If get_ui_context_json() cannot run:


Guardrails


See also

(SELECT ida_open_link(...)), and make answers clickable with [name](uri) links.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.