Autonomous Api Drift Healer 标志

Autonomous Api Drift Healer

社区
roedyrustam
autonomous-api-drift-healer

Autonomous API schema drift detection and breaking change healing / Deteksi drift skema API otonom dan perbaikan breaking change.

Add to TypingMind

概览

发布者roedyrustam
代码仓库vibes-plug
技能名称autonomous-api-drift-healer
星标数
117
复刻数
27
附带文件
仅含指令
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 roedyrustam 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Autonomous Api Drift Healer AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/roedyrustam/vibes-plug/tree/main/skills/autonomous-api-drift-healer
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/roedyrustam/vibes-plug.git /tmp/vibes-plug
mkdir -p .claude/skills
cp -r /tmp/vibes-plug/skills/autonomous-api-drift-healer .claude/skills/autonomous-api-drift-healer
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Autonomous Api Drift Healer,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Autonomous Api Drift Healer。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Autonomous Api Drift Healer 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

autonomous-api-drift-healer — vibes-plug Skill

English | Bahasa Indonesia


English

Orchestration & Integration

  • Upstream Specs & Contract SSoT: api-design-expert, spec-driven-development-expert, prd-architect
  • Client & SDK Codegen: openapi-swagger-codegen-expert, typescript-expert, tanstack-query-expert
  • Testing & Verification Sandbox: e2e-testing-expert, ephemeral-wasm-sandbox-executor, autonomous-tdd-debugger
  • Debt Auditing & Cleanup: zero-tech-debt-auditor, anti-slop
  • Lifecycle & Governance: zero-to-prod-orchestrator, brainstorming, session-memory-manager

Description

Production guide for architecting autonomous API drift detection and self-healing pipelines across microservices and fullstack applications. Continuously analyzes schema differences across OpenAPI 3.1 specifications, gRPC Protocol Buffers, and GraphQL schemas, automatically synthesizing backward-compatible adapter layers, updating frontend Zod schemas, and issuing self-healing pull requests to eliminate client-server desynchronization.

Trigger Conditions

Activate this skill when:

  • Backend API endpoints or payload schemas are updated and frontend client calls risk desynchronization.
  • Migrating between major API versions while requiring zero downtime for existing mobile and web clients.
  • Auditing microservice contracts for breaking changes prior to deployment.
  • Generating automated backward-compatibility shims when deprecating legacy fields.

Core Concepts & Patterns

1. API Drift Classification Taxonomy
Drift TypeSeverityImpactSelf-Healing Strategy
Field RenamingHigh (Breaking)Old clients crash on undefined propertySynthesize getter shim translating old field name to new name
New Required ParamHigh (Breaking)Old client requests rejected with 400 Bad RequestIntroduce server-side default fallback in middleware
Type Broadening (e.g. string $\to$ string | string[])MediumDownstream callers may fail on single-item assumptionsSynthesize client normalizer normalizing to array
Field Addition (Optional)Low (Additive)Non-breakingRegenerate TypeScript types and Zod schemas automatically
2. Autonomous Schema Drift Detector (TypeScript Implementation)
typescript
export interface SchemaProperty {
  type: string;
  required?: boolean;
}

export interface EndpointContract {
  path: string;
  method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
  properties: Record<string, SchemaProperty>;
}

export interface DriftReport {
  breakingChanges: string[];
  additiveChanges: string[];
  hasDrift: boolean;
}

export class AutonomousApiDriftHealer {
  public static compareContracts(
    baseline: EndpointContract,
    updated: EndpointContract
  ): DriftReport {
    const breakingChanges: string[] = [];
    const additiveChanges: string[] = [];

    // Check for removed properties
    for (const [key, baseProp] of Object.entries(baseline.properties)) {
      if (!updated.properties[key]) {
        breakingChanges.push(`Property "${key}" of type "${baseProp.type}" was removed.`);
      } else if (baseProp.type !== updated.properties[key].type) {
        breakingChanges.push(
          `Property "${key}" changed type from "${baseProp.type}" to "${updated.properties[key].type}".`
        );
      }
    }

    // Check for newly introduced required properties
    for (const [key, updatedProp] of Object.entries(updated.properties)) {
      if (!baseline.properties[key]) {
        if (updatedProp.required) {
          breakingChanges.push(`New required property "${key}" was added.`);
        } else {
          additiveChanges.push(`New optional property "${key}" added.`);
        }
      }
    }

    return {
      breakingChanges,
      additiveChanges,
      hasDrift: breakingChanges.length > 0 || additiveChanges.length > 0
    };
  }

  public static generateBackwardCompatibleShim(
    oldField: string,
    newField: string
  ): string {
    return [
      `// Auto-generated backward compatibility adapter`,
      `export function adaptLegacyPayload<T extends Record<string, unknown>>(data: T): T & Record<string, unknown> {`,
      `  if (data && typeof data === 'object') {`,
      `    if (data['${newField}'] !== undefined && data['${oldField}'] === undefined) {`,
      `      return { ...data, ['${oldField}']: data['${newField}'] };`,
      `    }`,
      `  }`,
      `  return data;`,
      `}`
    ].join('\n');
  }
}
3. Continuous Self-Healing Loop
[Git Commit: Backend Schema Edit]
               │
               ▼
[Drift Detection Sentinel]
  ├── Compares Staging OpenAPI against Production Spec
  └── Generates Drift Classification Report
               │
         Is Breaking?
        ┌──────┴──────┐
        ▼             ▼
      (Yes)          (No)
        │             │
        │             ▼
        │     Update Frontend Types
        ▼
[Synthesize Compatibility Layer]
  ├── Inject Middleware Default Mappings
  ├── Update Zod Client Validation Schemas
  └── Run E2E Test Suite via Ephemeral Sandbox
               │
               ▼
[Generate Automated Self-Healing PR]

Best Practices

  1. Enforce Contract Verification in CI: Block merge requests that introduce unannounced breaking schema changes without adapters.
  2. Auto-Generate Compatibility Shims: When deprecating fields, keep them active for at least one minor release cycle via transformation adapters.
  3. Keep Zod Schemas Synchronized: Automatically run code generation from OpenAPI specs so frontend types and runtime validators stay in lockstep.
  4. Log Adapter Usage: Track telemetry on how often legacy adapters are triggered to safely decommission them when usage reaches zero.

Common Pitfalls to Avoid

Anti-PatternOperational RiskEngineering Remedy
Deleting an API field without client auditInstant client crashes on mobile apps where updates are delayedMark field @deprecated and synthesize compatibility getter
Silently ignoring unmapped fieldsData loss and corrupted downstream stateValidate payloads strictly using Zod .strict() or .passthrough()
Manual manual updating of API typesDrift builds up, leading to painful quarterly migrationsAutomate codegen via openapi-typescript on every commit

Runtime Schema Drift Detector & Adapter Coercer (TypeScript)
typescript
export interface FieldMigrationRule {
  legacyField: string;
  modernField: string;
}

export function healPayloadDrift(
  rawPayload: Record<string, unknown>,
  rules: readonly FieldMigrationRule[]
): { normalized: Record<string, unknown>; driftedFields: string[] } {
  const normalized: Record<string, unknown> = { ...rawPayload };
  const driftedFields: string[] = [];

  for (const rule of rules) {
    if (rule.legacyField in normalized && !(rule.modernField in normalized)) {
      normalized[rule.modernField] = normalized[rule.legacyField];
      delete normalized[rule.legacyField];
      driftedFields.push(rule.legacyField);
    }
  }

  return { normalized, driftedFields };
}

Sovereign Execution, Token Efficiency & Invariants

DimensionSovereign Mandate & Deterministic Contract
Frontier Model CascadeMedium / High (GPT-5.6 Sol Medium, Gemini 4 Argon, Claude Sonnet 5.5 High, Grok 4.7 High Fast)
Availability FallbackGemini 4 Argon/Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Zero unhandled missing-model errors)
KV-Cache & Token ProtocolPin static instructions & schemas at prompt prefix (kv-cache-prefix-optimizer); pass surgical CONTEXT_MAP.md slices (<250 tokens/call) during Swarm Fan-Out
SaaT CLI & MCP DispatchCLI: vibes skill exec autonomous-api-drift-healer <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_ast_query, vibes_compile_cache, vibes_optimize_budget, vibes_verify_gate
NFR & Anti-Slop InvariantsP99 API Gateway Latency < 85ms, OpenAPI 3.1 / TypeSpec strict schema parity, RFC 9457 Problem Details error contracts, Idempotency-Key enforcement; 100% complete zero-placeholder output verified via node scripts/check-anti-slop.js --strict


Bahasa Indonesia

Integrasi Orkestrasi

  • Spesifikasi Hulu & SSoT Kontrak: api-design-expert, spec-driven-development-expert, prd-architect
  • Codegen SDK & Klien: openapi-swagger-codegen-expert, typescript-expert, tanstack-query-expert
  • Sandbox Pengujian & Verifikasi: e2e-testing-expert, ephemeral-wasm-sandbox-executor, autonomous-tdd-debugger
  • Audit Utang Teknis & Pembersihan: zero-tech-debt-auditor, anti-slop
  • Siklus Hidup & Tata Kelola: zero-to-prod-orchestrator, brainstorming, session-memory-manager

Deskripsi

Panduan produksi untuk merancang pipeline deteksi drift skema API dan penyembuhan mandiri (self-healing) pada aplikasi fullstack dan microservices. Menganalisis perbedaan skema secara berkesinambungan pada spesifikasi OpenAPI 3.1, gRPC Protocol Buffers, dan GraphQL, menghasilkan adapter kompatibilitas mundur (backward-compatible), memperbarui skema Zod pada frontend, serta membuat pull request otomatis untuk mencegah desinkronisasi client-server.

Kondisi Pemicu

Aktifkan skill ini ketika:

  • Endpoint API backend atau skema payload diubah dan panggilan frontend berisiko mengalami desinkronisasi.
  • Melakukan migrasi antar versi API utama dengan target nol downtime pada aplikasi web dan mobile.
  • Mengaudit kontrak microservices sebelum proses deploy ke produksi.
  • Menghasilkan shim kompatibilitas mundur saat menghapus atau mengubah nama properti lawas.

Konsep Inti & Pola Praktik

1. Klasifikasi Perubahan Skema (Drift Classification)
  • Perubahan Merusak (Breaking): Menghapus field yang sudah ada, mengubah tipe data (misal dari string ke number), atau menambahkan parameter wajib (required) baru. Solusi: Buat adapter transformasi atau nilai default di middleware.
  • Perubahan Tambahan (Additive): Menambahkan field opsional baru. Solusi: Perbarui tipe TypeScript dan skema Zod secara otomatis.
2. Pipeline Penyembuhan Mandiri (Self-Healing Loop)
  1. Deteksi Perubahan: Bandingkan spesifikasi OpenAPI backend terkini dengan skema klien yang ada.
  2. Pembuatan Adapter: Jika ditemukan penggantian nama field, buat adapter getter untuk menerjemahkan field lama ke field baru.
  3. Pembaruan Tipe Klien: Jalankan generator tipe TypeScript dan skema validasi runtime Zod.
  4. Verifikasi Pengujian: Uji integrasi dalam sandbox untuk memastikan klien lama tetap berfungsi.
  5. Pull Request Otomatis: Buat cabang git dan PR dengan deskripsi perubahan yang jelas.

Praktik Terbaik

  1. Jadikan Pengecekan Kontrak Sebagai Gerbang CI: Gagalkan proses merge jika terdapat breaking change yang belum dilengkapi adapter kompatibilitas.
  2. Pertahankan Field Lawas Selama Masa Transisi: Jangan langsung menghapus properti; tandai sebagai @deprecated dan gunakan adapter minimal selama satu siklus rilis.
  3. Sinkronkan Skema Zod: Pastikan validator frontend selalu diperbarui langsung dari kontrak OpenAPI.
  4. Pantau Penggunaan Adapter: Catat metrik penggunaan adapter untuk mengetahui kapan modul lawas aman dihapus sepenuhnya.

Jebakan Umum yang Harus Dihindari

Praktik BurukDampak BurukSolusi Rekayasa
Menghapus field API tanpa memeriksa versi aplikasi mobileAplikasi versi lama langsung crash saat dibuka penggunaGunakan adapter kompatibilitas mundur pada middleware
Mengabaikan properti tambahan secara diam-diamTerjadi kehilangan data saat payload disimpan kembaliGunakan validasi eksplisit dengan skema Zod
Mengetik ulang interface API secara manual di frontendTerjadi akumulasi desinkronisasi tipe dataGunakan otomatisasi codegen dari OpenAPI pada setiap commit

Matriks Eksekusi Berdaulat, Efisiensi Token & Invarian

DimensiMandat Berdaulat & Kontrak Deterministik
Kaskade Model FrontierMedium / High (GPT-5.6 Sol Medium, Gemini 4 Argon, Claude Sonnet 5.5 High, Grok 4.7 High Fast)
Invarian Fallback KetersediaanGemini 4 Argon/Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Bebas gagal saat model belum tersedia/kuota penuh)
Protokol Hemat Token & KV-CacheKunci instruksi & skema statis di prefix awal (kv-cache-prefix-optimizer); kirim potongan CONTEXT_MAP.md (<250 token/panggilan) saat Fan-Out
Eksekusi SaaT CLI & MCPCLI: vibes skill exec autonomous-api-drift-healer <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_ast_query, vibes_compile_cache, vibes_optimize_budget, vibes_verify_gate
Invarian NFR & Anti-SlopLatensi P99 API < 85ms, paritas skema ketat OpenAPI 3.1 / TypeSpec, kontrak error RFC 9457 Problem Details, penegakan Idempotency-Key; kode 100% tuntas tanpa placeholder diverifikasi melalui node scripts/check-anti-slop.js --strict

常见问题

Autonomous Api Drift Healer AI 技能有什么作用?

Autonomous API schema drift detection and breaking change healing / Deteksi drift skema API otonom dan perbaikan breaking change.

为什么在 TypingMind 中使用 Autonomous Api Drift Healer?

因为您只需安装一次,就能搭配任何模型使用。Autonomous Api Drift Healer 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Autonomous Api Drift Healer?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/roedyrustam/vibes-plug/tree/main/skills/autonomous-api-drift-healer。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Autonomous Api Drift Healer?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Autonomous Api Drift Healer 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Autonomous Api Drift Healer 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Autonomous Api Drift Healer AI 技能免费吗?

是的。roedyrustam 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇