con un clic
quarkus-verification
Bucle de verificación para proyectos Quarkus: build, análisis estático, pruebas con cobertura, escaneos de seguridad, compilación nativa y revisión de diff antes del lanzamiento o PR.
Menú
Bucle de verificación para proyectos Quarkus: build, análisis estático, pruebas con cobertura, escaneos de seguridad, compilación nativa y revisión de diff antes del lanzamiento o PR.
Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents. v2.1 adds project-scoped instincts to prevent cross-project contamination.
Orchestrate building a brand-new feature end to end — research, plan, TDD implementation, review, and gated commit — by delegating each phase to the matching ECC agent. Use when adding a capability that does not exist yet.
Orchestrate bootstrapping a working MVP from a design or spec document — ingest the doc, plan thin vertical slices, scaffold the first end-to-end slice, then TDD-implement, review, and gated commit. Use to turn an SDD/PRD into a running starting point.
Orchestrate altering an existing, working feature to new desired behavior — update its tests to the new spec, change the implementation to match, review, and gated commit. Use when behavior is not broken but should be different.
Orchestrate fixing a bug — reproduce it as a failing regression test, fix to green, review, and gated commit — by delegating each phase to the matching ECC agent. Use when existing behavior is broken or wrong.
Shared orchestration engine for the orch-* skill family. Defines the gated Research-Plan-TDD-Review-Commit pipeline, the size classifier, the agent map, and the two human gates that the orch-* operation skills delegate to. Not usually invoked directly.
| name | quarkus-verification |
| description | Bucle de verificación para proyectos Quarkus: build, análisis estático, pruebas con cobertura, escaneos de seguridad, compilación nativa y revisión de diff antes del lanzamiento o PR. |
| origin | ECC |
Ejecutar antes de PRs, después de cambios importantes y antes del despliegue.
# Maven
mvn clean verify -DskipTests
# Gradle
./gradlew clean assemble -x test
Si el build falla, detener y corregir errores de compilación.
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}
# Ejecutar todas las pruebas
mvn clean test
# Generar reporte de cobertura
mvn jacoco:report
# Exigir umbral de cobertura (80%)
mvn jacoco:check
# O con 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", "alice@example.com");
doNothing().when(userRepository).persist(any(User.class));
User result = userService.create(dto);
assertThat(result.name).isEqualTo("Alice");
verify(userRepository).persist(any(User.class));
}
}
@QuarkusTest
@QuarkusTestResource(PostgresTestResource.class)
class UserRepositoryIntegrationTest {
@Inject
UserRepository userRepository;
@Test
@Transactional
void findByEmail_existingUser_returnsUser() {
User user = new User();
user.name = "Alice";
user.email = "alice@example.com";
userRepository.persist(user);
Optional<User> found = userRepository.findByEmail("alice@example.com");
assertThat(found).isPresent();
assertThat(found.get().name).isEqualTo("Alice");
}
}
@QuarkusTest
class UserResourceTest {
@Test
void createUser_validInput_returns201() {
given()
.contentType(ContentType.JSON)
.body("""
{"name": "Alice", "email": "alice@example.com"}
""")
.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);
}
}
Verificar target/site/jacoco/index.html para cobertura detallada:
mvn org.owasp:dependency-check-maven:check
Revisar target/dependency-check-report.html para CVEs.
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
Probar compatibilidad de imagen nativa GraalVM:
# Construir ejecutable nativo
mvn package -Dnative
# O con contenedor
mvn package -Dnative -Dquarkus.native.container-build=true
# Probar ejecutable nativo
./target/*-runner
# Ejecutar smoke tests básicos
curl http://localhost:8080/q/health/live
curl http://localhost:8080/q/health/ready
Problemas comunes:
quarkus.native.resources.includesEjemplo de configuración de reflexión:
@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
# Todos los health checks
curl http://localhost:8080/q/health
# Métricas (si están habilitadas)
curl http://localhost:8080/q/metrics
# Construir imagen de contenedor
mvn package -Dquarkus.container-image.build=true
# Escaneo de seguridad del contenedor
trivy image myorg/my-quarkus-app:1.0.0
grype myorg/my-quarkus-app:1.0.0
mvn quarkus:info
/q/swagger-ui)Generar especificación OpenAPI:
curl http://localhost:8080/q/openapi -o openapi.json
#!/bin/bash
set -e
echo "=== Fase 1: Build ==="
mvn clean verify -DskipTests
echo "=== Fase 2: Análisis Estático ==="
mvn checkstyle:check pmd:check spotbugs:check
echo "=== Fase 3: Pruebas + Cobertura ==="
mvn test jacoco:report jacoco:check
echo "=== Fase 4: Escaneo de Seguridad ==="
mvn org.owasp:dependency-check-maven:check
echo "=== Fase 5: Compilación Nativa ==="
mvn package -Dnative -Dquarkus.native.container-build=true
echo "=== Todas las Fases Completadas ==="
echo "Revisar reportes:"
echo " - Cobertura: target/site/jacoco/index.html"
echo " - Seguridad: target/dependency-check-report.html"