스킬 dead-code-removal
🧹

dead-code-removal

낮은 위험 ⚡ 스크립트 포함📁 파일 시스템 액세스

安全移除無用程式碼

또한 다음에서 사용할 수 있습니다: Joseph OBrien

未使用的程式碼會使專案膨脹並增加維護成本。此技能可偵測多種語言中未使用的引入、函式和類別,並透過安全檢查來保留關鍵程式碼。

지원: Claude Codex Code(CC)
📊 71 적절함
1

스킬 ZIP 다운로드

2

Claude에서 업로드

설정 → 기능 → 스킬 → 스킬 업로드로 이동

3

토글을 켜고 사용 시작

테스트해 보기

"dead-code-removal" 사용 중입니다. Remove unused imports and functions from src/utils/helpers.py

예상 결과:

  • Analysis of src/utils/helpers.py:
  • - 8 imports found, 3 unused
  • - Unused: os (line 2), json (line 3), timedelta (line 5)
  • - 2 functions analyzed, 0 unused
  • - Safe to remove: All 3 imports
  • Validation: Syntax check passed, no dynamic usage detected

"dead-code-removal" 사용 중입니다. Clean up the entire src/services/ directory

예상 결과:

  • Analyzed 12 files in src/services/
  • - 45 functions found, 2 unused
  • - formatOldDate() is safe to remove (no references)
  • - legacyAuth() preserved - referenced in routes
  • - Created backup: unused_code_backup_20251215_143022
  • Recommend: Remove formatOldDate() only after tests pass

"dead-code-removal" 사용 중입니다. Find all unused imports in the Python files

예상 결과:

  • Running find-unused-imports.py on 15 files:
  • Results: 23 unused imports found
  • - utils.py: 4 unused (os, json, re, datetime)
  • - auth.py: 2 unused (uuid, hashlib)
  • - models.py: 1 unused (typing)
  • - Run with --remove to auto-clean or review manually

보안 감사

낮은 위험
v3 • 1/16/2026

Legitimate code cleanup tool with safe implementation. The Python helper script uses only AST parsing for static analysis. All static findings are false positives: 'cryptographic algorithm' flags are scanner errors, 'eval()' and 'import()' mentions are documentation about safety checks, and 'shell backtick' findings are markdown code examples. No network calls, no credential access, no dangerous runtime execution.

3
스캔된 파일
648
분석된 줄 수
2
발견 사항
3
총 감사 수

위험 요인

⚡ 스크립트 포함 (1)
📁 파일 시스템 액세스 (1)
감사자: claude 감사 이력 보기 →

품질 점수

45
아키텍처
100
유지보수성
85
콘텐츠
24
커뮤니티
90
보안
100
사양 준수

만들 수 있는 것

重構後清理

移除功能開發或重構工作階段後留下的未使用程式碼。

減少套件大小

在部署前識別並移除無用程式碼,以減少套件大小並提升效能。

維護程式碼品質

在程式碼審查期間找出並報告未使用的程式碼,以保持程式碼庫精簡。

이 프롬프트를 사용해 보세요

基本清理
Find and remove all unused imports and functions in this project. Use conservative mode and create a backup first.
特定目錄
Clean up dead code in the src/utils/ directory. Identify unused imports and functions but ask before removing.
引入分析
Use the find-unused-imports.py script to analyze src/ and find all unused imports. Show me the results.
安全審查
Analyze the codebase for unused code. Apply safety checks for dynamic usage patterns like getattr, eval, and dynamic imports before removing anything.

모범 사례

  • 移除程式碼後務必執行測試以驗證沒有破壞任何功能
  • 在批量移除前建立備份,以便快速回滾
  • 保留框架模式,如路由、元件和控制器

피하기

  • 在不了解程式碼用途或依賴關係的情況下移除程式碼
  • 跳過動態使用模式的安全檢查
  • 在沒有逐步驗證的情況下進行批量移除

자주 묻는 질문

此技能支援哪些語言?
支援 Python、JavaScript、TypeScript、Java、Go 和 Rust,並使用特定語言的偵測模式。
移除前會執行哪些安全檢查?
會檢查動態引入、反射使用、框架模式和進入點引用。
此技能會直接修改檔案嗎?
此技能會建議變更並建立備份,但會在套用移除前先提示確認。
我的程式碼資料安全嗎?
此技能僅讀取檔案進行分析。不會將資料傳送至外部,也不會儲存超出本機備份的資料。
如果移除破壞了我的程式碼怎麼辦?
變更前會建立備份。如果發生問題,您可以從備份目錄還原。
這與 linter 有何不同?
此技能會跨檔案進行更深入的依賴分析,而不僅僅是本機語法檢查。

개발자 세부 정보

파일 구조