File tree Expand file tree Collapse file tree 3 files changed +83
-0
lines changed
Expand file tree Collapse file tree 3 files changed +83
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ import json
3+ import re
4+ import sys
5+
6+ data = json .load (sys .stdin )
7+ url = data .get ('tool_input' , {}).get ('url' , '' )
8+
9+ if 'ci.aztec-labs.com' in url :
10+ # Allow if basic auth is present (user:pass@)
11+ if re .search (r'://[^/:]+:[^/@]+@ci\.aztec-labs\.com' , url ):
12+ sys .exit (0 )
13+ print (f'BLOCKED: Cannot WebFetch ci.aztec-labs.com (requires auth). Use /ci-logs skill instead: /ci-logs { url } ' , file = sys .stderr )
14+ sys .exit (2 )
15+
16+ sys .exit (0 )
Original file line number Diff line number Diff line change 1+ {
2+ "hooks" : {
3+ "PreToolUse" : [
4+ {
5+ "matcher" : " WebFetch" ,
6+ "hooks" : [
7+ {
8+ "type" : " command" ,
9+ "command" : " python3 .claude/scripts/check-ci-url.py"
10+ }
11+ ]
12+ }
13+ ]
14+ }
15+ }
Original file line number Diff line number Diff line change 1+ ---
2+ name : ci-logs
3+ description : Analyze CI logs from ci.aztec-labs.com. Use this instead of WebFetch for CI URLs.
4+ user-invocable : true
5+ arguments : <url-or-hash>
6+ ---
7+
8+ # CI Log Analysis
9+
10+ When you need to analyze logs from ci.aztec-labs.com, use the Task tool to spawn the analyze-logs agent.
11+
12+ ## Usage
13+
14+ 1 . ** Extract the hash** from the URL (e.g., ` http://ci.aztec-labs.com/e93bcfdc738dc2e0 ` → ` e93bcfdc738dc2e0 ` )
15+
16+ 2 . ** Spawn the analyze-logs agent** using the Task tool:
17+
18+ ```
19+ Task(
20+ subagent_type: "analyze-logs",
21+ prompt: "Analyze CI log hash: <hash>. Focus: errors",
22+ description: "Analyze CI logs"
23+ )
24+ ```
25+
26+ ## Examples
27+
28+ ** User asks:** "What failed in http://ci.aztec-labs.com/343c52b17688d2cd "
29+
30+ ** You do:**
31+ ```
32+ Task(
33+ subagent_type: "analyze-logs",
34+ prompt: "Analyze CI log hash: 343c52b17688d2cd. Focus: errors. Download with: yarn ci dlog 343c52b17688d2cd > /tmp/343c52b17688d2cd.log",
35+ description: "Analyze CI failure"
36+ )
37+ ```
38+
39+ ** For specific test analysis:**
40+ ```
41+ Task(
42+ subagent_type: "analyze-logs",
43+ prompt: "Analyze CI log hash: 343c52b17688d2cd. Focus: test 'my test name'",
44+ description: "Analyze test failure"
45+ )
46+ ```
47+
48+ ## Do NOT
49+
50+ - Do NOT use WebFetch to access ci.aztec-labs.com (requires auth)
51+ - Do NOT try to curl the URL directly
52+ - Always use the analyze-logs agent which knows how to use ` yarn ci dlog `
You can’t perform that action at this time.
0 commit comments