Migrate FileMaker fmscript skill

This commit is contained in:
martin committed 2026-08-09 09:15:07 +02:00
1 parent 18a9a4cd67
commit d677b26ded
20 files changed
+424 -24

No files matched your search

+1 -1
View File
@@ -30,5 +30,5 @@ The consuming project's root `AGENTS.md` must direct agents here explicitly and
## Available Skills ## Available Skills
- `skills/ddr-analysis/`: analyze FileMaker DDR safely and evidence-first. - `skills/ddr-analysis/`: analyze FileMaker DDR safely and evidence-first.
- `skills/filemaker-scripting/`: prepare or review FileMaker script work. - `skills/filemaker-fmscript/`: create, edit, review, or validate `.fmscript` work using the preserved step catalog and references.
- `skills/ticket-analysis/`: turn a request into confirmed scope, questions, risks, and tests. - `skills/ticket-analysis/`: turn a request into confirmed scope, questions, risks, and tests.
+1 -1
View File
@@ -6,7 +6,7 @@ This repository deliberately contains no client DDR, tickets, production data, c
## Phase 1 status ## Phase 1 status
The initial skeleton establishes the shared contract, three generic skills, a ticket-analysis prompt, and project templates. It intentionally does not yet include a DDR parser wrapper or any material copied from a client workspace. The initial structure establishes the shared contract, generic DDR and ticket-analysis placeholders, a ticket-analysis prompt, and project templates. It includes the preserved `filemaker-fmscript` skill with its original examples and references. It intentionally does not yet include a DDR parser wrapper or material copied from a client workspace.
## Layout ## Layout
+97
View File
@@ -0,0 +1,97 @@
---
name: filemaker-fmscript
description: Create, edit, review, or troubleshoot FileMaker `.fmscript` files that follow the open fmscript grammar and can be validated or converted with ai2fm. Use for complete FileMaker scripts, script fragments, ai2fm text, `.fmscript` syntax questions, script refactoring, and conversion-readiness reviews.
---
# FileMaker fmscript
Create deterministic FileMaker script text without inventing FileMaker objects,
business rules, script steps, or parameter syntax. The files in `examples/` are
the authoritative catalog of permitted script steps and their fmscript format.
## Follow the applicable instructions
1. Read every applicable project `AGENTS.md` and any referenced script example.
2. Treat project rules as authoritative for naming, indentation, file location,
output style, supported FileMaker version, and required verification.
3. Before generating or materially editing a script, read the relevant file or
files in `examples/`. Use `rg` to find a step when its category is unclear.
A script step is permitted only when its step name appears in this catalog.
4. Copy the matching example's step name, brackets, parameter labels, label
order, punctuation, and spacing exactly. Replace only its placeholders with
confirmed project values. Do not infer omitted parameters or invent another
parameter form from FileMaker knowledge, the grammar, or a similar step.
5. Read [references/fmscript-0.90.md](references/fmscript-0.90.md) for
language-level parsing and control-structure rules, but never use it to
authorize a step or parameter form absent from `examples/`.
6. Read [references/examples.md](references/examples.md) to select the right
category file.
7. Preserve established project conventions when they are compatible with the
grammar. Report meaningful conflicts instead of silently choosing a format.
## Authoritative script-step catalog
Read the applicable category file directly; do not merge or rewrite its copied
examples. Its lines are the source of truth for both step availability and
format.
- [Accounts](examples/Accounts.fmscript)
- [Artificial Intelligence](examples/Artificial%20Intelligence.fmscript)
- [Control](examples/Control.fmscript)
- [Editing](examples/Editing.fmscript)
- [Fields](examples/Fields.fmscript)
- [Files](examples/Files.fmscript)
- [Found Sets](examples/Found%20Sets.fmscript)
- [Miscellaneous](examples/Miscellaneous.fmscript)
- [Navigation](examples/Navigation.fmscript)
- [Open Menu Item](examples/Open%20Menu%20Item.fmscript)
- [Records](examples/Records.fmscript)
- [Spelling](examples/Spelling.fmscript)
- [Windows](examples/Windows.fmscript)
If no matching example exists, do not emit a substitute script step. Explain
that the catalog has no approved format for it and request a copied example or
permission to extend the catalog. Comments, blank lines, and calculation
continuation indentation are not script steps; preserve the project's existing
style for them.
## Establish the script semantics
- Confirm the affected FileMaker tables, table occurrences, fields, layouts,
scripts, value lists, custom functions, privileges, and relationships from
project sources or a supplied FileMaker export.
- Preserve existing behavior, error handling, and supported FileMaker version.
- Separate confirmed behavior from proposed logic.
- Ask a concise question when a required business rule or object is missing.
- Never manufacture an uncertain script step, parameter form, field reference,
function, object name, or relationship path.
## Generate or edit the script
- For a script-generation request, return only the script text without
Markdown fences or explanation unless the user requests otherwise.
- Include concise section comments, blank lines, and readable multiline
calculations unless the user requests a minimal script.
- Use the catalog's English step name and exact parameter form, unless the
project supplies an explicit approved localized equivalent.
- Emit one logical script step per line. Keep multiline calculations and
multiline comment steps intact.
- For ai2fm output, keep script-step lines flush left, including steps inside
control blocks. Indent only continuation lines inside a multiline parameter
or calculation when it improves readability.
- Use complete matching closing steps for control blocks.
- Preserve inline comments inside calculation bodies.
- Retain disabled steps unless the requested change explicitly removes them.
- Preserve a different established project indentation convention when the
project supplies a known-good ai2fm export that requires it.
- Save complete scripts only when the user or project instructions authorize a
file change, using the required project location and filename.
## Verify conversion readiness
1. Check the script against the grammar checklist in the reference.
2. Compare every emitted step and parameter form with its source line in the
applicable `examples/` file.
3. Validate with ai2fm when that workflow is available.
4. If deterministic validation is unavailable, identify the unverified step or
variant instead of claiming that the script will round-trip.
@@ -0,0 +1,4 @@
interface:
display_name: "FileMaker fmscript"
short_description: "Generate and review valid FileMaker scripts"
default_prompt: "Use $filemaker-fmscript to create or review a valid FileMaker .fmscript script."
@@ -0,0 +1,6 @@
Add Account [ Privilege Set: <unknown> ]
Change Password [ With dialog: On ]
Delete Account []
Enable Account [ Activate ]
Re-Login [ With dialog: Off ; Current File ]
Reset Account Password []
@@ -0,0 +1,14 @@
Configure AI Account [ Account Name: ; Model Provider: OpenAI ; API key: ]
Configure Machine Learning Model [ Operation: Unload ; Name: ]
Configure Prompt Template [ Template Name: ; Model Provider: OpenAI ; Template Type: SQL Query ]
Configure RAG Account [ RAG Account Name: ; Endpoint: ; API key: ]
Configure Regression Model [ Action: Train Model ; Model Name: ; Algorithm: Random Forest ]
Fine-Tune Model [ Account Name: ; Base Model: ; Training Data: Table ]
Generate Response from Model [ Account Name:; Model:; User Prompt:; Agentic mode:On; Response:; Stream:Off ]
Insert Embedding [ Account Name: ; Embedding Model: ]
Insert Embedding in Found Set [ Account Name: ; Embedding Model: ]
Perform Find by Natural Language [ Account Name:; Model:; Prompt:; Get: Found Set ]
Perform RAG Action [ RAG Account Name: ; Space ID: ; Action: Add Data ; RAG Data: From Text ; ]
Perform Semantic Find [ Query by: Natural language ; Account Name: ; Embedding Model: ; Text: ; Record set: All records ]
Perform SQL Query by Natural Language [ Account Name: ; Model: ; Prompt: ; Options specified: From list ; Action: Query ; Data Tables: From list ; [ ] ; Stream: Off ]
Set AI Call Logging [ Off ; Verbose: Off ]
@@ -0,0 +1,38 @@
Allow User Abort [ Off ]
Open Transaction []
Set Revert Transaction on Error [ Off ]
Revert Transaction []
Commit Transaction
Configure Local Notification [ Action: Queue ]
Configure NFC Reading [ Action: Read ]
Configure Region Monitor Script [ Monitor: iBeacon ]
If [ ]
Else If [ ]
Else
End If
Loop [ Flush type: Always ]
Exit Loop If [ True ]
End Loop
Install OnTimer Script [ “” ]
Pause/Resume Script [ Indefinitely ]
Perform Script [ "" ; Specified: From list ; Parameter: ]
Perform Script on Server [ "" ; Specified: From list ; Parameter: ; Wait for completion: On ]
Perform Script on Server with Callback [ "" ; Specified: From list ; Parameter: ; Callback script specified: From list ; "" ; State: “Continue” ]
Set Error Capture [ On ]
Set Error Logging [ Off ]
Set Layout Object Animation [ On ]
Set Variable []
Trigger Claris Connect Flow [ Flow: <unknown> ; JSON Data: ]
Exit Script [ Result: ]
Halt Script
@@ -0,0 +1,10 @@
Clear [ Select ]
Copy [ Select ]
Cut [ Select ]
Paste [ Select ; No style ]
Perform Find/Replace [ With dialog: On ; Search operation: Find Next ; Search settings: Forward ; Search across: All records/requests ; Search within: All fields ]
Select All
Set Selection []
Undo/Redo [ Undo ]
@@ -0,0 +1,21 @@
Export Field Contents [ Create folders: On ]
Insert Audio/Video []
Insert Calculated Result [ Select ]
Insert Current Date [ Select ]
Insert Current Time [ Select ]
Insert Current User Name [ Select ]
Insert File [ Dialog options: Off ]
Insert from Device [ Type: Camera; Camera: Back; Resolution: Full; Flash: Auto ]
Insert from Index [ Select ]
Insert from Last Visited [ Select ]
Insert from URL [ Select ; With dialog: Off ]
Insert PDF []
Insert Picture []
Insert Text [ Select ]
Relookup Field Contents [ With dialog: Off ; :: ]
Replace Field Contents [ With dialog: Off ]
Set Field []
Set Field By Name []
Set Next Serial Value []
@@ -0,0 +1,25 @@
Close Data File [ File ID: ]
Close File [ Current File ]
Convert File [ With dialog: On ]
Create Data File [ "" ; Create folders: On ]
Delete File [ Target file: ]
Get Data File Position [ File ID: ; Target: ]
Get File Exists [ "" ; Target: ]
Get File Size [ "" ; Target: ]
New File
Open Data File [ "" ; Target: ]
Open File [ Open hidden: Off ; <unknown> ]
Print [ With dialog: Off ]
Print Setup [ With dialog: Off ]
# ⚠️ Warning: the Amount (bytes) value is not in this copy — FileMaker left it out when the step was copied, even though the step still holds it.
# Re-enter the Amount here and paste the step back into FileMaker: that repairs the step for good — copy it again afterwards and the value stays.
Read from Data File [ Target: ; Read as: Bytes ]
Recover File [ With dialog: Off ]
Rename File [ Source file: "" ; New name: ]
Save a Copy as [ copy of current file ; Create folders: On ]
Save a Copy as XML [ Window name: ; Destination file: “” ]
# ⚠️ Warning: check the New position value — FileMaker 2026 may have dropped it on copy; re-enter it here if it was set.
Set Data File Position [ ]
Set Multi-User [ On ]
Set Use System Formats [ On ]
Write to Data File [ File ID: ; Data source: ; Write as: UTF-16 ; Append line feed: On ]
@@ -0,0 +1,13 @@
Constrain Found Set []
Extend Found Set []
Find Matching Records [ Replace ]
Modify Last Find
Omit Multiple Records [ With dialog: Off ]
Omit Record
Perform Find []
Perform Quick Find []
Show All Records
Show Omitted Only
Sort Records [ With dialog: Off ]
Sort Records by Field [ Ascending ]
Unsort Records
@@ -0,0 +1,32 @@
Allow Formatting Bar [ Off ]
AVPlayer Play [ Object Name: <Active Object> ]
AVPlayer Set Options []
AVPlayer Set Playback State [ Stopped ]
Beep
Dial Phone [ With dialog: Off ]
Enable Touch Keyboard [ On ]
Execute FileMaker Data API [ Select ]
Execute SQL [ With dialog: Off ]
Exit Application
Flush Cache to Disk
Get Folder Path []
Install Menu Set [ “[Standard FileMaker Menus]” ; Use as file default: Off ]
Install Plug-In File []
Open URL [ With dialog: Off ]
Perform AppleScript [ ]
Perform JavaScript in Web Viewer [ Object Name: <Active Object> ]
Refresh Object []
Refresh Portal []
Save a Copy as Add-on Package [ Window name: ; Replace UUIDs: Off ]
Send DDE Execute [ ]
Send Event [ Event Class: “”; Event ID: “” ; Bring target application to foreground: Off ; Wait for event completion: Off ; Copy event result to clipboard: Off ]
Send Mail [ Send via E-mail Client ; With dialog: Off ; To: $to ; CC: $cc ; BCC: $bcc ; Subject: $subject ; Message: $message ; Attachments: "$attachmentFilePathList" ]
Send Mail [ Send via SMTP Server ; With dialog: Off ; To: $to ; CC: $cc ; BCC: $bcc ; Subject: $subject ; Message: $message ; Attachments: "$attachmentFilePathList" ; Name: $name ; Email Address: $from ; Reply-To Address: $replyTo ; SMTP Server: $smtp ; Port: 587 ; Use TLS ; Authentication Type: Plain Password ; User Name: $username ; Password: $password ]
Send Mail [ Send via OAuth 2.0 ; With dialog: Off ; To: $to ; CC: $cc ; BCC: $bcc ; Subject: $subject ; Message: $message ; Attachments: "$attachmentFilePathList" ; OAuth 2.0 Provider: Google ; Name: $name ; Reply-To Address: $replyTo ; Email Address: $from ; Service Account Email: $serviceAccountEmail ; Admin User Email: $adminUserEmail ; Private Key: $privateKey ]
Set Session Identifier []
Set Web Viewer [ Action: Reset ]
Show Custom Dialog []
Speak [ Text: ; Wait for completion: On ]
@@ -0,0 +1,17 @@
Close Popover
Enter Browse Mode [ Pause: Off ]
Enter Find Mode [ Pause: On ]
Enter Preview Mode [ Pause: Off ]
Go to Field []
Go to Layout [ original layout ]
Go to List of Records [ List of record IDs: ; Using layout: <Current Layout> ]
Go to Next Field
Go to Object []
Go to Portal Row [ Select: Off ; First ]
Go to Previous Field
Go to Record/Request/Page [ First ]
Go to Record/Request/Page [ Next ; Exit after last: On ]
Go to Related Record [ From table: ""; Using layout: "" () ]
@@ -0,0 +1,16 @@
Open Edit Saved Finds
Open Favorites
Open File Options
Open Find/Replace
Open Help
Open Hosts
Open Manage Containers
Open Manage Data Sources
Open Manage Database
Open Manage Layouts
Open Manage Themes
Open Manage Value Lists
Open Script Workspace
Open Settings
Open Sharing
Open Upload to Host
@@ -0,0 +1,18 @@
Commit Records/Requests [ With dialog: Off ]
Copy All Records/Requests
Copy Record/Request
Delete All Records [ With dialog: On ]
Delete Portal Row [ With dialog: On ]
Delete Record/Request [ With dialog: On ]
Duplicate Record/Request
Export Records [ With dialog: Off ; Create folders: On ]
Import Records [ With dialog: Off ]
New Record/Request
Open Record/Request
Revert Record/Request [ With dialog: Off ]
Save Records as Excel [ With dialog: Off ; Create folders: On ]
Save Records as JSONL [ Format for fine-tuning: Off ; Create folders: Off ]
Save Records as PDF [ Save to: File ; Create folders: On ; With dialog: Off ]
Save Records as Snapshot Link [ Records being browsed ; Create folders: On ]
Truncate Table [ With dialog: On ; Table: “<Current Table>” ]
@@ -0,0 +1,8 @@
Check Found Set
Check Record
Check Selection [ Select ]
Correct Word
Edit User Dictionary
Select Dictionaries
Set Dictionary [ Spelling Language: US English ]
Spelling Options
@@ -0,0 +1,15 @@
Adjust Window [ Resize to Fit ]
Arrange All Windows [ Tile Horizontally ]
Close Window [ Current Window ]
Freeze Window
Move/Resize Window [ Current Window ]
New Window [ Style: Document; Name: ; Using layout: "" (""); Height: ; Width: ; Top: ; Left: ; Close: Yes; Minimize: Yes; Maximize: Yes; Resize: Yes; Menu Bar: No; Dim parent window: No; Toolbars: No ]
Refresh Window []
Scroll Window [ Home ]
Select Window [ Current Window ]
Set Window Title [ Current Window ]
Set Zoom Level [ Lock: Off ; 100% ]
Show/Hide Menubar [ Lock: Off ; Hide ]
Show/Hide Text Ruler [ Show ]
Show/Hide Toolbars [ Include Edit Record Toolbar ; Hide ]
View As [ Cycle ]
@@ -0,0 +1,25 @@
# `.fmscript` script-step examples
The `examples/` directory is the authoritative catalog for this skill. Each
file contains copied fmscript lines grouped by FileMaker category. A step may
be generated only if it appears there, and its line is the required template
for its fmscript form.
| Category | Source file |
| --- | --- |
| Accounts | [`examples/Accounts.fmscript`](../examples/Accounts.fmscript) |
| Artificial Intelligence | [`examples/Artificial Intelligence.fmscript`](../examples/Artificial%20Intelligence.fmscript) |
| Control | [`examples/Control.fmscript`](../examples/Control.fmscript) |
| Editing | [`examples/Editing.fmscript`](../examples/Editing.fmscript) |
| Fields | [`examples/Fields.fmscript`](../examples/Fields.fmscript) |
| Files | [`examples/Files.fmscript`](../examples/Files.fmscript) |
| Found Sets | [`examples/Found Sets.fmscript`](../examples/Found%20Sets.fmscript) |
| Miscellaneous | [`examples/Miscellaneous.fmscript`](../examples/Miscellaneous.fmscript) |
| Navigation | [`examples/Navigation.fmscript`](../examples/Navigation.fmscript) |
| Open Menu Item | [`examples/Open Menu Item.fmscript`](../examples/Open%20Menu%20Item.fmscript) |
| Records | [`examples/Records.fmscript`](../examples/Records.fmscript) |
| Spelling | [`examples/Spelling.fmscript`](../examples/Spelling.fmscript) |
| Windows | [`examples/Windows.fmscript`](../examples/Windows.fmscript) |
Do not treat this index as a second set of examples. Read the matching source
file before using a step.
@@ -0,0 +1,63 @@
# `.fmscript` 0.90 grammar reference
Source: <https://fmscript.org/spec.html>
This is a concise working reference to the public 0.90 grammar overview. The
published page is not yet the complete script-step catalogue. When a particular
step or parameter variant is uncertain, use a known-good FileMaker/ai2fm export
or validate it with ai2fm; do not infer syntax from another step.
## Core grammar
- Give a parameterized script step exactly one bracket group containing all of
its parameters.
- Do not add brackets to a step with no parameters.
- Separate main arguments inside the brackets with a semicolon followed by a
space. Do not use a comma as the main argument separator.
- Use `# ` for a FileMaker comment step.
- Continue the same multiline comment step with `#>`.
- Use `// ` before a script step to represent a disabled step.
- Preserve `//` and `/* */` comments that occur inside FileMaker calculations.
- Qualify field references with their table occurrence, for example
`Customers::Name`. Do not emit a bare `::Name` reference.
- Prefix a local variable with one `$` and a global variable with exactly `$$`.
- Keep simple steps on one line.
- Preserve multiline calculations and determine their boundary using the known
step name, balanced brackets, and continuation structure.
## Representative forms
```text
Show All Records
Set Field [ Customers::Name ; "Ada" ]
Set Variable [ $name ; Value: Customers::Name ]
Perform Script [ Specified:From list; "Normalize Customer"; Parameter: $name ]
```
```text
# Prepare the payload
Set Variable [ $payload ; Value: JSONSetElement (
"{}" ;
[ "id" ; Customers::ID ; JSONString ]
) ]
```
The exact parameter labels and internal punctuation belong to the individual
FileMaker step definition. Verify them rather than generalizing from these
representative forms.
## Review checklist
- Use an exact, supported FileMaker step name.
- Give each parameterized step one balanced outer bracket group.
- Keep calculation parentheses and internal brackets balanced.
- Use semicolons for main arguments.
- Fully qualify every field reference.
- Use `$` and `$$` variables correctly.
- Close every structured block with the complete matching FileMaker closing
step.
- Preserve comment steps, disabled steps, and calculation comments correctly.
- Preserve multiline calculation boundaries.
- Apply the project's formatting, naming, path, and output-only requirements.
- Validate uncertain or version-specific syntax through ai2fm or a known-good
export before describing the script as round-trip ready.
-22
View File
@@ -1,22 +0,0 @@
---
name: filemaker-scripting
description: Prepare or review FileMaker script changes while preserving verified legacy behavior, context safety, validation, error handling, and regression coverage.
---
# FileMaker Scripting
Use this skill for FileMaker script generation, edits, reviews, or troubleshooting.
## Workflow
1. Confirm the requirement and locate comparable current scripts in the project DDR.
2. Establish or validate context, parameters, privilege assumptions, record state, and expected errors.
3. Preserve the project's proven naming and framework patterns.
4. Use the available FileMaker script-format tooling when producing `.fmscript` content.
5. Define normal, invalid-input, empty-result, privilege, cancellation, and regression tests as relevant.
## Safety
- Never assume the current layout, found set, record, account, or PSoS context.
- Treat deletes, commits, imports, account changes, and integrations as high-risk operations.
- Do not replace a working legacy pattern solely because a generic convention looks cleaner.