[!IMPORTANT] Core Pain Point: In fast-paced projects, the high cost of manual documentation updates leads to persistent “drifting” or loss of synchronization between code and architectural documentation (README, ARCHITECTURE.md). The Solution: Offload the cognitive burden of “documentation maintenance” from human developers to AI Agents with semantic reasoning capabilities, enabling “metabolic” renewal of architectural maps.

After multiple rounds of conversation with AI regarding documentation governance, I’ve distilled a concept for “AI-Native Metabolic Governance V3.0.” This is not just an automation script, but a governance logic designed to make code architecture “come alive.”


Skill: AI-Native Metabolic Governance V3.0

🎯 Objective

Eliminate the mental tax of documentation through “zero-intrusion” sensing and AI-driven autonomy. This skill guides an Agent to autonomously analyze changes in physical structure and logical intent whenever code changes, automatically updating machine-readable addressing maps (Map: .anti_bot_map.md) and human-readable architectural principles (Lore: ARCHITECTURE.md).

⚙️ Trigger Conditions

  • Active Trigger: Triggered by commands like Execute metabolism, Run metabolism, or Update architecture map.
  • Passive Interception: Mounted as a git pre-commit hook or executed before deployment scripts (e.g., scripts/remote_deploy.py).

🔄 AI-Native Workflow

When this skill is triggered, the Agent must strictly execute these three steps:

Step 1: Zero-Intrusion Discovery

  1. Discard Manual Tags: Strictly forbid requiring human developers to write redundant comments like @identity.
  2. AST Physical Scanning: Scan the src/ directory of the target domain, extracting all Exported Classes, Interfaces, and Top-level Functions as natural identities.

Step 2: Semantic Metabolism & Computation

  1. Extract Context: Retrieve current Git Diffs, the latest AST structure, and the previous version of .anti_bot_map.md.
  2. Intent Identification: Determine the nature of the code changes.
    • New module? -> Automatically summarize its Role.
    • File split? -> Trace where the old logic flowed into new files.
    • Deprecation/Deletion? -> Mark it as removed.
  3. Calculate Health Score: A scale of 1.0 - 10.0. Deduct points for large, undocumented complex classes or severe module coupling.

Step 3: Dual-Update (Map & Lore)

Based on the deduction, overwrite the two core files:

1. Map: .anti_bot_map.md (Machine-Oriented RAG Routing Table)

  • Requirement: Minimalist, high signal-to-noise ratio, no long-winded descriptions.
  • Purpose: Provides a precise addressing map for AI, solving the problem of LLMs “getting lost” in complex codebases.
  • Format Specification:
---
domain: <Domain Name, e.g., core.cdp>
last_metabolism: <ISO 8601 Timestamp>
health_score: <1.0 - 10.0>
metabolist_version: 3.0
---
# 🗺️ Architecture Radar: <Domain Name>

## 📍 Live Entities
- `[Class: CdpManager]` -> `src/cdp/CdpManager.ts`
  - **Role**: Core orchestrator for browser environment injection and CDP command forwarding.
- `[Function: injectStealth]` -> `src/cdp/stealth.ts`
  - **Role**: Implements fingerprint cloaking logic to bypass anti-bot checks.

## 🔗 Sub-Domains
- 📁 `[Module: telegram]` -> `[./telegram/.anti_bot_map.md]`

2. Lore: ARCHITECTURE.md (Human-Oriented Core Principles)

  • Content: Focuses on “Why it was designed this way” and the collaboration model between modules. AI should automatically generate semantic versioned changelogs based on Diffs.

💡 Why Do We Need “Metabolism”?

Traditional documentation is a “static” corpse, while code is a “dynamic” organism. Through AI-native governance, we are essentially building a self-healing semantic layer within the codebase.

  1. Eliminate RAG Hallucinations: Traditional grep/search often finds outdated files. .anti_bot_map.md ensures the AI Agent always works on the “hot map.”
  2. Free Up Cognitive Bandwidth: Developers no longer need to worry about “If I rename this function, do I need to update the README?” AI handles it silently before the commit.

This is the essence of V3.0—making documentation governance not a task, but a natural “physiological breath” within the code lifecycle.