Skip to content

a-pavithraa/springboot-skills-marketplace / plugins/springboot-architecture/skills/spring-boot-team-harness

spring-boot-team-harness

Verified

Use when a team wants every developer's coding agent (Claude Code or Codex) to follow the same rules and coding conventions on a Maven or Gradle Spring Boot 4 repository: setting up AGENTS.md, coding standards, guardrails, shared agent settings, or build and CI checks that agents must pass before code merges. It adds ./mvnw verify or ./gradlew build gates that fail on null-safety bugs (NullAway with JSpecify), module-boundary breaches (Spring Modulith), unknown or deprecated Boot property keys, Spring mistakes that compile (ArchUnit) and unformatted code, Claude Code and Codex hooks that run those gates before a turn ends, and a CI workflow.

FileKindSize
SKILL.mdskill md20.3 KB
assets/gradle/harness.gradleother5.4 KB
assets/observability/HandledFailureFilter.javaother2.1 KB
assets/observability/InstallOpenTelemetryAppender.javaother877 B
assets/observability/LogLeakCheck.javaother3.3 KB
assets/observability/application-observability-defaults.ymlconfig1.9 KB
assets/observability/application-observability.ymlconfig445 B
assets/observability/check_dashboards.pyscript3.4 KB
assets/observability/check_request.pyscript6.6 KB
assets/observability/compose.observability.ymlconfig704 B
assets/observability/dashboards/jvm-resources.jsonconfig7.7 KB
assets/observability/dashboards/service-health.jsonconfig10.7 KB
assets/observability/grafana-provider.yamlconfig133 B
assets/observability/logback-spring.xmlconfig736 B
assets/observability/observability.mdmarkdown7.4 KB
assets/pom/dependencies.xmlconfig236 B
assets/pom/managed-dependencies.xmlconfig355 B
assets/pom/modules-dependencies.xmlconfig269 B
assets/pom/observability-dependencies.xmlconfig833 B
assets/pom/plugins.xmlconfig2.2 KB
assets/pom/properties.xmlconfig642 B
assets/pom/rules-dependencies.xmlconfig268 B
assets/project/.claude/hooks/guard.shscript7.2 KB
assets/project/.claude/hooks/verify-on-stop.shscript11.9 KB
assets/project/.claude/settings.jsonconfig1.4 KB
assets/project/.codex/hooks.jsonconfig858 B
assets/project/.github/harness/check-file-size.shscript3.7 KB
assets/project/.github/harness/check-protected.shscript10.0 KB
assets/project/.github/workflows/harness-integrity.ymlconfig1.6 KB
assets/project/.github/workflows/verify.ymlconfig440 B
assets/project/.mvn/jvm.configother644 B
assets/project/AGENTS.mdmarkdown10.2 KB
assets/project/CLAUDE.mdmarkdown11 B
assets/project/REVIEW.mdmarkdown2.6 KB
assets/tests/BuildSetupTests.javaother19.6 KB
assets/tests/CodeRulesTests.javaother42.2 KB
assets/tests/ConfigurationKeysTests.javaother14.2 KB
assets/tests/ModuleBoundariesTests.javaother10.3 KB
assets/tests/UnusedCodeTests.javaother9.3 KB
assets/tests/archunit.propertiesother106 B
references/browser-verification.mdmarkdown18.1 KB
references/gates.mdmarkdown7.7 KB
scripts/apply_harness.pyscript59.6 KB
scripts/baseline.pyscript8.9 KB
scripts/report.pyscript6.1 KB

assets/observability/check_request.py

View on GitHub
#!/usr/bin/env python3
"""Prove what one request did: send it with a fresh trace id, then read that trace and its log lines.

  python3 observability/check_request.py --service <spring.application.name> http://localhost:8080/api/orders
  python3 observability/check_request.py --service <name> -X POST -H 'Content-Type: application/json' -d '{}' <url>
  python3 observability/check_request.py --service <name> --expect 404 <url>
  python3 observability/check_request.py --service <name> --trace <id>

Use --trace for a request something else sent, such as a browser test that set its own traceparent header. Log
messages aren't printed, so the report is safe to paste: it shows levels, loggers and exception types.
Exit codes: 0 the request worked and its trace arrived, 1 it failed or left no trace, 2 the app or the stack is down.
"""

import argparse
import json
import secrets
import sys
import time
import urllib.error
import urllib.parse
import urllib.request

ERROR_LEVELS = {"error", "fatal", "critical"}
LOG_WAIT_SECONDS = 15


def get(url: str, **params) -> dict | None:
    query = f"?{urllib.parse.urlencode(params)}" if params else ""
    request = urllib.request.Request(f"{url}{query}", headers={"Accept": "application/json"})
    try:
        with urllib.request.urlopen(request, timeout=15) as response:
            return json.load(response)
    except urllib.error.HTTPError as error:
        if error.code == 404:
            return None
        raise


def send(args, trace: str) -> int:
    headers = dict(header.split(":", 1) for header in args.header)
    headers = {name.strip(): value.strip() for name, value in headers.items()}
    headers["traceparent"] = f"00-{trace}-{secrets.token_hex(8)}-01"
    body = args.data.encode() if args.data is not None else None
    method = args.request or ("POST" if body is not None else "GET")
    request = urllib.request.Request(args.url, data=body, headers=headers, method=method)
    try:
        with urllib.request.urlopen(request, timeout=30) as response:
            return response.status
    except urllib.error.HTTPError as error:
        return error.code


def spans_of(trace: dict, service: str) -> list[dict]:
    spans = []
    for batch in trace.get("batches") or trace.get("resourceSpans") or []:
        attributes = batch.get("resource", {}).get("attributes", [])
        names = [a["value"].get("stringValue") for a in attributes if a["key"] == "service.name"]
        if service in names:
            spans += [span for scope in batch.get("scopeSpans", []) for span in scope.get("spans", [])]
    return spans


def read_trace(args, trace: str) -> list[dict]:
    """Waits for the server span, which is the last to arrive: its parent ends after its children."""
    deadline = time.monotonic() + args.wait
    spans = []
    while True:
        found = get(f"{args.tempo}/api/traces/{trace}")
        spans = spans_of(found, args.service) if found else []
        if any(span.get("kind") == "SPAN_KIND_SERVER" for span in spans) or time.monotonic() >= deadline:
            return spans
        time.sleep(1)


def read_logs(args, trace: str) -> list[dict]:
    query = '{service_name="%s"} | trace_id="%s"' % (args.service, trace)
    deadline = time.monotonic() + min(args.wait, LOG_WAIT_SECONDS)
    while True:
        streams = get(f"{args.loki}/loki/api/v1/query_range", query=query, since="1h")["data"]["result"]
        if streams or time.monotonic() >= deadline:
            return streams
        time.sleep(1)


def failed(span: dict) -> bool:
    outcome = [a["value"].get("stringValue") for a in span.get("attributes", []) if a["key"] == "outcome"]
    return span.get("status", {}).get("code") == "STATUS_CODE_ERROR" or "SERVER_ERROR" in outcome


def main() -> int:
    parser = argparse.ArgumentParser(description=__doc__.split("\n")[0])
    parser.add_argument("url", nargs="?")
    parser.add_argument("--service", required=True)
    parser.add_argument("--trace", help="Read this trace instead of sending a request")
    parser.add_argument("--expect", type=int, help="The status the request should get. Default: anything below 500")
    parser.add_argument("-X", "--request", help="Method. Default: GET, or POST with -d")
    parser.add_argument("-H", "--header", action="append", default=[])
    parser.add_argument("-d", "--data")
    parser.add_argument("--wait", type=int, default=60, help="Seconds to wait for the trace")
    parser.add_argument("--tempo", default="http://localhost:3200")
    parser.add_argument("--loki", default="http://localhost:3100")
    args = parser.parse_args()
    if bool(args.url) == bool(args.trace):
        parser.error("give a URL or --trace, not both")

    trace = args.trace or secrets.token_hex(16)
    problems = []
    expected_failure = args.expect is not None and args.expect >= 500
    try:
        if args.url:
            status = send(args, trace)
            print(f"request  {args.url} -> {status}")
            if args.expect is not None and status != args.expect:
                problems.append(f"status {status}, expected {args.expect}")
            elif args.expect is None and status >= 500:
                problems.append(f"status {status}")
    except OSError as error:
        print(f"CANNOT RUN  app not reachable at {args.url}: {error}")
        return 2
    try:
        spans = read_trace(args, trace)
        streams = read_logs(args, trace)
    except OSError as error:
        print(f"CANNOT RUN  stack not reachable: {error}")
        return 2

    print(f"trace    {trace}")
    print(f"spans    {len(spans)}: {', '.join(sorted({span.get('name', '?') for span in spans})[:10])}")
    if not spans:
        problems.append(f"no trace from {args.service}: another process answered, the app runs without the "
                        "observability profile, or the trace is still on its way")
    failures = [span.get("name", "?") for span in spans if failed(span)]
    if failures and args.expect is None:
        problems.append(f"failed spans: {', '.join(sorted(set(failures)))}")

    errors = [stream for stream in streams if stream["stream"].get("detected_level", "").lower() in ERROR_LEVELS]
    print(f"logs     {sum(len(stream['values']) for stream in streams)} lines, "
          f"{sum(len(stream['values']) for stream in errors)} at ERROR")
    for stream in errors:
        labels = stream["stream"]
        print(f"  ERROR  {labels.get('scope_name', '?')} {labels.get('exception_type', '')}".rstrip())
    if errors and not expected_failure:
        problems.append("ERROR log lines")

    for problem in problems:
        print(f"FAIL     {problem}")
    if not problems:
        print("ok       request verified")
    return 1 if problems else 0


if __name__ == "__main__":
    sys.exit(main())
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall