Adonis0123/adonis-skills / skills/agent-practice-audit
agent-practice-audit
FlaggedScore how someone uses coding agents (Claude Code, Codex, Grok and WorkBuddy session logs, instruction files, hooks, permissions, Codex config) against practices quoted from official vendor docs, and write a local HTML report with coverage, trend and suggestions; also refresh or verify that practice list from official docs with multi-model consensus. Use when the user asks how far their agent usage is from official practice, wants an agent usage check-up or grade, or wants the practice list refreshed, its links checked, or either run on a schedule. Chinese triggers: Agent 用法体检、对照官方最佳实践、我的 agent 用得对不对、给 agent 用法打分、更新最佳实践清单. Not for whether a tool, MCP or skill is worth keeping (dev-environment-roi-audit), for writing or reviewing one CLAUDE.md or AGENTS.md, for general best-practice questions, or for Cursor or Gemini CLI logs, which it does not read. Never edits the user's config.
scripts/safe_output.py
View on GitHub"""Shared guard for every script that writes output: never write inside a git work tree.
Audit output contains local paths, session counts and configuration facts (no
prompt text), so it must not land in a repository where it could be committed. The target is resolved with realpath
(symlinks followed, `..` removed) before checking, and every ancestor is tested
for a `.git` directory or a `.git` file (linked worktrees and submodules).
"""
from __future__ import annotations
import os
import re
DATE = re.compile(r"^\d{4}-\d{2}-\d{2}$")
class UnsafeOutput(ValueError):
"""The output path is not allowed; the message says how to fix it."""
def git_root(path: str) -> str | None:
p = os.path.realpath(path)
while True:
if os.path.exists(os.path.join(p, ".git")):
return p
parent = os.path.dirname(p)
if parent == p:
return None
p = parent
def safe_output_path(path: str) -> str:
"""Return the resolved path, or raise UnsafeOutput when it is inside a git work tree."""
real = os.path.realpath(os.path.expanduser(path))
root = git_root(real)
if root:
raise UnsafeOutput(f"refusing to write {real}: it is inside the git work tree {root}. "
"Write audit output outside repositories, e.g. under ~/.local/share/agent-practice-audit "
"(set AGENT_PRACTICE_AUDIT_DIR or pass a different path).")
return real
def safe_file_target(path: str) -> str:
"""Check one file about to be written: refuse a symlinked target, then check its real path.
Call this for every final file (not just the directory), right before opening it for writing.
"""
p = os.path.expanduser(path)
if os.path.islink(p):
raise UnsafeOutput(f"refusing to write {p}: it is a symlink. Remove the link or choose another path.")
return safe_output_path(p)
def check_date(value: str) -> str:
if not DATE.match(value or ""):
raise UnsafeOutput(f"--date must look like YYYY-MM-DD (got {value!r})")
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: 471k | 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: 471k | 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: 471k | 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 |