Files
2026-09-15 16:36:17 +02:00

56 lines
5.3 KiB
Markdown

---
name: filemaker-ddr-script
description: Read, create, edit, or review FileMaker scripts in DDRparser's copy-and-paste-compatible text format. Use for script files in a project's parsed DDR Scripts directory, DDRparser script syntax, or script steps intended to be converted and pasted into FileMaker. Do not use for `.fmscript` or ai2fm output.
---
# FileMaker DDR script
Produce FileMaker script text that matches DDRparser output and the active project's established script style. DDRparser-compatible text can be converted and pasted into FileMaker as script steps.
## Follow project evidence
1. Read the active project's `AGENTS.md`, `PROJECT.md`, ticket material, and any script-specific instructions before changing a script.
2. Locate the active solution under the project's `DDR-Parsed/` directory. Confirm the target script name, group, filename, and relevant FileMaker objects from current project evidence.
3. Read the target script and structurally similar scripts from the same project. Prefer examples from the same feature, script group, caller/callee chain, and supported FileMaker version. Read a project script template when one exists and applies.
4. Match the project's script structure, comments, section order, error handling, parameter/result conventions, calculation layout, indentation, naming, and use of enabled or disabled steps.
5. Inspect callers, called scripts, fields, layouts, table occurrences, custom functions, and other affected definitions when they determine the script's behavior. Use `ddr-analysis` alongside this skill when broader dependency analysis is needed.
Do not copy conventions or business logic from another client project. Example DDRs used while developing this skill are not part of the skill and are not fallback sources during project work.
## Resolve script-step format
Use this evidence order for every unfamiliar step or parameter form:
1. An exact current instance in the active project's `DDR-Parsed/<solution>/Scripts/` directory.
2. A closely related current script from the same project.
3. [`all-script-steps.txt`](all-script-steps.txt) for the general step name and base form.
Search the active project with `rg` before deciding that a step form is unavailable. Copy an exact project's step name, option labels, option order, punctuation, brackets, quotes, and spacing when a matching form exists. The general catalog permits a step name and shows a base form; it does not authorize inventing unshown options or project object names.
If the required form is still unknown, identify the missing step or option and request a known-good example. Do not substitute a similar step, borrow another client's syntax, translate from `.fmscript`, or infer a parameter form from general FileMaker knowledge.
## Read and write the text format
- Treat the `// Script:` header and any `// Group:` line as file metadata. Preserve the existing header; for a new script, derive only the header fields supported by confirmed project naming and group evidence.
- Treat `#` lines as FileMaker Comment steps. Preserve the project's comment wording and section style.
- Treat `// ` before a step as DDRparser's disabled-step representation. Retain disabled steps unless the requested change explicitly enables or removes them.
- Preserve control-block structure and use the project's indentation for nested `If`, `Else If`, `Else`, `Loop`, and corresponding closing steps. Every opened control block must have its matching close.
- Preserve multiline calculations as a single script step, including calculation comments, tabs, line breaks, operators, and the final closing bracket.
- Use the active project's representation for empty options, named objects, curly or straight quotes, semicolon spacing, and option continuation lines.
- Preserve supported plug-in steps only when their exact form is present in the current project or the general catalog.
- Keep changes minimal. Do not rewrite unaffected comments, calculations, formatting, or neighboring steps merely to normalize them.
- Do not invent business rules, FileMaker objects, functions, fields, layouts, scripts, relationships, parameters, results, or error behavior.
For a requested snippet, return DDRparser-format text in a fenced `text` block. For a requested project change, edit the complete tracked `.txt` file at `DDR-Parsed/<solution>/Scripts/<script name>.txt`; do not create a parallel `.fmscript` or source-scripts directory.
## Review and round-trip
1. Compare every changed step and parameter form with the selected current project instance or `all-script-steps.txt` entry.
2. Check matching control blocks, nesting, disabled-step markers, multiline brackets, and confirmed object names.
3. Inspect the scoped Git diff and run `git diff --check`.
4. Review the edited tracked script text before it is pasted into FileMaker.
5. When FileMaker implementation is within the request and available, convert or copy the text through the project's DDRparser clipboard workflow and paste it into FileMaker.
6. After a paste, regenerate `DDR-Parsed/` with the project's documented parser command and compare the resulting script with the reviewed text.
Editing the tracked script file proves only the proposed text. Claim successful FileMaker implementation or round-trip compatibility only after the paste and regenerated DDR have been verified. If those actions are unavailable, report them as pending validation.