.cursor/skills/path-to-regexp-v8-migration/SKILL.md
Migrate @data-client/rest path strings from path-to-regexp v6 to v8 syntax. Use when upgrading path-to-regexp, updating RestEndpoint.path or resource path strings, or when seeing errors about unexpected ?, +, (, or ) in paths.
npx skillsauth add reactive/data-client path-to-regexp-v8-migrationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Applies to path in RestEndpoint, resource(), and any string passed to path-to-regexp.
Reference: path-to-regexp README errors section
? suffix removed. Wrap the optional segment (including its prefix) in {}.
/:id? → {/:id}
/users/:id? → /users{/:id}
/files/:name? → /files{/:name}
+ (one-or-more) and * (zero-or-more) suffixes removed. Use *name wildcard syntax.
/:path+ → /*path
/:path* → {/*path}
Parameter names must be valid JS identifiers. Names with special characters need double quotes.
/:with-dash → /:"with-dash"
/:my.param → /:"my.param"
Characters including {}()[]+?!:*\\ must be escaped with \\ when used as literals (see
path-to-regexp errors). A literal ? in the path
(e.g. before fixed query text like ?per_page=50) must stay as \\? in the source string — removing the
backslash causes Unexpected ? at compile() time.
/(literal) → /\\(literal\\)
/[bracket] → /\\[bracket\\]
/a+b → /a\\+b (+ is special unless escaped)
/resource?p=1 → /resource\\?p=1 (? starts a modifier unless escaped)
Optional path params no longer use a trailing ? on :name — use {/:name} instead (see above); that is different from a literal ? in the URL.
Inline regex like /:id(\d+) is no longer supported. Remove regex patterns.
/:id(\d+) → /:id
Optional with prefix:
/:attr1?{-:attr2}?{-:attr3}? → {/:attr1}{-:attr2}{-:attr3}
Query params embedded in path (prefer grouped params; do not drop \\ before a literal ? unless you rewrite to this form):
/search\\?q=:q?&page=:page? → /search?{q=:q}{&page=:page}
Search patterns for locating v6 paths in a codebase:
path: properties in RestEndpoint, resource(), .extend() callsdocs/rest/api/typescript-tests/pathTypes.ts infers TypeScript parameter types from path strings:
:name and *name → required parameter{/:name} and {/*name} → optional parameter (trailing } signals optionality):"quoted" → CleanKey strips quotes for the property name\\: / \\* / \\} → escaped, not treated as parameterstools
Create a GitHub pull request from current working changes. Handles all git states - uncommitted changes, no branch, unpushed commits, etc. Analyzes diffs and changesets to generate a PR with filled-in template. Opens the PR in the browser when done. Use when the user asks to create a PR, open a PR, submit changes, or push for review.
development
Write, update, and format docs for public APIs - API reference, README, docstrings, usage examples, migration guides, deprecation notices
tools
Setup, install, and onboard new developers to Reactive Data Client monorepo - nvm, yarn, build, test, getting started guide
development
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.