.cursor/skills/script-lookup/SKILL.md
Locate a specific FileMaker script in the `agent/xml_parsed/` folder, resolving to the matching pair of scripts from `scripts_sanitized` - human-readable version - and the Save a Copy as XML (SaXML) version. Use when the user says "review/refactor/optimize/open/show" a script, mentions "script ID", or asks about a specific script by name.
npx skillsauth add petrowsky/agentic-fm script-lookupInstall 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.
Locate a FileMaker script by ID or name, resolving to the paired human-readable and Save-As-XML files. Optimized for minimum tool calls.
Performance target: 4 tool calls for ID-based lookups, 5 for name-based.
Treat these as script IDs:
If no ID is present, treat the remainder as a script name hint, e.g.:
Normalize name hints:
This is the critical optimization. agent/context/{solution}/scripts.index is a pipe-delimited file (ScriptName|ScriptID|FolderPath) covering every script in the solution. Use it as the primary lookup source — never start with filesystem traversal.
Run these in parallel (single message, multiple tool calls):
Tool call A — Grep the index:
grep "|{id}|" agent/context/*/scripts.index — returns the exact match plus the solution name from the file path.grep -i "{name_hint}" agent/context/*/scripts.index — returns matching rows. If the user also mentions a solution name, include it in the grep path: agent/context/{solution_hint}*/scripts.index.Tool call B — List sandbox:
ls agent/sandbox/ — check for any existing fmxmlsnippet files (in-progress work).From the index result, extract:
agent/context/{solution}/scripts.index)Multi-solution handling: If index results come from multiple solution paths, or the user mentions a specific solution, resolve to one. If ambiguous, use AskUserQuestion to ask which solution.
Derive file paths — the sanitized filename follows the pattern {ScriptName} - ID {ScriptID}.txt, nested inside a folder whose name starts with the folder path value from the index. Since the folder's own ID suffix isn't in the index, use a glob:
agent/xml_parsed/scripts_sanitized/{solution}/{FolderPath}*/{ScriptName} - ID {ScriptID}.txtagent/xml_parsed/scripts/{solution}/{FolderPath}*/{ScriptName} - ID {ScriptID}.xmlFor top-level scripts (empty folder path in index): files are directly in agent/xml_parsed/scripts_sanitized/{solution}/.
Sandbox match: From the sandbox listing (Step 1B), check if any file matches the script name (sandbox files don't include IDs — match by name).
Run in parallel:
Tool call A — Glob for sanitized file:
Use Bash: ls agent/xml_parsed/scripts_sanitized/"{solution}"/"{FolderPath}"*/*"ID {ScriptID}"* 2>/dev/null || ls agent/xml_parsed/scripts_sanitized/"{solution}"/*"ID {ScriptID}"* 2>/dev/null
Tool call B — Read first 20 lines of the sanitized script (for the excerpt). If you already know the exact path from the glob, read it directly. Otherwise, combine with tool call A by using a single Bash command that finds and reads:
file=$(find "agent/xml_parsed/scripts_sanitized/{solution}" -name "*ID {ScriptID}*" -type f | head -1) && head -20 "$file"
For name-based lookups where multiple index rows matched: pick the best candidate using the matching rules below, then resolve paths for that candidate.
Present the report and confirm in one response:
Selected script
{script name}{id}Paths found
{path or "not found"}{path or "not found"}{path in agent/sandbox, or "not found"}Alternates (if any)
Quick excerpt
scripts_sanitized to confirm identityThen use AskUserQuestion: "Is this the correct script? — {Script Name} (ID: {id}) in {solution}"
yes — "Yes, proceed" / no — "No, that's not it — let me clarify"If confirmed:
agent/sandbox/, use it as the editable base.python3 agent/scripts/fm_xml_to_snippet.py "agent/xml_parsed/scripts/{solution}/{folder}/{ScriptName} - ID {ScriptID}.xml" "agent/sandbox/{ScriptName}.xml"
If declined:
When the index grep returns multiple rows, rank candidates:
Pick the best candidate and continue. The confirmation step is the redirect gate — don't block on a separate disambiguation question unless confidence is truly Low across all candidates.
If agent/context/ has no scripts.index files, fall back to filesystem search:
ls agent/xml_parsed/scripts_sanitized/ — determine solution subfolders.
AskUserQuestion to disambiguate.find "agent/xml_parsed/scripts_sanitized/{solution}" -name "*ID {id}*" -type ffind "agent/xml_parsed/scripts_sanitized/{solution}" -iname "*{hint}*" -type fIf agent/xml_parsed/ does not exist or is empty, report that explicitly and stop.
The sanitized and XML variants are a pair sharing the same name pattern: {ScriptName} - ID {ScriptID} with .txt vs .xml extension, in mirrored folder structures under scripts_sanitized/ vs scripts/.
When ID and name conflict, trust ID.
If the user request is a review/refactor/optimization:
script-review or script-refactor workflow:
agent/sandbox/ as the base.agent/scripts/fm_xml_to_snippet.py.User: "Lets work on script 104"
Step 1 (parallel):
grep "|104|" agent/context/*/scripts.index → Quick Find Clients|104|Quick Find in Invoice Solutionls agent/sandbox/ → check for existing "Quick Find Clients" fileStep 2 (parallel):
ls agent/xml_parsed/scripts_sanitized/"Invoice Solution"/"Quick Find"*/*"ID 104"*Step 3: Report + confirm → "Is this the correct script? — Quick Find Clients (ID: 104) in Invoice Solution"
Step 4: On confirmation → convert to sandbox if no fmxmlsnippet exists.
Tool calls: 4 (2 parallel + 1 read/glob + 1 confirm) + 1 convert if needed.
User: "Let's work on the invoices quick find for the invoice solution"
Step 1 (parallel):
grep -i "quick find" agent/context/"Invoice Solution"/scripts.index → multiple matches:
Quick Find Clients|104|Quick FindQuick Find Invoices|106|Quick FindQuick Find Products|108|Quick FindQuick Find Staff|110|Quick Findls agent/sandbox/Best match: "Quick Find Invoices" (contains "invoices" token from hint).
Step 2: Resolve paths for ID 106, read excerpt.
Step 3: Report with alternates (104, 108, 110) + confirm.
Step 4: Convert on confirmation.
Tool calls: 5 (2 parallel + 1 resolve + 1 confirm + 1 convert).
User: "Review the New Invoice script"
Step 1:
grep -i "new invoice" agent/context/*/scripts.index → results from two solutionsStep 1.5: AskUserQuestion to disambiguate solution, then continue from Step 2.
User: "Show me the invoice script"
Step 1 (parallel):
grep -i "invoice" agent/context/*/scripts.index → many matchesls agent/sandbox/Pick best candidate, include alternates prominently. Confirmation step acts as redirect gate.
development
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.