You are helping the team audit third-party scripts running on the Jocko Fuel storefront.
Follow these steps:
Step 1: Identify Scripts
Delegate to the script-investigator agent to catalog all third-party scripts on the target page(s). For each script, capture:
- Source domain (e.g., googletagmanager.com, klaviyo.com)
- Purpose (analytics, marketing, chat widget, A/B testing, etc.)
- Load method (sync, async, defer)
- File size (KB transferred)
Ask the user which page to audit, or default to the homepage.
Step 2: Analyze Performance Impact
For each script, delegate to the performance-auditor agent to measure:
- Load time contribution (ms added to page load)
- Main thread blocking time (ms of main thread occupied)
- Network requests triggered (cascading requests from the script)
- Total resource footprint (KB of JS, CSS, images loaded)
Rank scripts by total performance impact (highest impact first).
Step 3: Check Security Concerns
Delegate to the script-investigator agent to evaluate:
- Are scripts loaded over HTTPS?
- Do any scripts have known vulnerabilities?
- Are there scripts from unfamiliar or untrusted domains?
- Do any scripts access sensitive data (cookies, form inputs)?
- Are Content Security Policy headers properly configured?
Step 4: Generate Recommendations
For each script, recommend one of:
- Keep: Essential, well-optimized, no concerns
- Optimize: Needed but can be deferred, async-loaded, or version-updated
- Review: Purpose unclear or redundant with another script
- Remove: Unused, high-impact, or security risk
Present as a table with script name, purpose, impact score, security risk, and recommendation.
Error Handling
- If the page uses a consent manager that blocks scripts, note which scripts load before/after consent
- If script sources are obfuscated, flag them for manual review
- If performance measurement tools are unavailable, provide qualitative assessment based on script analysis
1---2name: script-audit3description: Audit third-party scripts on the storefront for performance and security impact4---5
6You are helping the team audit third-party scripts running on the Jocko Fuel storefront.
7
8Follow these steps:
9
10### Step 1: Identify Scripts
11
12Delegate to the `script-investigator` agent to catalog all third-party scripts on the target page(s). For each script, capture:
13- **Source domain** (e.g., googletagmanager.com, klaviyo.com)
14- **Purpose** (analytics, marketing, chat widget, A/B testing, etc.)
15- **Load method** (sync, async, defer)
16- **File size** (KB transferred)
17
18Ask the user which page to audit, or default to the homepage.
19
20### Step 2: Analyze Performance Impact
21
22For each script, delegate to the `performance-auditor` agent to measure:
23- **Load time contribution** (ms added to page load)
24- **Main thread blocking time** (ms of main thread occupied)
25- **Network requests triggered** (cascading requests from the script)
26- **Total resource footprint** (KB of JS, CSS, images loaded)
27
28Rank scripts by total performance impact (highest impact first).
29
30### Step 3: Check Security Concerns
31
32Delegate to the `script-investigator` agent to evaluate:
33- Are scripts loaded over HTTPS?
34- Do any scripts have known vulnerabilities?
35- Are there scripts from unfamiliar or untrusted domains?
36- Do any scripts access sensitive data (cookies, form inputs)?
37- Are Content Security Policy headers properly configured?
38
39### Step 4: Generate Recommendations
40
41For each script, recommend one of:
42- **Keep**: Essential, well-optimized, no concerns
43- **Optimize**: Needed but can be deferred, async-loaded, or version-updated
44- **Review**: Purpose unclear or redundant with another script
45- **Remove**: Unused, high-impact, or security risk
46
47Present as a table with script name, purpose, impact score, security risk, and recommendation.
48
49### Error Handling
50
51- If the page uses a consent manager that blocks scripts, note which scripts load before/after consent
52- If script sources are obfuscated, flag them for manual review
53- If performance measurement tools are unavailable, provide qualitative assessment based on script analysis