Token导航 LogoToken导航TokenDH.com
开发只读github未标认证来源可访问许可证需确认审计通过

nats-design-subject国家设计主题

Agent Skill

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

总安装

717

周安装

29

GitHub Stars

公开资料未说明

下载量

225
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:nats-design-subject(国家设计主题)
来源仓库:https://github.com/trogonstack/agentskills
仓库路径:skills/nats-design-subject
安装命令:
npx skills add https://github.com/trogonstack/agentskills --skill nats-design-subject
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/trogonstack/agentskills --skill nats-design-subject

简介

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化,提升产品质感。

  • 适合整理页面结构、生成 UI 方案或改进组件层级,增强视觉一致性。
  • 使用时需结合现有品牌、设计系统和用户任务,避免堆砌装饰元素。
  • 涉及真实页面改动时应通过截图或浏览器预览检查文本溢出、对齐与响应式表现。
  • nats-design-subject 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Design NATS Subject Hierarchy

Design a subject architecture that subscribers can efficiently navigate using wildcards, with proper segment ordering, tenant isolation, and growth path.

Interview Phase

Skip interview if ALL of these are already specified:

  • Messaging patterns (pub/sub, request/reply, streaming)
  • Multi-tenancy needs (single/multi-tenant, scale requirements)
  • Security requirements (authorization, tenant isolation)
  • Persistence needs (JetStream vs core NATS)

Always interview if: Migrating existing subjects (needs anti-pattern audit first)

Questions

  1. Scope — "Is this greenfield design or migrating existing subjects?"

- Impact: Migration needs anti-pattern audit first (see references/anti-patterns.md)

  1. Multi-Tenancy & Scale — "Do you need: (A) Single tenant, (B) Multi-tenant with isolation, (C) Massive scale with regions/shards?"

- Impact: Determines whether tenant prefix is needed and segmentation depth

  1. Messaging Patterns — "Which patterns do you use? (A) Pub/Sub only, (B) Request/Reply, (C) Streaming/JetStream, (D) All/mix?"

- Impact: JetStream needs stream-aware subject design; request/reply has its own conventions

  1. Security — "Do you need subject-based authorization or tenant isolation?"

- Impact: Determines whether tenant/role prefixes are needed and permission boundaries

  1. Persistence — "Do you need JetStream persistence or core NATS only?"

- Impact: Determines stream/consumer subject design and retention considerations


When to Use

  • Designing a new NATS messaging system
  • Planning multi-tenant subject isolation
  • Organizing device telemetry or event streams
  • Setting up request/reply patterns across microservices
  • Defining event subject structure for event-sourced systems
  • Building agentic AI platforms with inter-agent messaging

When NOT to Use

  • Configuring NATS server or cluster settings (infrastructure, not subject design)
  • Writing NATS client code or connection logic (implementation, not architecture)
  • Choosing between NATS and other messaging systems (technology evaluation)
  • Debugging existing NATS connectivity or performance issues

Workflow

1. Identify Domain Boundaries

List all business domains involved (orders, payments, inventory, etc.). Each domain becomes a top-level subject segment.

2. Choose a Pattern

Match the user's scenario to a pattern:

Use CasePatternExample
Simple Domain{domain}.{action}.{scope}orders.created.us-west
Multi-Region{domain}.{action}.{region}.{id}devices.telemetry.us-east.sensor-456
Multi-Tenant SaaS{tenant}.{domain}.{action}.{id}acme-corp.analytics.processed.report-123
Multi-Tenant AIagents.{action}.{tenant}.{agent-id}.{task-id}agents.task-assigned.tenant-abc.agent-xyz.task-123
Request/Reply{service}.request / {service}.replyorders.request / orders.reply
Event Sourcing{aggregate}.{action}.v{version}.{id}orders.order.created.v1.order-123

For full pattern details with subscriber paths and scaling guidance, read references/patterns.md.

3. Order Segments Strategically

Apply these rules when ordering segments left-to-right:

  • Broad to specific: Domain → Action → Scope → Identifier
  • Low-cardinality left, high-cardinality right: Regions (few values) before IDs (millions of values)
  • Never put IDs or UUIDs before actions
✓ GOOD: orders.created.us-west.order-123
                            ↑          ↑
                       low-card    high-card

✗ BAD:  orders.order-123.us-west.created
                ↑
           high-card early (kills wildcard filtering)

Why this matters: NATS wildcard matching scans left-to-right. High-cardinality values on the left force subscribers into inefficient orders.*.us-west.created patterns that must match thousands of IDs.

For common ordering mistakes and migration strategies, read references/anti-patterns.md.

4. Plan Subscriber Paths

For each domain, document how subscribers will filter:

orders.>                    → All order events
orders.created.>            → All order creation events
orders.created.us-west.>    → Orders created in US West
orders.created.us-west.order-123 → Specific order

Design subjects for subscribers, not publishers. Subscribers determine how you organize — a good hierarchy lets them efficiently filter with wildcards.

5. Design Security Model (if multi-tenant)

If the user needs tenant isolation or role-based access:

  • Tenant ID as first segment enables subject-based authorization (acme-corp.>)
  • Separate admin subjects from user operations (_admin.> for platform ops)
  • Apply least-privilege permissions per service

For authorization patterns and tenant isolation examples, read references/security.md.

6. Design JetStream Streams (if persistence needed)

If the user needs JetStream:

  • One stream per domain (or per tenant for isolation)
  • Consumer filters for fine-grained routing
  • Retention policies per domain (financial: years, telemetry: days)
  • Keep to 4-6 subject segments — use consumer filters instead of deeper hierarchies

For stream design, consumer patterns, and migration from core NATS, read references/jetstream.md.

7. Validate and Write Output

Present the design using this template:

# NATS Subject Architecture: [System Name]

## Domain Overview
[Describe the domains and their interactions]

## Subject Hierarchy

### Domain: [Name]
- `domain.action.{scope}.{id}`
- `domain.action.{scope}.{id}`

Subscriber paths:
- `domain.>` — All events
- `domain.action.>` — Specific action

[Repeat for each domain]

## Multi-Tenancy Model
[How tenant isolation works via subjects, if applicable]

## Security Model
[Authorization rules per role/service, if applicable]

## JetStream Streams
[Stream definitions and consumer filters, if applicable]

## Quality Validation
[Run checklist below]

Example Output

# NATS Subject Architecture: IoT Smart Building Platform

## Domain Overview

Smart building system with 10,000+ sensors across multiple regions sending temperature, humidity, and occupancy data. Needs real-time monitoring, regional aggregation, and alerting.

## Subject Hierarchy

### Domain: Devices
- `devices.telemetry.{region}.{device-id}.{metric}`
- `devices.telemetry.us-west.sensor-456.temperature`
- `devices.telemetry.us-west.sensor-456.humidity`
- `devices.telemetry.eu-central.sensor-789.occupancy`

Subscriber paths:
- `devices.telemetry.>` — All telemetry (global monitoring)
- `devices.telemetry.us-west.>` — Regional dashboard (US West)
- `devices.telemetry.>.>.temperature` — All temperature readings

### Domain: Alerts
- `alerts.triggered.{severity}.{region}.{device-id}`
- `alerts.triggered.critical.us-west.sensor-456`

Subscriber paths:
- `alerts.triggered.critical.>` — Critical alerts only
- `alerts.triggered.>.us-west.>` — Regional alert dashboard

## Multi-Tenancy Model

Not applicable (single organization)

## Security Model

- Building operators: `devices.telemetry.>`, `alerts.>` (subscribe only)
- Alert service: `alerts.>` (publish + subscribe)
- Admin: `>` (full access)

## JetStream Streams

Stream: `telemetry-us-west`
  Subjects: `devices.telemetry.us-west.>`
  Retention: 24h (high volume)

Stream: `alerts`
  Subjects: `alerts.>`
  Retention: 30d

## Quality Validation

✓ All segments follow broad-to-specific order
✓ Device IDs at rightmost position
✓ Naming consistent (lowercase, hyphens)
✓ Regional filtering efficient
✓ 4 segments (within 4-6 limit)

For complete real-world examples across microservices, IoT, SaaS, event sourcing, and agentic AI platforms, read references/use-cases.md.


Quick Start (Simple Cases)

If you're designing a simple single-domain system without multi-tenancy:

  1. Use Pattern 1 (Simple Domain): {domain}.{action}.{id}
  2. Skip references — follow the workflow above
  3. Example: orders.created.order-123, payments.authorized.payment-456

For multi-region, multi-tenant, or event-sourcing needs, continue with full workflow and read references as needed.


Reference Navigation

The skill includes 5 detailed reference documents — read them as needed during workflow steps:

Don't read all references upfront — use them progressively as the workflow requires.


Naming Rules

  • All lowercase with hyphens: orders.created
  • Never underscores: orders_created
  • Never mixed case: Orders.Created
  • Keep to 4-6 segments maximum

Quality Checklist

  • All segments follow broad-to-specific order ({domain}.{action}.{scope}.{id})
  • No UUID/ID fields appear before action/scope segments
  • Naming consistent (all lowercase, hyphens, no underscores)
  • Documented subscriber wildcard paths for each domain
  • No subjects deeper than 6 segments
  • Multi-tenancy isolation is clear (tenant ID positioning documented)
  • Security subjects defined for admin/monitoring access
  • No conflicting patterns (e.g., orders.created.123 vs orders.123.created)
  • High-cardinality decision documented (why ID placement chosen)

Testing Your Design

Validate your subject hierarchy before deployment:

# Start local NATS server
nats-server -D

# Test subscriber wildcards
nats sub "orders.>"                    # Should match all order subjects
nats sub "orders.created.>"            # Should match only creations
nats sub "orders.created.us-west.>"    # Should match region-specific

# Test publishing
nats pub "orders.created.us-west.order-123" "test message"

# Verify JetStream streams (if applicable)
nats stream info orders-stream
nats consumer info orders-stream order-consumer

For existing deployments, audit current subjects:

# List active subjects (requires monitoring enabled)
nats server report jetstream

# Check subject permissions
nats server check connection --account <account-name>

Reference Documentation

  • Patterns: 6 hierarchy patterns with subscriber paths and scaling guidance
  • Anti-Patterns: 8 common mistakes with detection, fixes, and migration strategies
  • Security & Multi-Tenancy: Authorization patterns and tenant isolation
  • JetStream Design: Stream filters, consumer subjects, and retention policies
  • Use Cases: Complete examples for microservices, IoT, SaaS, event sourcing, agentic AI

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.15%
按下载量换算84

Claude

30.49%
按下载量换算69

Cursor

18.49%
按下载量换算42

Gemini CLI

9.28%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills