Communitygithub.com

バックエンド主権ランタイムリファクタリング

バックエンドが実行時真実を所有し、UIはスナップショットのみを投影するようアプリをリファクタリングします。ツールの権限が分割されている場合に使用します。UIの見た目だけの作業や、ドリフト除去前の新機能追加には使用しません。

バックエンド主権ランタイムリファクタリング とは?

このスキルは、バックエンドとUIの間で実行時状態の権限が分割されているアプリケーションをリファクタリングするためのものです。主な目的は、バックエンドが唯一の実行時真実(single source of truth)となり、UIはそれを投影するスナップショットとしてのみ機能するようにアーキテクチャを変更することです。このスキルはClaude Code、Cursor、CodexなどのAIエージェントで使用されることを想定しており、SKILL.mdに詳細な手順と判断ポイントが記載されています。具体的には、まず分割された権限の箇所を棚卸しし、コマンド・クエリ・イベントの3クラスのみにインタラクションを統一します。その後、状態の所有権を正規化し、互換性レイヤーを削除し、最後に評価機構を追加してリファクタリングの完全性を検証します。このスキルは、アプリケーションの再起動や再接続時に、バックエンドの真実のみから可視状態を復元できることを目標としています。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/curiositech/windags-skills/tree/HEAD/skills/backend-authoritative-runtime-refactor

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

バックエンド主権ランタイムリファクタリング は何をしますか?

実行時真実がどこに存在し、UIがそれをどのように読み取るかを正確に説明できるようになった後にのみリファクタリングを行うこと。

使用すべき場合

  • UIが、バックエンドが認識しないグラフ、フェーズ、またはプロバイダ選択を合成している。
  • 再起動や再接続によって、フロントエンドが権限をキャッシュしていたために可視ランタイム状態が変化する。
  • アクティブなオーサリングパスに、新旧のスキーマ、スターター形式、またはノードタイプが共存している。
  • 承認、レビュー、または下流の実行がフロントエンドのみの再構築に依存している。

使用すべきでない場合

  • ランタイムの所有権に変更がない、見た目だけの視覚的クリーンアップ。
  • バックエンドの契約がすでに権威的である、独立したコンポーネントのリファクタリング。
  • 分割権限の継ぎ目を削除する前に、新しいビジネス機能を出荷すること。
  • アーキテクチャにすでに単一の真実源がある場合の、純粋なバックエンドパフォーマンス改善作業。

判断ポイント

flowchart TD
  A[ワークフローリファクタリング依頼] --> B{UIがまだランタイム真実を発明できるか?}
  B -->|いいえ| C[より狭いドメインまたはUIスキルを使用]
  B -->|はい| D[コマンド、クエリ、イベントの継ぎ目を棚卸し]
  D --> E{すべてのユーザーアクションをコマンド、クエリ、またはイベントにマッピングできるか?}
  E -->|いいえ| F[機能作業の前に契約を凍結]
  E -->|はい| G[投影状態をバックエンド所有状態から分割]
  G --> H{レガシー互換パスがまだアクティブか?}
  H -->|はい| I[マイグレーションエッジに移動するか削除]
  H -->|いいえ| J[評価機構、リプレイセーフな起動クエリ、イベントサブスクリプションを追加]
  I --> J
  J --> K[再接続、承認、下流の準備状態を検証]

まずこのルーティングモデルを使用すること:

  • UIを「コマンド -> バックエンド遷移 -> クエリまたはイベント投影」として記述できない場合、継ぎ目は依然として間違っている。
  • 「一時的な互換性」パスがホットパスにある場合、それを機能ではなくリファクタリング債務として扱うこと。
  • 再起動や再接続がバックエンドの真実のみから可視状態を再構築できない場合、リファクタリングは不完全である。

作業方法

1. 分割された判断基盤を棚卸し

UIが以下のことを行っているすべての場所を見つける:

  • 実行時真実を生成または変更している
  • バックエンドが認識していないフェーズを発明している
  • アクティブなコードパスで実行をシミュレートしている
  • 同じオーサリングパスに新旧両方のスキーマを保持している
  • 抽象的なルーティング階層と正確なプロバイダIDを混在させている

2. 契約を凍結

次の3クラスのみを定義する:

  • コマンド:開始、停止、承認、再開、変更
  • クエリ:起動状態、レビューペイロード、実行スナップショット、プロバイダヘルス
  • イベント:権威的な遷移、評価機構の判定、ゲートステータス、リプレイマーカー

UIアクションがこれらのいずれかとして表現できない場合、アーキテクチャは依然として曖昧である。

3. 状態所有権を正規化

ストアを次のように分割する:

  • 契約入力状態
  • バックエンドスナップショット投影状態
  • UIレイアウト状態

どのストアもランタイム真実とレイアウト懸念の両方を所有させてはならない。

4. アクティブな互換性の継ぎ目を削除

「とりあえず両方サポート」よりも削除を優先する。

典型的な削除対象:

  • アクティブなオーサリングでの単数形と複数形のスキーマ互換性
  • アクティブなデスクトップランタイムでのブラウザまたはデモシミュレーション
  • メインパスでの非推奨ノードタイプ
  • 重複したレビューサマリー
  • 複数のスターターまたはインポート形式

5. リファクタリングを信頼する前に評価機構を追加

すべての実装ノードには以下が必要である:

  • 正しさのためのローカル出力評価機構
  • 契約安全性のための下流準備状態評価機構
  • フロントエンドの推測ではなくバックエンドの真実から再水和する再起動または再接続パス

障害モード

権威を装う投影

症状:UIは「読み取り専用」に見えるが、フェーズ、グラフ、またはプロバイダの真実をローカルで静かに組み立てている。

修正:そのロジックをバックエンドのコマンドまたはクエリに移動し、フロントエンドをプロジェクターとして扱う。

互換性の継ぎ目の硬化

症状:「とりあえず両方サポート」が何週間もホットパスに残り、実際のアーキテクチャになる。

修正:互換性を明示的な削除日付付きの一方向マイグレーションエッジにプッシュするか、今すぐ削除する。

検査不可能な承認

症状:レビューペイロードが部分的またはフロントエンド合成であるため、人間が検査できない作業を承認できる。

修正:バックエンドが正確なレビューペイロードを出力しなければならず、UIはそれをレンダリングするだけにする。

リプレイに敵対的な起動

症状:フロントエンドが権限をキャッシュしていたため、アプリの再起動で可視状態が変化したり、ゲート位置が失われる。

修正:起動はバックエンドの真実に対するクエリとイベントリプレイでなければならず、ストアの再構築であってはならない。

シグナル

新しいバックエンドイベントなしにアプリの再起動で可視ランタイム状態が変化する場合、権限は依然として分割されている。

実例

フロントエンド所有のフェーズロジックを持つTauriワークフローエディタ

問題:

  • Reactストアがグラフをオーサリングし、フェーズ状態を推論し、プロバイダ階層を正規化していた。
  • バックエンド実行は異なる契約を使用していたため、レビューと再起動フローがずれていた。

リファクタリングパス:

  1. UIが実行時真実を発明していたすべての場所を棚卸し。
  2. ランタイムインタラクションをコマンド、クエリ、イベントに統合。
  3. プロバイダの正規化とフェーズ遷移をバックエンドコマンドの背後に移動。
  4. アクティブなオーサリングパスからスターター形式のユニオンを削除。
  5. 下流の作業がバックエンド検証済み出力からのみ進行するように、評価機構ゲートを追加。

成功条件:

  • 再起動時に、UIはバックエンドスナップショットとイベントから同じ可視状態を再構築する。
  • 承認画面は、Reactの再構成ではなく、バックエンドが出力したレビューペイロードをレンダリングする。

フォークガイダンス

作業がきれいに分離する場合にフォークする:

  • 契約レーン:分割権限の継ぎ目を棚卸し、コマンド、クエリ、イベントを定義。
  • 削除レーン:互換性レイヤー、非推奨ノードタイプ、スターター形式のユニオンを削除。
  • 検証レーン:評価機構ゲート、リプレイテスト、再起動または再接続カバレッジを追加。

最終的な所有権の決定は親レーンに残し、1つのアクターがバックエンドが真に所有するものを決定するようにする。

品質ゲート

  • UIがグラフ、フェーズ、プロバイダ、またはゲートの真実をローカルで捏造できない。
  • すべてのユーザーアクションがコマンド、クエリ、またはイベントにマッピングされる。
  • ランタイム状態が、バックエンドの真実のみからの再起動と再接続に耐える。
  • レビューと承認のペイロードはバックエンドによって出力され、UIによってレンダリングされる。
  • 互換性ロジックはアクティブパスではなく、マイグレーションエッジにのみ存在する。
  • 下流の実行は上流の契約失敗時に停止する。
  • 正確なプロバイダIDとモデル選択が契約境界で可視である。
  • テストが再起動、再接続、承認、評価機構障害パスをカバーする。

リファレンスマップ

  • references/architecture-patterns.md — バックエンド所有のワークフロー契約パターンと状態所有権の分割。
  • references/windags-lessons.md — 実際の分割権限ランタイムマイグレーションからの具体的な教訓。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

curiositech/windags-skills

Expert in 2000s-era music visualization (Milkdrop, AVS, Geiss) and modern WebGL implementations. Specializes in Butterchurn integration, Web Audio API AnalyserNode FFT data, GLSL shaders for audio-reactive visuals, and psychedelic generative art. Activate on "Milkdrop", "music visualization", "WebGL visualizer", "Butterchurn", "audio reactive", "FFT visualization", "spectrum analyzer". NOT for simple bar charts/waveforms (use basic canvas), video editing, or non-audio visuals.

curiositech/windags-skills

Expert legal research agent for finding and scraping expungement data state by state. Knows authoritative sources, URL patterns, Firecrawl configuration, and 2026 legal landscape.

curiositech/windags-skills

Expert in 3D computer vision labeling tools, workflows, and AI-assisted annotation for LiDAR, point clouds, and sensor fusion. Covers SAM4D/Point-SAM, human-in-the-loop architectures, and vertical-specific training strategies. Activate on '3D labeling', 'point cloud annotation', 'LiDAR labeling', 'SAM 3D', 'SAM4D', 'sensor fusion annotation', '3D bounding box', 'semantic segmentation point cloud'. NOT for 2D image labeling (use clip-aware-embeddings), general ML training (use ml-engineer), video annotation without 3D (use computer-vision-pipeline), or VLM prompt engineering (use prompt-engineer).

curiositech/windags-skills

Implement WCAG 2.2 AA/AAA compliance with automated testing, keyboard navigation, screen reader support, and focus management. Activate on: accessibility audit, WCAG compliance, keyboard navigation, screen reader, aria attributes, axe-core, focus trap. NOT for: design-level accessibility review (use design-accessibility-auditor), color contrast only (use css-in-js-architect).

curiositech/windags-skills

Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time estimation, dopamine-aware task design, and building systems that actually work for neurodivergent minds.

curiositech/windags-skills

Designs digital experiences for ADHD brains using neuroscience research and UX principles. Expert in reducing cognitive load, time blindness solutions, dopamine-driven engagement, and compassionate design patterns. Activate on 'ADHD design', 'cognitive load', 'accessibility', 'neurodivergent UX', 'time blindness', 'dopamine-driven', 'executive function'. NOT for general accessibility (WCAG only), neurotypical UX design, or simple UI styling without ADHD context.

curiositech/windags-skills

>- Apply crisis decision-making research to agent routing, uncertainty triage, and coordination failure analysis in time-pressured systems. Use when diagnosing handoff failures, analytical paralysis, or expert judgment under incomplete information. NOT for routine coding, simple CRUD design, or static single-agent tasks with complete information.

curiositech/windags-skills

Extend and modify the admin dashboard, developer portal, and operations console. Use when adding new admin tabs, metrics, monitoring features, or internal tools. Activates for dashboard development, analytics, user management, and internal tooling.

curiositech/windags-skills

Conversation patterns and interaction protocols for multi-agent systems. Covers request/response, pub/sub, blackboard, delegation chains, debate, critique, consensus, fan-out/fan-in, supervisor-worker, and peer negotiation. Deep analysis of AutoGen conversation patterns, CrewAI delegation, LangGraph state passing, and FIPA-ACL performatives. Teaches how to design what agents say to each other and in what order. Activate on: "agent conversation", "agent protocol", "multi-agent debate", "agent delegation", "supervisor worker pattern", "agent voting", "consensus protocol", "fan-out fan-in", "agent negotiation", "blackboard pattern", "agent dialogue", "conversation topology", "agent handoff". NOT for: wire format or serialization (use agent-interchange-formats), orchestration infrastructure (use agentic-infrastructure-2026), single agent behavior (use agentic-patterns).

curiositech/windags-skills

Meta-agent for creating new custom agents, skills, and MCP integrations. Expert in agent design, MCP development, skill architecture, and rapid prototyping. Activate on 'create agent', 'new skill', 'MCP server', 'custom tool', 'agent design'. NOT for using existing agents (invoke them directly), general coding (use language-specific skills), or infrastructure setup (use deployment-engineer).

curiositech/windags-skills

AI-powered calendar management and agent-based scheduling coordination. Covers calendar APIs (Google Calendar, CalDAV/iCal), AI scheduling assistants (Reclaim, Clockwise, Motion, Cal.com), building custom calendar agents with MCP, multi-calendar merging, timezone management, focus block protection, meeting fatigue detection, and agent-to-agent meeting negotiation protocols. Activate on: "calendar agent", "AI scheduling", "calendar coordination", "meeting scheduling", "calendar API", "focus time protection", "calendar optimization", "Google Calendar MCP", "Reclaim", "Clockwise", "Motion", "Cal.com", "smart scheduling", "calendar-aware agent", "timezone scheduling", "agent negotiation meetings". NOT for: manual calendar UI component design (use form-validation-architect), project management scheduling or Gantt charts (use project-management-guru-adhd), general time-tracking or pomodoro apps (use adhd-daily-planner for time-awareness), building the agent itself from scratch (use agent-creator).

curiositech/windags-skills

Build and adopt production AI agent infrastructure in 2026. Covers framework selection (LangGraph, CrewAI, AutoGen, MCP), orchestration patterns, evaluation, observability, memory systems, and tool use. Also covers the SOCIAL dimension: how to sell agent infrastructure internally, change management, measuring ROI, building trust in autonomous systems, and scaling adoption across teams. Activate on: "agent infrastructure", "agent framework comparison", "which agent framework", "sell AI tools internally", "agent adoption", "agent observability", "agent evaluation", "MCP architecture", "agentic mesh", "enterprise AI agents", "AI change management", "agent ROI". NOT for: building specific agents (use ai-engineer), designing agent behavior patterns (use agentic-patterns), prompt tuning (use prompt-engineer).

curiositech/windags-skills

Fundamental patterns for effective agentic behavior. Teaches decomposition, tool orchestration, error recovery, context management, quality self-assessment, and knowing when to stop. Model-agnostic principles that make any agent more effective regardless of domain. Activate on: "how should I structure this agent", "agentic workflow", "agent patterns", "multi-step task", "tool orchestration", "/agentic-patterns", "decompose this", "agent best practices", "chain of actions", "when should the agent stop", "agent loop design". NOT for: creating agent infrastructure (use agent-creator), building DAGs (use windags-architect), specific tool implementation.

curiositech/windags-skills

Automated discovery and matching of agent skills for dynamic task routing and capability assessment

curiositech/windags-skills

Cryptographic security for agentic systems — zero-trust agent networking, signed message envelopes (JWS/JWE), capability-based security (ocaps), Merkle tree audit trails, WASM sandboxing, and formal verification. Covers CLI dev tool security, mTLS between agents, permission boundaries (least privilege for AI agents), and supply chain security for skills/plugins. Activate on: "agent security", "zero trust agents", "secure agent communication", "capability-based security", "ocap", "signed messages between agents", "agent audit trail", "sandbox agent execution", "agent permissions", "mTLS agents", "cryptographic verification", "agent supply chain", "OWASP agentic", "prove agent did X", "tamper-proof agent logs". NOT for: application-level SAST scanning (use security-auditor), network firewall rules (use infrastructure), SOC2/HIPAA compliance (organizational), or prompt injection defense (use prompt-engineer).

curiositech/windags-skills

Data structures and serialization formats for agent-to-agent communication. Covers message envelopes, structured output schemas, capability declarations, task handoff payloads, error/retry signaling, and context windows as data structures. Deep comparison of A2A protocol, MCP, OpenAI function calling, and LangChain message types. Teaches when to use rigid schemas vs free-form with validation, typed vs untyped, streaming vs batch. Activate on: "agent message format", "agent communication schema", "agent-to-agent protocol", "A2A protocol", "MCP message format", "structured output for agents", "agent interop", "interchange format", "agent serialization", "task handoff format", "capability declaration". NOT for: what agents say to each other (use agent-conversation-protocols), orchestration topology (use multi-agent-coordination), building agent infrastructure (use agentic-infrastructure-2026).

curiositech/windags-skills

Logic-based agent programming language implementing BDI architecture for practical autonomous agent development

curiositech/windags-skills

>- Design AgentSpeak(L)-style BDI agents with context-guarded plans, selection functions, and intention stacks. Use for interruptible autonomy, agent policy, and multi-agent orchestration in dynamic environments. NOT for simple rule engines, static planners, or centralized workflows.

curiositech/windags-skills

Foundational concurrent computation model where actors communicate exclusively through asynchronous message passing

curiositech/windags-skills

license: Apache-2.0 NOT for unrelated tasks outside this domain.

関連スキル