AGENT SKILL

x-execute-socket-smoke-tests

Runs automated smoke tests against the TCP socket server using a standalone Java client with message framing and protocol validation.

License 许可
MIT
最近更新
2026-10-27
Stars
★ 0
Forks
1

01 前言 Front Matter

name
x-execute-socket-smoke-tests
description
Runs automated smoke tests against the TCP socket server using a standalone Java client with message framing and protocol validation.
allowed-tools
Read, Bash
argument-hint
[--scenario echo|all] [--k8s] [--host <host>] [--port <port>]
user-invocable
true
requires-capabilities
[]

02 资源文件 1

03 SKILL.md 正文

Global Output Policy

  • Language: English ONLY.
  • Tone: Technical, Direct, and Concise.
  • Efficiency: Remove all conversational fillers and greetings to save tokens.

Skill: TCP Socket Smoke Tests

Purpose

Orchestrate black-box smoke tests against the application's TCP socket server using a standalone Java client. The client speaks the real wire protocol with proper message framing (length-prefix header). Tests validate that the server correctly receives messages, processes them, and returns valid responses over persistent TCP connections.

Activation Condition

Include this skill when smoke_tests is enabled AND "tcp-custom" is in protocols.

Triggers

  • /x-execute-socket-smoke-tests -- run all scenarios against local environment
  • /x-execute-socket-smoke-tests --k8s -- run with automatic port-forward (orchestrator)
  • /x-execute-socket-smoke-tests --k8s --scenario echo -- run specific scenario
  • /x-execute-socket-smoke-tests --host 10.0.0.1 --port 8583 -- run against custom host/port

Parameters

Parameter Type Required Default Description
--scenario String No all Scenario: echo, request-approved, request-denied, malformed, persistent, all
--k8s Flag No false Enable automatic port-forward for HTTP and TCP ports
--host String No localhost Target server hostname
--port Integer No (configured) Target server TCP port

Prerequisites

  • Java 21+ installed
  • Client JAR built: cd smoke-tests/socket && {{BUILD_COMMAND}}
  • Application deployed and accessible (local or {{ORCHESTRATOR}})
  • TCP socket listening on configured port

Workflow

Step 1 — Verify Prerequisites

  • Check Java version: java --version
  • Check client JAR exists in smoke-tests/socket/target/
  • If JAR missing, suggest build command

Step 2 — Setup Networking (if --k8s)

  • Create port-forward for both HTTP (health) and TCP (socket) ports
  • Register cleanup via trap EXIT

Step 3 — Wait for Health Check

Poll HTTP health endpoint:

  • Retry up to 30 times with 2s interval
  • Abort with exit code 2 if health check fails

Step 4 — Run Scenarios

Execute Java client JAR:

  • Pass --scenario flag (default: all)
  • Pass --host and --port for target server
  • Each scenario: connect, send message, validate response, report

Step 5 — Report Results

  • Per-scenario: PASS / FAIL with details
  • CRITICAL scenarios: all must pass
  • HIGH scenarios: all must pass
  • Overall exit code: 0 (success), 1 (test failure), 2 (setup failure), 3 (JAR not found)

Step 6 — Cleanup

Automatic via trap EXIT:

  • Stop port-forwards if started

Available Scenarios

Scenario Flag Description
Echo/Ping echo Basic connectivity and response validation
Request Approved request-approved Standard request with successful response
Request Denied request-denied Request triggering a denial/error response
Malformed Message malformed Invalid bytes, expects error response
Persistent Connection persistent Multiple messages on same TCP connection
All all Runs all scenarios sequentially

Artifacts

File Description
smoke-tests/socket/pom.xml Client build file (executable JAR)
smoke-tests/socket/src/ Java client source code
smoke-tests/socket/x-execute-socket-smoke-tests.sh Execution script

Client Architecture

  • SmokeTestRunner -- Main class: arg parsing, scenario dispatch, result aggregation
  • SmokeSocketClient -- TCP client wrapper with length-prefix framing (send/receive)
  • SmokeScenario -- Sealed interface for scenario implementations
  • ScenarioResult -- Record: pass/fail + message

Error Handling

Scenario Action
JAR not found Suggest build command: cd smoke-tests/socket && {{BUILD_COMMAND}}
Connection refused (TCP) Suggest using --k8s flag or starting app manually
Connection refused (HTTP) Check orchestrator service status
Unexpected response Suggest checking application logs for protocol or logic bugs
Message parse failure Suggest verifying length-prefix and encoding config

04 同仓库更多 Skills

review-bench
review-bench/edercnj_ia-dev-environment

x-parallel-eval

Detects and classifies file-collision risks between work units (tasks, stories, or epic phases) before parallel execution. Reads ## File Footprint blocks produced by x-task-plan / x-story-plan, applies the parallelism-heuristics knowledge pack (hard / regen / soft categories + hotspot overrides), and emits a collision matrix + serialization recommendation in Markdown (default) or JSON.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

parallelism-heuristics

Canonical catalog of file-collision heuristics for parallel task, story, and epic execution. Defines the File Footprint block format, the three Conflict Categories (hard / regen / soft), a hotspot list of high-contention paths, and the degrade-with-warning policy. Consumed by x-task-plan, x-story-plan, x-epic-map, x-parallel-eval, and x-dev-*-implement.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-watch-pr-ci

Polls a PR's CI checks and Copilot review status, blocking until checks complete or timeout. Returns one of 8 stable exit codes (SUCCESS=0, CI_PENDING_PROCEED=10, CI_FAILED=20, TIMEOUT=30, PR_ALREADY_MERGED=40, NO_CI_CONFIGURED=50, PR_CLOSED=60, PR_NOT_FOUND=70). Writes a versioned state-file for session resume.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-validate-docs

Documentation freshness gate: validates 6 dimensions (readme, api-specs, grpc-proto, adr, skill-docs, system-architecture) against code changes in a PR. Stack-aware — only validates targets declared/auto-detected from ProjectConfig.documentation.targets. Returns exit non-zero on staleness; produces structured report.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-update-system-architecture

Incrementally updates docs/architecture/system.md after an epic completes. Appends new entries to the Decision Log (§11) using x-internal-write-report --append (dedup by ## ID: marker) and surgically inserts component/integration changes into sections 1-10 via Edit. Idempotent: re-running with the same epic produces a byte-identical system.md.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-update-architecture

Incrementally updates the service architecture document with changes from architecture plans. Adds new components, integrations, flows, and ADR references without rewriting existing content. Use after implementation to keep architecture documentation current.

★ 0