跳到正文
cccskills
免费在 GitHub 公开

ln-54-codebase-auditor

Audits cross-cutting codebase health, security and maintainability; not a single-change review or specialist audit.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md17.3 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Codebase Auditor

Goal: Perform a broad, read-only production-code health audit. Find concrete cross-cutting failure, security, delivery, and maintenance risks without turning detector matches or personal style preferences into findings. Do not substitute for documentation trust, test-portfolio, whole-architecture, or persistence-specific review.

Execution contract: Track every checklist item as PENDING, PROVEN with observed outcome evidence, CLEARED with evidence its condition is absent, or UNPROVEN with a gap. Reading, delegation, tool failure, zero exit status, and self-reported success are not proof. Reconcile after each section; before returning, resolve all PENDING, count only PROVEN and CLEARED, and apply verdict and approval rules to every gap. Preserve intent, scope, mode, and existing authorization. Complete authorized work before required external approval; ask only consequential unresolved choices. If nobody can answer, report the exact question and apply the skill's gap verdict without waiting or guessing. Cite any blocking instruction and unresolved boundary; never invent approval gates. Scale depth to material risk; preserve mandatory checks, dependencies, and safety order while choosing verification methods. Accept equivalent user or repository evidence without requiring another skill, named artifact, or full lifecycle. Preserve source requirement and decision IDs. Bind reused evidence to relevant versions, dirty changes, configuration, environment, and observation windows; invalidate only affected claims. Choose the primary workflow by outcome and explicit selection. Consume neighboring contracts and valid evidence without duplicating ownership or restarting audits. Split distinct deliverables by scope, not mandatory skill invocation. Broad independent assessments use audit workflows; focused domain reviews remain read-only. On continuation, reconcile task, authorization, state, and gaps. Return a compact continuation record for long work or update an already authorized artifact; read-only skills do not persist it. Distinguish artifact readiness, verified behavior, and external-action authority. Trace applicable requirements to their authoritative owner, planned or implemented change, acceptance evidence and status in the existing artifact or response; no new registry is required. Explicit constraints remain binding until an authorized deviation; risk determines priority, not permission to ignore them. Investigate the causal flow beyond initially named files. Within implementation authority, include structural repair needed for the outcome; minimize total complexity and risk, not changed lines. This does not authorize unrelated cleanup or mutation during review. Before retrieval, define the evidence question; read selectively without skipping applicable instructions. Use tools for mechanical processing; summarize bounded results, errors, coverage, and source paths, keeping full output outside context. Before technical decisions, establish applicability and actual versions; verify version-dependent assumptions against official documentation or specifications. Search and read primary pages for current external recommendations; snippets are not evidence. Version-matched bundled documentation or valid prior evidence suffices. Record decision, version, source, and limitations. Mark unavailable evidence UNVERIFIED; block only essential dependent work. Prefer native mechanisms, justify added tools or abstractions with evidence, and reuse the existing rule owner.

Tool Routing

NeedPreferred toolUse it whenFallback
Repository map and stack detectionNative file listing, manifests, build files, and repository instructionsEstablishing scope, generated areas, entrypoints, supported runtimes, and commandsTargeted tree inspection and known entrypoints
Symbols, callers, ownership, and data flowLanguage server or host-native code intelligenceA finding depends on symbol identity, references, overrides, route wiring, or cross-file behaviorNarrow text search plus direct inspection of every relevant match
Current changes and historical contextGit status, diff, log, and blameSeparating current work, regressions, intentional constraints, and dead compatibility pathsCurrent implementation and explicit decision records
Delivery healthRepository-defined build, lint, type, test, and smoke commandsEstablishing whether the project can ship in its documented environmentInspect CI and scripts; mark execution unavailable
Dependency and security stateNative package-manager audit, manifests, lockfiles, and official advisoriesChecking known vulnerabilities, unsupported versions, and dependency healthOfficial registry and vendor sources; never guess severity
Runtime evidenceExisting logs, metrics, traces, profiles, and diagnosticsStatic analysis cannot establish frequency, reachability, or operational impactCall-path analysis with an explicit static-only limitation
Current external behaviorOfficial specifications, vendor documentation, and release notesA finding depends on current API, runtime, or standard behaviorPrimary-source web research; otherwise mark UNVERIFIED

Start with summary-level discovery and narrow before reading deeply. Run only repository-defined or clearly safe diagnostic commands; never publish, deploy, migrate production data, rotate secrets, or rewrite files during the audit.

Workflow Boundary

This workflow owns read-only cross-cutting findings. Foundation engineering owns authorized remediation of technical contracts. An audit request never authorizes invoking an implementation workflow to repair its findings.

Evidence Rules

  • A pattern match is a candidate, not a finding. Confirm reachability, context, and consequence.
  • Runtime failure or deterministic command output outweighs static suspicion; static evidence remains valid when execution is unavailable and the limitation is explicit.
  • Generated, vendored, fixture, migration-history, and intentionally compatible code require context-specific treatment.
  • External best practice is actionable only when it addresses a concrete repository defect or risk.
  • Score or count only findings with distinct root causes; deduplicate symptoms that share one correction.

Checklist

1. Establish Scope and Baseline

  • Detect languages, frameworks, package managers, entrypoints, deployment model, generated areas, and the repository's supported verification commands.
  • Classify each runtime surface as long-running service, CLI, library, job, serverless function, or platform-managed component before requiring probes, telemetry, signal handling, or shutdown behavior.
  • Read applicable instructions and identify security boundaries, critical business paths, public interfaces, and irreversible operations.
  • Inspect Git state so the audit does not overwrite, misattribute, or ignore unrelated user changes.
  • Establish feasible build, lint, type, test, and smoke baselines; record executed scope, environment, exit status, and evidence. Verify required work ran rather than succeeding with no selected tests or skipped gates.
  • Define exclusions and depth based on risk rather than scanning every file with equal effort.
  • Keep the audit read-only. Allow only permitted caches and build artifacts and disclose them when created.

2. Audit Security and Delivery Boundaries

  • Search for committed secrets, unsafe credential patterns, sensitive defaults, debug bypasses, and accidental exposure through logs or errors.

  • For credential findings, never expose the raw value: distinguish live material from placeholders, fixtures, examples, and allowlisted fingerprints; report only the type, location, and redacted evidence, and recommend revocation, rotation, or history remediation only for confirmed exposure without performing it during the audit.

  • Trace untrusted input into SQL, shell, templates, HTML, file paths, URLs, deserialization, redirects, and other injection-sensitive sinks.

  • Check authentication, authorization, tenant or ownership isolation, privilege transitions, insecure direct object access, and default-deny behavior.

  • Check validation at trust boundaries, canonicalization, size and rate limits, unsafe file operations, and destructive-action confirmation or guards.

  • Verify security findings against actual call paths, framework behavior, configuration, and current official guidance before assigning severity.

  • Inspect compiler, linter, type checker, tests, packaging, and CI configuration for skipped gates, ignored failures, environment drift, and non-reproducible delivery.

  • Verify that successful packaging produces the intended entrypoints, assets, metadata, target platform, and deployable artifact; exit code zero alone does not prove a shippable build.

  • Find stale skip, quarantine, allow-failure, continue-on-error, and warning-suppression paths that make required signals appear green.

  • Check configuration completeness, required environment validation, unsafe fallbacks, missing examples, and differences between local, CI, and deployment settings.

  • Engineering enforcement: Map applicable technical rules to executable checks, covered technologies/files, strictness and documented exceptions. Identify missing or ineffective checks and their implementation owner; preserve mandated presets and warning policy. Bind evidence to the actual command and supported environment, not configuration presence. Read-only workflows report gaps without repairing them; guidance-only workflows describe controls without executing or implementing them.

3. Audit Maintainability and Dependencies

  • Find evidence-backed duplication across functions, handlers, modules, configuration, and integration code; distinguish shared domain concepts from coincidental similarity.
  • Identify over-abstraction, unused extension points, excessive factories or wrappers, parallel mechanisms, and custom utilities that duplicate declared platform capabilities.
  • Before merging duplication or removing an abstraction, check lifecycle and ownership boundaries, intentional decoupling, dependency injection or test seams, framework requirements, public extension contracts, and expected independent evolution.
  • Inspect complexity hotspots, long methods, god modules, deep nesting, excessive parameters, boolean-mode APIs, misleading names, and mixed responsibilities.
  • Check algorithms for early-exit mistakes, duplicate-key loss, boundary errors, unbounded work, repeated scans, mutation during iteration, and hidden shared state.
  • Check hardcoded operational values, URLs, timeouts, limits, identifiers, and environment-specific behavior that should be explicit configuration or named policy.
  • Trace one concept across external contracts, DTOs, services, persistence, and storage; flag synonym or casing drift only when no explicit serializer, code-generation, or ORM boundary mapping explains it.
  • Audit dependency vulnerabilities, support status, license or runtime constraints, duplicate packages, unused packages, and credible replacement or removal opportunities.
  • Match advisories to the resolved version and deployment, then classify exposure as confirmed, unknown, or not applicable using reachability and exploit conditions; an unavailable call path cannot clear an affected component.
  • Recommend native, existing-dependency, or external replacements only after checking required feature parity, migration surface, maintenance, license, security history, and domain-specific behavior.
  • Find unreachable code, unused imports and exports, commented-out implementations, obsolete flags, dead compatibility shims, and replacement code left beside its successor.
  • Confirm dead-code findings against reflection, registration, framework discovery, configuration, serialization, templates, and external entrypoints before reporting deletion as safe.

4. Audit Diagnosability, Concurrency, and Lifecycle

  • Check whether logs are structured, correctly leveled, actionable, correlated across a request or job, and free of secrets and excessive payload data.
  • Verify that correlation context crosses outbound calls, queues, retries, scheduled work, and detached async boundaries instead of existing only in the first request log.
  • Check metrics, traces, health signals, and error context for critical paths; require observability only where operators need it to detect or diagnose failure.
  • Trace shared mutable state, lock ordering, atomicity, async task ownership, cancellation, retries, and race windows on reachable concurrent paths.
  • Inspect read-modify-write across await or yield points and build a resource/accessor timeline for shared files, subprocesses, terminal or OS resources, and repeated user triggers; include accessors outside the current process.
  • Check blocking I/O or synchronous waits in async paths, unbounded concurrency, orphan tasks, deadlocks, TOCTOU hazards, and thread-unsafe resources.
  • Inspect startup ordering, dependency readiness, configuration validation, fail-fast behavior, signal handling, graceful shutdown, and in-flight work draining.
  • Inventory resources acquired during startup and runtime, then match each to idempotent cleanup in safe reverse dependency order on success, failure, timeout, cancellation, and repeated shutdown signals.
  • Verify host-specific probe semantics: liveness failure should justify restart, readiness governs traffic eligibility, and startup checks protect initialization. Avoid dependency-triggered restart cascades and probes that create material load or side effects.

5. Validate Findings and Report

  • Research external APIs, standards, vulnerabilities, and runtime behavior only when they can change a finding, using official sources matching the relevant version.
  • Filter framework conventions, generated code, bounded administrative paths, tests, examples, and documented tradeoffs before confirming a candidate.
  • Reproduce high-severity issues with a safe command, test, minimal call trace, or complete static failure path whenever possible.
  • Apply the materiality gate: require a proven violation of an applicable accepted rule or concrete failure, security, delivery, operability, or recurring maintenance impact at evidenced scale. Reject taste, theoretical purity, generic practice, hypothetical scale, and reasonable alternatives; require the outcome or constraint, not a preferred implementation.
  • External correction evidence: Ground external corrections in version-matched official contracts, using primary engineering sources for unresolved tradeoffs. Cite the supported mechanism; local evidence suffices for local defects.
  • For each accepted finding, identify the bounded owning capability and observable correction evidence so remediation can proceed without repeating the audit or authorizing unrelated cleanup.
  • Classify findings as P0-P3 based on exploitability, data or availability impact, delivery blockage, recurrence, and remediation urgency.
  • Order remediation by risk reduction and dependency, not by file order or detector category.
  • Use BLOCKED when a required safety environment, high-risk behavior, or authoritative contract cannot be verified without a credible fallback; use FAIL for an evidenced unresolved P0/P1, required failing delivery gate, or demonstrated unsafe behavior; use CONCERNS only for verified non-blocking risks, and PASS only when required checks complete with no material finding.

Self-Check

  • Reconcile before returning. Check item-level evidence, requirement coverage, contradictions, scope, verdict, and applicable cleanup. Correct the report or authorized artifacts. Reuse valid evidence; do not automatically rescan the repository or rerun successful commands. Repeat checks only for relevant changes, failures, or unresolved evidence. Disclose remaining gaps.

Output Contract

Report in the user's language, in this order; label all five fields and state each fact once. Use controlled plain language: one fact per sentence, usually under 20 words, active voice, and one term per concept, with no synonyms for verdicts, IDs, or states. Small results may use one line per field; omit empty tables and do not copy linked artifacts:

  1. Result: The exact skill-specific verdict token first, then the supported outcome.
  2. Scope: Reviewed/changed scope, exclusions, baseline, and material assumptions.
  3. Evidence: Skill-specific fields below; distinguish facts, inferences, and unverified claims. Link artifacts; use tables when useful.
  4. Verification: Checks/results, unavailable evidence, and applicable cleanup/external state.
  5. Completion: Checklist: X/Y complete; Incomplete: None or each UNPROVEN item's reason, outcome impact, and exact next action; residual risks and required decisions.

Skill-specific evidence: Security, delivery, maintainability/dependencies, diagnosability, concurrency, and lifecycle evidence. Findings need priority, location, trigger or failure path, confidence, material impact, unacceptable tradeoff, and minimal remediation with expected effort; allow equivalent valid solutions. Order remediation by prerequisites and risk reduction, not detector count.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Evaluates new product opportunities through demand, channels and economics before committing to build.

中文简介正在准备中。当前显示原文说明。

levnikolaevich/claude-code-skills5812026年10月18日 更新

Defines product requirements, business rules and acceptance criteria for a committed intent; edits product docs only.

中文简介正在准备中。当前显示原文说明。

levnikolaevich/claude-code-skills5812026年10月18日 更新

Designs user flows, interaction states and mockups for a defined product scope; does not implement UI code.

中文简介正在准备中。当前显示原文说明。

levnikolaevich/claude-code-skills5812026年10月18日 更新

Defines measurable architecture drivers and constraints before system design; edits architecture docs only.

中文简介正在准备中。当前显示原文说明。

levnikolaevich/claude-code-skills5812026年10月18日 更新

Documents current architecture from implementation evidence; does not propose a target or audit fitness.

中文简介正在准备中。当前显示原文说明。

levnikolaevich/claude-code-skills5812026年10月18日 更新

Designs target system boundaries, contracts and tradeoffs from requirements; does not plan tasks or implement.

中文简介正在准备中。当前显示原文说明。

levnikolaevich/claude-code-skills5812026年10月18日 更新

查看 levnikolaevich 的全部技能

报告此技能的问题