fix-csp-compliance

fix-csp-compliance is a skill for Claude Code, Codex from UI5/plugins-coding-agents. It costs 121 tokens per session (2,716 once invoked), scanned A, original, Apache-2.0.

A repair guide for unsafe inline JavaScript reported by a Content Security Policy, a browser security system that restricts where code may run. It moves code written inside HTML into separate JavaScript files.

In plain words
What is it for?
Use it when HTML contains inline script tags or handlers such as onclick and onload, so the code can be referenced from external JavaScript files.
Why use it?
It removes the linter warning while preserving inline code such as setup logic, configuration, and event behavior.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when HTML contains inline script tags or handlers such as onclick and onload, so the code can be referenced from external JavaScript files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ui5/plugins-coding-agents/fix-csp-compliance
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add UI5/plugins-coding-agents --skill fix-csp-compliance
Clone the repo
git clone --depth 1 https://github.com/UI5/plugins-coding-agents

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fix-csp-compliance

README.md
[![agentmods](https://agentmods.dev/badge/skills/ui5/plugins-coding-agents/fix-csp-compliance/github.svg)](https://agentmods.dev/skills/ui5/plugins-coding-agents/fix-csp-compliance)
Your own site
<a href="https://agentmods.dev/skills/ui5/plugins-coding-agents/fix-csp-compliance"><img src="https://agentmods.dev/badge/skills/ui5/plugins-coding-agents/fix-csp-compliance/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for fix-csp-compliance

Your own site · 80×15
<a href="https://agentmods.dev/skills/ui5/plugins-coding-agents/fix-csp-compliance"><img src="https://agentmods.dev/badge/skills/ui5/plugins-coding-agents/fix-csp-compliance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 121 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,716 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 4 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Prompt Injection · line 54
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • high Prompt Injection · line 91
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • high Prompt Injection · line 228
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • high Prompt Injection · line 304
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00121 $0.02716
Opus 5.5 $0.00048 $0.01086
Sonnet 5.5 $0.00024 $0.00543
Haiku 4.5 $0.00012 $0.00272

Measured 3mo ago against content hash da6952e07425, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

fix-csp-compliance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/ui5-modernization/skills/fix-csp-compliance/SKILL.md · 438 lines

How it starts

The opening of the file, as written. The whole thing — 438 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Fix CSP Compliance - Unsafe Inline Scripts

Key Rules

  1. NEVER delete inline script content. Always extract it to an external .js file and replace the inline <script>...</script> with <script src="filename.js"></script>. Even trivial config objects, debug flags, or seemingly unused code must be externalized — removal is a functional regression.
  2. File naming: use a descriptive name matching the content's purpose (e.g., appConfig.js for configuration, init.js for initialization).

This skill fixes Content Security Policy (CSP) compliance issues that the UI5 linter detects but cannot auto-fix because they require restructuring code into external files.

Linter Rule Handled

Rule ID Message Pattern Severity This Skill's Action
csp-unsafe-inline-script Use of unsafe inline script Warning Move to external JS file

When to Use

Apply this skill when you see linter output like:

index.html:15:5 warning Use of unsafe inline script  csp-unsafe-inline-script
test.html:20:5 warning Use of unsafe inline script  csp-unsafe-inline-script

Background: Why CSP Matters

Content Security Policy (CSP) is a security feature that helps prevent:

  • Cross-Site Scripting (XSS) attacks
  • Data injection attacks
  • Unauthorized script execution

Inline scripts are considered unsafe because an attacker who manages to inject HTML can also inject malicious JavaScript. CSP-compliant apps use script-src 'self' which blocks inline scripts.

Documentation: Content Security Policy

Detection

The linter flags <script> tags that:

  • Have NO src attribute AND
  • Have inline JavaScript content

Flagged:

<script>
    console.log("Inline code");  <!-- Flagged -->
</script>

<script type="text/javascript">
    doSomething();  <!-- Flagged -->
</script>

<script type="module">
    import { foo } from './foo.js';  <!-- Flagged -->
</script>

Read the full file on GitHub · 438 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 438 lines · 121 tokens per session scan A da6952e07425

Subscribe to this mod's changes

fix-csp-compliance is a skill published in the GitHub repository UI5/plugins-coding-agents (48 stars, last pushed 3d ago), licensed Apache-2.0. It adds 121 tokens to every session and 2,716 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

fix-csp-compliance compared with skills from other repositories

fix-csp-compliance next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
fix-csp-complianceUI5/plugins-coding-agentsSkill483d agoApache-2.0A121Claude Code, Codex
plugin-initzhinjs/zhinSkill136yesterdayMITA56Claude Code, Codex
plugin-publishzhinjs/zhinSkill136yesterdayMITA58Claude Code, Codex
plugin-developzhinjs/zhinSkill136yesterdayMITA70Claude Code, Codex
wordpress-plugin-fundamentalsbobmatnyc/claude-mpm-skillsSkill794mo agoMITA32Claude Code
plugin-authoringMaxQian888/cognia-nextSkill87d agoAGPL-3.0A21Claude Code
mcp-buildermartineserios/thebranaSkill39d agoMITA19Claude Code