Token导航 LogoToken导航

Agent Skill · 运维和基础设施

java-dev(Java DEV 搜索)

用于辅助 Java 项目开发、面向对象设计、Spring 生态、Maven 或 Gradle 依赖和后端工程实践。它适合让 Agent 分析类结构、设计接口、整理服务分层、生成测试或检查常见代码坏味道。使用时需要结合项目已有架构、包结构和依赖版本,不应只按通用教程改代码;涉及数据库、事务、并发或框架配置时,应先确认运行环境和回归测试范围。

java-dev 是运维和基础设施类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证为 MIT,第三方扫描有未通过项,按安装量在运维和基础设施类的 2,449 个 Skill 里排第 1,049。

总安装 955周安装 39GitHub Stars 5下载 309核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/story-has-you/skills --skill java-dev

这个 Skill 是做什么的

运维和基础设施类 Skill 处理部署、监控、日志和云资源,多数需要较高的执行权限。

这项技能确保所有 Java 代码都遵守阿里巴巴的行业标准编码指南。始终优先考虑: 可读性胜过聪明性 安全重于便利 可维护性优于快速修复 标准高于个人喜好 如有疑问,请查阅详细的参考文档以获取具体指导。

每周安装量 39 存储库 故事里有你/技能 GitHub 之星 5 第一次看到 2026 年 1 月 22 日 安全审计 Gen 代理信任中心失败 套接字通行证 斯尼克通行证

来源仓库内路径:skills/java-dev

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

java-dev 怎么安装?

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

java-dev 支持哪些 AI 工具?

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

java-dev 需要什么权限?

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

java-dev 是免费的吗?

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

java-dev 用的人多吗?

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

java-dev 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理运维和基础设施类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

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

运维和基础设施类 Skill 对比

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

头脑风暴 · Codex、Claude

3,148,776173,131操作浏览器MIT通过
copywriting

文案写作 · Codex、Claude

1,996,72425,583需要联网MIT通过
openclaw-secure-linux-cloud

OpenClaw secure linux cloud 命令行 · Codex、Claude

1,853,08840接触敏感数据未明确未通过
xget

xget 命令行 · Codex、Claude

1,799,28040执行命令未明确未通过
requesting-code-review

代码审查请求 · Codex、Claude

1,590,144173,103权限未标注MIT通过
java-dev

Java DEV 搜索 · 本页

9555只读MIT未通过

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

SKILL.md 原文

Java Development - Alibaba Coding Guidelines

Overview

This skill provides comprehensive Java development guidance based on the Alibaba Java Coding Guidelines (Songshan Edition). It ensures all Java code follows industry best practices covering naming conventions, coding standards, concurrency, exception handling, database design, security, testing, and architectural design.

Core Principles

When writing Java code, always follow these fundamental principles:

  1. Code Readability: Write code that is easy to understand and maintain
  2. Consistency: Follow consistent naming and formatting conventions
  3. Safety First: Prevent common pitfalls like NPE, SQL injection, and concurrency issues
  4. Performance Awareness: Consider performance implications of design decisions
  5. Test Coverage: Ensure adequate unit test coverage for critical code

Quick Reference

Naming Conventions

  • Classes: UpperCamelCase (e.g., UserService, OrderController)
  • Methods/Variables: lowerCamelCase (e.g., getUserById, userName)
  • Constants: UPPER_SNAKE_CASE (e.g., MAX_COUNT, DEFAULT_SIZE)
  • Packages: lowercase, single word preferred (e.g., com.company.module)

Common Patterns

  • Abstract classes: Abstract* or Base* prefix
  • Exception classes: *Exception suffix
  • Test classes: *Test suffix
  • Service implementations: *Impl suffix
  • Boolean variables: No is prefix in POJO classes
  • DAO methods: get* (single), list* (multiple), count*, save*, remove*, update*

Critical Rules

  • ❌ Never use magic numbers directly in code
  • ❌ Never catch exceptions without handling them
  • ❌ Never use == to compare wrapper types (use equals())
  • ❌ Never create threads directly (use thread pools)
  • ❌ Never use SELECT * in SQL queries
  • ✅ Always use parameterized queries to prevent SQL injection
  • ✅ Always specify initial capacity for collections when size is known
  • ✅ Always close resources in finally blocks or use try-with-resources
  • ✅ Always validate external inputs

Workflow

1. Before Writing Code

Check the detailed guidelines:

2. Writing Code

Apply the following checks as you write:

Naming

  • Class names use UpperCamelCase
  • Method/variable names use lowerCamelCase
  • Constants use UPPER_SNAKE_CASE
  • Meaningful English names (no pinyin)

Code Structure

  • Methods under 80 lines
  • Single responsibility per class/method
  • Proper access modifiers (private by default)
  • Use @Override for overridden methods

Common Pitfalls to Avoid

// ❌ Wrong: Magic numbers
if (status == 1) { ... }

// ✅ Correct: Named constants
private static final int STATUS_ACTIVE = 1;
if (status == STATUS_ACTIVE) { ... }

// ❌ Wrong: Comparing wrapper types with ==
Integer a = 128;
Integer b = 128;
if (a == b) { ... }  // May fail!

// ✅ Correct: Use equals()
if (a.equals(b)) { ... }

// ❌ Wrong: Empty catch block
try {
    doSomething();
} catch (Exception e) {
    // Silent failure
}

// ✅ Correct: Handle or rethrow
try {
    doSomething();
} catch (Exception e) {
    logger.error("Failed to do something", e);
    throw new BusinessException("Operation failed", e);
}

// ❌ Wrong: Creating threads directly
new Thread(() -> doWork()).start();

// ✅ Correct: Use thread pool
ExecutorService executor = new ThreadPoolExecutor(
    corePoolSize, maxPoolSize, keepAliveTime,
    TimeUnit.SECONDS, new LinkedBlockingQueue<>(),
    new ThreadFactoryBuilder().setNameFormat("worker-%d").build()
);
executor.submit(() -> doWork());

3. Database Operations

Table Design

  • Table names: lowercase with underscores (e.g., user_order)
  • Required fields: id, create_time, update_time
  • Boolean fields: is_* prefix (e.g., is_deleted)
  • Use BIGINT UNSIGNED for IDs
  • Use DECIMAL for monetary values (never FLOAT or DOUBLE)

SQL Best Practices

// ✅ Correct: Parameterized query
String sql = "SELECT id, user_name, email FROM user WHERE id = ?";
PreparedStatement ps = conn.prepareStatement(sql);
ps.setLong(1, userId);

// ✅ Correct: MyBatis parameter binding
@Select("SELECT * FROM user WHERE user_name = #{userName}")
User selectByUserName(@Param("userName") String userName);

// ❌ Wrong: String concatenation (SQL injection risk!)
String sql = "SELECT * FROM user WHERE user_name = '" + userName + "'";

4. Exception Handling

Exception Hierarchy

  • Use specific exception types
  • Checked exceptions for recoverable errors
  • Unchecked exceptions for programming errors
  • Always include context in exception messages
// ✅ Correct exception handling
public User getUserById(Long userId) {
    if (userId == null) {
        throw new IllegalArgumentException("userId cannot be null");
    }

    User user = userDao.selectById(userId);
    if (user == null) {
        throw new NotFoundException("User not found: " + userId);
    }

    return user;
}

// ✅ Correct logging with exception
try {
    processOrder(order);
} catch (Exception e) {
    logger.error("Failed to process order, orderId: {}", order.getId(), e);
    throw new BusinessException("订单处理失败", e);
}

5. Concurrency

Thread Safety Rules

  • Use ThreadPoolExecutor instead of Executors
  • Name your threads for debugging
  • Use volatile for visibility, AtomicXxx for atomic operations
  • Avoid SimpleDateFormat in multi-threaded code (use DateTimeFormatter)
  • Clean up ThreadLocal variables
// ✅ Correct: Thread pool with proper configuration
ThreadPoolExecutor executor = new ThreadPoolExecutor(
    10,  // corePoolSize
    20,  // maximumPoolSize
    60L, // keepAliveTime
    TimeUnit.SECONDS,
    new LinkedBlockingQueue<>(100),
    new ThreadFactoryBuilder().setNameFormat("order-processor-%d").build(),
    new ThreadPoolExecutor.CallerRunsPolicy()
);

// ✅ Correct: ThreadLocal cleanup
private static final ThreadLocal<User> USER_CONTEXT = new ThreadLocal<>();

public void processRequest() {
    try {
        USER_CONTEXT.set(getCurrentUser());
        // Process request
    } finally {
        USER_CONTEXT.remove();  // Critical: prevent memory leak
    }
}

6. Security

Input Validation

  • Validate all external inputs
  • Use parameterized queries (never string concatenation)
  • Sanitize HTML output to prevent XSS
  • Implement CSRF protection
  • Mask sensitive data in logs
// ✅ Correct: Input validation
public void createUser(UserCreateRequest request) {
    if (StringUtils.isBlank(request.getUserName())) {
        throw new ValidationException("用户名不能为空");
    }
    if (!ValidationUtils.isValidMobile(request.getMobile())) {
        throw new ValidationException("手机号格式不正确");
    }
    // Process...
}

// ✅ Correct: Sensitive data masking
logger.info("User login, mobile: {}", maskMobile(user.getMobile()));

7. Unit Testing

Testing Standards

  • Test class naming: *Test
  • Test method naming: test*
  • Target coverage: 70% statement coverage minimum
  • Use JUnit 5 + Mockito
  • Follow BCDE principle (Border, Correct, Design, Error)
@ExtendWith(MockitoExtension.class)
public class UserServiceTest {

    @Mock
    private UserDao userDao;

    @InjectMocks
    private UserService userService;

    @Test
    @DisplayName("根据ID获取用户 - 正常情况")
    public void testGetUserById_Success() {
        // Given
        Long userId = 1L;
        User mockUser = new User();
        mockUser.setId(userId);
        mockUser.setUserName("test");
        when(userDao.selectById(userId)).thenReturn(mockUser);

        // When
        User result = userService.getUserById(userId);

        // Then
        assertNotNull(result);
        assertEquals(userId, result.getId());
        verify(userDao, times(1)).selectById(userId);
    }

    @Test
    @DisplayName("根据ID获取用户 - 参数为null")
    public void testGetUserById_NullParameter() {
        assertThrows(IllegalArgumentException.class, () -> {
            userService.getUserById(null);
        });
    }
}

Code Review Checklist

When reviewing Java code, verify:

Naming & Style

  • Class names use UpperCamelCase
  • Method/variable names use lowerCamelCase
  • Constants use UPPER_SNAKE_CASE
  • No magic numbers in code
  • Meaningful English names (no pinyin)

Code Quality

  • Methods under 80 lines
  • Single responsibility principle followed
  • Proper access modifiers used
  • No duplicate code
  • Proper exception handling

Safety

  • No NPE risks (null checks where needed)
  • Wrapper types compared with equals(), not ==
  • Resources properly closed (try-with-resources or finally)
  • Thread-safe if used in concurrent context
  • Input validation for external data

Database

  • Parameterized queries (no SQL injection risk)
  • Specific columns selected (no SELECT *)
  • Proper indexes defined
  • Transaction boundaries correct

Performance

  • Collection initial capacity specified when size known
  • String concatenation uses StringBuilder in loops
  • Appropriate data structures chosen
  • No unnecessary object creation in loops

Testing

  • Unit tests exist for new code
  • Edge cases covered
  • Exception cases tested
  • Mock dependencies properly

Reference Documentation

For detailed guidelines on specific topics, consult these reference documents:

naming-conventions.md

Complete naming rules for classes, methods, variables, packages, and domain models.

coding-standards.md

Detailed coding standards including constants, formatting, OOP rules, date/time handling, collections, and control statements.

concurrency.md

Comprehensive concurrency guidelines covering thread pools, locks, volatile, concurrent collections, and common patterns.

exception-logging.md

Exception handling best practices and logging standards using SLF4J.

database.md

MySQL database design rules, indexing strategies, SQL optimization, and ORM mapping conventions.

security.md

Security guidelines covering input validation, SQL injection prevention, XSS protection, CSRF defense, encryption, and sensitive data handling.

testing.md

Unit testing standards, frameworks (JUnit 5, Mockito), coverage requirements, and testing patterns.

design.md

Design principles, layered architecture, domain models, design patterns, and API design conventions.

Common Scenarios

Scenario 1: Creating a New Service Class

  1. Read naming-conventions.md for service naming rules
  2. Read coding-standards.md for class structure
  3. Read exception-logging.md for error handling
  4. Implement following the patterns shown above
  5. Add unit tests following testing.md

Scenario 2: Database Table Design

  1. Read database.md for table design rules
  2. Ensure required fields: id, create_time, update_time
  3. Use proper data types (DECIMAL for money, BIGINT for IDs)
  4. Add appropriate indexes
  5. Create corresponding DO class following naming conventions

Scenario 3: Implementing Concurrent Processing

  1. Read concurrency.md for thread pool configuration
  2. Use ThreadPoolExecutor with proper parameters
  3. Name threads for debugging
  4. Handle exceptions in worker threads
  5. Clean up ThreadLocal variables

Scenario 4: Security Review

  1. Read security.md for security checklist
  2. Verify input validation exists
  3. Check for SQL injection vulnerabilities
  4. Ensure sensitive data is masked in logs
  5. Verify authentication and authorization

Integration with Development Workflow

This skill integrates seamlessly into your development process:

  1. During Development: Reference quick rules above and detailed guidelines as needed
  2. Code Review: Use the checklist to ensure compliance
  3. Refactoring: Apply guidelines to improve existing code
  4. Onboarding: Use as training material for new team members

Summary

This skill ensures all Java code adheres to Alibaba's industry-standard coding guidelines. Always prioritize:

  • Readability over cleverness
  • Safety over convenience
  • Maintainability over quick fixes
  • Standards over personal preference

When in doubt, consult the detailed reference documents for specific guidance.

平台分布

Claude Code

30.64%
按下载量换算95

Codex

25.08%
按下载量换算77

OpenCode

18.66%
按下载量换算58

Gemini CLI

13.41%
按下载量换算41

trae

7.14%
按下载量换算22

Antigravity

3.54%
按下载量换算11

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

只读

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills