.cursor/skills/script-preview/SKILL.md
Generates a human-readable preview of a proposed FileMaker script before XML generation. Use when the user wants to preview, outline, draft, or review script steps in plain English before committing to fmxmlsnippet output. Triggers on phrases like "preview the script", "show me the steps", "outline the logic", "draft the script", or "before you generate".
npx skillsauth add petrowsky/agentic-fm script-previewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Produce a human-readable script outline for review and iteration before generating fmxmlsnippet XML.
Before generating a preview of an existing script (or when verifying line numbers), run:
python3 .claude/skills/script-preview/scripts/saxmlpreview.py agent/xml_parsed/scripts/<solution>/<path/to/script.xml>
This parses the SaXML file and produces one output line per <Step> element, numbered from 1. Because each step maps to exactly one Script Workspace row, the line numbers are 1:1 with what a developer sees in FileMaker. Use this as the authoritative line map when discussing specific steps or referencing insertion points.
The script uses xml.etree.ElementTree (standard library, no dependencies). Output format matches Script Workspace (Script Workspace–format syntax, disabled steps prefixed with //, blank comment steps rendered as # ).
Read agent/CONTEXT.json. Extract:
task — what the script should docurrent_layout — the starting contextFormat the script exactly as it would appear in FileMaker Script Workspace. This is the absolute truth format that developers read and compare against. Rules:
N\tstep (tab-separated number and step text), matching the output of saxmlpreview.py.# but that is a copy artifact, not the visual presentation.)// prefix: // Set Variable [ ... ]<placeholder> text for calculations — show the full calculation or a faithful abbreviated form ending with … for very long ones (matching how Script Workspace truncates long calc text in the step list)When pushing a script to the webviewer Monaco editor, strip the line numbers — Monaco provides its own line numbering. The line-numbered format is for chat display only.
Step syntax rules — match Script Workspace exactly:
| Step | Script Workspace format |
| ----------------- | ------------------------------------------------------------------ |
| Set Variable | Set Variable [ $name ; Value: expression ] — no [1] repetition |
| Exit Script | Exit Script [ Text Result: ] |
| Perform Script | Perform Script [ "Name" ; Specified: From list ; Parameter: ] |
| If / Else If | If [ condition ] — no Collapsed: OFF prefix |
| Loop | Loop [ Flush: Always ] — no Collapsed: OFF prefix |
| Allow User Abort | Allow User Abort [ Off ] / Allow User Abort [ On ] |
| Set Error Capture | Set Error Capture [ On ] / Set Error Capture [ Off ] |
| Commit Records | Commit Records/Requests [ With dialog: Off ] |
| Freeze Window | Freeze Window |
| Comments | # comment text |
Example format:
Script: Process Invoice
1 # PURPOSE: Validate and commit a single invoice record.
2
3 Allow User Abort [ Off ]
4 Set Error Capture [ On ]
5
6 Set Variable [ $invoiceID ; Value: Get ( ScriptParameter ) ]
7 If [ IsEmpty ( $invoiceID ) ]
8 Show Custom Dialog [ "No invoice ID provided." ]
9 Exit Script [ Text Result: ]
10 End If
11
12 Go to Layout [ "Invoice Details" ; Animation: None ]
13 Perform Find [ Restore ]
14
15 If [ Get ( FoundCount ) = 0 ]
16 Show Custom Dialog [ "Invoice not found." ]
17 Exit Script [ Text Result: ]
18 End If
19
20 Set Field [ Invoice::Status ; "Processed" ]
21 Commit Records/Requests [ With dialog: Off ]
22 Exit Script [ Text Result: True ]
After the preview, ask:
AskQuestion:
{
"question": "Does this logic look right?",
"options": [
{ "id": "good", "label": "Looks good — generate the XML" },
{ "id": "changes", "label": "I have changes to make" }
]
}
xml_parsed/scripts_sanitized/ use a different format (e.g. Collapsed: OFF, [1] repetitions, Exit Script []) — do not use that as the format reference; always target Script Workspace formatdevelopment
Generate a complete web application inside a FileMaker Web Viewer — self-contained HTML/CSS/JS styled with the FM theme, plus companion FM bridge scripts for bidirectional data flow. Use when the developer says "web viewer", "webviewer app", "HTML in FileMaker", "build web viewer", or when the layout-design skill delegates to the web-first output path. Recommended for modern, responsive UI, complex interactions (drag-and-drop, charts, rich text), or solutions considering future migration off FileMaker.
development
Trace references to a FileMaker object across the entire solution. Supports usage reports ("where is this field used?"), impact analysis ("what breaks if I rename this?"), and dead object scans ("show unused fields/scripts"). Use when the developer says "trace", "find references", "where is X used", "impact of renaming", "unused fields/scripts", "dead code", "what references X", or "is X used anywhere".
development
Analyze a FileMaker solution and produce a structured profile covering data model, business logic, UI layer, integrations, and health metrics. Uses on-disk pre-processing to handle solutions of any size without sending raw XML through the agent. Use when the developer says "analyze solution", "solution overview", "solution analysis", "solution profile", "solution spec", "what does this solution do", "solution summary", or wants a high-level understanding of an entire FileMaker solution.
development
Interactive setup wizard for agentic-fm. Detects what's already configured, walks the user through each remaining step, and verifies completion before proceeding. Use when the developer says "help me set up", "setup", "get started", "onboard", "first time setup", "install agentic-fm", "configure agentic-fm", or is clearly new to the project and needs guidance.