Skip to content

composio-community/nemoclaw-composio / .agents/skills/nemoclaw-maintainer-day

nemoclaw-maintainer-day

Verified

Runs the daytime maintainer loop for NemoClaw, prioritizing items labeled with the current version target. Picks the highest-value item, executes the right workflow (merge gate, salvage, security sweep, test gaps, hotspot cooling, or sequencing), and reports progress. Use during the workday to land PRs and close issues. Designed for /loop (e.g. /loop 10m /nemoclaw-maintainer-day). Trigger keywords - maintainer day, work on PRs, land PRs, make progress, what's next, keep going, maintainer loop.

FileKindSize
HOTSPOTS.mdmarkdown1.4 KB
MERGE-GATE.mdmarkdown2.6 KB
PR-REVIEW-PRIORITIES.mdmarkdown3.1 KB
RISKY-AREAS.mdmarkdown756 B
SALVAGE-PR.mdmarkdown3.3 KB
SECURITY-SWEEP.mdmarkdown1.6 KB
SEQUENCE-WORK.mdmarkdown1.6 KB
SKILL.mdskill md3.7 KB
STATE-SCHEMA.mdmarkdown1.5 KB
TEST-GAPS.mdmarkdown2.2 KB
scripts/bump-stragglers.tsscript2.4 KB
scripts/check-gates.tsscript10.1 KB
scripts/handoff-summary.tsscript3.9 KB
scripts/hotspots.tsscript3.9 KB
scripts/shared.tsscript6.3 KB
scripts/state.tsscript7.7 KB
scripts/triage.tsscript16.0 KB
scripts/version-progress.tsscript2.2 KB
scripts/version-target.tsscript4.3 KB

scripts/hotspots.ts

View on GitHub
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

/**
 * Deterministic hotspot detection for NemoClaw.
 *
 * Combines 30-day git churn on main with open PR file overlap to rank
 * the files causing the most merge pain. Outputs structured JSON.
 *
 * Usage: node --experimental-strip-types --no-warnings .agents/skills/nemoclaw-maintainer-day/scripts/hotspots.ts [--days N] [--repo OWNER/REPO]
 */

import { isRiskyFile, run, parseStringArg, parseIntArg } from "./shared.ts";

// ---------------------------------------------------------------------------
// Types
// ---------------------------------------------------------------------------

interface Hotspot {
  path: string;
  mainTouchCount: number;
  openPrCount: number;
  combinedScore: number;
  isRisky: boolean;
}

interface HotspotOutput {
  generatedAt: string;
  repo: string;
  days: number;
  hotspots: Hotspot[];
}

// ---------------------------------------------------------------------------
// Data collection
// ---------------------------------------------------------------------------

function gitChurn(days: number): Map<string, number> {
  const out = run("git", [
    "log",
    `--since=${days} days ago`,
    "--name-only",
    "--format=",
    "origin/main",
  ]);

  const counts = new Map<string, number>();
  if (!out) return counts;

  for (const line of out.split("\n")) {
    const path = line.trim();
    if (path) {
      counts.set(path, (counts.get(path) ?? 0) + 1);
    }
  }
  return counts;
}

function openPrFileOverlap(repo: string): Map<string, number> {
  const prListOut = run("gh", [
    "pr", "list",
    "--repo", repo,
    "--state", "open",
    "--limit", "200",
    "--json", "number",
  ]);

  const counts = new Map<string, number>();
  if (!prListOut) return counts;

  let prs: Array<{ number: number }>;
  try {
    prs = JSON.parse(prListOut);
  } catch {
    return counts;
  }

  const sample = prs.slice(0, 50);
  for (const pr of sample) {
    const filesOut = run("gh", [
      "pr", "view", String(pr.number),
      "--repo", repo,
      "--json", "files",
    ]);
    if (!filesOut) continue;

    let data: { files?: Array<{ path: string }> };
    try {
      data = JSON.parse(filesOut);
    } catch {
      continue;
    }

    const seen = new Set<string>();
    for (const f of data.files ?? []) {
      if (!seen.has(f.path)) {
        seen.add(f.path);
        counts.set(f.path, (counts.get(f.path) ?? 0) + 1);
      }
    }
  }

  return counts;
}

// ---------------------------------------------------------------------------
// Main
// ---------------------------------------------------------------------------

function main(): void {
  const args = process.argv.slice(2);
  const days = parseIntArg(args, "--days", 30);
  const repo = parseStringArg(args, "--repo", "NVIDIA/NemoClaw");

  process.stderr.write("Collecting git churn...\n");
  const churn = gitChurn(days);

  process.stderr.write("Collecting open PR file overlap...\n");
  const prOverlap = openPrFileOverlap(repo);

  const allPaths = new Set([...churn.keys(), ...prOverlap.keys()]);
  const hotspots: Hotspot[] = [];

  for (const path of allPaths) {
    const mainTouchCount = churn.get(path) ?? 0;
    const openPrCount = prOverlap.get(path) ?? 0;

    if (mainTouchCount < 2 && openPrCount < 2) continue;

    const risky = isRiskyFile(path);
    // Score: main churn weight 1x, PR overlap 3x (conflict proxy), risky 2x bonus
    const combinedScore =
      mainTouchCount + openPrCount * 3 + (risky ? (mainTouchCount + openPrCount) * 2 : 0);

    hotspots.push({ path, mainTouchCount, openPrCount, combinedScore, isRisky: risky });
  }

  hotspots.sort((a, b) => b.combinedScore - a.combinedScore);

  const output: HotspotOutput = {
    generatedAt: new Date().toISOString(),
    repo,
    days,
    hotspots: hotspots.slice(0, 25),
  };

  console.log(JSON.stringify(output, null, 2));
}

main();
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: 194kUpdated Claude CodeCodexVerifiedInstall