본문으로 건너뛰기
cccskills
무료GitHub에 공개

codebase-audit

Codebase audit + refactoring workflow. Dead code detection, God Object splitting, duplicate function removal, design flaw identification, frontier comparison verification. Triggered by "audit" ("감사"), "dead code" ("데드코드"), "refactor" ("리팩토링"), "god object", "duplication" ("중복"), "design flaw" ("설계 결함") keywords.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Codebase Audit & Refactoring Workflow

A systematic workflow for auditing and improving the entire codebase.

Workflow

1. Audit
   → Dead code + duplicates + God Object + Parameter Bloat detection
2. Triage
   → Verdict: candidate / refactoring / defer, backed by caller evidence
3. Scope and plan
   → Record keep/change/delete decisions; tracking updates only when requested
4. Workspace Isolation
   → Worktree isolation
5. Implementation + Verification
   → Delete/extract/convert then lint + test
6. Docs-sync + authorized integration
   → CHANGELOG for functional changes; tracking docs follow their main-owned workflow

An audit alone does not authorize implementation, merge, global reinstall, or runtime restart. Use the canonical workflow for the requested scope; deploy or restart only when separately in scope.

Phase 1: Audit

Dead Code Detection

# Check import status per module
for f in $(find core/ -name "*.py" -not -name "__init__.py" -not -path "*__pycache__*"); do
    basename=$(basename $f .py)
    # Check using actual import path (basename match alone causes false positives)
    module_path=$(echo $f | sed 's/\.py$//' | tr '/' '.')
    count=$(grep -rn "from ${module_path}\|import ${module_path}" core/ --include="*.py" | grep -v "$f" | wc -l)
    if [ "$count" -eq 0 ]; then
        echo "CANDIDATE: $f ($(wc -l < $f) lines; no matching textual imports)"
    fi
done

Note: Search by full module path, not basename, to reduce false positives. This core-only text scan misses relative imports, outer-package callers, entrypoints, registries, public exports, and dynamic loading. Apply the deletion gate below before deciding that a module is unused.

Duplicate Function Detection

grep -rn "^def " core/ --include="*.py" | awk -F: '{split($NF,a," "); print a[2]}' | sort | uniq -c | sort -rn | head -10

Repeated names are discovery candidates, not proof of duplication. Trace full call paths and compare behavior; protocol methods and local helpers commonly share names legitimately.

God Object Detection (Kent Beck criteria)

find core/ -name "*.py" -not -path "*__pycache__*" -exec wc -l {} + | sort -rn | head -10
  • Large files are candidates for responsibility tracing, not automatic splits.
  • grep -c "^def " FILE counts top-level function declarations, not responsibilities. Trace callers, state ownership, and reasons to change before proposing a split.

Parameter Bloat Detection

grep -rn "def __init__" core/ --include="*.py" -A20 | grep -B1 "def __init__" | head -20
# Review call-site cohesion; parameter count alone is not a finding.

Phase 2: Triage

ClassificationCriteriaAction
Deletion candidateNo textual imports foundApply the agent anti-pattern deletion gate
RefactoringMultiple proven responsibilities or drift pathsUse the smallest extraction that removes the failure
DeferPlanned for future use, or requires large-scale changesKanban Backlog

Before implementation, use the finding record to connect the violated contract, actual caller, counterexample, smallest correction and surviving oracle. Review entry/registration, persisted readers and failure branches; discovery counts are not findings. For deletion, apply the existing deletion gate. Similar setup does not make distinct provider, route, cancellation or cleanup checks redundant. Keep the behavior oracle after refactoring or test deduplication.

Phase 3: Module Extraction Patterns

Circular Import Prevention

Trace dependency direction before extraction. A deferred back-import can hide the cycle rather than remove it; do not bypass a package boundary that way. Use naming conventions §1 and §6 for ownership and the limited reasons to defer an import.

Thin Wrapper (Delegation Function)

Keep a wrapper only for a named compatibility consumer and one canonical implementation. If only symbol identity must be preserved, prefer the existing explicit re-export pattern instead of introducing another function.

re-export (ruff F401 prevention)

from core.cli.tool_handlers import _build_tool_handlers as _build_tool_handlers

Phase 4: Verification

Preserve a surviving check for every affected behavior or invariant after deletion. Follow the verification reference for scope and evidence reuse; do not run a full suite merely to report an audit. Use scripts/preflight.sh when broad checks are warranted and report all skips.

Anti-patterns

  1. Searching imports by basename → false positives (e.g., "repl" matching the string "REPL")
  2. Treating shared names as duplicate behavior → trace callers before changing either implementation
  3. Not deleting originals after refactoring → the most dangerous pattern; old version called from serve, leading to lengthy debugging
  4. Reinstalling or restarting as an audit side effect → require an in-scope deployment request and verify the installation/process owner first

For dead-code or test-deletion decisions, follow .agents/skills/agent-anti-pattern/references/field-guide.md. Zero textual imports, file size, parameter count, and test-only callers are insufficient on their own; check entrypoints, registries, public exports, persisted state, and compatibility contracts first.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Audit agent runtimes and their tests for lifecycle inference, capability overload, context pollution, correlated verification, prompt-only control, false success, dead compatibility paths, test-only seams, and complexity without contribution. Use for whole-repository agent audits, slop or dead-code triage, test contribution reviews, large refactors, tool/context simplification, and cleanup requests that need proof before deleting code or tests.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mangowhoiscloud/geode152026년 10월 19일 업데이트

Diagnose agent operational failures through default-policy checks, multi-gap analysis, explicit service ownership, request-context lifetime, and degradation-versus-correctness checks.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mangowhoiscloud/geode152026년 10월 19일 업데이트

Align, run, audit, and publish GEODE benchmark comparisons against Agent-World arXiv 2604.18292v1 across MCP-Mark, BFCL V4, and tau2-bench. Use for Agent-World or AgentWorld comparison requests, cross-suite agent benchmark design, Tau2 comparator/profile diagnosis, paired thin-runtime-versus-GEODE experiments, mean-accuracy@8 replication, or benchmark comparability and artifact reviews.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mangowhoiscloud/geode152026년 10월 19일 업데이트

Verification checklist to prevent fake success. Detects test deletion/disabling, coverage regression, lint bypass, secret exposure. Triggered by "deception", "fake" ("가짜"), "fake success", "verification" ("검증"), "checklist" ("체크리스트"), "deletion detection" ("삭제 탐지"), "regression" keywords.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mangowhoiscloud/geode152026년 10월 19일 업데이트

Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use when architecting complex backend systems or refactoring existing applications for better maintainability.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mangowhoiscloud/geode152026년 10월 19일 업데이트

Auto-search and summarize latest AI/agent papers.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mangowhoiscloud/geode152026년 10월 19일 업데이트

mangowhoiscloud의 스킬 모두 보기

이 스킬의 문제 신고