SKILL.md
Custom Code Management
Add, review, and manage inline custom scripts on a Webflow site — analytics, tracking pixels, chat widgets, or any custom JavaScript.
Important Note
ALWAYS use Webflow MCP tools for all operations:
- Use Webflow MCP's
webflowguidetoolto get best practices before any other tool call - Use Webflow MCP's
datasitestoolwith actionlist_sitesto identify available sites - Use Webflow MCP's
datascriptstoolwith actionlistregisteredscriptsto list all registered scripts - Use Webflow MCP's
datascriptstoolwith actionlistappliedscriptsto list scripts applied to pages - Use Webflow MCP's
datascriptstoolwith actionaddinlinesite_scriptto register a new inline script - Use Webflow MCP's
datascriptstoolwith actiondeleteallsite_scriptsto remove ALL site scripts (no selective delete) - Use Webflow MCP's
datascriptstoolwith actiongetpagescriptto get custom code for a specific page - Use Webflow MCP's
datascriptstoolwith actionupsertpagescriptto add or update page-level custom code - Use Webflow MCP's
datascriptstoolwith actiondeleteallpage_scriptsto remove all custom code from a page - All tool calls must include the required
contextparameter (15-25 words, third-person perspective)
Instructions
Phase 1: Discovery
- Call
webflowguidetoolfirst — always the first MCP tool call - Get the site: Use
datasitestoolwith actionlist_sites. If only one site, use it automatically.
Phase 2: Analysis
- List scripts: Call
listregisteredscriptsandlistappliedscriptsin parallel - Check page-level scripts (if relevant): Use
getpagescriptfor specific pages - Present findings: Name, version, location (header/footer), registration vs application status
Phase 3: Planning & Confirmation
Before any mutation, present the plan and require explicit confirmation:
- Adding scripts: user must type "add"
- Removing ALL site scripts: user must type "delete all" (warn: no selective delete)
- Page-level changes: user must type "update"
Phase 4: Execution
- Add site script:
addinlinesite_scriptwith displayName, sourceCode, version, location, canCopy - Remove all site scripts:
deleteallsite_scripts - Add/update page script:
upsertpagescript - Remove page scripts:
deleteallpage_scripts
Phase 5: Verification
- Re-list scripts to confirm success
- Report what changed (name, location, version, char count)
- Remind user to publish — suggest using
safe-publishskill
Examples
Example 1: View scripts
User: "What scripts are on my site?"
webflowguidetool→datasitestool→listregisteredscripts+listappliedscriptsin parallel- Present summary of all scripts
Example 2: Add Google Tag Manager
User: "Add GTM to my site"
webflowguidetool→datasitestool→ ask for GTM container ID- Preview script, require "add" →
addinlinesite_script(header, version "1.0.0") - Verify and remind to publish
Example 3: Remove all scripts
User: "Remove all scripts"
webflowguidetool→datasitestool→ list current scripts- Warn: removes ALL scripts. Require "delete all" →
deleteallsite_scripts - Verify and remind to publish
Example 4: Page-specific tracking
User: "Add conversion tracking to my thank-you page"
webflowguidetool→datasitestool→getpagescriptto check existing- Preview, require "update" →
upsertpagescript - Verify and remind to publish
Guidelines
webflowguidetoolalways first — before any other MCP tool- No
<script>tags — Webflow adds them automatically - Max 10,000 characters per script;
displayName+versionmust be unique - Site-level scripts (
addinlinesitescript) apply to all pages; page-level scripts (upsertpage_script) apply to one page - No selective delete —
deleteallsite_scriptsremoves everything; always list scripts first so user knows what will be lost - Hosted/external scripts not available via MCP — inline only
- Recommend header for analytics (GA, GTM); footer for chat widgets and non-critical scripts
- If
displayName + versionexists, suggest incrementing the version - Always remind users to publish after changes