Kanji
・ Cloud engineer / freelance ・ Born in 1993 ・ Born in Ehime Prefecture / Lives in Shibuya-ku, Tokyo ・ AWS history 5 years Profile details
Table of Contents
As you use AI coding assistants (such as Google Antigravity or Claude Code), you will notice configuration files and custom skills accumulating rapidly. This can lead to what is known as “configuration chaos.” In this article, we introduce how to build a self-maintenance custom skill called antigravity-audit , which scans, diagnoses, and optimizes your configurations automatically, alongside clean portable design patterns.
antigravity-audit
The introduction of AI coding assistants often leads to a quick buildup of behavior rules (e.g., RULES.md, AGENTS.md) and custom scripts (e.g., SKILL.md) in both project-local and user-global folders.
This rapid growth introduces several management challenges: 1. Outdated Rules : Obsolete instructions stay active, cluttering the AI’s context window. 2. Broken Skills : Missing script references or outdated dependencies break execution. 3. Desynchronized Bilingual Docs : Doc updates in one language leave the other language outdated.
Manually reviewing these files is tedious. An elegant solution is to delegate the audit of AI configurations to the AI assistant itself .
The antigravity-audit custom skill scans target directories, diagnoses configurations and skills, creates a clean Markdown diagnostic report, and attempts to auto-fix minor issues.
name
description
The following diagram illustrates the sequence of actions from triggering the audit skill to applying environment patches.
.agents/
audit_report.md
apply_patch.py
To prevent AI development environments from deteriorating, the skill performs checks combining programmatic “static validation” and “AI qualitative review” powered by the LLM.
Using audit.py and diagnostic submodules, the following items are automatically verified:
audit.py
SKILL.md
rules/*.md
~/.gemini/config/
sidecar.json
sidecars.<id>.enabled
false
~/.gemini/config/config.json
.agents/plugins/
_agents/plugins/
mcp_config.json
serverUrl
AgentStop
hooks.json
decision
After running static checks, the AI agent reviews the configuration files to propose structural improvements:
invoke_subagent
*
--no-verify
task.md
Another critical pillar of rule auditing is “ruleset freshness management” . Official specifications for cloud services like AWS and GCP, as well as AI tool documentations (such as Antigravity itself), receive frequent updates. If rules saved locally ( RULES.md ) remain static, the AI assistant will continue generating outdated configurations and deprecated command invocations.
RULES.md
To combat this, antigravity-audit supports automatic web crawling and scraping of official specification sites using Selenium (headless Chrome) to fetch the latest guidelines.
port_allocation.md
This mechanism ensures your local rule context remains synced with the latest industry specifications without human intervention.
Here is an example of the actual Markdown report output generated when running antigravity-audit . It uses visual alerts ( ❌ Error , ⚠️ Warning ) and GitHub-style alerts to make issues easily identifiable.
❌ Error
⚠️ Warning
# 🛡️ Antigravity Environment Audit Report > [!NOTE] > Scan completed at: 2026-07-12 19:40:00 (JST) > Detected primary language: English (en) ## 📈 Diagnostic Summary | Category | Checks Run | Issues Found | Auto-fix Status | | :--- | :---: | :---: | :---: | | Global Rules (AGENTS.md) | 12 | 1 | 🛠️ Auto-fixed | | Project Rules (RULES.md) | 8 | 0 | ✅ No issues | | Custom Skills (skills/) | 15 | 2 | ⚠️ Action Required | --- ## 🚨 Diagnostic Alert Details ### 1. Duplicate Rule in Global Settings - **File**: `~/.gemini/config/AGENTS.md` - **Status**: `⚠️ Warning` - **Details**: The rule forbidding "Chrome automation" duplicates a project-level definition in `.agents/RULES.md`. - **Action**: Automatically removed the duplicate rule section from the global configuration to optimize context. (**Auto-fix completed**) ### 2. Missing YAML Frontmatter Field in Custom Skill - **File**: `skills/aws-deploy/SKILL.md` - **Status**: `❌ Error` - **Details**: Missing the mandatory `description` field required by the skill loader. - **Action**: Please open `skills/aws-deploy/SKILL.md` manually and add a suitable description to its frontmatter block. ### 3. Broken Executable Reference in Custom Skill - **File**: `skills/house-keeping/SKILL.md` - **Status**: `❌ Error` - **Details**: The helper script `scripts/cleanup.sh` referenced in `SKILL.md` is missing or lacks executable permissions. - **Action**: Check if the file exists and verify if `chmod +x` has been run.
Beyond simply reporting issues, antigravity-audit can safely resolve specific configurations:
We recommend integrating this audit workflow into your daily development cycle:
The configuration templates for the auto-audit skill and the source code of this blog are available on the following GitHub repository:
👉 kanji-shinohara/web-gcp-us-firebase-moderniser-repo
To maximize the efficiency of AI coding agents, our development environment must stay organized and optimized. Delegating self-maintenance tasks to custom skills frees developers to focus on active coding.