AgentSkillsCN

interaction-mapper

映射高层次的架构关系,包括 K8s CRD 至控制器的监听机制,以及跨仓库的 gRPC 通信流程。

SKILL.md
--- frontmatter
name: interaction-mapper
description: Maps high-level architectural relationships, including K8s CRD-to-Controller watches and cross-repo gRPC communication flows.
compatibility: opencode
metadata:
  version: "1.0"
  impact: High (Architectural Awareness)
  tags: ["architecture", "crd", "grpc", "interaction", "mapping"]

Skill: interaction-mapper

Description

While LSP handles code-level symbols, this skill indexes the "glue" of Longhorn's microservices. It identifies which controllers reconcile which CRDs and maps gRPC service definitions to their cross-repo implementation logic.

When to Use

  • Impact Analysis: When changing a CRD schema or a gRPC proto definition.
  • Root Cause Analysis: When a resource state (e.g., Volume 'Faulted') doesn't transition as expected, to find the responsible controller.
  • Onboarding: When the Agent needs to understand the call chain from Manager to Instance Manager.

Usage

Run from workspace root:

bash
bash .opencode/skills/interaction-mapper/map_interactions.sh

Remotes: The script now logs warnings instead of failing if the workspace lacks an upstream remote, so it is safe immediately after cloning.

Expected Outcomes

  • context/indices/crd-interaction.json: Map of CRDs to their primary reconciling logic.
  • context/indices/rpc-topology.json: Map of gRPC services and their cross-repo caller relationships.