utility-components

3
1
Source

工具组件指南,涵盖 JWT 安全认证、表达式解析器、线程池循环工具、责任链模式等特定功能的工具类使用。当用户需要实现 JWT 认证、解析表达式、使用线程池或实现责任链时使用。

Install

mkdir -p .claude/skills/utility-components && curl -L -o skill.zip "https://mcp.directory/api/skills/download/3331" && unzip -o skill.zip -d .claude/skills/utility-components && rm skill.zip

Installs to .claude/skills/utility-components

About this skill

工具组件指南

Skill 概述

本 Skill 涵盖了 BK-CI 中常用的 4 类工具组件,这些是特定功能的工具类和组件实现。

核心主题

主题说明文档
JWT 安全认证JWT 生成验证、Token 刷新、OAuth21-jwt-security.md
表达式解析器变量表达式、条件求值、自定义函数2-expression-parser.md
线程池循环工具线程池配置、批量处理、循环工具类3-thread-pool-loop-util.md
责任链模式责任链设计、拦截器链、请求处理链4-chain-responsibility.md

⚠️ 与 common-technical-practices 的区别

定位对比

Skill定位关注点典型场景
common-technical-practices框架级实践如何在 Spring Boot 中使用技术AOP 切面、分布式锁、重试机制、参数校验、性能监控、定时任务、审计日志
utility-components (本 Skill)工具级组件如何使用特定的工具类和组件JWT 认证、表达式解析、线程池使用、责任链实现

使用选择

需要实现横切关注点(AOP、锁、重试、监控)
    → 使用 common-technical-practices

需要使用特定工具类(JWT、表达式、线程池、责任链)
    → 使用 utility-components (本 Skill)

示例对比:

  • 需要 添加性能监控切面common-technical-practices (reference/5-performance-monitoring.md)
  • 需要 使用线程池批量处理utility-components (reference/3-thread-pool-loop-util.md)
  • 需要 实现分布式锁common-technical-practices (reference/2-distributed-lock.md)
  • 需要 实现 JWT 认证utility-components (reference/1-jwt-security.md)

工具组件架构

组件分层视图

┌─────────────────────────────────────────────────────────────┐
│                    BK-CI 业务逻辑层                          │
│      (Process/Project/Store/Auth/Repository...)            │
└─────────────────────────────────────────────────────────────┘
                           ↓
        ┌──────────────────┼──────────────────┐
        │                  │                  │
   ┌────▼────┐       ┌────▼────┐       ┌────▼────┐
   │  JWT    │       │  表达式  │       │  线程池  │
   │  认证   │       │  解析   │       │  工具   │
   └─────────┘       └─────────┘       └─────────┘
        │                  │                  │
        └──────────────────┼──────────────────┘
                           ↓
                  ┌────────────────┐
                  │  责任链模式    │
                  │  (拦截器链)    │
                  └────────────────┘

一、JWT 安全认证

详见 reference/1-jwt-security.md

核心功能

  • JWT Token 生成与验证
  • Token 刷新机制
  • 权限校验拦截器
  • OAuth2 集成

快速开始

// 生成 JWT Token
val token = JwtManager.generateToken(userId, expireTime)

// 验证 Token
val claims = JwtManager.verifyToken(token)

二、表达式解析器

详见 reference/2-expression-parser.md

核心功能

  • 变量表达式解析 (${variable})
  • 条件表达式求值
  • 自定义函数扩展
  • 表达式缓存优化

快速开始

// 解析变量表达式
val context = mapOf("buildId" to "b-123", "status" to "success")
val result = ExpressionParser.parse("${buildId}_${status}", context)
// 结果: "b-123_success"

三、线程池与循环工具

详见 reference/3-thread-pool-loop-util.md

核心功能

  • 线程池配置与管理
  • 批量任务并发处理
  • 循环工具类 (LoopUtil)
  • 并发控制与优化

快速开始

// 批量并发处理
val results = ThreadPoolUtil.executeBatch(taskList) { task ->
    processTask(task)
}

// 循环重试
LoopUtil.loopWithRetry(maxRetries = 3) {
    callExternalApi()
}

四、责任链模式

详见 reference/4-chain-responsibility.md

核心功能

  • 责任链设计与实现
  • 拦截器链模式
  • 流水线插件链
  • 请求处理链

快速开始

// 定义拦截器链
val chain = InterceptorChain()
    .addInterceptor(AuthInterceptor())
    .addInterceptor(ValidationInterceptor())
    .addInterceptor(LoggingInterceptor())

// 执行链
chain.proceed(request)

使用场景决策树

用户需求
    ↓
是横切关注点(AOP/锁/重试/监控)?
    ├─ 是 → 使用 common-technical-practices
    └─ 否 → 是否需要特定工具类?
              ├─ JWT 认证 → utility-components (reference/1)
              ├─ 表达式解析 → utility-components (reference/2)
              ├─ 线程池处理 → utility-components (reference/3)
              ├─ 责任链模式 → utility-components (reference/4)
              └─ 其他 → 查找对应模块 Skill

相关 Skill


Quick Reference

需求使用 Skill参考章节
实现 JWT 认证utility-componentsreference/1-jwt-security.md
解析流水线变量utility-componentsreference/2-expression-parser.md
批量并发处理utility-componentsreference/3-thread-pool-loop-util.md
实现拦截器链utility-componentsreference/4-chain-responsibility.md
添加 AOP 切面common-technical-practicesreference/1-aop-aspect.md
实现分布式锁common-technical-practicesreference/2-distributed-lock.md
配置重试机制common-technical-practicesreference/3-retry-mechanism.md

project-module-architecture

TencentBlueKing

Project 项目管理模块架构指南,涵盖项目 CRUD、成员管理、项目配置、标签管理、项目迁移。当用户开发项目管理功能、处理项目成员、配置项目属性或实现项目相关逻辑时使用。

126

microservice-infrastructure

TencentBlueKing

微服务基础设施指南,涵盖条件配置、事件驱动架构、服务间通信、国际化与日志等微服务架构的核心基础设施。当用户实现服务间调用、配置多环境、实现异步通信、处理国际化或规范日志输出时使用。

114

artifactory-module-architecture

TencentBlueKing

Artifactory 制品库模块架构指南,涵盖制品上传下载、存储后端适配、制品元数据、清理策略、权限控制。当用户开发制品库功能、处理制品存储、配置清理策略或实现制品管理时使用。

193

supporting-modules-architecture

TencentBlueKing

BK-CI 支撑模块架构指南,涵盖凭证管理(Ticket)、构建机环境(Environment)、通知服务(Notify)、构建日志(Log)、质量红线(Quality)、开放接口(OpenAPI)等支撑性服务模块。当用户开发这些模块功能或需要理解支撑服务架构时使用。

132

managing-devops-pipeline

TencentBlueKing

管理蓝盾流水线的构建操作,包括查询构建历史、获取启动参数、查看构建状态、启动构建。当用户提及流水线、构建、部署、CI/CD、蓝盾或需要触发构建任务时使用。

102

go-agent-development

TencentBlueKing

Go Agent 开发指南,涵盖 Agent 架构设计、心跳机制、任务执行、日志上报、升级流程、与 Dispatch 模块交互。当用户开发构建机 Agent、实现任务执行逻辑、处理 Agent 通信或进行 Go 语言开发时使用。

12

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

1,6771,424

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

1,2541,315

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

1,5241,142

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

1,346805

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

1,260725

pdf-to-markdown

aliceisjustplaying

Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.

1,465673