composio-community/nemoclaw-composio / .agents/skills/nemoclaw-maintainer-day
nemoclaw-maintainer-day
VerifiedRuns 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.
| File | Kind | Size |
|---|---|---|
| HOTSPOTS.md | markdown | 1.4 KB |
| MERGE-GATE.md | markdown | 2.6 KB |
| PR-REVIEW-PRIORITIES.md | markdown | 3.1 KB |
| RISKY-AREAS.md | markdown | 756 B |
| SALVAGE-PR.md | markdown | 3.3 KB |
| SECURITY-SWEEP.md | markdown | 1.6 KB |
| SEQUENCE-WORK.md | markdown | 1.6 KB |
| SKILL.md | skill md | 3.7 KB |
| STATE-SCHEMA.md | markdown | 1.5 KB |
| TEST-GAPS.md | markdown | 2.2 KB |
| scripts/bump-stragglers.ts | script | 2.4 KB |
| scripts/check-gates.ts | script | 10.1 KB |
| scripts/handoff-summary.ts | script | 3.9 KB |
| scripts/hotspots.ts | script | 3.9 KB |
| scripts/shared.ts | script | 6.3 KB |
| scripts/state.ts | script | 7.7 KB |
| scripts/triage.ts | script | 16.0 KB |
| scripts/version-progress.ts | script | 2.2 KB |
| scripts/version-target.ts | script | 4.3 KB |
scripts/shared.ts
View on GitHub// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
/**
* Shared utilities for NemoClaw maintainer scripts.
*
* Centralizes risky-area detection, test-file detection, and shell helpers
* so that triage, check-gates, and hotspots stay in sync.
*/
import { execFileSync } from "node:child_process";
// ---------------------------------------------------------------------------
// Risky area patterns — paths that need tests before approval
// ---------------------------------------------------------------------------
export const RISKY_PATTERNS: RegExp[] = [
/^install\.sh$/,
/^setup\.sh$/,
/^brev-setup\.sh$/,
/^scripts\/.*\.sh$/,
/^bin\/lib\/onboard\.js$/,
/^bin\/.*\.js$/,
/^nemoclaw\/src\/blueprint\//,
/^nemoclaw-blueprint\//,
/^\.github\/workflows\//,
/\.prek\./,
/policy/i,
/ssrf/i,
/credential/i,
/inference/i,
];
export const TEST_PATTERNS: RegExp[] = [
/\.test\.[jt]sx?$/,
/\.spec\.[jt]sx?$/,
/^test\//,
];
export function isRiskyFile(path: string): boolean {
return RISKY_PATTERNS.some((re) => re.test(path));
}
export function isTestFile(path: string): boolean {
return TEST_PATTERNS.some((re) => re.test(path));
}
// ---------------------------------------------------------------------------
// Shell helpers
// ---------------------------------------------------------------------------
/**
* Run a command and return its stdout. On failure, logs the error to stderr
* and returns an empty string so callers can handle the absence of data.
*/
export function run(
cmd: string,
args: string[],
timeoutMs = 120_000,
): string {
try {
return execFileSync(cmd, args, {
encoding: "utf-8",
timeout: timeoutMs,
maxBuffer: 10 * 1024 * 1024,
}).trim();
} catch (err: unknown) {
const message = err instanceof Error ? err.message : String(err);
process.stderr.write(`[shared] ${cmd} ${args[0] ?? ""} failed: ${message}\n`);
return "";
}
}
/**
* Run `gh` with the given args and parse the JSON output.
* Returns null when the command fails or output is not valid JSON.
*/
export function ghJson(args: string[]): unknown {
const out = run("gh", args);
if (!out) return null;
try {
return JSON.parse(out);
} catch {
process.stderr.write(`[shared] gh JSON parse failed for: gh ${args.join(" ")}\n`);
return null;
}
}
// ---------------------------------------------------------------------------
// Required CI checks
// ---------------------------------------------------------------------------
// Checks triggered by `pull_request` events. First-time fork contributors
// need a maintainer to click "Approve and run" before these execute.
// If any are missing from statusCheckRollup, CI cannot be considered green.
export const REQUIRED_CHECK_NAMES: string[] = [
"checks", // pr.yaml — lint, typecheck, test
"commit-lint", // commit-lint.yaml
"dco-check", // dco-check.yaml
];
// ---------------------------------------------------------------------------
// Status check types
// ---------------------------------------------------------------------------
/** Union of CheckRun and StatusContext fields from GitHub's statusCheckRollup. */
export interface StatusCheck {
__typename?: string;
name?: string; // CheckRun field
context?: string; // StatusContext field
status?: string; // CheckRun: COMPLETED, IN_PROGRESS, QUEUED, etc.
conclusion?: string; // CheckRun: SUCCESS, FAILURE, NEUTRAL, SKIPPED, etc.
state?: string; // StatusContext: SUCCESS, FAILURE, PENDING, ERROR
}
// ---------------------------------------------------------------------------
// Triage scoring weights
//
// Each weight reflects relative priority in the maintainer queue.
// Documented in nemoclaw-maintainer-day/PR-REVIEW-PRIORITIES.md.
// ---------------------------------------------------------------------------
/** PR passed all checks and is already approved — only needs final gate */
export const SCORE_MERGE_NOW = 40;
/** PR has green CI, no conflicts, not draft — ready for maintainer review */
export const SCORE_REVIEW_READY = 35;
/** PR is close to ready with a clear small fix path */
export const SCORE_NEAR_MISS = 30;
/** PR touches security-sensitive code and is actionable */
export const SCORE_SECURITY_ACTIONABLE = 20;
/** PR carries the "security" GitHub label */
export const SCORE_LABEL_SECURITY = 15;
/** PR carries a "priority: high" GitHub label */
export const SCORE_LABEL_PRIORITY_HIGH = 10;
/** PR has been stale > 7 days — mild priority bump to prevent rot */
export const SCORE_STALE_AGE = 5;
/** Draft PRs or PRs with non-trivial merge conflicts are effectively blocked */
export const PENALTY_DRAFT_OR_CONFLICT = -100;
/** Unresolved major/critical CodeRabbit finding blocks approval */
export const PENALTY_CODERABBIT_MAJOR = -80;
/** Broad CI red with no obvious local fix — not worth salvaging yet */
export const PENALTY_BROAD_CI_RED = -60;
/** Blocked on external admin action (permissions, secrets, etc.) */
export const PENALTY_MERGE_BLOCKED = -20;
// ---------------------------------------------------------------------------
// CLI argument parsing helpers
// ---------------------------------------------------------------------------
/**
* Parse a string CLI flag from argv. Returns `defaultValue` when the flag is
* absent or when the next token is missing / looks like another flag.
*/
export function parseStringArg(args: string[], flag: string, defaultValue: string): string {
const idx = args.indexOf(flag);
if (idx < 0) return defaultValue;
const value = args[idx + 1];
if (!value || value.startsWith("--")) {
process.stderr.write(`[shared] ${flag} requires a value, using default: ${defaultValue}\n`);
return defaultValue;
}
return value;
}
/**
* Parse an integer CLI flag from argv. Returns `defaultValue` when the flag is
* absent, the next token is missing, or the value is not a valid integer.
*/
export function parseIntArg(args: string[], flag: string, defaultValue: number): number {
const idx = args.indexOf(flag);
if (idx < 0) return defaultValue;
const value = parseInt(args[idx + 1], 10);
if (isNaN(value)) {
process.stderr.write(`[shared] ${flag} requires a number, using default: ${defaultValue}\n`);
return defaultValue;
}
return value;
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 472k | Updated | Claude CodeCodex | Verified | Install |
| 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: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |