Agent Skillsluxury-yacht/app › shared-resource-model

shared-resource-model

GitHub

规范 Kubernetes 资源的统一身份、状态呈现、事实及关系模型,确保前后端数据投影与展示的一致性。

.agents/skills/shared-resource-model/SKILL.md luxury-yacht/app

Trigger Scenarios

修改资源身份或状态逻辑 调整 DTO 投影规则 维护资源关系链接

Install

npx skills add luxury-yacht/app --skill shared-resource-model -g -y
More Options

Non-standard path

npx skills add https://github.com/luxury-yacht/app/tree/main/.agents/skills/shared-resource-model -g -y

Use without installing

npx skills use luxury-yacht/app@shared-resource-model

指定 Agent (Claude Code)

npx skills add luxury-yacht/app --skill shared-resource-model -a claude-code -g -y

安装 repo 全部 skill

npx skills add luxury-yacht/app --all -g -y

预览 repo 内 skill

npx skills add luxury-yacht/app --list

SKILL.md

Frontmatter
{
    "name": "shared-resource-model",
    "description": "Work on Luxury Yacht canonical Kubernetes resource identity, status presentation, facts, ResourceLink relationships, DTO projection, table\/detail\/object-map parity, and shared resource model tests"
}

Shared Resource Model

Use this when touching canonical object identity, resource status, statusPresentation, lifecycle, facts, owner/relationship links, ResourceLink, event involved-object identity, DTO projection, or parity across refresh rows, streams, object panel details, and object map nodes/edges.

Read First

  1. AGENTS.md
  2. backend/AGENTS.md
  3. frontend/AGENTS.md for frontend consumers
  4. docs/architecture/shared-resource-model.md
  5. docs/architecture/resource-kind-registry.md for the per-kind package + registry layout (where identity, model, facts, and DTO live)
  6. docs/architecture/catalog.md when identity/existence is involved
  7. docs/architecture/refresh-system.md when rows, streams, events, or object details consume the model

Backend Entry Points

  • backend/resources/<kind> — per-kind identity.go, descriptor.go, model.go, facts.go, dto.go (the single definition of a kind)
  • backend/resourcemodel — shared status/facts/link primitives + relationship index that the per-kind models build on
  • backend/resourcekind, backend/resourcecontract, backend/kind/kindregistry — identity leaf, the built-in identity contract, and the kind registry
  • backend/refresh/snapshot
  • backend/resource_gateway.go — request-shaped detail/action owner
  • backend/resources/types — shared cross-kind DTO field types
  • backend/object_detail_provider.go — ResourceGateway detail dispatch (generated bindings)

Frontend Entry Points

  • frontend/src/shared/utils/backendStatusPresentation.ts
  • frontend/src/shared/utils/resourceLinkIdentity.ts
  • frontend/src/modules/object-panel
  • frontend/src/modules/object-map
  • Refresh/table consumers under frontend/src/modules/* and frontend/src/core/refresh/types.ts

Checklist

  • Object refs crossing boundaries include clusterId, group, version, kind, and namespace/name for concrete objects.
  • Backend GVK/GVR/scope lookups use the object catalog ResourceResolver. Built-ins use their real group/version from the catalog seed; CRDs preserve group/version from discovery, catalog, owner refs, HPA targets, events, or manifests.
  • Primary status is computed once in backend model code and projected as status, statusState, statusPresentation, and optional statusReason.
  • Frontend renders backend presentation fields instead of deriving primary status classes.
  • Relationships use ResourceLink; incomplete source refs become display-only refs rather than unsafe navigation links.
  • Facts stay semantic until the final DTO/table formatting boundary.
  • Table rows, stream rows, object panel details, events, and object-map payloads stay consistent when they render the same resource family.
  • Tests cover model status/facts/links and every changed projection.

Validation

Use focused checks while iterating:

mise exec -- go test ./backend/resourcemodel ./backend/refresh/snapshot ./backend/resources/... ./backend
mise exec -- npm run typecheck --prefix frontend
mise exec -- npm run test --prefix frontend -- backendStatusPresentation resourceLinkIdentity object-map object-panel

Then follow the root final validation gate.

Version History

  • ee846a6 Current 2026-08-20 13:02

Same Skill Collection

.agents/skills/add-resource/SKILL.md
.agents/skills/app-review/SKILL.md
.agents/skills/app-shell/SKILL.md
.agents/skills/branch-review/SKILL.md
.agents/skills/browse-tables/SKILL.md
.agents/skills/cluster-auth-lifecycle/SKILL.md
.agents/skills/draft-release-notes/SKILL.md
.agents/skills/improve-backend/SKILL.md
.agents/skills/improve-frontend/SKILL.md
.agents/skills/make-impossible-states-impossible/SKILL.md
.agents/skills/new-story/SKILL.md
.agents/skills/object-map/SKILL.md
.agents/skills/object-panel/SKILL.md
.agents/skills/operations-workflows/SKILL.md
.agents/skills/permissions-capabilities/SKILL.md
.agents/skills/refresh-subsystem/SKILL.md

Metadata

Files
0
Version
ee846a6
Hash
54e267f8
Indexed
2026-08-20 13:02

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-26 03:23
浙ICP备14020137号-1 $방문자$