Skip to content

jeremylongshore/tons-of-skills-marketplace / plugins/community/contributing-clanker/skills/contribute-prepare

contribute-prepare

Verified

Prepare an OSS contribution locally after a read-only contribution audit. Creates explicitly scoped candidate records, repository dossiers, worktrees, test evidence, and gate results, but never publishes to GitHub. Use when the user has selected an issue and asks to set up, research, implement, test, or draft the contribution. Trigger with "/contribute-prepare" or "prepare this contribution locally".

FileKindSize
SKILL.mdskill md5.1 KB
agents/draft-writer.mdmarkdown2.0 KB
agents/repo-analyzer.mdmarkdown3.1 KB
agents/researcher.mdmarkdown10.5 KB
agents/scout.mdmarkdown7.5 KB
agents/test-runner.mdmarkdown3.5 KB
assets/claim-template.mdmarkdown714 B
assets/evidence-template.mdmarkdown532 B
assets/pr-template.mdmarkdown890 B
references/candidate-file-format.mdmarkdown9.3 KB
references/workflow-guide.mdmarkdown3.9 KB
scripts/audit-overrides.shexecutablescript7.3 KB
scripts/catalog-coverage.shexecutablescript4.0 KB
scripts/check.shexecutablescript1.1 KB
scripts/gate-runner.shexecutablescript8.9 KB
scripts/gates/a01-already-assigned.shexecutablescript1.1 KB
scripts/gates/a02-already-shipped.shexecutablescript1.3 KB
scripts/gates/a03-duplicate-flagged.shexecutablescript851 B
scripts/gates/a04-issue-age.shexecutablescript3.8 KB
scripts/gates/a05-issue-still-open.shexecutablescript1.6 KB
scripts/gates/a06-claim-etiquette-required.shexecutablescript1.6 KB
scripts/gates/a09-mention-routing.shexecutablescript2.1 KB
scripts/gates/b01-base-branch.shexecutablescript969 B
scripts/gates/b02-branch-naming.shexecutablescript1.0 KB
scripts/gates/b03-clone-fresh.shexecutablescript1.0 KB
scripts/gates/b05-dco-signoff.shexecutablescript1.5 KB
scripts/gates/b06-commit-format.shexecutablescript1.4 KB
scripts/gates/b07-scope-files.shexecutablescript2.1 KB
scripts/gates/b12-new-deps.shexecutablescript1.7 KB
scripts/gates/b14-local-checks.shexecutablescript1.7 KB
scripts/gates/b16-local-check-allowlist.shexecutablescript1.8 KB
scripts/gates/c01-draft-first.shexecutablescript902 B
scripts/gates/c02-pr-title-format.shexecutablescript1.2 KB
scripts/gates/c03-pr-body-sections.shexecutablescript2.0 KB
scripts/gates/c04-ui-screenshots.shexecutablescript1.6 KB
scripts/gates/c05-test-evidence.shexecutablescript1.4 KB
scripts/gates/c07-coauthor-banned.shexecutablescript1.2 KB
scripts/gates/c09-issue-link.shexecutablescript1.5 KB
scripts/gates/c11-no-force-push.shexecutablescript1.3 KB
scripts/gates/c12-ci-green.shexecutablescript1.2 KB
scripts/gates/c13-bots-passed.shexecutablescript2.1 KB
scripts/gates/c16-no-self-merge.shexecutablescript914 B
scripts/gates/c19-body-claim-vs-diff.shexecutablescript2.9 KB
scripts/gates/d02-no-ai-bug-reports.shexecutablescript1.4 KB
scripts/gates/d03-no-ai-pr-reviews.shexecutablescript1.1 KB
scripts/gates/d05-no-reopen.shexecutablescript1.1 KB
scripts/gates/e02-ai-strike-track.shexecutablescript2.7 KB
scripts/gates/e04-fork-target.shexecutablescript1.5 KB
scripts/gates/f01-license-compat.shexecutablescript3.5 KB
scripts/gates/f03-fixtures-clean.shexecutablescript1.2 KB
scripts/gates/f04-override-disclosure.shexecutablescript2.4 KB
scripts/gates/g01-no-vendored-edits.shexecutablescript1.9 KB
scripts/gates/g02-protected-paths.shexecutablescript1.2 KB
scripts/gates/g03-no-changelog-edits.shexecutablescript1.4 KB
scripts/gates/g04-no-version-bump.shexecutablescript1.4 KB
scripts/gates/g06-override-rate-limit.shexecutablescript1.5 KB
scripts/gates/lib/preamble.shexecutablescript4.8 KB
scripts/lint-candidate.shexecutablescript5.1 KB
scripts/researcher-build.shexecutablescript17.6 KB
scripts/researcher-refresh.pyscript4.9 KB
scripts/setup.shexecutablescript1.7 KB
scripts/test-known-traps.shexecutablescript5.4 KB
scripts/test-override-audit.shexecutablescript3.5 KB
scripts/test-plug-in.shexecutablescript4.0 KB
scripts/test-scout-refresh.shexecutablescript4.9 KB
scripts/test-stale-dossier-refresh.shexecutablescript3.7 KB
scripts/transition.shexecutablescript10.3 KB

scripts/audit-overrides.sh

View on GitHub
#!/usr/bin/env bash
# audit-overrides.sh — report override frequency and reasons across gates.
#
# Closes beads contributing-clanker-15b.3 and contributing-clanker-i4y.1
# (both ask for the same reporter: every --override-gate logged with reason +
# override frequency by gate).
#
# Reads $CONTRIBUTE_STATE_DIR/log.jsonl. Aggregates two event types:
#   - gate_override  → an engineer pressed --override-gate=<ID> "reason"
#   - gate_run       → every gate verdict (BLOCK / PASS / WARN / etc.)
#
# Output: per-gate row with [overrides, blocks, override_rate, top_reason].
# Sorted by override_rate desc — the most-overridden gates surface first.
# A high override_rate means the gate is either too strict (false-positive
# heavy) or genuinely catching real risk that engineers consciously accept.
# Either way, it's the signal worth surfacing.
#
# Usage:
#   audit-overrides.sh                           # all-time, all repos
#   audit-overrides.sh --since=30                # last 30 days only
#   audit-overrides.sh --scope=org:posthog       # only posthog/* repos
#   audit-overrides.sh --scope=repo:foo/bar      # exact repo
#   audit-overrides.sh --json                    # JSON output (no table)
#   audit-overrides.sh --gate=A05                # drill into one gate

set -uo pipefail

: "${CONTRIBUTE_STATE_DIR:?CONTRIBUTE_STATE_DIR must be explicitly set}"

LOG="${CONTRIBUTE_STATE_DIR}/log.jsonl"
SINCE_DAYS=""
SCOPE=""
GATE_FILTER=""
JSON_OUT=0

while [[ $# -gt 0 ]]; do
  case "$1" in
    --since=*)     SINCE_DAYS="${1#*=}" ;;
    --scope=*)     SCOPE="${1#*=}" ;;
    --gate=*)      GATE_FILTER="${1#*=}" ;;
    --json)        JSON_OUT=1 ;;
    -h|--help)
      sed -n '2,30p' "$0"
      exit 0
      ;;
    *)
      /usr/bin/printf 'unknown arg: %s\n' "$1" >&2
      exit 2
      ;;
  esac
  shift
done

if [[ ! -f "$LOG" ]]; then
  /usr/bin/printf 'no log file at %s — run a transition first\n' "$LOG" >&2
  exit 0
fi

# Build a jq filter that applies --since + --scope + --gate filters before
# aggregation. The repo field is on .details.repo for gate_run, and on
# .details.candidate (a path) for gate_override — gate_override events don't
# carry a repo string directly, so for gate_override we extract from the path
# pattern <owner>__<repo>__issue<N>.md when present, falling back to "" when
# not parseable. That's why scope filtering for overrides is best-effort.

since_filter='true'
if [[ -n "$SINCE_DAYS" ]]; then
  cutoff=$(/usr/bin/date -u -d "$SINCE_DAYS days ago" +%Y-%m-%dT%H:%M:%SZ 2>/dev/null \
    || /usr/bin/date -u -v-"${SINCE_DAYS}"d +%Y-%m-%dT%H:%M:%SZ)
  since_filter=".ts >= \"$cutoff\""
fi

case "$SCOPE" in
  org:*)
    owner="${SCOPE#org:}"
    scope_run='(.details.repo // "") | startswith("'"$owner"'/")'
    scope_ovr='(.details.candidate // "") | test("/'"$owner"'__")'
    ;;
  repo:*)
    repo="${SCOPE#repo:}"
    scope_run='(.details.repo // "") == "'"$repo"'"'
    owner_repo_path=$(/usr/bin/printf '%s' "$repo" | /usr/bin/sed 's|/|__|')
    scope_ovr='(.details.candidate // "") | test("/'"$owner_repo_path"'__")'
    ;;
  "")
    scope_run='true'
    scope_ovr='true'
    ;;
  *)
    /usr/bin/printf 'invalid --scope (use org:OWNER or repo:OWNER/NAME)\n' >&2
    exit 2
    ;;
esac

gate_filter_run='true'
gate_filter_ovr='true'
if [[ -n "$GATE_FILTER" ]]; then
  # Gate IDs in gate_run are lowercase ("a05"); in gate_override they're as
  # passed by the engineer (often uppercase "A05"). Match case-insensitively.
  gate_filter_run='(.details.gate // "" | ascii_downcase) == "'"$(/usr/bin/printf '%s' "$GATE_FILTER" | /usr/bin/tr '[:upper:]' '[:lower:]')"'"'
  gate_filter_ovr='(.details.gate // "" | ascii_downcase) == "'"$(/usr/bin/printf '%s' "$GATE_FILTER" | /usr/bin/tr '[:upper:]' '[:lower:]')"'"'
fi

# Phase 1: aggregate override counts + reasons per gate
overrides_json=$(jq -cs --slurpfile _ <(/usr/bin/printf '[]') '
  map(select(.event == "gate_override" and ('"$since_filter"') and ('"$scope_ovr"') and ('"$gate_filter_ovr"')))
  | group_by(.details.gate // "" | ascii_downcase)
  | map({
      gate: (.[0].details.gate // "" | ascii_downcase),
      overrides: length,
      reasons: (map(.details.reason // "") | unique)
    })
' "$LOG" 2>/dev/null || /usr/bin/printf '[]')

# Phase 2: aggregate BLOCK count per gate (denominator for override rate)
blocks_json=$(jq -cs '
  map(select(.event == "gate_run" and (.details.severity // "") == "BLOCK"
             and ('"$since_filter"') and ('"$scope_run"') and ('"$gate_filter_run"')))
  | group_by(.details.gate // "" | ascii_downcase)
  | map({
      gate: (.[0].details.gate // "" | ascii_downcase),
      blocks: length
    })
' "$LOG" 2>/dev/null || /usr/bin/printf '[]')

# Phase 3: merge and compute rate
merged=$(jq -cn --argjson o "$overrides_json" --argjson b "$blocks_json" '
  ($o + $b)
  | group_by(.gate)
  | map({
      gate: .[0].gate,
      overrides: ((map(.overrides // 0) | add) // 0),
      blocks: ((map(.blocks // 0) | add) // 0),
      reasons: ((map(.reasons // [])  | add | unique) // [])
    })
  | map(. + {
      override_rate: (if .blocks > 0 then (.overrides / .blocks * 100 | floor) else null end),
      top_reason: (.reasons | first // "")
    })
  | sort_by(if .override_rate == null then -1 else -.override_rate end)
')

if [[ "$JSON_OUT" -eq 1 ]]; then
  /usr/bin/printf '%s\n' "$merged" | jq .
  exit 0
fi

# Render text table
header_parts=()
[[ -n "$SINCE_DAYS" ]] && header_parts+=("last ${SINCE_DAYS}d")
[[ -n "$SCOPE" ]] && header_parts+=("scope=${SCOPE}")
[[ -n "$GATE_FILTER" ]] && header_parts+=("gate=${GATE_FILTER}")
[[ ${#header_parts[@]} -eq 0 ]] && header_parts+=("all-time")
header=$(/usr/bin/printf '%s, ' "${header_parts[@]}" | /usr/bin/sed 's/, $//')
/usr/bin/printf '\nOverride audit — %s\n' "$header"
/usr/bin/printf '%s\n' '─────────────────────────────────────────────────────────────────────────'
/usr/bin/printf '%-6s %10s %8s %10s  %s\n' "GATE" "OVERRIDES" "BLOCKS" "RATE" "TOP REASON"
/usr/bin/printf '%s\n' '─────────────────────────────────────────────────────────────────────────'

count=$(/usr/bin/printf '%s' "$merged" | jq 'length')
if [[ "$count" -eq 0 ]]; then
  /usr/bin/printf '  (no override events match the filter)\n\n'
  exit 0
fi

/usr/bin/printf '%s\n' "$merged" | jq -r '
  .[] | [
    .gate,
    .overrides,
    .blocks,
    (if .override_rate == null then "n/a" else "\(.override_rate)%" end),
    (if (.top_reason | length) > 50 then (.top_reason[0:47] + "...") else .top_reason end)
  ] | @tsv
' | /usr/bin/awk -F'\t' '{ printf "%-6s %10s %8s %10s  %s\n", $1, $2, $3, $4, $5 }'

/usr/bin/printf '%s\n\n' '─────────────────────────────────────────────────────────────────────────'

# Surface insight
high_rate=$(/usr/bin/printf '%s' "$merged" | jq -r '[.[] | select(.override_rate != null and .override_rate >= 50)] | length')
if [[ "$high_rate" -gt 0 ]]; then
  /usr/bin/printf '  ⚠ %d gate(s) overridden ≥50%% of the time — investigate false positives.\n\n' "$high_rate"
fi
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 196kUpdated Claude CodeCodexVerifiedInstall