Skip to content

Adonis0123/adonis-skills / skills/dev-environment-roi-audit

dev-environment-roi-audit

Verified

Audit a local coding-agent environment with real logs and controlled ablations, then make evidence-backed keep, narrow, on-demand, or remove decisions for MCP servers, skills, instruction files, plugins, commands, hooks, and memory, plus the attention they cost the user (notifications, pending decisions, scheduled automations, and settings toggles). Use whenever the user asks to audit or slim a Claude, Codex, Grok, Cursor, or similar development setup; find unused tools; quantify context, startup, or attention tax; review noisy notifications or scheduled jobs; or clean agent configuration by ROI. Enforces discovered paths, per-file JSONL schema probes, OUT_DIR-only artifacts, secret-safe output, and item-by-item approval before mutations.

FileKindSize
SKILL.mdskill md12.3 KB
evals/evals.jsonconfig2.3 KB
evals/fixtures/schema-a.jsonlother72 B
evals/fixtures/schema-b.jsonlother151 B
references/artifact-contract.mdmarkdown2.2 KB
references/metrics-and-decisions.mdmarkdown5.5 KB
scripts/finalize_audit.pyexecutablescript2.4 KB
scripts/init_audit.pyexecutablescript2.0 KB
scripts/probe_jsonl_schema.pyexecutablescript2.6 KB

scripts/probe_jsonl_schema.py

View on GitHub
#!/usr/bin/env python3
from __future__ import annotations

import argparse
import json
import os
from collections import Counter
from datetime import datetime, timezone
from pathlib import Path


def discover(inputs: list[Path]) -> list[Path]:
    found: set[Path] = set()
    for candidate in inputs:
        resolved = candidate.expanduser().resolve()
        if resolved.is_file() and resolved.suffix == ".jsonl":
            found.add(resolved)
        elif resolved.is_dir():
            found.update(path.resolve() for path in resolved.rglob("*.jsonl"))
    return sorted(found, key=lambda path: path.stat().st_mtime, reverse=True)


def probe(path: Path) -> dict[str, object]:
    stat = path.stat()
    try:
        with path.open("r", encoding="utf-8") as handle:
            first_line = handle.readline()
        value = json.loads(first_line)
        schema = sorted(value.keys()) if isinstance(value, dict) else [f"<{type(value).__name__}>"]
        error = None
    except (OSError, UnicodeError, json.JSONDecodeError) as exc:
        schema = []
        error = f"{type(exc).__name__}: first line is not parseable JSON"
    return {
        "path": str(path),
        "size_bytes": stat.st_size,
        "mtime": datetime.fromtimestamp(stat.st_mtime, timezone.utc).isoformat(),
        "first_line_keys": schema,
        "error": error,
    }


def main() -> int:
    parser = argparse.ArgumentParser()
    parser.add_argument("paths", nargs="+", type=Path)
    parser.add_argument("--since-days", type=int)
    args = parser.parse_args()

    files = discover(args.paths)
    if args.since_days is not None:
        if args.since_days <= 0:
            parser.error("--since-days must be positive")
        cutoff = datetime.now(timezone.utc).timestamp() - args.since_days * 86400
        files = [path for path in files if path.stat().st_mtime >= cutoff]

    results = [probe(path) for path in files]
    patterns = Counter(json.dumps(item["first_line_keys"]) for item in results)
    payload = {
        "method": "first physical line of every JSONL file",
        "file_count": len(results),
        "parse_error_count": sum(item["error"] is not None for item in results),
        "schema_patterns": [
            {"keys": json.loads(keys), "file_count": count}
            for keys, count in sorted(patterns.items(), key=lambda item: (-item[1], item[0]))
        ],
        "files": results,
    }
    json.dump(payload, os.sys.stdout, ensure_ascii=False, indent=2)
    os.sys.stdout.write("\n")
    return 0 if payload["parse_error_count"] == 0 else 2


if __name__ == "__main__":
    raise SystemExit(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: 471kUpdated 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: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated 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