vtex-io-rootpath — Claude Code skill for VTEX IO rootPath
A skill for VTEX IO apps in multi-binding stores: shows how to build URLs with the binding's path prefix. Useful when links 404 or point to the wrong locale.
npx skills add vtex/skills --skill vtex-io-rootpath -a claude-codeWhat vtex-io-rootpath does
This skill covers rootPath handling in VTEX IO stores where several bindings share one domain behind path prefixes (store.com/us/, store.com/br/). It walks through pulling rootPath out of the x-vtex-root-path header, the useRuntime().rootPath hook in React, URL building on the backend, link generation and asset paths.
Inside are decision rules and hard constraints. A Node backend needs an early middleware, usually named prepare, that reads the header, normalizes the value and stores it on ctx.state.rootPath; the same middleware sets Vary: x-vtex-root-path so CDN caching stays per binding. React components read the prefix through the hook from vtex.render-runtime. One more requirement: sanitize rootPath, since a value of "/" concatenated with a path yields a double slash (//product/shoes) — that breaks canonical URLs and can trigger redirect loops.
The skill is not meant for stores with a separate domain per locale, nor for general IO backend patterns. Hardcoding a prefix such as /us/ breaks every other binding, and that is the failure this skill is built around.
What it helps with
- build canonical URLs that carry the binding prefix
- fix 404s and wrong links in a multi-binding store
- wire a
preparemiddleware that readsx-vtex-root-path - strip double slashes when
rootPath === "/" - generate sitemap entries per binding
Example prompts for the agent
- Show me how the
preparemiddleware should readx-vtex-root-pathintoctx.state.rootPath. - Build a product canonical URL with
rootPathon a VTEX IO backend. - How do I read
rootPathin a React component withuseRuntime()?
How to install vtex-io-rootpath
1Skills CLI (Vercel)
npx skills add vtex/skills --skill vtex-io-rootpath -a claude-code2Manually: put the files in place
~/.claude/skills/vtex-io-rootpath/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/vtex-io-rootpath/
1Skills CLI (Vercel)
npx skills add vtex/skills --skill vtex-io-rootpath -a codex2Manually: put the files in place
.agents/skills/vtex-io-rootpath/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add vtex/skills --skill vtex-io-rootpath -a cursor2Manually: put the files in place
.cursor/skills/vtex-io-rootpath/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install vtex/skills vtex-io-rootpath2Manually: put the files in place
.github/skills/vtex-io-rootpath/SKILL.md1Skills CLI (Vercel)
npx skills add vtex/skills --skill vtex-io-rootpath -a gemini-cli2Platform CLI
gemini skills install https://github.com/vtex/skills --path skills/vtex-io-rootpathManually: put the files in place
.devin/skills/vtex-io-rootpath/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add vtex/skills --skill vtex-io-rootpath -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about vtex-io-rootpath
How do I install vtex-io-rootpath in Claude Code?
Run npx skills add vtex/skills --skill vtex-io-rootpath -a claude-code. The skill lands at ~/.claude/skills/vtex-io-rootpath/SKILL.md.
What does vtex-io-rootpath do?
It explains how to build URLs, links, redirects and asset paths with the binding prefix in multi-binding VTEX IO stores. Both Node backends and React frontends are covered.
When should I skip this skill?
When each locale has its own domain and no path prefix is involved. It also does not replace general IO backend patterns or CDN configuration.