docs/ja-JP/skills/quarkus-verification/SKILL.md
Quarkusプロジェクト検証ループ:ビルド、静的分析、カバレッジ付きテスト、セキュリティスキャン、ネイティブコンパイル、本番環境またはPR前の差分レビュー。
npx skillsauth add affaan-m/everything-claude-code quarkus-verificationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
PR、メジャー変更後、および本番前に実行します。
# Maven
mvn clean verify -DskipTests
# Gradle
./gradlew clean assemble -x test
ビルド失敗時は停止してコンパイルエラーを修正します。
mvn checkstyle:check pmd:check spotbugs:check
mvn sonar:sonar \
-Dsonar.projectKey=my-quarkus-project \
-Dsonar.host.url=http://localhost:9000 \
-Dsonar.login=${SONAR_TOKEN}
# 全テスト実行
mvn clean test
# カバレッジレポート生成
mvn jacoco:report
# カバレッジ閾値を強制(80%)
mvn jacoco:check
# またはGradleで
./gradlew test jacocoTestReport jacocoTestCoverageVerification
モック化された依存関係でサービスロジックテスト:
@ExtendWith(MockitoExtension.class)
class UserServiceTest {
@Mock UserRepository userRepository;
@InjectMocks UserService userService;
@Test
void createUser_validInput_returnsUser() {
var dto = new CreateUserDto("Alice", "[email protected]");
// Panacheのpersist()はvoid — doNothing + verifyを使用
doNothing().when(userRepository).persist(any(User.class));
User result = userService.create(dto);
assertThat(result.name).isEqualTo("Alice");
verify(userRepository).persist(any(User.class));
}
}
実データベース(Testcontainers)でテスト:
@QuarkusTest
@QuarkusTestResource(PostgresTestResource.class)
class UserRepositoryIntegrationTest {
@Inject
UserRepository userRepository;
@Test
@Transactional
void findByEmail_existingUser_returnsUser() {
User user = new User();
user.name = "Alice";
user.email = "[email protected]";
userRepository.persist(user);
Optional<User> found = userRepository.findByEmail("[email protected]");
assertThat(found).isPresent();
assertThat(found.get().name).isEqualTo("Alice");
}
}
REST Assured でRESTエンドポイントテスト:
@QuarkusTest
class UserResourceTest {
@Test
void createUser_validInput_returns201() {
given()
.contentType(ContentType.JSON)
.body("""
{"name": "Alice", "email": "[email protected]"}
""")
.when().post("/api/users")
.then()
.statusCode(201)
.body("name", equalTo("Alice"));
}
@Test
void createUser_invalidEmail_returns400() {
given()
.contentType(ContentType.JSON)
.body("""
{"name": "Alice", "email": "invalid"}
""")
.when().post("/api/users")
.then()
.statusCode(400);
}
}
詳細なカバレッジに対してtarget/site/jacoco/index.htmlを確認:
mvn org.owasp:dependency-check-maven:check
CVEについて target/dependency-check-report.html を確認。
# 脆弱な拡張機能をチェック
mvn quarkus:audit
# 全拡張機能をリスト
mvn quarkus:list-extensions
docker run -t owasp/zap2docker-stable zap-api-scan.py \
-t http://localhost:8080/q/openapi \
-f openapi
GraalVM ネイティブイメージ互換性テスト:
# ネイティブ実行ファイルビルド
mvn package -Dnative
# またはコンテナで
mvn package -Dnative -Dquarkus.native.container-build=true
# ネイティブ実行ファイルテスト
./target/*-runner
# 基本スモークテスト実行
curl http://localhost:8080/q/health/live
curl http://localhost:8080/q/health/ready
一般的な問題:
quarkus.native.resources.includesでリソース含めるリフレクション設定例:
@RegisterForReflection(targets = {MyDynamicClass.class})
public class ReflectionConfiguration {}
// load-test.js
import http from 'k6/http';
import { check } from 'k6';
export const options = {
stages: [
{ duration: '30s', target: 50 },
{ duration: '1m', target: 100 },
{ duration: '30s', target: 0 },
],
};
export default function () {
const res = http.get('http://localhost:8080/api/markets');
check(res, {
'status is 200': (r) => r.status === 200,
'response time < 200ms': (r) => r.timings.duration < 200,
});
}
実行:
k6 run load-test.js
# Liveness
curl http://localhost:8080/q/health/live
# Readiness
curl http://localhost:8080/q/health/ready
# 全ヘルスチェック
curl http://localhost:8080/q/health
# メトリクス(有効な場合)
curl http://localhost:8080/q/metrics
期待されるレスポンス:
{
"status": "UP",
"checks": [
{
"name": "Database connection",
"status": "UP"
}
]
}
# コンテナイメージビルド
mvn package -Dquarkus.container-image.build=true
# または特定のレジストリで
mvn package \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.registry=docker.io \
-Dquarkus.container-image.group=myorg \
-Dquarkus.container-image.tag=1.0.0
# コンテナテスト
docker run -p 8080:8080 myorg/my-quarkus-app:1.0.0
# Trivy
trivy image myorg/my-quarkus-app:1.0.0
# Grype
grype myorg/my-quarkus-app:1.0.0
# 全設定プロパティをチェック
mvn quarkus:info
# 全設定ソースをリスト
curl http://localhost:8080/q/dev/io.quarkus.quarkus-vertx-http/config
/q/swagger-ui)OpenAPI spec生成:
curl http://localhost:8080/q/openapi -o openapi.json
#!/bin/bash
set -e
echo "=== Phase 1: Build ==="
mvn clean verify -DskipTests
echo "=== Phase 2: Static Analysis ==="
mvn checkstyle:check pmd:check spotbugs:check
echo "=== Phase 3: Tests + Coverage ==="
mvn test jacoco:report jacoco:check
echo "=== Phase 4: Security Scan ==="
mvn org.owasp:dependency-check-maven:check
echo "=== Phase 5: Native Compilation ==="
mvn package -Dnative -Dquarkus.native.container-build=true
echo "=== All Phases Complete ==="
echo "Review reports:"
echo " - Coverage: target/site/jacoco/index.html"
echo " - Security: target/dependency-check-report.html"
echo " - Native: target/*-runner"
name: Verification
on: [push, pull_request]
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- name: Build
run: mvn clean verify -DskipTests
- name: Test with Coverage
run: mvn test jacoco:report jacoco:check
- name: Security Scan
run: mvn org.owasp:dependency-check-maven:check
- name: Upload Coverage
uses: codecov/codecov-action@v3
with:
files: target/site/jacoco/jacoco.xml
tools
Garbage collection for your Claude Code configuration. Periodically scans ~/.claude (skills, memory, hooks, permissions, MCP servers, caches) for redundant, stale, orphaned, or low-value items, then walks the user through a confirm-each-deletion cleanup. Use when the user says "clean up my config", "config GC", "too many skills", "audit my setup", "my .claude is bloated", or asks for a periodic config review.
data-ai
当用户希望通过并行工作、并发 agents、批量工具调用、隔离 worktree 或多条独立验证通道来大幅加速任务、同时不损失正确性时使用。
documentation
在回答之前先读取仓库的实时状态,引导用户了解 ECC 当前的 agents、skills、命令、hooks、规则、安装配置档案以及项目接入流程。
testing
Fact-forcing gate that blocks Edit/Write/Bash (including MultiEdit) and demands concrete investigation (importers, data schemas, user instruction) before allowing the action. Measurably improves output quality by +2.25 points vs ungated agents.