Build Better AI Agents with Google Antigravity Skills and Workflows

Photo by Editor
# Introduction
You may already feel that a new era of artificial intelligence for the first agent has arrived, when developers use new tools that, instead of coding continuously, truly understand the unique processes of code generation.
Google Antigravity He has a lot to say about this story. This tool holds the key to building highly customized agents. This article reveals part of its power by developing three basic concepts: rules, capabilities, and workflow.
In this article, you'll learn how to combine these key concepts to create strong agents and powerful automation pipelines. Specifically, we will create a step-by-step process to set up a code quality assurance (QA) agent workflow, based on specific rules and skills. We're leaving!
# Understanding Three Key Concepts
Before getting our hands dirty, it's easy to distinguish the following three features of the Google Antigravity ecosystem:
- Rule: These are the basic constraints that govern the agent's behavior, and how to adapt it to our stack and match our style. They are saved as tag files.
- Skill: Consider skills as a reusable package containing information that teaches an agent how to deal with a concrete task. They are assigned to a dedicated folder containing the named file
SKILL.md. - Workflow: These are the orchestrators that put it all together. Workflows are invoked using command-like instructions preceded by a forward slash, e.g
/deploy. Simply put, a workflow guides an agent through an action plan or route that is well-structured and contains multiple steps. This is the key to automating repetitive tasks without losing accuracy.
# Taking Action
Let's move on to our working example. We will see how to prepare Antigravity for review Python code, use correct formatting, and run tests — all without the need for additional third-party tools.
Before taking these steps, make sure to download and install Google Antigravity on your computer first.
Once installed, open the desktop application and open your Python project folder – if you're new to the tool, you'll be asked to define a folder in your computer's file system to serve as the project folder. However, the way to add a manually created folder to Antigravity is by using the “File >> Add Folder to Workspace…” option on the top menu toolbar.
Say you have a new, empty workspace folder. In the root of the project directory (left side), create a new folder and give it a name .agents. Inside this folder, we will create two subfolders: one called rules and another named skills. You might guess that these two are where we will define the two pillars of our agent's behavior: rules and skills.

Project folder category | Photo by the Author
Let's define the rule first, which contains our basic constraints that will ensure the agent's adherence to Python formatting standards. We don't need verbose syntax to do this: in Antigravity, we define it using clear instructions in natural language. Within the rules subfolder, you will create a file named python-style.md and paste the following content:
# Python Style Rule
Always use PEP 8 standards. When providing or refactoring code, assume we are using `black` for formatting. Keep dependencies strictly to free, open-source libraries to ensure our project remains free-friendly.
If you want to encrypt it, go to the agent customization panel that works on the right side of the editor, open it, and find and select the rule we just described:

Activating custom agent rules | Photo by the Author
Customization options will appear above the file we just edited. Set the usage model to “glob” and specify this glob pattern: **/*.pyas shown below:

Sets the globe activation mode | Photo by the Author
With this, you have just ensured that the agent that will be launched later always uses the rule defined when we work directly in the Python script.
Next, it's time to define (or “teach”) the agent some skills. That will be the ability to run rigorous tests on Python code – something that is very useful in today's software development environment. Within the skills subfolder, we will create another folder with the name pytest-generator. Create a SKILL.md file inside it, with the following content:

Defining agent capabilities within a workspace | Photo by the Author
Now it's time to put it all together and launch our agent, but without having inside our project workspace an example Python file containing “bad quality” code first to try everything. If you don't have one, try creating a new one .py file, called flawed_division.py in the root directory, and add this code:
def divide_numbers( x,y ):
return x/y
You may have noticed that this Python code is intentionally dirty and buggy. Let's see what our agent can do about it. Go to the customization panel on the right side, and this time focus on the “Workflows” navigation pane. Click “+Workspace” to create a new workflow that we will call qa-checkand this content:
# Title: Python QA Check
# Description: Automates code review and test generation for Python files.
Step 1: Review the currently open Python file for bugs and style issues, adhering to our Python Style Rule.
Step 2: Refactor any inefficient code.
Step 3: Call the `pytest-generator` skill to write comprehensive unit tests for the refactored code.
Step 4: Output the final test code and suggest running `pytest` in the terminal.
All these pieces, when put together by an agent, will change the overall development loop. With the dirty Python file still open in the workspace, we'll put our agent to work by clicking the agent icon in the right panel, typing qa-check command, and hit enter to run the agent:

Invoking QA workflow through agent console | Photo by the Author
After execution, the agent will have updated the code and automatically suggested the new version in the Python file, as shown below:

Refactored code suggested by agent | Photo by the Author
But that's not all: the agent also comes with the complete quality testing we were looking for by generating multiple code snippets that you can use to perform different types of tests using it. pytest. For illustration, here's what some of these tests might look like:
import pytest
from flawed_division import divide_numbers
def test_divide_numbers_normal():
assert divide_numbers(10, 2) == 5.0
assert divide_numbers(9, 3) == 3.0
def test_divide_numbers_negative():
assert divide_numbers(-10, 2) == -5.0
assert divide_numbers(10, -2) == -5.0
assert divide_numbers(-10, -2) == 5.0
def test_divide_numbers_float():
assert divide_numbers(5.0, 2.0) == 2.5
def test_divide_numbers_zero_numerator():
assert divide_numbers(0, 5) == 0.0
def test_divide_numbers_zero_denominator():
with pytest.raises(ValueError, match="Cannot divide by zero"):
divide_numbers(10, 0)
All of this sequential process performed by the agent includes first analyzing the code under the constraints we defined with rules, and then automatically calling the newly defined ability to generate a complete test strategy that matches our codebase.
# Wrapping up
Looking back, in this article, we showed how to combine the three key features of Google Antigravity – rules, capabilities, and workflow – to transform generic agents into specialized, robust, and efficient partners. We've shown how to make an agent adept at properly formatting dirty code and defining QA tests.
Iván Palomares Carrascosa is a leader, author, speaker, and consultant in AI, machine learning, deep learning and LLMs. He trains and guides others in using AI in the real world.



