CFL & AI: smartCFL for Antigravity

Note - I created this project while waiting for my latest Tesla FSD update. I had 35 minutes to kill, so I tasked Google’s Antigravity to create a CFL integration with Google’s new Antigravity (agentic) IDE. I’m certain there are missing features, but it seems to have generated a good start. Enjoy…

Here’s the agentic process that created this toolset.

Supercharge your Coda formula development with syntax highlighting and AI-powered formula generation


If you’re a Coda Maker who’s ever found yourself:

  • Staring at a wall of text trying to debug a complex formula

  • Wishing you had syntax highlighting for your Coda formulas

  • Wanting an AI assistant that truly understands CFL (Coda Formula Language)

  • Struggling to remember the exact syntax for that perfect filter chain

…then this project might help.

IMPORTANT! I have tested very little of this code and syntax. The claims are made by the same AI that created this. Proceed with caution and feel free to post issues.

The Problem: Building Complex Formulas is Hard

As Coda Makers, we love the power of formulas. They’re what make our docs come alive—filtering tables, personalizing views, automating workflows. But let’s be honest: building complex formulas can be challenging.

When you’re working with formulas like this:

…it’s easy to lose track of parentheses, forget a filter condition, or make a syntax error that’s hard to spot in plain text.

And while Coda’s formula builder is helpful, wouldn’t it be amazing to have:

  • Syntax highlighting that makes functions, strings, and operators visually distinct?

  • An AI assistant that can generate formulas from natural language descriptions?

  • A proper IDE experience for building and testing formulas?

The Solution: smartCFL for Google Antigravity

I’m excited to share smartCFL—a complete integration that brings Coda Formula Language support to Google Antigravity (Google’s AI-powered code editor built on VS Code).

What You Get

:artist_palette: Syntax Highlighting

Your .coda formula files now light up with color-coded syntax:

  • Functions like Filter(), Count(), User() are highlighted

  • Strings, operators, and numbers are visually distinct

  • Comments stand out for better documentation

  • Parentheses matching helps you track complex nesting

:robot: AI-Powered Formula Generation

Describe what you want in plain English, and Antigravity’s AI agent generates the CFL code:

“Show me all high-priority tasks assigned to me that aren’t done yet, sorted by due date”

The AI generates:


Tasks

.Filter(Assignee = User())

.Filter(Priority = "High")

.Filter(Status != "Done")

.Sort(true, Due Date)

:books: Comprehensive Documentation

The project includes complete CFL reference materials that the AI agent uses to:

  • Apply best practices (chaining syntax, named formulas)

  • Understand context (thisRow, User(), table relationships)

  • Generate syntactically correct formulas

:light_bulb: Learning Resources

Three levels of example formulas help you learn:

  • Basic: Filter, Count, simple operations

  • Intermediate: thisRow, User(), conditional logic

  • Advanced: Complex chaining, optimization, named formulas

How It Works

The Visual Layer: Syntax Highlighting

smartCFL uses a clever trick: since CFL shares structural similarities with JavaScript (dot-chaining, function calls, operators), we map .coda files to JavaScript for syntax highlighting. It’s not perfect, but it is functional. A more precise interpretation of syntax highlighting can be achieved by using Antigravity itself to build that for you. I didn’t have the time or the skills to explore this.

(Color-coded: functions in one color, strings in another, operators highlighted)

You get ~90% accurate syntax highlighting without building a custom extension—just a simple file association setting.

The Intelligence Layer: AI Agent

The real magic happens when you combine syntax highlighting with Antigravity’s AI capabilities. The agent has been trained on comprehensive CFL documentation and can:

Generate formulas from requirements:


You: "Calculate total revenue from completed Electronics sales this month"

AI: Sales

.Filter(Status = "Completed")

.Filter(Product.Category = "Electronics")

.Filter(Sale Date >= Date(Year(Today()), Month(Today()), 1))

.Sum(Total Amount)

Explain complex formulas:


You: "What does this formula do?"

AI: "This formula filters your Projects table for active projects

owned by you that are due within the next 7 days, sorts them

by due date (soonest first), and returns just the project names."

Suggest improvements:


You: "How can I optimize this formula?"

AI: "Instead of repeating the same filter multiple times, create

a named formula called 'MyActiveTasks' and reference it.

This improves performance and maintainability."

Real-World Use Cases

1. Building Complex Filters

Scenario: You need a personalized dashboard showing urgent items.

Natural language prompt:

“Show me tasks that are either high or critical priority, not done, and either assigned to me or I’m on the team”

AI-generated formula:


Tasks.Filter(

(Priority = "High" OR Priority = "Critical") AND

Status != "Done" AND

(Assignee = User() OR Team.Contains(User()))

)

2. Creating Dynamic Status Indicators

Scenario: You want visual status indicators based on due dates.

Natural language prompt:

“Create a status indicator: red for overdue, yellow for due this week, green for future”

AI-generated formula:


SwitchIf(

thisRow.Due Date < Today() AND thisRow.Status != "Done", "🔴 Overdue",

thisRow.Due Date <= Today().AddDays(7), "🟡 Due Soon",

"🟢 On Track"

)

3. Building Reusable Named Formulas

Scenario: You frequently need to reference low-stock products.

Natural language prompt:

“Create a named formula for products with stock less than 10”

AI-generated formula:


// Name: LowStockProducts

Products.Filter(Stock Quantity < 10)

// Usage examples:

LowStockProducts.Count()

LowStockProducts.Filter(Category = "Electronics")

Getting Started in 5 Minutes

Step 1: Install Antigravity

Download Google Antigravity (it’s VS Code-based, so familiar if you’ve used VS Code).

Step 2: Clone the Repository


git clone https://github.com/GlobalTC/smartCFL.git

cd smartCFL

Step 3: Configure File Association

  1. Open Antigravity Settings (Cmd + , on Mac)

  2. Search for “File Associations”

  3. Add: *.codajavascript

That’s it! You now have syntax highlighting.

Step 4: Test the AI Agent

Open the EXAMPLE-VALIDATION-PROMPT.md file and copy one of the test scenarios. Ask the Antigravity agent to generate the formula. Watch as it references the CFL documentation and creates syntactically correct code.

Step 5: Start Building

Create a new .coda file and start writing formulas with syntax highlighting, or ask the AI agent to generate formulas from your requirements.

What Makes This Different?

Not Just Syntax Highlighting

While syntax highlighting is great, the real power is the AI agent that understands CFL deeply. It’s like having a Coda formula expert sitting next to you.

Learns from Official Documentation

The agent references comprehensive CFL documentation, ensuring it follows best practices and uses the correct syntax.

Validated and Tested

The project includes a validation framework with 8 test scenarios covering:

  • Basic filtering and aggregation

  • Personalized views with User()

  • Conditional logic with SwitchIf()

  • Complex chaining and lookups

  • Named formulas and button actions

All tests passed :white_check_mark:

Open Source and Extensible

The entire project is open source. Add your own examples, enhance the documentation, or share your CFL patterns with the community.

Important Considerations

:warning: Early Stage Project

This project has undergone light testing and should be considered experimental. While core functionality has been validated, it hasn’t been extensively tested in production environments. Test thoroughly in your own environment before relying on it for critical work.

What’s Next?

This is just the beginning. Here’s what could come next:

Community Contributions

  • More example formulas from real-world use cases

  • Additional validation scenarios

  • Performance optimization patterns

  • Integration with Coda Packs

Enhanced Features

  • Custom CFL grammar for 100% accurate syntax highlighting

  • Formula debugging tools

  • Live formula testing against sample data

  • Formula performance analysis

Your Ideas

What would make this more useful for you? Open an issue on GitHub and let’s discuss!

Join the Community

Repository: GitHub - GlobalTC/smartCFL: Coda Formula Language integration for Google Antigravity with AI-powered formula generation

Get Started:

  1. :star: Star the repository

  2. :inbox_tray: Clone and try it out

  3. :speech_balloon: Share your feedback

  4. :handshake: Contribute your CFL patterns

Final Thoughts

Building complex Coda formulas doesn’t have to be a frustrating experience. With syntax highlighting and AI assistance, you can:

  • Write formulas faster with AI generation from natural language

  • Debug easier with visual syntax highlighting

  • Learn better with comprehensive examples at all skill levels

  • Build confidently knowing the AI follows CFL best practices

Whether you’re a formula novice or a CFL expert, smartCFL can enhance your Coda-making experience.

Ready to supercharge your formula development? Head over to the smartCFL repository and give it a try!


About the Project

smartCFL is an open-source integration bringing Coda Formula Language support to Google Antigravity. It provides syntax highlighting, AI-powered formula generation, and comprehensive CFL documentation for Coda Makers.

License: MIT

Repository: GitHub - GlobalTC/smartCFL: Coda Formula Language integration for Google Antigravity with AI-powered formula generation

Topics: #coda #formulas #ai-assistant #antigravity #developer-tools


Have questions or feedback? Open an issue on GitHub or share your experience with the community!

4 Likes