diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..a390150 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,16 @@ +name: skill-lint + +on: + push: + branches: [main] + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + with: + python-version: "3.12" + - run: python3 scripts/lint_skills.py diff --git a/README.md b/README.md index 545944e..4882bea 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ npx skills add full-stack-skills/java-skills --skill | `license-compliance-triage` | Evidence-backed dependency-license review that reduces scanner false positives, resolves multi-license expressions, binds decisions to exact versions, and separates conditional obligations from real blockers | | `unirest-java-3` | Unirest 3.x HTTP client for Java 8+ with Apache HttpClient, built-in GSON, per-request proxy, mocking, caching, and connection pool tuning | | `unirest-java-4` | Unirest 4.x HTTP client for Java 11+ with java.net.http, SSE, WebSocket, HTTP/2, ProxySelector, mocking, caching, and modular JSON support | -| `okhttp3-5.x` | OkHttp 5.x HTTP client for Java/JVM 8+ and Android 5+ with HTTP/2, transparent GZIP, Fast Fallback, MockWebServer, and GraalVM Native Image support | +| `okhttp5` | OkHttp 5.x HTTP client for Java/JVM 8+ and Android 5+ with HTTP/2, transparent GZIP, Fast Fallback, MockWebServer, and GraalVM Native Image support | | `sa-token` | Sa-Token core authentication framework — login, permission/role auth, annotation auth, route interceptor, session management, token configuration, front-back separation | | `sa-token-advanced` | Sa-Token advanced security — secondary auth (2FA), account banning (full/category/tiered), identity switching, multi-account systems, global listener & filter, password encryption, HTTP Basic/Digest | | `sa-token-sso` | Sa-Token SSO single sign-on — 3 modes (same-domain cookie, cross-domain redirect, cross-domain HTTP ticket), SSO-Server setup, SSO-Client integration, single logout | diff --git a/README.zh-CN.md b/README.zh-CN.md index 7ea89b4..dd05277 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -51,7 +51,7 @@ npx skills add full-stack-skills/java-skills --skill | `license-compliance-triage` | 基于证据的依赖许可证分诊,压降扫描误报、解析多许可证表达式、将结论绑定精确版本,并区分附带义务与真实阻断 | | `unirest-java-3` | Unirest 3.x HTTP 客户端,基于 Apache HttpClient,支持 Java 8+,内置 GSON,支持每请求代理、Mock 测试、缓存和连接池调优 | | `unirest-java-4` | Unirest 4.x HTTP 客户端,基于 java.net.http,支持 Java 11+,SSE、WebSocket、HTTP/2、ProxySelector、Mock 测试、缓存和模块化 JSON 支持 | -| `okhttp3-5.x` | OkHttp 5.x HTTP 客户端,支持 Java/JVM 8+ 和 Android 5+,HTTP/2、透明 GZIP、Fast Fallback、MockWebServer、GraalVM Native Image 支持 | +| `okhttp5` | OkHttp 5.x HTTP 客户端,支持 Java/JVM 8+ 和 Android 5+,HTTP/2、透明 GZIP、Fast Fallback、MockWebServer、GraalVM Native Image 支持 | | `sa-token` | Sa-Token 核心权限认证框架 — 登录认证、权限/角色认证、注解鉴权、路由拦截鉴权、Session 会话管理、框架配置、前后端分离 | | `sa-token-advanced` | Sa-Token 高级安全特性 — 二级认证、账号封禁(全/分类/阶梯)、身份切换、多账号体系(StpUserUtil/StpKit)、全局侦听器与过滤器、密码加密、Http Basic/Digest | | `sa-token-sso` | Sa-Token SSO 单点登录 — 三种模式(同域Cookie/跨域重定向/跨域Http ticket)、Server 搭建、Client 接入、单点注销、前后端分离 H5 方案 | diff --git a/scripts/lint_skills.py b/scripts/lint_skills.py new file mode 100644 index 0000000..5f8daa7 --- /dev/null +++ b/scripts/lint_skills.py @@ -0,0 +1,72 @@ +"""Lint gate for skill packages: every skills//SKILL.md must be well-formed. + +Rules (exit 1 on any violation): +- every directory under skills/ contains SKILL.md +- frontmatter has a `name` equal to its directory name +- `description` is present, single-line (block scalars break some hosts), 20-1024 chars +- skill names are lowercase kebab-case without a `codex-` prefix +""" +import re +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +NAME_RE = re.compile(r"^[a-z0-9]+(-[a-z0-9]+)*$") + + +def frontmatter(text: str) -> dict: + if not text.startswith("---\n"): + return {} + end = text.find("\n---", 4) + if end == -1: + return {} + fields = {} + for line in text[4:end].splitlines(): + if line and not line.startswith(" ") and ":" in line: + key, _, value = line.partition(":") + fields[key.strip()] = value.strip() + elif line.startswith(" ") or line.startswith("-"): + # continuation of a block scalar or list: mark parent as multiline + if fields: + last = next(reversed(fields)) + fields[last] = fields[last] + "\n" + line + return fields + + +def main() -> int: + errors = [] + skills_dir = ROOT / "skills" + dirs = sorted(p for p in skills_dir.iterdir() if p.is_dir()) + if not dirs: + errors.append("skills/ has no skill directories") + for skill_dir in dirs: + skill_md = skill_dir / "SKILL.md" + if not skill_md.is_file(): + errors.append(f"{skill_dir.name}: missing SKILL.md") + continue + fm = frontmatter(skill_md.read_text()) + name = fm.get("name", "") + desc = fm.get("description", "") + if not name: + errors.append(f"{skill_dir.name}: frontmatter missing name") + elif name != skill_dir.name: + errors.append(f"{skill_dir.name}: name '{name}' != directory name") + if not NAME_RE.match(skill_dir.name): + errors.append(f"{skill_dir.name}: not lowercase kebab-case") + if skill_dir.name.startswith("codex-"): + errors.append(f"{skill_dir.name}: host-prefixed names are not allowed in source packages") + if not desc: + errors.append(f"{skill_dir.name}: frontmatter missing description") + else: + if "\n" in desc or desc in ("|", ">", "|-", ">-", "|+", ">+"): + errors.append(f"{skill_dir.name}: description must be single-line (no block scalars)") + elif not (20 <= len(desc) <= 1024): + errors.append(f"{skill_dir.name}: description length {len(desc)} outside 20..1024") + for error in errors: + print(f"ERROR: {error}") + print(f"lint_skills: {len(dirs)} skills, {len(errors)} errors") + return 1 if errors else 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/skills/caffeine-patterns/SKILL.md b/skills/caffeine-patterns/SKILL.md index eecb9ab..3d489e9 100644 --- a/skills/caffeine-patterns/SKILL.md +++ b/skills/caffeine-patterns/SKILL.md @@ -1,8 +1,6 @@ --- name: caffeine-patterns -description: | - Caffeine JVM 本地缓存技能。覆盖本地缓存 vs 远程缓存(Redis)选择决策树、expireAfterWrite vs expireAfterAccess vs refreshAfterWrite 三种过期策略对比与组合规则(refresh < expire)、CacheLoader加载与reload异步刷新模式、Spring Cache @Cacheable集成、maximumSize驱逐策略、recordStats缓存统计。 - 纠正 LLM:用 ConcurrentHashMap+手动过期、所有缓存走Redis、refreshAfterWrite > expireAfterWrite导致永远不刷新、CacheLoader返回null导致缓存穿透。 +description: Caffeine JVM 本地缓存技能。覆盖本地缓存 vs 远程缓存(Redis)选择决策树、expireAfterWrite vs expireAfterAccess vs refreshAfterWrite 三种过期策略对比与组合规则(refresh < expire)、CacheLoader加载与reload异步刷新模式、Spring Cache @Cacheable集成、maximumSize驱逐策略、recordStats缓存统计。 纠正 LLM:用 ConcurrentHashMap+手动过期、所有缓存走Redis、refreshAfterWrite > expireAfterWrite导致永远不刷新、CacheLoader返回null导致缓存穿透。 license: Apache-2.0 --- diff --git a/skills/commons-patterns/SKILL.md b/skills/commons-patterns/SKILL.md index 17976c3..ab9f085 100644 --- a/skills/commons-patterns/SKILL.md +++ b/skills/commons-patterns/SKILL.md @@ -1,8 +1,6 @@ --- name: commons-patterns -description: | - Apache Commons 最佳实践模式。从官方文档提炼,覆盖 Commons Lang3(StringUtils千面判空/isEmpty vs isBlank/Validate抛NullPointerException迁移)、Commons IO(IOUtils.toString大文件陷阱/FileUtils.lineIterator逐行读模式/FilenameUtils.normalize路径规范化)、Commons Collections4(CollectionUtils.union/intersection/subtract集合运算)。 - 纠正 LLM 误用:混淆 StringUtils.isBlank vs isEmpty、IOUtils.toString 读大文件OOM、不知道 LineIterator 逐行读模式、用 lang 而非 lang3 包名。 +description: Apache Commons 最佳实践模式。从官方文档提炼,覆盖 Commons Lang3(StringUtils千面判空/isEmpty vs isBlank/Validate抛NullPointerException迁移)、Commons IO(IOUtils.toString大文件陷阱/FileUtils.lineIterator逐行读模式/FilenameUtils.normalize路径规范化)、Commons Collections4(CollectionUtils.union/intersection/subtract集合运算)。 纠正 LLM 误用:混淆 StringUtils.isBlank vs isEmpty、IOUtils.toString 读大文件OOM、不知道 LineIterator 逐行读模式、用 lang 而非 lang3 包名。 license: Apache-2.0 --- diff --git a/skills/guava-patterns/SKILL.md b/skills/guava-patterns/SKILL.md index 77fffb8..de0ab3d 100644 --- a/skills/guava-patterns/SKILL.md +++ b/skills/guava-patterns/SKILL.md @@ -1,8 +1,6 @@ --- name: guava-patterns -description: | - Google Guava 最佳实践模式。从官方 wiki 提炼,覆盖 Immutable集合的 of/copyOf/builder 三模式与防御性拷贝规则、Cache 选择决策(LoadingCache vs Cache vs Caffeine)、Joiner/Splitter 不可变流水线、CharMatcher 替代正则、Preconditions 格式化消息校验、CaseFormat 命名互转。 - 纠正 LLM 误用:手写不可变集合、ConcurrentHashMap 替代 Cache、不知 CharMatcher。 +description: Google Guava 最佳实践模式。从官方 wiki 提炼,覆盖 Immutable集合的 of/copyOf/builder 三模式与防御性拷贝规则、Cache 选择决策(LoadingCache vs Cache vs Caffeine)、Joiner/Splitter 不可变流水线、CharMatcher 替代正则、Preconditions 格式化消息校验、CaseFormat 命名互转。 纠正 LLM 误用:手写不可变集合、ConcurrentHashMap 替代 Cache、不知 CharMatcher。 license: Apache-2.0 --- diff --git a/skills/hutool-patterns/SKILL.md b/skills/hutool-patterns/SKILL.md index 8e4dd0d..8474282 100644 --- a/skills/hutool-patterns/SKILL.md +++ b/skills/hutool-patterns/SKILL.md @@ -1,8 +1,6 @@ --- name: hutool-patterns -description: | - Hutool 中文 Java 工具库技能。覆盖与 Guava/Apache Commons 的功能选择矩阵、字符串/集合/日期/文件/HTTP 最常用方法速查、HttpUtil vs OkHttp 选型、BeanUtil vs MapStruct 职责划分。 - 当用户在 Java 项目中需要中文场景的工具方法(拼音/身份证/手机号校验)、HTTP请求、文件操作、加解密时使用。避免 LLM 自造轮子而不用 Hutool。 +description: Hutool 中文 Java 工具库技能。覆盖与 Guava/Apache Commons 的功能选择矩阵、字符串/集合/日期/文件/HTTP 最常用方法速查、HttpUtil vs OkHttp 选型、BeanUtil vs MapStruct 职责划分。 当用户在 Java 项目中需要中文场景的工具方法(拼音/身份证/手机号校验)、HTTP请求、文件操作、加解密时使用。避免 LLM 自造轮子而不用 Hutool。 license: Apache-2.0 --- diff --git a/skills/jackson-patterns/SKILL.md b/skills/jackson-patterns/SKILL.md index b6e7dbe..f22d86d 100644 --- a/skills/jackson-patterns/SKILL.md +++ b/skills/jackson-patterns/SKILL.md @@ -1,8 +1,6 @@ --- name: jackson-patterns -description: | - Jackson JSON 序列化技能。覆盖日期格式配置(非ISO-8601)、Null序列化规则(数组→[]/字符串→""/数字→null)、@JsonView分层、ObjectMapper单例规则、TypeReference泛型反序列化、@JsonProperty/@JsonFormat/@JsonIgnore注解原则、与Spring Boot集成。 - 当用户处理JSON序列化/反序列化、配置ObjectMapper、解决日期格式或null处理问题时使用。 +description: Jackson JSON 序列化技能。覆盖日期格式配置(非ISO-8601)、Null序列化规则(数组→[]/字符串→""/数字→null)、@JsonView分层、ObjectMapper单例规则、TypeReference泛型反序列化、@JsonProperty/@JsonFormat/@JsonIgnore注解原则、与Spring Boot集成。 当用户处理JSON序列化/反序列化、配置ObjectMapper、解决日期格式或null处理问题时使用。 license: Apache-2.0 --- diff --git a/skills/java-code-comments/SKILL.md b/skills/java-code-comments/SKILL.md index cce249b..f976b16 100644 --- a/skills/java-code-comments/SKILL.md +++ b/skills/java-code-comments/SKILL.md @@ -1,13 +1,6 @@ --- name: java-code-comments -description: | - Provides comprehensive guidance for adding Java code comments following industry standards and best practices. - This skill helps add class-level comments, method-level comments, and field-level comments to Java code. - Use when the user wants to add comments to Java code, needs to document Java classes/methods/fields, - wants to improve code documentation, or needs to generate JavaDoc comments. This skill covers Controller, - Service, ServiceImpl, Mapper, Model, Entity, BO (Business Object), DTO, VO, and other common Java - component types. The skill follows a systematic workflow: scan codebase, identify components, create - todo list, and add comments in order (class comments → method comments → field comments). +description: "Provides comprehensive guidance for adding Java code comments following industry standards and best practices. This skill helps add class-level comments, method-level comments, and field-level comments to Java code. Use when the user wants to add comments to Java code, needs to document Java classes/methods/fields, wants to improve code documentation, or needs to generate JavaDoc comments. This skill covers Controller, Service, ServiceImpl, Mapper, Model, Entity, BO (Business Object), DTO, VO, and other common Java component types. The skill follows a systematic workflow: scan codebase, identify components, create todo list, and add comments in order (class comments → method comments → field comments)." license: Apache-2.0 --- diff --git a/skills/java-component-patterns/SKILL.md b/skills/java-component-patterns/SKILL.md index 9a85ce7..647c005 100644 --- a/skills/java-component-patterns/SKILL.md +++ b/skills/java-component-patterns/SKILL.md @@ -1,9 +1,6 @@ --- name: java-component-patterns -description: | - Java 组件(SDK/工具库,非 Spring Boot starter)封装规范。无 parent 独立 POM 结构、licenses/scm/developers 元数据三段、三段式 properties(基础/Dependency versions/Plugin versions 自然排序)、Jackson BOM 统一版本管理、maven.compiler.release 的 API 安全用法、多 JDK 分支模型(feature/{line} → JDK 8/17/21)、组件间同线依赖、tag 发布与 SNAPSHOT 滚动、JaCoCo 90% 门禁、pom.xml 4 空格缩进格式化。 - 纠正 LLM:给独立组件加 spring-boot-starter-parent、java.version 写 8(应写 1.8)、properties 不分类不排序、漏 licenses/scm/developers 导致 Central 被拒、跨线依赖内部组件(1.0.x 依赖 2.0.x)、忘记无 parent 需自管全部插件版本、Jackson 依赖在 dm 中放无 version 条目遮蔽 BOM、License URL 用 http(应用 https)。 - 触发词:组件封装、SDK 开发、无 parent pom、独立库、java component、多 JDK 分支、xxx-java-sdk 模板、jackson-bom、Jackson 版本管理。 +description: Java 组件(SDK/工具库,非 Spring Boot starter)封装规范。无 parent 独立 POM 结构、licenses/scm/developers 元数据三段、三段式 properties(基础/Dependency versions/Plugin versions 自然排序)、Jackson BOM 统一版本管理、maven.compiler.release 的 API 安全用法、多 JDK 分支模型(feature/{line} → JDK 8/17/21)、组件间同线依赖、tag 发布与 SNAPSHOT 滚动、JaCoCo 90% 门禁、pom.xml 4 空格缩进格式化。 纠正 LLM:给独立组件加 spring-boot-starter-parent、java.version 写 8(应写 1.8)、properties 不分类不排序、漏 licenses/scm/developers 导致 Central 被拒、跨线依赖内部组件(1.0.x 依赖 2.0.x)、忘记无 parent 需自管全部插件版本、Jackson 依赖在 dm 中放无 version 条目遮蔽 BOM、License URL 用 http(应用 https)。 触发词:组件封装、SDK 开发、无 parent pom、独立库、java component、多 JDK 分支、xxx-java-sdk 模板、jackson-bom、Jackson 版本管理。 license: Apache-2.0 --- diff --git a/skills/java-development-manual/SKILL.md b/skills/java-development-manual/SKILL.md index fed904f..48fdea4 100644 --- a/skills/java-development-manual/SKILL.md +++ b/skills/java-development-manual/SKILL.md @@ -1,13 +1,8 @@ --- name: java-development-manual license: Apache-2.0 -description: | - Java开发手册规约集合,基于阿里巴巴Java开发手册(嵩山版)。 - 涵盖7大维度:编程规约、异常日志、单元测试、安全规约、MySQL数据库、工程结构、设计规约。 - 当用户需要:(1) 编写或审查Java代码 (2) 检查命名/代码规范 (3) 处理异常和日志 (4) 编写单元测试 (5) 安全编码 (6) 数据库设计 (7) 工程架构设计时使用此skill。 - 触发词:Java规范、阿里规约、代码规范、开发手册、编程规约、异常处理、单元测试、安全、MySQL、工程结构、设计模式。 +description: Java开发手册规约集合,基于阿里巴巴Java开发手册(嵩山版)。 涵盖7大维度:编程规约、异常日志、单元测试、安全规约、MySQL数据库、工程结构、设计规约。 当用户需要:(1) 编写或审查Java代码 (2) 检查命名/代码规范 (3) 处理异常和日志 (4) 编写单元测试 (5) 安全编码 (6) 数据库设计 (7) 工程架构设计时使用此skill。 触发词:Java规范、阿里规约、代码规范、开发手册、编程规约、异常处理、单元测试、安全、MySQL、工程结构、设计模式。 --- - # Java开发手册(嵩山版) ## 概述 @@ -158,42 +153,3 @@ try { 2. **性能问题** → 查看 [mysql.md](references/mysql.md) 的"索引规约" 3. **并发问题** → 查看 [coding-convention.md](references/coding-convention.md) 的"并发处理" -## 能力边界 - -### ✅ 适用场景 -- 当你需要使用此技能对应的技术栈时 -- 当项目需要遵循最佳实践时 -- 当需要快速上手或深入理解核心概念时 - -### ⚠️ 需要注意 -- 复杂业务逻辑需要结合具体场景调整 -- 性能优化需要根据实际数据量评估 - -### ❌ 不适用场景 -- 不相关的技术栈或框架 -- 需要完全自定义的特殊场景 - -## 常见陷阱 (Gotchas) - -1. **版本兼容性**:注意框架版本与依赖库的兼容性,不同版本 API 可能有差异 -2. **配置文件格式**:配置文件格式错误是最常见的问题,建议使用编辑器的语法检查 -3. **环境变量**:确保所有必要的环境变量已正确设置,敏感信息不要硬编码 -4. **依赖冲突**:多版本共存时注意依赖冲突,使用 lock 文件锁定版本 -5. **性能陷阱**:大数据量场景下注意性能优化,避免 N+1 查询等常见问题 - -## 使用流程 - -### Step 1: 环境准备 -确保开发环境已安装必要的依赖和工具。 - -### Step 2: 配置初始化 -根据项目需求进行基础配置。 - -### Step 3: 核心功能使用 -按照示例代码实现核心功能。 - -### Step 4: 测试验证 -运行测试确保功能正常。 - -### Step 5: 部署上线 -完成开发后进行部署和监控。 diff --git a/skills/junit-mockito-patterns/SKILL.md b/skills/junit-mockito-patterns/SKILL.md index 181d9ce..94c852c 100644 --- a/skills/junit-mockito-patterns/SKILL.md +++ b/skills/junit-mockito-patterns/SKILL.md @@ -1,8 +1,6 @@ --- name: junit-mockito-patterns -description: | - JUnit5 + Mockito 测试框架技能。覆盖 JUnit5 @ExtendWith替代@RunWith、Mockito @Mock/@InjectMocks规则、测试隔离原则(FIRST)、@SpringBootTest何时用何时不用(@WebMvcTest/@DataJpaTest切片测试)、BDDMockito given/willReturn风格、ArgumentCaptor参数捕获、verify行为验证、@ParameterizedTest参数化测试。 - 当用户编写 Java 单元测试/集成测试、Mock外部依赖时需要此技能。 +description: JUnit5 + Mockito 测试框架技能。覆盖 JUnit5 @ExtendWith替代@RunWith、Mockito @Mock/@InjectMocks规则、测试隔离原则(FIRST)、@SpringBootTest何时用何时不用(@WebMvcTest/@DataJpaTest切片测试)、BDDMockito given/willReturn风格、ArgumentCaptor参数捕获、verify行为验证、@ParameterizedTest参数化测试。 当用户编写 Java 单元测试/集成测试、Mock外部依赖时需要此技能。 license: Apache-2.0 --- diff --git a/skills/kafka-patterns/SKILL.md b/skills/kafka-patterns/SKILL.md index 1d99229..da93d2f 100644 --- a/skills/kafka-patterns/SKILL.md +++ b/skills/kafka-patterns/SKILL.md @@ -1,8 +1,6 @@ --- name: kafka-patterns -description: | - Apache Kafka 消息队列技能。覆盖生产者 acks=all/1/0 选择决策、幂等性(enable.idempotence + acks=all)配置、消费者手动提交 offset(enable.auto.commit=false)、DLT死信处理(@RetryableTopic/@DltHandler)、@KafkaListener + 异常处理器(DefaultErrorHandler)、顺序消息(同一Key发同一分区)、事务消息。 - 纠正 LLM:acks=0 丢消息、auto.commit 漏消息、不处理重复消费、不配置 DLT。 +description: Apache Kafka 消息队列技能。覆盖生产者 acks=all/1/0 选择决策、幂等性(enable.idempotence + acks=all)配置、消费者手动提交 offset(enable.auto.commit=false)、DLT死信处理(@RetryableTopic/@DltHandler)、@KafkaListener + 异常处理器(DefaultErrorHandler)、顺序消息(同一Key发同一分区)、事务消息。 纠正 LLM:acks=0 丢消息、auto.commit 漏消息、不处理重复消费、不配置 DLT。 license: Apache-2.0 --- diff --git a/skills/lombok-patterns/SKILL.md b/skills/lombok-patterns/SKILL.md index 23c100d..ea093c1 100644 --- a/skills/lombok-patterns/SKILL.md +++ b/skills/lombok-patterns/SKILL.md @@ -1,8 +1,6 @@ --- name: lombok-patterns -description: | - Lombok 注解使用规则技能。覆盖 @Data/@Builder/@Slf4j 组合规则、@EqualsAndHashCode(callSuper=true)继承陷阱、与Jackson/@Builder/@Jacksonized组合、与MyBatis无参构造器冲突解决、@Value不可变对象、@With对象复制、@SuperBuilder继承Builder。 - 纠正 LLM 最常见的 Lombok 误用:不写 callSuper、不加 @Jacksonized、Builder 与继承冲突、@Builder.Default 默认值丢失。 +description: Lombok 注解使用规则技能。覆盖 @Data/@Builder/@Slf4j 组合规则、@EqualsAndHashCode(callSuper=true)继承陷阱、与Jackson/@Builder/@Jacksonized组合、与MyBatis无参构造器冲突解决、@Value不可变对象、@With对象复制、@SuperBuilder继承Builder。 纠正 LLM 最常见的 Lombok 误用:不写 callSuper、不加 @Jacksonized、Builder 与继承冲突、@Builder.Default 默认值丢失。 license: Apache-2.0 --- diff --git a/skills/mapstruct-patterns/SKILL.md b/skills/mapstruct-patterns/SKILL.md index 67bae76..7e4c6f1 100644 --- a/skills/mapstruct-patterns/SKILL.md +++ b/skills/mapstruct-patterns/SKILL.md @@ -1,8 +1,6 @@ --- name: mapstruct-patterns -description: | - MapStruct 最佳实践模式。从官方 Reference Guide 提炼,覆盖 Mapper 三种定义方式(接口/抽象类/default方法)、Spring 注入策略(CONSTRUCTOR推荐/SETTER解决循环依赖)、嵌套映射模式(显式子方法 > dot notation 一次性配置)、@Qualifier > @Named 的安全选择、Lombok 集成规则、@MappingComposition 谨慎使用。 - 纠正 LLM 最常见的错误:用反射 BeanUtils 而非编译期 MapStruct、嵌套映射全写在一个方法、不知 SETTER 解决循环依赖。 +description: MapStruct 最佳实践模式。从官方 Reference Guide 提炼,覆盖 Mapper 三种定义方式(接口/抽象类/default方法)、Spring 注入策略(CONSTRUCTOR推荐/SETTER解决循环依赖)、嵌套映射模式(显式子方法 > dot notation 一次性配置)、@Qualifier > @Named 的安全选择、Lombok 集成规则、@MappingComposition 谨慎使用。 纠正 LLM 最常见的错误:用反射 BeanUtils 而非编译期 MapStruct、嵌套映射全写在一个方法、不知 SETTER 解决循环依赖。 license: Apache-2.0 --- diff --git a/skills/maven-search/SKILL.md b/skills/maven-search/SKILL.md index b0c671a..03e7b35 100644 --- a/skills/maven-search/SKILL.md +++ b/skills/maven-search/SKILL.md @@ -3,7 +3,6 @@ name: maven-search description: Provides comprehensive guidance for searching and retrieving Maven components from Maven Central Repository (https://repo1.maven.org/maven2/). This skill enables searching by groupId, artifactId, version, and other coordinates, retrieving component metadata (POM files, JARs, sources, Javadoc), querying version history, and analyzing dependencies. Use when the user needs to find, verify, or retrieve Maven dependencies, check component versions, analyze dependency trees, or work with Maven coordinates. license: Apache-2.0 --- - ## When to use this skill **ALWAYS use this skill when the user mentions:** @@ -56,13 +55,13 @@ To search for Maven components: 3. **Follow the specific instructions** in that example file for API endpoints, parameters, and best practices 4. **Use Maven Central Repository API**: - + **Search API** (https://search.maven.org/solrsearch/select): - Query parameter: `q` - Search query (e.g., `g:com.google.guava AND a:guava`) - Rows parameter: `rows` - Number of results (default: 20, max: 200) - Start parameter: `start` - Pagination offset - Core parameter: `core` - Search core (default: `gav`) - + **Direct Repository Access** (https://repo1.maven.org/maven2/): - Path format: `{groupId}/{artifactId}/{version}/{artifactId}-{version}.{extension}` - GroupId path: Replace dots with slashes (e.g., `com.google.guava` → `com/google/guava`) @@ -73,12 +72,12 @@ To search for Maven components: - Javadoc: `{artifactId}-{version}-javadoc.jar` 5. **Construct the appropriate URL**: - + **Search Example**: ``` https://search.maven.org/solrsearch/select?q=g:com.google.guava+AND+a:guava&rows=20&wt=json ``` - + **Direct Access Example**: ``` https://repo1.maven.org/maven2/com/google/guava/guava/maven-metadata.xml @@ -214,42 +213,3 @@ Maven, Maven 中央仓库, Maven 仓库, Maven 依赖, Maven 组件, Maven 坐 - **Maven Central Search API Documentation**: https://central.sonatype.com/search-api/ - **Maven Coordinates Guide**: https://maven.apache.org/guides/mini/guide-naming-conventions.html -## 能力边界 - -### ✅ 适用场景 -- 当你需要使用此技能对应的技术栈时 -- 当项目需要遵循最佳实践时 -- 当需要快速上手或深入理解核心概念时 - -### ⚠️ 需要注意 -- 复杂业务逻辑需要结合具体场景调整 -- 性能优化需要根据实际数据量评估 - -### ❌ 不适用场景 -- 不相关的技术栈或框架 -- 需要完全自定义的特殊场景 - -## 常见陷阱 (Gotchas) - -1. **版本兼容性**:注意框架版本与依赖库的兼容性,不同版本 API 可能有差异 -2. **配置文件格式**:配置文件格式错误是最常见的问题,建议使用编辑器的语法检查 -3. **环境变量**:确保所有必要的环境变量已正确设置,敏感信息不要硬编码 -4. **依赖冲突**:多版本共存时注意依赖冲突,使用 lock 文件锁定版本 -5. **性能陷阱**:大数据量场景下注意性能优化,避免 N+1 查询等常见问题 - -## 使用流程 - -### Step 1: 环境准备 -确保开发环境已安装必要的依赖和工具。 - -### Step 2: 配置初始化 -根据项目需求进行基础配置。 - -### Step 3: 核心功能使用 -按照示例代码实现核心功能。 - -### Step 4: 测试验证 -运行测试确保功能正常。 - -### Step 5: 部署上线 -完成开发后进行部署和监控。 diff --git a/skills/mybatis-patterns/SKILL.md b/skills/mybatis-patterns/SKILL.md index 5e24ed7..2ae3948 100644 --- a/skills/mybatis-patterns/SKILL.md +++ b/skills/mybatis-patterns/SKILL.md @@ -1,8 +1,6 @@ --- name: mybatis-patterns -description: | - MyBatis 核心 ORM 技能。覆盖 XML vs 注解 SQL选择、ResultMap复用(extends)、关联查询(association/collection join vs 嵌套select/N+1决策)、分页插件配置、#和$的SQL注入防护、动态SQL(if/where/set/foreach/choose)最佳实践、columnPrefix解决同表多次JOIN。 - 当用户编写 MyBatis Mapper XML、处理关联查询、配置分页、防范SQL注入时使用。 +description: MyBatis 核心 ORM 技能。覆盖 XML vs 注解 SQL选择、ResultMap复用(extends)、关联查询(association/collection join vs 嵌套select/N+1决策)、分页插件配置、#和$的SQL注入防护、动态SQL(if/where/set/foreach/choose)最佳实践、columnPrefix解决同表多次JOIN。 当用户编写 MyBatis Mapper XML、处理关联查询、配置分页、防范SQL注入时使用。 license: Apache-2.0 --- diff --git a/skills/mybatis-plus-generator/SKILL.md b/skills/mybatis-plus-generator/SKILL.md index 3bc73fb..1b5f9c3 100644 --- a/skills/mybatis-plus-generator/SKILL.md +++ b/skills/mybatis-plus-generator/SKILL.md @@ -1,15 +1,8 @@ --- name: mybatis-plus-generator -description: | - Provides comprehensive guidance for generating MyBatis-Plus code including Entity, Mapper, Service, ServiceImpl, - Controller, DTO, VO, BO and other related objects from database tables. Use ONLY when the user explicitly - mentions MyBatis-Plus, mybatis-plus-generator, or wants to generate code using MyBatis-Plus framework. - This skill automatically generates standard CRUD methods and custom methods based on user requirements for - MyBatis-Plus projects. Supports MVC and DDD architectures, Java and Kotlin languages. Do NOT trigger for - generic code generation, JPA/Hibernate, or other ORM frameworks. +description: Provides comprehensive guidance for generating MyBatis-Plus code including Entity, Mapper, Service, ServiceImpl, Controller, DTO, VO, BO and other related objects from database tables. Use ONLY when the user explicitly mentions MyBatis-Plus, mybatis-plus-generator, or wants to generate code using MyBatis-Plus framework. This skill automatically generates standard CRUD methods and custom methods based on user requirements for MyBatis-Plus projects. Supports MVC and DDD architectures, Java and Kotlin languages. Do NOT trigger for generic code generation, JPA/Hibernate, or other ORM frameworks. license: Apache-2.0 --- - ## When to use this skill **CRITICAL: This skill should ONLY be triggered when the user explicitly mentions MyBatis-Plus or mybatis-plus-generator.** @@ -474,25 +467,3 @@ MyBatis-Plus, mybatis-plus-generator, MyBatis-Plus 代码生成器, MyBatis-Plus **IMPORTANT**: All keywords must include "MyBatis-Plus" or "mybatis-plus" to avoid false triggers. Generic terms like "代码生成器" (code generator) or "根据表生成代码" (generate code from table) without "MyBatis-Plus" should NOT trigger this skill. -## 能力边界 - -### ✅ 适用场景 -- 当你需要使用此技能对应的技术栈时 -- 当项目需要遵循最佳实践时 -- 当需要快速上手或深入理解核心概念时 - -### ⚠️ 需要注意 -- 复杂业务逻辑需要结合具体场景调整 -- 性能优化需要根据实际数据量评估 - -### ❌ 不适用场景 -- 不相关的技术栈或框架 -- 需要完全自定义的特殊场景 - -## 常见陷阱 (Gotchas) - -1. **版本兼容性**:注意框架版本与依赖库的兼容性,不同版本 API 可能有差异 -2. **配置文件格式**:配置文件格式错误是最常见的问题,建议使用编辑器的语法检查 -3. **环境变量**:确保所有必要的环境变量已正确设置,敏感信息不要硬编码 -4. **依赖冲突**:多版本共存时注意依赖冲突,使用 lock 文件锁定版本 -5. **性能陷阱**:大数据量场景下注意性能优化,避免 N+1 查询等常见问题 diff --git a/skills/mybatis-plus-patterns/SKILL.md b/skills/mybatis-plus-patterns/SKILL.md index aac89e4..16b6ae0 100644 --- a/skills/mybatis-plus-patterns/SKILL.md +++ b/skills/mybatis-plus-patterns/SKILL.md @@ -1,9 +1,6 @@ --- name: mybatis-plus-patterns -description: | - MyBatis-Plus 增强 ORM 技能。覆盖 LambdaQueryWrapper vs QueryWrapper选择(始终Lambda)、分页插件(PaginationInnerInterceptor)配置、乐观锁(@Version + OptimisticLockerInnerInterceptor)、逻辑删除(@TableLogic 全局/局部配置)、自动填充(@TableField fill + MetaObjectHandler)、ActiveRecord vs Mapper模式选择、防全表更新(BlockAttackInnerInterceptor)、通用PageQuery抽取。 - 当用户使用 MyBatis-Plus 进行数据库操作、配置分页乐观锁、选择查询方式时使用。 - 与 mybatis 技能互补:mybatis 侧重XML/ResultMap/SQL写法,mybatis-plus 侧重增强功能。 +description: MyBatis-Plus 增强 ORM 技能。覆盖 LambdaQueryWrapper vs QueryWrapper选择(始终Lambda)、分页插件(PaginationInnerInterceptor)配置、乐观锁(@Version + OptimisticLockerInnerInterceptor)、逻辑删除(@TableLogic 全局/局部配置)、自动填充(@TableField fill + MetaObjectHandler)、ActiveRecord vs Mapper模式选择、防全表更新(BlockAttackInnerInterceptor)、通用PageQuery抽取。 当用户使用 MyBatis-Plus 进行数据库操作、配置分页乐观锁、选择查询方式时使用。 与 mybatis 技能互补:mybatis 侧重XML/ResultMap/SQL写法,mybatis-plus 侧重增强功能。 license: Apache-2.0 --- diff --git a/skills/okhttp3-5.x/SKILL.md b/skills/okhttp5/SKILL.md similarity index 99% rename from skills/okhttp3-5.x/SKILL.md rename to skills/okhttp5/SKILL.md index e8cfb54..b8e1669 100644 --- a/skills/okhttp3-5.x/SKILL.md +++ b/skills/okhttp5/SKILL.md @@ -1,5 +1,5 @@ --- -name: okhttp3-5.x +name: okhttp5 license: Apache-2.0 description: OkHttp 5.x HTTP client for Java/JVM 8+ and Android 5+. Use when making HTTP/HTTPS requests, building REST API clients, implementing connection pooling, response caching, request/response interceptors, certificate pinning, event monitoring, WebSocket connections, SSE consumption, or configuring TLS/cipher suites. Covers OkHttp 5.4.0 with HTTP/2, transparent GZIP, Fast Fallback (Happy Eyeballs), MockWebServer for testing, and GraalVM Native Image support. --- diff --git a/skills/okhttp3-5.x/examples/basic-usage.md b/skills/okhttp5/examples/basic-usage.md similarity index 100% rename from skills/okhttp3-5.x/examples/basic-usage.md rename to skills/okhttp5/examples/basic-usage.md diff --git a/skills/okhttp3-5.x/examples/caching-examples.md b/skills/okhttp5/examples/caching-examples.md similarity index 100% rename from skills/okhttp3-5.x/examples/caching-examples.md rename to skills/okhttp5/examples/caching-examples.md diff --git a/skills/okhttp3-5.x/examples/https-examples.md b/skills/okhttp5/examples/https-examples.md similarity index 100% rename from skills/okhttp3-5.x/examples/https-examples.md rename to skills/okhttp5/examples/https-examples.md diff --git a/skills/okhttp3-5.x/examples/interceptors-examples.md b/skills/okhttp5/examples/interceptors-examples.md similarity index 100% rename from skills/okhttp3-5.x/examples/interceptors-examples.md rename to skills/okhttp5/examples/interceptors-examples.md diff --git a/skills/okhttp3-5.x/references/caching.md b/skills/okhttp5/references/caching.md similarity index 100% rename from skills/okhttp3-5.x/references/caching.md rename to skills/okhttp5/references/caching.md diff --git a/skills/okhttp3-5.x/references/calls.md b/skills/okhttp5/references/calls.md similarity index 100% rename from skills/okhttp3-5.x/references/calls.md rename to skills/okhttp5/references/calls.md diff --git a/skills/okhttp3-5.x/references/configuration.md b/skills/okhttp5/references/configuration.md similarity index 100% rename from skills/okhttp3-5.x/references/configuration.md rename to skills/okhttp5/references/configuration.md diff --git a/skills/okhttp3-5.x/references/connections.md b/skills/okhttp5/references/connections.md similarity index 100% rename from skills/okhttp3-5.x/references/connections.md rename to skills/okhttp5/references/connections.md diff --git a/skills/okhttp3-5.x/references/events.md b/skills/okhttp5/references/events.md similarity index 100% rename from skills/okhttp3-5.x/references/events.md rename to skills/okhttp5/references/events.md diff --git a/skills/okhttp3-5.x/references/https.md b/skills/okhttp5/references/https.md similarity index 100% rename from skills/okhttp3-5.x/references/https.md rename to skills/okhttp5/references/https.md diff --git a/skills/okhttp3-5.x/references/interceptors.md b/skills/okhttp5/references/interceptors.md similarity index 100% rename from skills/okhttp3-5.x/references/interceptors.md rename to skills/okhttp5/references/interceptors.md diff --git a/skills/okhttp3-5.x/references/recipes.md b/skills/okhttp5/references/recipes.md similarity index 100% rename from skills/okhttp3-5.x/references/recipes.md rename to skills/okhttp5/references/recipes.md diff --git a/skills/okhttp3-5.x/references/security.md b/skills/okhttp5/references/security.md similarity index 100% rename from skills/okhttp3-5.x/references/security.md rename to skills/okhttp5/references/security.md diff --git a/skills/redis-redisson-patterns/SKILL.md b/skills/redis-redisson-patterns/SKILL.md index b78834c..353f43a 100644 --- a/skills/redis-redisson-patterns/SKILL.md +++ b/skills/redis-redisson-patterns/SKILL.md @@ -1,8 +1,6 @@ --- name: redis-redisson-patterns -description: | - Redis + Redisson 缓存与分布式锁技能。覆盖缓存Key命名规范、过期时间设置原则、RedisTemplate序列化选择(JSON vs JDK vs String)、Redisson分布式锁三大模式(watchDog/tryLock 有leaseTime/无leaseTime 决策)、缓存穿透(布隆/空值缓存)/击穿(互斥锁)/雪崩(随机TTL)防护、Caffeine vs Redis选择决策。 - 纠正 LLM:不设过期时间、StringRedisTemplate和RedisTemplate混用、Redisson锁不 try-finally unlock、看门狗在指定 leaseTime 时不生效。 +description: Redis + Redisson 缓存与分布式锁技能。覆盖缓存Key命名规范、过期时间设置原则、RedisTemplate序列化选择(JSON vs JDK vs String)、Redisson分布式锁三大模式(watchDog/tryLock 有leaseTime/无leaseTime 决策)、缓存穿透(布隆/空值缓存)/击穿(互斥锁)/雪崩(随机TTL)防护、Caffeine vs Redis选择决策。 纠正 LLM:不设过期时间、StringRedisTemplate和RedisTemplate混用、Redisson锁不 try-finally unlock、看门狗在指定 leaseTime 时不生效。 license: Apache-2.0 --- diff --git a/skills/sa-token-advanced/SKILL.md b/skills/sa-token-advanced/SKILL.md index 57e1f90..6fd5b79 100644 --- a/skills/sa-token-advanced/SKILL.md +++ b/skills/sa-token-advanced/SKILL.md @@ -1,9 +1,6 @@ --- name: sa-token-advanced -description: | - Sa-Token 高级安全特性技能。覆盖二级认证(safe-auth二次验证)、账号封禁(全封禁/分类封禁/阶梯封禁)、模拟他人与身份切换、多账号认证(StpUserUtil/StpKit)、全局侦听器(登录/注销/踢人/封禁/续签事件)、全局过滤器(SaServletFilter/SaReactorFilter)、密码加密(MD5/SHA1/SHA256/AES/RSA/BCrypt/TOTP)、会话查询(终端列表/全局搜索Token)、Http Basic/Digest认证、防火墙(IP黑白名单/频率限制)、自定义鉴权注解、路由鉴权动态化、反向代理URI修复、异步Mock上下文、数据架构Redis键值设计。 - 当用户需要实现敏感操作二次验证、账号分级封禁、模拟用户操作、多套账号体系(User/Admin分离)、全局事件监听、密码加密工具时使用。 - 基础登录认证请使用 sa-token 技能。 +description: Sa-Token 高级安全特性技能。覆盖二级认证(safe-auth二次验证)、账号封禁(全封禁/分类封禁/阶梯封禁)、模拟他人与身份切换、多账号认证(StpUserUtil/StpKit)、全局侦听器(登录/注销/踢人/封禁/续签事件)、全局过滤器(SaServletFilter/SaReactorFilter)、密码加密(MD5/SHA1/SHA256/AES/RSA/BCrypt/TOTP)、会话查询(终端列表/全局搜索Token)、Http Basic/Digest认证、防火墙(IP黑白名单/频率限制)、自定义鉴权注解、路由鉴权动态化、反向代理URI修复、异步Mock上下文、数据架构Redis键值设计。 当用户需要实现敏感操作二次验证、账号分级封禁、模拟用户操作、多套账号体系(User/Admin分离)、全局事件监听、密码加密工具时使用。 基础登录认证请使用 sa-token 技能。 license: Apache-2.0 --- diff --git a/skills/sa-token-api-security/SKILL.md b/skills/sa-token-api-security/SKILL.md index 38fe8d9..5f44f49 100644 --- a/skills/sa-token-api-security/SKILL.md +++ b/skills/sa-token-api-security/SKILL.md @@ -1,9 +1,6 @@ --- name: sa-token-api-security -description: | - Sa-Token API 安全防御技能。覆盖 API 参数签名(sa-token-sign)防篡改防重放(timestamp+nonce+sign四步演进)、API Key(sa-token-apikey)部分授权与Scope控制(可吊销/可限权)、临时Token(SaTempUtil内嵌核心包)短效链接邀请。 - API签名支持多应用(多secret-key)模式和多种摘要算法(md5/sha256/sha512)。API Key支持多账号体系、数据库持久化模式。临时Token支持前缀裁剪、反向查询、JWT集成。 - 基础登录认证请先使用 sa-token 技能。 +description: Sa-Token API 安全防御技能。覆盖 API 参数签名(sa-token-sign)防篡改防重放(timestamp+nonce+sign四步演进)、API Key(sa-token-apikey)部分授权与Scope控制(可吊销/可限权)、临时Token(SaTempUtil内嵌核心包)短效链接邀请。 API签名支持多应用(多secret-key)模式和多种摘要算法(md5/sha256/sha512)。API Key支持多账号体系、数据库持久化模式。临时Token支持前缀裁剪、反向查询、JWT集成。 基础登录认证请先使用 sa-token 技能。 license: Apache-2.0 --- diff --git a/skills/sa-token-integration/SKILL.md b/skills/sa-token-integration/SKILL.md index e908d28..53a90cb 100644 --- a/skills/sa-token-integration/SKILL.md +++ b/skills/sa-token-integration/SKILL.md @@ -1,9 +1,6 @@ --- name: sa-token-integration -description: | - Sa-Token 集成扩展技能。覆盖 JWT 集成(Simple/Mixin/Stateless三种模式对比表)、Redis持久化(JDK序列化/JSON序列化)、Alone-Redis独立Redis(鉴权缓存与业务缓存隔离)、AOP注解鉴权(Service层使用注解)、SpEL表达式注解(@SaCheckEL)、Quick-Login快速登录(零代码登录页)、JSON序列化扩展(Jackson/Fastjson/Fastjson2/Snack3)、模板引擎集成(Thymeleaf/Freemarker标签方言)、RPC集成(Dubbo/Dubbo3/gRPC上下文传播)。 - 当用户需要集成JWT实现无状态认证、配置Redis分布式会话、缓存隔离、Service层注解鉴权、快速搭建登录页面时使用。 - 基础登录认证请先使用 sa-token 技能。 +description: Sa-Token 集成扩展技能。覆盖 JWT 集成(Simple/Mixin/Stateless三种模式对比表)、Redis持久化(JDK序列化/JSON序列化)、Alone-Redis独立Redis(鉴权缓存与业务缓存隔离)、AOP注解鉴权(Service层使用注解)、SpEL表达式注解(@SaCheckEL)、Quick-Login快速登录(零代码登录页)、JSON序列化扩展(Jackson/Fastjson/Fastjson2/Snack3)、模板引擎集成(Thymeleaf/Freemarker标签方言)、RPC集成(Dubbo/Dubbo3/gRPC上下文传播)。 当用户需要集成JWT实现无状态认证、配置Redis分布式会话、缓存隔离、Service层注解鉴权、快速搭建登录页面时使用。 基础登录认证请先使用 sa-token 技能。 license: Apache-2.0 --- diff --git a/skills/sa-token-micro/SKILL.md b/skills/sa-token-micro/SKILL.md index eeea025..11d3541 100644 --- a/skills/sa-token-micro/SKILL.md +++ b/skills/sa-token-micro/SKILL.md @@ -1,9 +1,6 @@ --- name: sa-token-micro -description: | - Sa-Token 微服务鉴权技能。覆盖 Same-Token 内部服务外网隔离机制、SpringCloud Gateway 网关统一鉴权(Reactor响应式)、Feign/Dubbo/gRPC 内部RPC调用鉴权、分布式Session会话方案(Redis Session中心/JWT无状态)、Reactor/WebFlux框架集成、SpringBoot3/4依赖适配。 - 当用户需要微服务架构下的服务间认证、网关Token转发与校验、内部服务外网隔离、分布式会话共享时使用。 - 基础登录认证请先使用 sa-token 技能。 +description: Sa-Token 微服务鉴权技能。覆盖 Same-Token 内部服务外网隔离机制、SpringCloud Gateway 网关统一鉴权(Reactor响应式)、Feign/Dubbo/gRPC 内部RPC调用鉴权、分布式Session会话方案(Redis Session中心/JWT无状态)、Reactor/WebFlux框架集成、SpringBoot3/4依赖适配。 当用户需要微服务架构下的服务间认证、网关Token转发与校验、内部服务外网隔离、分布式会话共享时使用。 基础登录认证请先使用 sa-token 技能。 license: Apache-2.0 --- diff --git a/skills/sa-token-oauth2/SKILL.md b/skills/sa-token-oauth2/SKILL.md index 44886f0..f8f8ade 100644 --- a/skills/sa-token-oauth2/SKILL.md +++ b/skills/sa-token-oauth2/SKILL.md @@ -1,10 +1,6 @@ --- name: sa-token-oauth2 -description: | - Sa-Token OAuth2.0 服务端技能。覆盖四种授权模式:授权码模式(Authorization Code)、隐式模式(Implicit)、密码模式(Password)、客户端凭证模式(Client Credentials)。 - 完整 OAuth2-Server 搭建、SaOAuth2DataLoader 数据加载器、Scope 权限自定义与分级、OIDC 协议、OpenId/UnionId、自定义 grant_type、自定义登录授权页、注解校验 Access-Token、与登录会话互通、Scope level 等级控制、自定义API路由。 - 当用户需要搭建OAuth2.0认证服务器、开发开放平台、实现第三方应用授权时使用。 - 基础登录认证请先使用 sa-token 技能。 +description: Sa-Token OAuth2.0 服务端技能。覆盖四种授权模式:授权码模式(Authorization Code)、隐式模式(Implicit)、密码模式(Password)、客户端凭证模式(Client Credentials)。 完整 OAuth2-Server 搭建、SaOAuth2DataLoader 数据加载器、Scope 权限自定义与分级、OIDC 协议、OpenId/UnionId、自定义 grant_type、自定义登录授权页、注解校验 Access-Token、与登录会话互通、Scope level 等级控制、自定义API路由。 当用户需要搭建OAuth2.0认证服务器、开发开放平台、实现第三方应用授权时使用。 基础登录认证请先使用 sa-token 技能。 license: Apache-2.0 --- diff --git a/skills/sa-token-sso/SKILL.md b/skills/sa-token-sso/SKILL.md index e45edb2..3d5ba0f 100644 --- a/skills/sa-token-sso/SKILL.md +++ b/skills/sa-token-sso/SKILL.md @@ -1,10 +1,6 @@ --- name: sa-token-sso -description: | - Sa-Token SSO 单点登录专项技能。覆盖三种SSO模式完整方案:模式一(同域+同Redis/Cookie共享)、模式二(跨域+同Redis/URL重定向)、模式三(跨域+跨Redis/Http ticket)。 - SSO-Server认证中心搭建、SSO-Client接入、单点注销、自定义登录页面、前后端分离SSO(H5方案)、消息推送、匿名Client、域名校验、NoSdk非Java接入、自定义API路由、平台中心跳转。 - 当用户需要多系统统一登录/注销、搭建单点登录认证中心、跨域SSO集成时使用。 - 基础登录认证请先使用 sa-token 技能。 +description: Sa-Token SSO 单点登录专项技能。覆盖三种SSO模式完整方案:模式一(同域+同Redis/Cookie共享)、模式二(跨域+同Redis/URL重定向)、模式三(跨域+跨Redis/Http ticket)。 SSO-Server认证中心搭建、SSO-Client接入、单点注销、自定义登录页面、前后端分离SSO(H5方案)、消息推送、匿名Client、域名校验、NoSdk非Java接入、自定义API路由、平台中心跳转。 当用户需要多系统统一登录/注销、搭建单点登录认证中心、跨域SSO集成时使用。 基础登录认证请先使用 sa-token 技能。 license: Apache-2.0 --- diff --git a/skills/sa-token/SKILL.md b/skills/sa-token/SKILL.md index a397921..577bfc7 100644 --- a/skills/sa-token/SKILL.md +++ b/skills/sa-token/SKILL.md @@ -1,10 +1,6 @@ --- name: sa-token -description: | - Sa-Token 轻量级 Java 权限认证框架核心技能。覆盖登录认证、权限/角色认证、注解鉴权、路由拦截鉴权、Session 会话、踢人下线、Token 有效期策略、框架配置、Token 风格与提交前缀、前后端分离、记住我模式、同端互斥登录、NotLoginException 场景值处理。 - StpUtil 是核心门面工具类,提供 login/checkLogin/logout/isLogin/getLoginId/getTokenValue 等全套鉴权 API。 - 当用户需要 Java Web 项目集成权限认证、使用 StpUtil 进行登录/权限校验、配置路由拦截器或注解鉴权时使用。 - 不涉及二级认证/封禁/多账号/SSO/OAuth2/微服务/API安全/JWT/Redis 等高级功能,请使用对应专项技能。 +description: Sa-Token 轻量级 Java 权限认证框架核心技能。覆盖登录认证、权限/角色认证、注解鉴权、路由拦截鉴权、Session 会话、踢人下线、Token 有效期策略、框架配置、Token 风格与提交前缀、前后端分离、记住我模式、同端互斥登录、NotLoginException 场景值处理。 StpUtil 是核心门面工具类,提供 login/checkLogin/logout/isLogin/getLoginId/getTokenValue 等全套鉴权 API。 当用户需要 Java Web 项目集成权限认证、使用 StpUtil 进行登录/权限校验、配置路由拦截器或注解鉴权时使用。 不涉及二级认证/封禁/多账号/SSO/OAuth2/微服务/API安全/JWT/Redis 等高级功能,请使用对应专项技能。 license: Apache-2.0 --- diff --git a/skills/seata-patterns/SKILL.md b/skills/seata-patterns/SKILL.md index f2c2f9a..0ba3f5b 100644 --- a/skills/seata-patterns/SKILL.md +++ b/skills/seata-patterns/SKILL.md @@ -1,8 +1,6 @@ --- name: seata-patterns -description: | - Seata 分布式事务技能。覆盖 AT/TCC/SAGA/XA 四模式选择决策树、AT模式 undo_log 表必备、TCC 模式 useTCCFence 解决幂等/悬挂/空回滚、SAGA 状态机长流程、全局事务超时配置(@GlobalTransactional timeoutMills)、读隔离增强(@GlobalLock + FOR UPDATE)。 - 纠正 LLM:不知道 AT/TCC/SAGA选哪个、不建 undo_log 表、TCC Confirm非幂等、不看门狗处理。 +description: Seata 分布式事务技能。覆盖 AT/TCC/SAGA/XA 四模式选择决策树、AT模式 undo_log 表必备、TCC 模式 useTCCFence 解决幂等/悬挂/空回滚、SAGA 状态机长流程、全局事务超时配置(@GlobalTransactional timeoutMills)、读隔离增强(@GlobalLock + FOR UPDATE)。 纠正 LLM:不知道 AT/TCC/SAGA选哪个、不建 undo_log 表、TCC Confirm非幂等、不看门狗处理。 license: Apache-2.0 --- diff --git a/skills/spring-boot-starter-patterns/SKILL.md b/skills/spring-boot-starter-patterns/SKILL.md index 66fea9e..1388c44 100644 --- a/skills/spring-boot-starter-patterns/SKILL.md +++ b/skills/spring-boot-starter-patterns/SKILL.md @@ -1,9 +1,6 @@ --- name: spring-boot-starter-patterns -description: | - Spring Boot Starter 开发规范(组织无关)。标准 POM 结构(元素顺序铁律、properties 三段式分类+自然排序、licenses/scm/developers 元数据三段、完整 build/profiles)、十分支版本矩阵(2.3.x~4.1.x ↔ Spring Boot 2.3.12~4.1.0 ↔ JDK 8/17/21)、十 tag 发布工作流(tag → Maven Central → SNAPSHOT 月度滚动)、JDK 兼容规则、JaCoCo 90% 覆盖率门禁。 - 纠正 LLM:properties 不分类不排序、漏 licenses/scm/developers 导致 Central 发布被拒、java.version 写 1.8 触发编译失败、surefire argLine 丢 ${argLine} 导致 JaCoCo 失效、把 okhttp 等通用库当默认依赖复制。 - 触发词:starter 开发、pom 标准化、分支版本矩阵、tag 发布、版本滚动、多 Spring Boot 版本适配、新建 xxx-spring-boot-starter。 +description: Spring Boot Starter 开发规范(组织无关)。标准 POM 结构(元素顺序铁律、properties 三段式分类+自然排序、licenses/scm/developers 元数据三段、完整 build/profiles)、十分支版本矩阵(2.3.x~4.1.x ↔ Spring Boot 2.3.12~4.1.0 ↔ JDK 8/17/21)、十 tag 发布工作流(tag → Maven Central → SNAPSHOT 月度滚动)、JDK 兼容规则、JaCoCo 90% 覆盖率门禁。 纠正 LLM:properties 不分类不排序、漏 licenses/scm/developers 导致 Central 发布被拒、java.version 写 1.8 触发编译失败、surefire argLine 丢 ${argLine} 导致 JaCoCo 失效、把 okhttp 等通用库当默认依赖复制。 触发词:starter 开发、pom 标准化、分支版本矩阵、tag 发布、版本滚动、多 Spring Boot 版本适配、新建 xxx-spring-boot-starter。 license: Apache-2.0 --- diff --git a/skills/unirest-java-3/SKILL.md b/skills/unirest-java-3/SKILL.md index 81d58bf..687a155 100644 --- a/skills/unirest-java-3/SKILL.md +++ b/skills/unirest-java-3/SKILL.md @@ -1,12 +1,7 @@ --- name: unirest-java-3 license: Apache-2.0 -description: > - Unirest-Java 3.x HTTP client library for Java 8+. Use when making HTTP requests (GET/POST/PUT/DELETE), - building REST API clients, handling JSON responses, file uploads/downloads, async requests, - mocking HTTP calls for testing, configuring proxies, or caching responses. - Covers Unirest 3.x (Apache HttpClient based, default GSON included, kong.unirest package) with - object mapping, request/response interceptors, and migration guidance. +description: Unirest-Java 3.x HTTP client library for Java 8+. Use when making HTTP requests (GET/POST/PUT/DELETE), building REST API clients, handling JSON responses, file uploads/downloads, async requests, mocking HTTP calls for testing, configuring proxies, or caching responses. Covers Unirest 3.x (Apache HttpClient based, default GSON included, kong.unirest package) with object mapping, request/response interceptors, and migration guidance. --- # Unirest-Java 3.x Reference (v3.14.5) diff --git a/skills/unirest-java-4/SKILL.md b/skills/unirest-java-4/SKILL.md index bcbe970..297fd6c 100644 --- a/skills/unirest-java-4/SKILL.md +++ b/skills/unirest-java-4/SKILL.md @@ -1,12 +1,7 @@ --- name: unirest-java-4 license: Apache-2.0 -description: > - Unirest-Java 4.x HTTP client library for Java 11+. Use when making HTTP requests (GET/POST/PUT/DELETE), - building REST API clients, handling JSON responses, file uploads/downloads, async requests, - Server-Sent Events (SSE), mocking HTTP calls for testing, configuring proxies, or caching responses. - Covers Unirest 4.x (requires Java 11+, modular dependencies, kong.unirest.core package) with - GSON/Jackson object mapping, request/response interceptors, and migration from Unirest 3.x. +description: Unirest-Java 4.x HTTP client library for Java 11+. Use when making HTTP requests (GET/POST/PUT/DELETE), building REST API clients, handling JSON responses, file uploads/downloads, async requests, Server-Sent Events (SSE), mocking HTTP calls for testing, configuring proxies, or caching responses. Covers Unirest 4.x (requires Java 11+, modular dependencies, kong.unirest.core package) with GSON/Jackson object mapping, request/response interceptors, and migration from Unirest 3.x. --- # Unirest-Java 4.x Reference (v4.10.0) diff --git a/skills/xxl-job-patterns/SKILL.md b/skills/xxl-job-patterns/SKILL.md index 192503e..cdb5da4 100644 --- a/skills/xxl-job-patterns/SKILL.md +++ b/skills/xxl-job-patterns/SKILL.md @@ -1,8 +1,6 @@ --- name: xxl-job-patterns -description: | - XXL-JOB 最佳实践模式。基于 hiwepy/xxljob-spring-boot-starter 定制封装,覆盖 @XxlJobCron 注解替代原生 @XxlJob(代码即配置/cron写在代码里/启动时自动注册到admin)、XxlJobTemplate 编程式任务管理(CRUD/启停/触发/session自动续期)、执行器自动配置(Unirest SSL/端口兜底/Nacos适配)、Micrometer指标集成、v2/v3双版本兼容。 - 纠正 LLM 误用:用 @Scheduled 替代分布式调度、不知道 XxlJobTemplate 的编程式管理、不知道 @XxlJobCron 的 selfStarting 自动注册模式。 +description: XXL-JOB 最佳实践模式。基于 hiwepy/xxljob-spring-boot-starter 定制封装,覆盖 @XxlJobCron 注解替代原生 @XxlJob(代码即配置/cron写在代码里/启动时自动注册到admin)、XxlJobTemplate 编程式任务管理(CRUD/启停/触发/session自动续期)、执行器自动配置(Unirest SSL/端口兜底/Nacos适配)、Micrometer指标集成、v2/v3双版本兼容。 纠正 LLM 误用:用 @Scheduled 替代分布式调度、不知道 XxlJobTemplate 的编程式管理、不知道 @XxlJobCron 的 selfStarting 自动注册模式。 license: Apache-2.0 ---