Skip to content

FrancyJGLisboa/agent-skills-platform / references/examples/pr-blocker-summarizer

pr-blocker-summarizer

Unverified

Summarizes open pull requests into a blockers-first standup digest. Activates when the user asks to summarize open PRs, find blocked pull requests, generate a PR standup, or triage review backlog from a PR export.

scripts/dependency_health.py

View on GitHub
#!/usr/bin/env python3
"""
Dependency health check for a skill.

Issues an HTTP HEAD to each declared dependency URL and reports whether the
endpoint is reachable, returning a normal status, or has moved / errored.
Non-HTTP URLs and URLs without a scheme are reported as skipped.
"""

from __future__ import annotations

from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen

HTTP_TIMEOUT_SECONDS = 10
_USER_AGENT = "agent-skill-staleness-check/1.0"


def check_dependency_health(dependencies: list[dict]) -> list[dict]:
    """
    Probe each dependency's URL. Returns a list of issue dicts (level, message,
    detail). Status thresholds:
        2xx-3xx -> info "healthy"
        4xx     -> warning "client error / may have moved"
        5xx     -> error  "server error"
        URLError, other -> error "unreachable / check failed"
    """
    issues: list[dict] = []

    for dep in dependencies:
        url = dep.get("url", "").strip()
        name = dep.get("name", url)

        if not url:
            issues.append({
                "level": "warning",
                "message": f"Dependency '{name}' has no URL",
                "detail": "Cannot check health without a URL.",
            })
            continue

        if not url.startswith(("http://", "https://")):
            issues.append({
                "level": "warning",
                "message": f"Dependency '{name}' has non-HTTP URL",
                "detail": f"Skipping health check for: {url}",
            })
            continue

        try:
            req = Request(url, method="HEAD")
            req.add_header("User-Agent", _USER_AGENT)
            with urlopen(req, timeout=HTTP_TIMEOUT_SECONDS) as resp:
                status = resp.status
                if 200 <= status < 400:
                    issues.append({
                        "level": "info",
                        "message": f"Dependency '{name}' is healthy",
                        "detail": f"HTTP {status} from {url}",
                    })
                elif 400 <= status < 500:
                    issues.append({
                        "level": "warning",
                        "message": f"Dependency '{name}' returned client error",
                        "detail": f"HTTP {status} from {url}. "
                                  "The endpoint may have moved or require authentication.",
                    })
                else:
                    issues.append({
                        "level": "error",
                        "message": f"Dependency '{name}' returned server error",
                        "detail": f"HTTP {status} from {url}",
                    })
        except HTTPError as exc:
            # urlopen RAISES on 4xx/5xx; HTTPError subclasses URLError, so this
            # must be caught first or every error status reads as "unreachable".
            if 400 <= exc.code < 500:
                issues.append({
                    "level": "warning",
                    "message": f"Dependency '{name}' returned client error",
                    "detail": f"HTTP {exc.code} from {url}. "
                              "The endpoint may have moved or require authentication.",
                })
            else:
                issues.append({
                    "level": "error",
                    "message": f"Dependency '{name}' returned server error",
                    "detail": f"HTTP {exc.code} from {url}",
                })
        except URLError as exc:
            issues.append({
                "level": "error",
                "message": f"Dependency '{name}' is unreachable",
                "detail": f"Failed to connect to {url}: {exc.reason}",
            })
        except Exception as exc:
            issues.append({
                "level": "error",
                "message": f"Dependency '{name}' check failed",
                "detail": f"Error checking {url}: {exc}",
            })

    return issues
add-product-e2e-evalpaperclipai/paperclipAdd or extend a Paperclip full-stack runner E2E workflow, fixture, matcher, or report evidence path for local or Daytona execution.Stars: 115kUpdated Claude CodeCodexVerifiedInstall
add-runner-evalpaperclipai/paperclipAdd or extend a Paperclip Runner protocol evaluation definition, roster, assertion, or report fixture with provenance and narrow validation.Stars: 115kUpdated Claude CodeCodexVerifiedInstall
diagnose-why-work-stoppedpaperclipai/paperclipCompatibility entry point for failed, stalled, looping, or over-recovered Paperclip work. Use fix-failed-paperclip-run for the full diagnosis, regression, repair, real verification, and green-PR workflow; honor an explicitly requested diagnosis-only scope.Stars: 115kUpdated Claude CodeCodexVerifiedInstall
fix-failed-paperclip-runpaperclipai/paperclipDiagnose and fix failed, stuck, slow, or incorrectly blocked Paperclip tasks and runs. Use with a task/run URL or failure report to trace the root cause, prove a regression red then green, check second-order effects, verify the real workflow, and deliver a PR with passing checks.Stars: 115kUpdated Claude CodeCodexVerifiedInstall