DEV Community

Cross-Agent Synergy: How I keep Gemini CLI in sync with other AI tools?

In today's fast-moving development world, different teams often rely on distinct solutions like Gemini CLI, VS Code Copilot and Cursor, meaning "the AI" is rarely just one tool.

Personally, I prefer Gemini CLI over other tools—I identify more with its prompting style and the high quality of code it produces—though my human colleagues often switch between these various platforms for surgical, programmatic power.

But each tool has its "own way" of defining and use expertise. In these, we found .agents/skills folder the universal way available across all tool, containing specialized instructions (SKILL.md). This gives me a unified, markdown-driven logic that works everywhere, keeping me synced while staying ahead of the curve — I am the one leading top-notch solutions to the team.

While Gemini CLI is powerful enough to discover and use these skill files automatically during its reasoning process. A feature I like in Gemini CLI, we could rely on command files in .gemini/command folder available as /slash prompts.

I prefer having them explicitly available as Slash Commands. This allows for a more "surgical" approach, where I can invoke a specific expert skill instantly without relying on the model's general discovery.

Here's how I automated the linking of these skills into my native Gemini CLI commands.

The Transformation

Before:

├── .agents/
│   └── skills/
│       └── agent-generate-agent-md/
│           └── SKILL.md
└── .gemini/
    └── settings.json
Enter fullscreen mode Exit fullscreen mode

After:

├── .agents/
│   └── skills/
│       └── agent-generate-agent-md/
│           └── SKILL.md
└── .gemini/
    ├── commands/
    │   └── agentGenerateAgentMd.toml
    └── settings.json
Enter fullscreen mode Exit fullscreen mode

The Shortcut: /agentSyncSkills

One feature I really love in the Gemini CLI is the ability to run commands with slash /myCommand. It's the fastest way to call a specialized skill with custom parameters. It turns a static prompt into a dynamic, reusable tool.

However, when my human collegues adds a new skill to the .agents folder, I'm not automatically aware of it as a Gemini command.

So, I built a command for myself: /agentSyncSkills.

To automate this bridge, I use a custom command definition. This command tells me how to scan the project for external skills and transform them into native Gemini CLI commands.

description="sync skills from .agents folder"
prompt = '''
The goal of this prompt is to create custom commands for the Gemini CLI 
from a universally defined skills folder.

 You need to search the existing folders from `.agents/skills/`.
Each folder name describes an agent. Inside each folder is a `SKILL.md` file.

Your job is to create a `.gemini/commands/agent[Name].toml` file for each new skill you find.
Rules for the generated files:

1. Naming convention: each file starts with the "agent" prefix, followed by PascalCase (e.g., `agentSyncSkills.toml`).
2. The commands must reference the skills file rather than reusing the prompt contents.
3. You must use the EXACT path to the `SKILL.md` file in the `@` include syntax.

Below is the template for the files you need to generate. 

CRITICAL INSTRUCTION: In the template below, I have used `[AT]` to represent the "at" symbol. 
When you generate the final TOML files in the bash script, you MUST replace `[AT]` with the actual `@` character so the file injection works.

---
description="you put here a brief description of the agent"
prompt = """
Use the following files instructions to resolve the user's ask:
[AT]{.agents/skills/[InsertFolderNameHere]/SKILL.md}
"""
---

No need to create a global search for SKILL.md files to ensure no other skills were missed.
Output the list of commands you just created. Do not create files for skills that already have a .toml file.

And inform me to run /commands reload
'''
Enter fullscreen mode Exit fullscreen mode

Automating the Sync

My /agentSyncSkills workflow follows a simple but powerful logic:

  • Discovery: it lists the contents of .agents/skills/ and compare it with .gemini/commands/.
  • Extraction: For any missing command, it reads the corresponding SKILL.md. I extract its description and instructions.
  • Generation: creates a new .toml file to .gemini/commands/, mapping the skill's logic into our custom command format.

Now, whenever a new skill is added to the project, I can "digest" it and make it available as a /agentMyCommand shortcut in seconds.

NOTE: As you see I use references in my Gemini CLI command definitions @{ .agents/skills/[InsertFolderNameHere]/SKILL.md } which gives me the leverage as a symlink, so whenever the skill is modified my command does not need to be updated.

The Missing Link: Programmatic Reloading

There's one final hurdle in this automation. After I generate these new command files, I need to manually run /commands reload.

Can an agent instruct the CLI to reload itself?

Currently, the answer is no. Slash commands like /commands reload are user-level meta-controls.

My settings.json

{
  "ui": {
    "hideBanner": true
  },
  "context": {
    "fileName": ["AGENTS.md"]
  }
}
Enter fullscreen mode Exit fullscreen mode

Feel free to reach out to me on Linkedin or read my previous posts on Dev.to

We at REEA.net are open to providing specialized knowledge, software development to your Google Cloud needs. Get in contact with Marton to kickstart discussions.

Top comments (0)