4d-check-syntax

Check syntax and compile a 4D project to find errors and type issues. Use this skill when the user wants to compile, check syntax, or validate a 4D project. Creates a _compile method if not present, then runs it using tool4d. Returns compilation errors in JSON format for easy parsing.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "4d-check-syntax" with this command: npx skills add e-marchand/skills/e-marchand-skills-4d-check-syntax

4D Syntax Checker

Compile a 4D project to check for syntax errors and type mismatches.

Prerequisites

Uses the 4d-run skill to execute the compilation method. Ensure tool4d is available:

  • Install 4D-Analyzer extension in VS Code/Antigravity, OR
  • Set TOOL4D environment variable to point to tool4d executable

The _compile Method

Compilation requires a _compile method in the project. If not present, copy assets/_compile.4dm to Project/Sources/Methods/_compile.4dm.

Compilation Output

Success

{"success":true,"errors":[]}

Errors

{
  "success": false,
  "errors": [
    {
      "message": "Syntax error",
      "isError": true,
      "code": {
        "type": "classFunction",
        "className": "MyClass",
        "functionName": "myMethod",
        "path": "[class]/MyClass/myMethod",
        "file": "[object File]"
      },
      "line": 10,
      "lineInFile": 42
    }
  ]
}

Error Properties

  • message: Error description
  • isError: true for errors, false for warnings
  • code.type: "projectMethod", "classFunction", etc.
  • code.className: Class name (for class methods)
  • code.functionName: Function name
  • line: Line within the function
  • lineInFile: Absolute line in the file

Workflow

  1. Check for _compile method: Look in Project/Sources/Methods/_compile.4dm
  2. Create if missing: Write the _compile method using the template above
  3. Find tool4d: Use 4d-run skill to locate tool4d
  4. Run compilation: Execute _compile method with --dataless
  5. Parse results: Extract JSON from ALERT output

Running Compilation

"<tool4d_path>" --project="<project_path>" --startup-method=_compile --dataless 2>&1

Output format:

{"success":true,"errors":[]}

The JSON is output directly to system standard output via LOG EVENT.

Common Compilation Errors

ErrorCauseFix
"Syntax error"Invalid 4D syntaxCheck line for typos
"Object syntax is not valid"Invalid object property accessUse [index] for 4D.Blob properties
"Cannot make an assignment with those types"Type mismatchCheck variable types
"Undeclared property 'X' used"Missing property declarationAdd property X : Type to class
"The variable $X has not been explicitly declared"Missing var declarationAdd var $X : Type
"signed integer overflow handling differs"PCH cache issueNot a code error, can ignore

Integration Example

# Find tool4d
TOOL4D=$(python3 ".claude/skills/4d-run/scripts/find_tool4d.py")

# Run compilation and parse JSON result
OUTPUT=$("$TOOL4D" --project="/path/to/Project/MyProject.4DProject" --startup-method=_compile --dataless 2>&1)

# The JSON is output directly via LOG EVENT
echo "$OUTPUT" | jq .

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

4d-run

No summary provided by upstream source.

Repository SourceNeeds Review
General

4d-create-project

No summary provided by upstream source.

Repository SourceNeeds Review
General

4d-find-command

No summary provided by upstream source.

Repository SourceNeeds Review