test/failing-test
測試錯誤可見性
開發者需要可靠的方法來測試 AI 工具環境中的錯誤處理與輸出可見性。此測試工具會以可見的 stdout 與 stderr 輸出來模擬失敗,用於驗證錯誤回報流程。
スキルZIPをダウンロード
Claudeでアップロード
設定 → 機能 → スキル → スキルをアップロードへ移動
オンにして利用開始
テストする
「test/failing-test」を使用しています。 Use failing-test with message 'Connection timeout'
期待される結果:
- === Starting Test Tool ===
- Message: Connection timeout
- This is stdout output before the error
- === Error Output ===
- This is stderr output
- Error: Simulated failure for testing error visibility
- Stack trace:
- Error: Simulated failure for testing error visibility
- at Object.<anonymous> (/workspace/script.js:13:15)
- at Module._compile (node:internal/modules/cjs:893:27)
- at Object.Module._extensions..js (node:internal/modules/cjs:1105:10)
「test/failing-test」を使用しています。 Use failing-test with message 'Authentication failed'
期待される結果:
- === Starting Test Tool ===
- Message: Authentication failed
- This is stdout output before the error
- === Error Output ===
- This is stderr output
- Error: Simulated failure for testing error visibility
セキュリティ監査
低リスクStatic analysis flagged 2 potential security issues regarding weak cryptographic algorithms at SKILL.md:4 and SKILL.md:12. Investigation reveals these are FALSE POSITIVES. Line 4 contains a YAML description field ('A test tool that fails with visible output') and line 12 contains another description field ('Message to print before failing'). Both are plain text with no cryptographic content. The scanner incorrectly flagged the word 'fail' as a cryptographic weakness. The script.js file is a simple test tool that prints output and exits with error code 1 - no malicious behavior detected. Minor risk factor: script execution with command-line arguments.
高リスクの問題 (2)
リスク要因
⚡ スクリプトを含む (1)
品質スコア
作れるもの
驗證 AI 工具錯誤處理
透過呼叫可預期失敗且具有可見輸出的工具,測試 AI 助手對工具失敗的回應方式。
除錯錯誤可見性流程
確認 stderr 與 stdout 在你的開發環境中能被正確擷取並顯示。
測試 CI/CD 錯誤管線
用於自動化測試以確保持續整合流程中的錯誤狀況能被正確處理。
これらのプロンプトを試す
Use the failing-test tool with the message 'Testing error visibility'
Call the failing-test tool with a custom message describing a simulated scenario
Use failing-test multiple times with different messages to test error handling in workflows
Use failing-test in combination with other tools to verify error propagation behavior
ベストプラクティス
- 使用自訂訊息來區分測試中的不同失敗情境
- 同時擷取 stdout 與 stderr,以驗證完整的錯誤可見性
- 檢查錯誤代碼 1,以確認為刻意失敗行為
回避
- 不要用於生產流程 — 此工具依設計一律失敗
- 不要期待此工具執行任何有用工作,除了產生錯誤
- 不要依賴特定堆疊追蹤內容,因為它可能因環境而異