Token导航 LogoToken导航

Agent Skill · 前端设计

cross-context(跨上下文)

cross-context 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

cross-context 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 10,088。

总安装 186周安装 8GitHub Stars 2下载 65核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/knowlet/skills --skill cross-context

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

cross-context 识别微服务架构中多个有界上下文间的协作依赖类型。指导 Anti-Corruption Layer、Open Host Service 等集成模式选择。定义上下文映射契约与防腐层接口规范设计原则。依赖 YAML 配置文件维护各上下文边界与通信协议。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/cross-context

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/knowlet/skills --skill cross-context;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

cross-context 怎么安装?

在终端执行 npx skills add https://github.com/knowlet/skills --skill cross-context。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

cross-context 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

cross-context 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

cross-context 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

cross-context 用的人多吗?

公开数据是累计安装 186 次,近一周安装 8 次,下载 65 次,GitHub 2 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

cross-context 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
cross-context

跨上下文 · 本页

1862需要联网MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Cross-Context Skill

觸發時機

  • analyze-frame 識別出 cross_context_dependencies 時
  • 需求涉及多個 Bounded Context 的協作
  • 設計 Anti-Corruption Layer (ACL) 時
  • 定義 Context Mapping 策略時

核心任務

  1. 識別跨 BC 依賴的類型與方向
  2. 設計適當的整合模式 (ACL, Open Host, Shared Kernel, etc.)
  3. 定義跨 BC 的契約規格
  4. 確保當前 BC 不被外部 BC 污染

Context Mapping 模式

上游/下游關係

模式說明適用場景
Customer-Supplier下游需求驅動上游開發緊密合作的團隊
Conformist下游完全遵循上游模型無法影響上游時
Anti-Corruption Layer下游建立隔離層保護自身模型
Open Host Service上游提供標準化 API多下游消費者
Published Language共享交換格式跨組織整合

對等關係

模式說明適用場景
Shared Kernel共享部分模型高度協作
Partnership雙方共同演進緊密合作
Separate Ways完全獨立無需整合

cross-context/{context-name}.yaml 格式

# docs/specs/{feature-name}/cross-context/{context-name}.yaml
cross_context:
  id: XC1
  name: "Authorization"

  # ---------------------------------------------------------------------------
  # Context 關係
  # ---------------------------------------------------------------------------

  relationship:
    source_context: "AccessControl"     # 提供服務的 BC
    target_context: "WorkflowManagement" # 當前 BC
    direction: "upstream-downstream"     # | symmetric | separate
    pattern: "AntiCorruptionLayer"       # | Conformist | OpenHostService | SharedKernel

  # ---------------------------------------------------------------------------
  # 介面契約(需求層:只描述「需要什麼」)
  # ---------------------------------------------------------------------------

  required_capability:
    name: "AuthorizationCheck"
    description: |
      Check if the operator has permission to perform the action on the resource.

    # 這是「需求」,不是「實作」
    operations:
      - name: "canExecute"
        input:
          - name: "operatorId"
            type: "string"
            description: "The ID of the operator"
          - name: "action"
            type: "string"
            description: "The action to perform (e.g., 'create', 'update', 'delete')"
          - name: "resourceType"
            type: "string"
            description: "The type of resource (e.g., 'Workflow', 'Board')"
          - name: "resourceId"
            type: "string"
            description: "The ID of the resource"
        output:
          type: "boolean"
          description: "true if authorized, false otherwise"

        # Design by Contract
        pre_conditions:
          - "operatorId must not be empty"
          - "action must be a valid action type"
        post_conditions:
          - "returns true or false, never throws for authorization check"

        # 異常情況
        errors:
          - name: "OperatorNotFoundError"
            when: "operatorId does not exist"

  # ---------------------------------------------------------------------------
  # ACL 設計(實作層)
  # ---------------------------------------------------------------------------

  acl_design:
    adapter_interface:
      name: "AuthorizationService"
      location: "src/domain/services/"

    adapter_implementation:
      name: "AccessControlAuthorizationAdapter"
      location: "src/infrastructure/acl/"

    # 模型轉換
    translation:
      - source_model: "AccessControl.Permission"
        target_model: "WorkflowManagement.AuthorizationResult"
        mapping: |
          Permission.isGranted → AuthorizationResult.authorized
          Permission.denialReason → AuthorizationResult.reason

  # ---------------------------------------------------------------------------
  # 容錯策略
  # ---------------------------------------------------------------------------

  fault_tolerance:
    timeout: "3s"
    retry:
      max_attempts: 3
      backoff: "exponential"
    fallback:
      strategy: "deny-by-default"  # | allow-by-default | cached
      description: "If authorization service is unavailable, deny the request"
    circuit_breaker:
      enabled: true
      failure_threshold: 5
      reset_timeout: "30s"

  # ---------------------------------------------------------------------------
  # 可追溯性
  # ---------------------------------------------------------------------------

  satisfied_by:
    - machine/controller.yaml#authorization_check
    - "src/infrastructure/acl/AccessControlAuthorizationAdapter.ts"

  validates_concerns:
    - FC1  # 若有 Frame Concern 與權限相關

TypeScript 範例

Domain Service Interface (在 Domain 層)

// src/domain/services/AuthorizationService.ts

/**
 * Authorization Service Interface
 *
 * 這是 Domain 層的介面,不依賴任何外部實作
 * Anti-Corruption Layer 的入口點
 */
export interface AuthorizationService {
  /**
   * Check if the operator can execute the action
   *
   * @pre operatorId must not be empty
   * @pre action must be a valid action type
   * @post returns AuthorizationResult, never throws for check
   */
  canExecute(
    operatorId: string,
    action: ActionType,
    resourceType: ResourceType,
    resourceId: string
  ): Promise<AuthorizationResult>;
}

export interface AuthorizationResult {
  readonly authorized: boolean;
  readonly reason?: string;
}

export type ActionType = 'create' | 'read' | 'update' | 'delete';
export type ResourceType = 'Workflow' | 'Board' | 'Stage' | 'SwimLane';

ACL Adapter (在 Infrastructure 層)

// src/infrastructure/acl/AccessControlAuthorizationAdapter.ts

import { AuthorizationService, AuthorizationResult, ActionType, ResourceType }
  from '../../domain/services/AuthorizationService';
import { AccessControlClient } from '../clients/AccessControlClient';
import { CircuitBreaker } from '../resilience/CircuitBreaker';

/**
 * Anti-Corruption Layer Adapter
 *
 * 將 AccessControl BC 的模型轉換為當前 BC 的模型
 * 包含容錯策略:timeout, retry, circuit breaker
 */
export class AccessControlAuthorizationAdapter implements AuthorizationService {
  constructor(
    private readonly client: AccessControlClient,
    private readonly circuitBreaker: CircuitBreaker,
  ) {}

  async canExecute(
    operatorId: string,
    action: ActionType,
    resourceType: ResourceType,
    resourceId: string
  ): Promise<AuthorizationResult> {
    // ===== Pre-conditions =====
    if (!operatorId) {
      throw new Error('operatorId must not be empty');
    }

    try {
      // 透過 Circuit Breaker 呼叫外部服務
      const permission = await this.circuitBreaker.execute(
        () => this.client.checkPermission({
          userId: operatorId,
          action: this.mapAction(action),
          resource: `${resourceType}:${resourceId}`,
        }),
        {
          timeout: 3000,
          fallback: () => ({ isGranted: false, denialReason: 'Service unavailable' }),
        }
      );

      // ===== Model Translation (ACL 核心) =====
      return this.translateToAuthorizationResult(permission);

    } catch (error) {
      // Fallback: deny by default
      return {
        authorized: false,
        reason: 'Authorization service unavailable',
      };
    }
  }

  /**
   * 模型轉換:將外部 BC 的 Permission 轉換為當前 BC 的 AuthorizationResult
   */
  private translateToAuthorizationResult(
    permission: ExternalPermission
  ): AuthorizationResult {
    return {
      authorized: permission.isGranted,
      reason: permission.denialReason,
    };
  }

  private mapAction(action: ActionType): string {
    // 若外部 BC 使用不同的 action 命名,在此轉換
    const mapping: Record<ActionType, string> = {
      create: 'CREATE',
      read: 'READ',
      update: 'UPDATE',
      delete: 'DELETE',
    };
    return mapping[action];
  }
}

Go 範例

Domain Service Interface

// domain/services/authorization.go
package services

type ActionType string
type ResourceType string

const (
    ActionCreate ActionType = "create"
    ActionRead   ActionType = "read"
    ActionUpdate ActionType = "update"
    ActionDelete ActionType = "delete"
)

type AuthorizationResult struct {
    Authorized bool
    Reason     string
}

// AuthorizationService - Domain layer interface
// This is the Anti-Corruption Layer entry point
type AuthorizationService interface {
    // CanExecute checks if the operator can perform the action
    // @pre operatorId must not be empty
    // @post returns AuthorizationResult, never returns error for check
    CanExecute(
        ctx context.Context,
        operatorID string,
        action ActionType,
        resourceType ResourceType,
        resourceID string,
    ) (*AuthorizationResult, error)
}

ACL Adapter

// infrastructure/acl/access_control_adapter.go
package acl

import (
    "context"
    "time"

    "myapp/domain/services"
    "myapp/infrastructure/clients"
    "myapp/infrastructure/resilience"
)

type AccessControlAuthorizationAdapter struct {
    client         *clients.AccessControlClient
    circuitBreaker *resilience.CircuitBreaker
    timeout        time.Duration
}

func NewAccessControlAuthorizationAdapter(
    client *clients.AccessControlClient,
    cb *resilience.CircuitBreaker,
) *AccessControlAuthorizationAdapter {
    return &AccessControlAuthorizationAdapter{
        client:         client,
        circuitBreaker: cb,
        timeout:        3 * time.Second,
    }
}

func (a *AccessControlAuthorizationAdapter) CanExecute(
    ctx context.Context,
    operatorID string,
    action services.ActionType,
    resourceType services.ResourceType,
    resourceID string,
) (*services.AuthorizationResult, error) {
    // ===== Pre-conditions =====
    if operatorID == "" {
        return nil, errors.New("operatorId must not be empty")
    }

    // Context with timeout
    ctx, cancel := context.WithTimeout(ctx, a.timeout)
    defer cancel()

    // Execute through circuit breaker
    result, err := a.circuitBreaker.Execute(ctx, func() (interface{}, error) {
        return a.client.CheckPermission(ctx, &clients.PermissionRequest{
            UserID:   operatorID,
            Action:   a.mapAction(action),
            Resource: fmt.Sprintf("%s:%s", resourceType, resourceID),
        })
    })

    if err != nil {
        // Fallback: deny by default
        return &services.AuthorizationResult{
            Authorized: false,
            Reason:     "Authorization service unavailable",
        }, nil
    }

    // ===== Model Translation (ACL 核心) =====
    permission := result.(*clients.Permission)
    return a.translateToAuthorizationResult(permission), nil
}

func (a *AccessControlAuthorizationAdapter) translateToAuthorizationResult(
    permission *clients.Permission,
) *services.AuthorizationResult {
    return &services.AuthorizationResult{
        Authorized: permission.IsGranted,
        Reason:     permission.DenialReason,
    }
}

func (a *AccessControlAuthorizationAdapter) mapAction(action services.ActionType) string {
    mapping := map[services.ActionType]string{
        services.ActionCreate: "CREATE",
        services.ActionRead:   "READ",
        services.ActionUpdate: "UPDATE",
        services.ActionDelete: "DELETE",
    }
    return mapping[action]
}

Use Case 整合範例

// 在 Use Case 中使用 AuthorizationService

export class CreateWorkflowUseCase {
  constructor(
    private readonly authorizationService: AuthorizationService,
    private readonly workflowRepository: WorkflowRepository,
    private readonly eventPublisher: EventPublisher,
  ) {}

  async execute(input: CreateWorkflowInput): Promise<CreateWorkflowOutput> {
    // ===== Cross-Context: Authorization Check =====
    const authResult = await this.authorizationService.canExecute(
      input.operatorId,
      'create',
      'Workflow',
      input.boardId,
    );

    if (!authResult.authorized) {
      throw new UnauthorizedError(
        `Not authorized to create workflow: ${authResult.reason}`
      );
    }

    // ===== Domain Logic =====
    const workflow = Workflow.create({
      boardId: new BoardId(input.boardId),
      name: input.name,
      createdBy: new UserId(input.operatorId),
    });

    await this.workflowRepository.save(workflow);
    await this.eventPublisher.publish(new WorkflowCreatedEvent(workflow));

    return {
      workflowId: workflow.id.value,
      status: workflow.status,
      createdAt: workflow.createdAt,
    };
  }
}

常見的跨 BC 場景

場景Source BCPattern說明
權限檢查AccessControlACL檢查操作權限
用戶資訊UserManagementACL取得用戶詳情
付款處理PaymentACL + Saga處理付款流程
通知發送NotificationOpen Host發送通知
審計日誌AuditPublished Language記錄操作

品質檢查清單

  • 是否明確識別上下游關係?
  • ACL 是否在 Infrastructure 層,介面在 Domain 層?
  • 模型轉換是否完整,不洩漏外部 BC 概念?
  • 是否有適當的容錯策略(timeout, retry, circuit breaker)?
  • Fallback 策略是否符合業務需求?
  • 是否有明確的 pre/post-conditions?
  • 是否可追溯到 Frame Concerns?

與其他 Skills 的協作

analyze-frame
    │
    ├── 識別 cross_context_dependencies
    │
    └── cross-context (本 Skill)
        │
        ├── 設計 ACL 規格
        │
        ├── 連結到 arch-guard (確保層次正確)
        │
        └── 連結到 command-sub-agent / query-sub-agent
            └── 在 Use Case 中整合 ACL

平台分布

trae

30.6%
按下载量换算20

Claude Code

22.76%
按下载量换算15

windsurf

15.93%
按下载量换算10

OpenCode

10.84%
按下载量换算7

Codex

6.86%
按下载量换算4

Antigravity

3.11%
按下载量换算2

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills