console-cleanup
できること
このスキルは、ライブのサイトで実行されるべきでないconsoleの文が、JavaScriptにないかを確認します。公開に向けてスクリプトを準備する開発者向けです。
使う場面
- ✓本番のスクリプトに、console.logやconsole.debugの呼び出しがあるとき。
- ✓デバッグのメッセージが、訪問者に非公開の情報を明かすおそれがあるとき。
- ✓ログを自動で取り除くべきビルドを設定するとき。
スキルのリンク
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/console-cleanup/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“公開の前に、私のチェックアウトのスクリプトからデバッグ用のログを取り除いてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントはconsoleの文を見つけて取り除くか、本番では無効になるログの仕組みに切り替えます。エラーのログは、必要な場所に残します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Remove console statements in production
Console statements leak sensitive information, impact performance, and create unprofessional user experiences when visible in production.
Quick Reference
- Remove console.log, console.debug, console.table before production
- Use environment-aware logging utilities
- Configure build tools to strip console statements automatically
- Keep console.error for critical error tracking if needed
Check
Scan this JavaScript code for console.log, console.debug, console.warn, console.error, and other console statements that should be removed before production deployment.
Fix
Remove or conditionally disable console statements for production, or replace them with a proper logging service.
Explain
Explain why console statements should be removed from production code and alternatives for logging.
Code Review
Review scripts, client components, and browser execution paths related to Remove console statements in production. Flag exact imports, event handlers, runtime side effects, or blocking operations that violate the rule, and state how the change should be verified in the browser.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/javascript/console-cleanup
よくある質問
本番でconsoleの文は、なぜ問題ですか?
機密の情報を漏らしたり、性能に影響したり、プロフェッショナルに見えなかったりするおそれがあると、このスキルは説明しています。
エラーのログは残せますか?
はい。エラーの追跡に必要なら、console.errorは残せると、このスキルは説明しています。
consoleのログの良い代わりは何ですか?
環境に応じて切り替わるログのツール、または適切なログのサービスです。
詳細
作者による元の説明
Use when reviewing scripts, client components, bundles, or runtime behavior related to Remove console statements in production. Inspect both source code and the browser execution path so fixes target the real bottleneck or bug.
人気
- GitHubのスター
- 75k
- ランキング
- #2780
- ライセンス
- MIT
- 更新日
- 2026/10/31
コメント
- …
このリポジトリの他のスキル
frontendchecklist
75kコマンドラインツールを使って、フロントエンドのコードとライブページを、アクセシビリティ、速度、SEO、セキュリティに関する380以上のルールと照らし合わせて確認します。
frontend-checklist-global
75kフロントエンドのプロジェクトを、386のFront-End Checklistのルールすべてと照らし合わせて監査し、見つかった問題ごとに具体的な修正方法を示します。
404-page
75k見つからないページの画面に役立つリンクがあり、本物の404ステータスを返すかを確認し、迷った訪問者が目的のページを見つけられるようにします。
about-page
75kサイトの運営者が誰かを説明する、分かりやすいAboutページがあるかを確認し、訪問者と検索エンジンからの信頼を高めます。
似ているスキル
angular-developer
280kエージェントがAngularのコードを作成し、プロジェクト構成についてアドバイスできるようにします。新しいプロジェクトの開始、コード部品の作成、パフォーマンスやアクセシビリティの改善に役立ちます。
frontend-a11y
280kエージェントが Web インターフェースを誰にとっても使いやすくするよう支援します。スクリーンリーダーやキーボード操作に対応し、サイトやアプリが適切に動作するようにします。
frontend-patterns
280kエージェントがフロントエンド開発の最新パターンを適用できるようにします。React と Next.js において、パフォーマンスの最適化、状態管理、ベストプラクティスの遵守を行います。