Skip to content

Commit 2545dac

Browse files
Feat: Add coding agent domain skills ([#1457](#1457))
* feat(skills): add backend domain skills for runtime, discovery, engine, events, store, and Console API Document component lifecycle, ListAndWatch discovery, resource engine behavior, EventBus dispatching, storage indexes, and Web MVC flow for coding agents. * feat(skills): add frontend domain skill for routing, components, and traffic rule forms Document Vue frontend structure, API clients, Pinia state, route metadata, layout tabs, and traffic rule form design. * feat(skills): add OpenAI skill metadata Add agents/openai.yaml metadata for each dubbo-admin domain skill.
1 parent cea721e commit 2545dac

17 files changed

Lines changed: 337 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: dubbo-admin-console-api
3+
description: Work with the dubbo-admin Console API layer. Use when adding or changing HTTP endpoints, request/response models, Gin handlers, console services, route registration, error handling, or the handler to service to manager to store flow under pkg/console/. Do not use for frontend-only, discovery-only, or storage-internals tasks unless they directly affect Console API behavior.
4+
---
5+
6+
# dubbo-admin Console API
7+
8+
## Use This Workflow
9+
10+
1. Start at `pkg/console/router/router.go` to identify the HTTP path, method, and handler.
11+
2. Read the matching handler in `pkg/console/handler/` to confirm binding style, validation, and response handling.
12+
3. Read or update request and response structs in `pkg/console/model/`.
13+
4. Put business logic in `pkg/console/service/`; keep handlers thin.
14+
5. Access resources through `ctx.ResourceManager()` and helper functions in `pkg/core/manager/`.
15+
6. Return API responses with `model.NewSuccessResp`, `util.HandleArgumentError`, or `util.HandleServiceError`.
16+
17+
## Local Patterns
18+
19+
- Handlers return `gin.HandlerFunc` and usually close over `consolectx.Context`.
20+
- Query parameters are bound with `ShouldBindQuery`; JSON bodies use Gin binding helpers.
21+
- Services receive `consolectx.Context` and typed model requests.
22+
- API responses use `model.CommonResp` from `pkg/console/model/common.go`.
23+
- Pagination uses the shared core model types from `pkg/core/resource/model`.
24+
25+
## Key Paths
26+
27+
- `pkg/console/router/router.go`: route groups under `/api/v1`
28+
- `pkg/console/handler/`: HTTP handlers
29+
- `pkg/console/service/`: console business logic
30+
- `pkg/console/model/`: request and response types
31+
- `pkg/console/context/context.go`: console context interface
32+
- `pkg/console/util/error.go`: HTTP error response helpers
33+
34+
## Validation
35+
36+
Run focused Go tests for changed packages, then `make test` when the change touches shared Console API behavior.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Dubbo Admin Console API"
3+
short_description: "Guide for dubbo-admin Console API work"
4+
default_prompt: "Use $dubbo-admin-console-api to add or change a dubbo-admin Console API endpoint."
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: dubbo-admin-discovery
3+
description: Work with dubbo-admin discovery, ListAndWatch, informers, registry events, and resource derivation. Use when changing Zookeeper or Nacos discovery flow, ListWatcher factories, informer event emission, discovery subscribers, ServiceProviderMetadata or ServiceConsumerMetadata processing, or derived Application/Service/RPCInstance resources under pkg/core/discovery/ and pkg/core/controller/. Do not use for Console API, frontend, or store implementation details unless they are part of discovery event flow.
4+
---
5+
6+
# dubbo-admin Discovery
7+
8+
## Use This Workflow
9+
10+
1. Start with `pkg/core/discovery/component.go` to understand component dependencies, informer creation, subscriber registration, and start order.
11+
2. Inspect `pkg/core/controller/listwatcher.go` and `pkg/core/controller/informer.go` for List/Watch behavior and event emission.
12+
3. Follow registry-specific ListWatcher creation through `pkg/core/discovery/factory.go`.
13+
4. Read the relevant subscriber in `pkg/core/discovery/subscriber/` before changing derived resources.
14+
5. Verify resource writes against the store and index patterns used by the subscriber.
15+
16+
## Event Flow
17+
18+
Registry data is listed or watched by a ListWatcher, processed by an informer, emitted to the event bus, and consumed by subscribers. Subscribers update resources such as Application, Service, Instance, RPCInstance, and metadata resources.
19+
20+
## Subscriber Notes
21+
22+
`initSubscribes()` always registers the base subscribers for RPC instances, service consumer metadata, service provider metadata, and instances. It conditionally adds `NacosServiceEventSubscriber` when Nacos discovery is configured, and `ZKMetadataEventSubscriber` plus `ZKConfigEventSubscriber` when Zookeeper discovery is configured.
23+
24+
## Key Paths
25+
26+
- `pkg/core/discovery/component.go`: discovery orchestration
27+
- `pkg/core/discovery/factory.go`: ListWatcher factory registry
28+
- `pkg/core/controller/informer.go`: informer and event emission
29+
- `pkg/core/controller/listwatcher.go`: ListWatcher interface
30+
- `pkg/core/discovery/subscriber/`: event subscribers
31+
- `pkg/core/resource/apis/mesh/v1alpha1/`: resource types
32+
33+
## Validation
34+
35+
Run targeted tests for subscriber or controller changes. Run `make test` for broad discovery changes because event flow affects store state and Console API results.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Dubbo Admin Discovery"
3+
short_description: "Guide for dubbo-admin discovery flow"
4+
default_prompt: "Use $dubbo-admin-discovery to trace or modify dubbo-admin discovery event flow."
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: dubbo-admin-domain
3+
description: Navigate dubbo-admin architecture and choose the right domain skill. Use for cross-module questions, end-to-end flows, component boundaries, or deciding whether runtime, discovery, engine, events, store, Console API, or frontend guidance applies. Prefer a narrower dubbo-admin-* skill when the user request clearly targets one subsystem.
4+
---
5+
6+
# dubbo-admin Domain Guide
7+
8+
## Choose a Subskill
9+
10+
- Use `dubbo-admin-runtime` for component registration, dependency ordering, bootstrap, lifecycle, and shutdown.
11+
- Use `dubbo-admin-discovery` for registry ListAndWatch, informers, event subscribers, and metadata-derived resources.
12+
- Use `dubbo-admin-engine` for runtime infrastructure discovery, engine factories, runtime instance informers, and RuntimeInstance to Instance merging.
13+
- Use `dubbo-admin-events` for EventBus, subscriber registration, resource-kind dispatching, synchronous event processing, and error handling.
14+
- Use `dubbo-admin-store` for ResourceStore behavior, indexes, prefix lookup, pagination, and memory store internals.
15+
- Use `dubbo-admin-console-api` for Gin routes, handlers, models, console services, and API response behavior.
16+
- Use `dubbo-admin-frontend` for `ui-vue3/`, Vue routes, Pinia state, API clients, views, forms, and shared frontend utilities.
17+
18+
## Architecture Map
19+
20+
Discovery components read registry data, engine components read runtime infrastructure, informers emit resource events, the EventBus dispatches by resource kind, subscribers derive or update mesh resources, stores index those resources, resource managers provide typed access, Console API handlers expose data under `/api/v1`, and the Vue frontend consumes those APIs.
21+
22+
## Important Backend Areas
23+
24+
- `app/`: application entrypoints and packaging
25+
- `pkg/core/bootstrap/`: runtime construction
26+
- `pkg/core/runtime/`: component model and lifecycle
27+
- `pkg/core/discovery/`: discovery orchestration and subscribers
28+
- `pkg/core/engine/` and `pkg/engine/`: runtime infrastructure engine
29+
- `pkg/core/events/`: EventBus interfaces and dispatching
30+
- `pkg/core/controller/`: informer and ListWatcher abstractions
31+
- `pkg/core/store/` and `pkg/store/`: store interfaces and implementations
32+
- `pkg/console/`: HTTP API layer
33+
- `pkg/governor/`: governance rule support
34+
35+
## Important Frontend Areas
36+
37+
- `ui-vue3/src/api/`: API clients
38+
- `ui-vue3/src/router/`: route definitions and metadata
39+
- `ui-vue3/src/stores/`: Pinia stores
40+
- `ui-vue3/src/views/`: feature pages
41+
- `ui-vue3/src/components/`: shared UI components
42+
43+
## Validation
44+
45+
For code changes, use the narrowest relevant test first. Use `make test` for backend-wide changes and frontend package scripts from `ui-vue3/package.json` for UI changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Dubbo Admin Domain"
3+
short_description: "Guide for dubbo-admin architecture"
4+
default_prompt: "Use $dubbo-admin-domain to choose the right dubbo-admin subsystem for this task."
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: dubbo-admin-engine
3+
description: Work with dubbo-admin resource engine behavior. Use when changing runtime infrastructure discovery, engine factories, Kubernetes or mock engine ListWatchers, RuntimeInstance informers, RuntimeInstanceEventSubscriber, leader election for the engine component, or the flow that merges runtime infrastructure data into Instance resources under pkg/core/engine/ and pkg/engine/. Do not use for registry discovery unless the task is about engine-sourced RuntimeInstance resources.
4+
---
5+
6+
# dubbo-admin Engine
7+
8+
## Use This Workflow
9+
10+
1. Start with `pkg/core/engine/component.go` to inspect component dependencies, configuration, informer setup, subscriber setup, and start behavior.
11+
2. Check `pkg/core/engine/factory.go` before adding or changing an engine type.
12+
3. Inspect implementation factories under `pkg/engine/`, such as Kubernetes or mock engines.
13+
4. Follow ListWatcher output into `pkg/core/controller/informer.go`, which emits RuntimeInstance resource events.
14+
5. Read `pkg/core/engine/subscriber/runtime_instance.go` before changing RuntimeInstance to Instance merge or delete behavior.
15+
6. Check store indexes when subscriber logic uses `ListByIndexes` to find related Instance resources.
16+
17+
## Local Patterns
18+
19+
- The engine is a runtime component of type `runtime.ResourceEngine`.
20+
- It depends on `runtime.EventBus` and `runtime.ResourceStore`.
21+
- Engine factories create `controller.ResourceListerWatcher` instances from `pkg/config/engine` configuration.
22+
- The component starts informers and subscribes engine subscribers through the EventBus.
23+
- Non-memory stores may enable leader election so only the leader runs engine business logic.
24+
- `RuntimeInstanceEventSubscriber` converts or merges runtime infrastructure state into mesh `Instance` resources and emits follow-up Instance events.
25+
26+
## Key Paths
27+
28+
- `pkg/core/engine/component.go`: engine component lifecycle
29+
- `pkg/core/engine/factory.go`: engine factory registry
30+
- `pkg/core/engine/subscriber/runtime_instance.go`: RuntimeInstance event handling
31+
- `pkg/engine/kubernetes/`: Kubernetes engine factory and ListWatchers
32+
- `pkg/engine/mock/`: mock engine factory
33+
- `pkg/config/engine/`: engine configuration types
34+
35+
## Validation
36+
37+
Run focused tests around changed engine, subscriber, or store behavior. Use `make test` for changes that affect informer events, Instance lifecycle, or runtime component startup.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Dubbo Admin Engine"
3+
short_description: "Guide for dubbo-admin engine flow"
4+
default_prompt: "Use $dubbo-admin-engine to change dubbo-admin resource engine behavior."
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: dubbo-admin-events
3+
description: Work with dubbo-admin EventBus dispatching. Use when changing Event, Emitter, Subscriber, SubscriptionManager, EventBus component registration, Subscribe or Unsubscribe behavior, Send dispatch rules, subscriber ProcessEvent flow, or resource-kind based event routing under pkg/core/events/. Do not use for a domain subscriber unless the task changes the event bus contract or dispatch semantics.
4+
---
5+
6+
# dubbo-admin Events
7+
8+
## Use This Workflow
9+
10+
1. Start with `pkg/core/events/eventbus.go` for the Event, Emitter, Subscriber, SubscriptionManager, and EventBus interfaces.
11+
2. Read `pkg/core/events/component.go` for the concrete EventBus component.
12+
3. Trace event producers from informers or subscribers that call `events.NewResourceChangedEvent` and `Emitter.Send`.
13+
4. Trace consumers by finding subscribers that implement `ResourceKind`, `Name`, and `ProcessEvent`.
14+
5. When adding a subscriber, ensure its `Name()` is unique for the resource kind.
15+
16+
## Dispatch Rules
17+
18+
- `eventBus` is registered as a runtime component and has no required dependencies.
19+
- `Subscribe` groups subscribers by `model.ResourceKind`.
20+
- `Send` derives the resource kind from `event.NewObj()` first, then `event.OldObj()` for delete events.
21+
- Dispatch is synchronous: each subscriber's `ProcessEvent` runs in sequence inside `Send`.
22+
- Subscriber errors are logged and do not stop dispatch to later subscribers.
23+
- If no subscriber exists for the resource kind, the event is logged and skipped.
24+
25+
## Key Paths
26+
27+
- `pkg/core/events/eventbus.go`: public event interfaces and resource changed event type
28+
- `pkg/core/events/component.go`: EventBus component implementation
29+
- `pkg/core/controller/informer.go`: informer event emission
30+
- `pkg/core/discovery/subscriber/`: discovery subscribers
31+
- `pkg/core/engine/subscriber/`: engine subscribers
32+
33+
## Validation
34+
35+
Run focused tests for event contract changes. Run `make test` when dispatch behavior changes because discovery and engine both depend on EventBus semantics.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Dubbo Admin Events"
3+
short_description: "Guide for dubbo-admin EventBus"
4+
default_prompt: "Use $dubbo-admin-events to change dubbo-admin EventBus dispatching."

0 commit comments

Comments
 (0)