Claude-skill-registry kirby-routing-and-representations
Implements custom Kirby routes and content representations (.json/.xml/.rss), including redirects, sitemap endpoints, and URL pattern filtering. Use when building endpoints, redirects, or representation templates that change how URLs resolve.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/kirby-routing-and-representations" ~/.claude/skills/majiayu000-claude-skill-registry-kirby-routing-and-representations && rm -rf "$T"
manifest:
skills/data/kirby-routing-and-representations/SKILL.mdsource content
Kirby Routing and Representations
KB entry points
kirby://kb/scenarios/13-custom-routeskirby://kb/scenarios/21-filtering-via-routeskirby://kb/scenarios/49-sitemap-xml-routekirby://kb/scenarios/78-trailing-slash-and-canonical-urlskirby://kb/scenarios/02-json-content-representation-ajax-load-more
Required inputs
- URL pattern and HTTP methods.
- Response type and content language behavior.
- Redirect or canonicalization rules.
Decision guide
- Use content representations for page-backed JSON/XML/RSS.
- Use routes for non-page endpoints, redirects, or custom logic.
- Avoid greedy patterns that shadow representations.
Pattern hint
- Put specific routes before catch-alls; avoid top-level
when using representations.(:all)
Canonical redirect example
[ 'pattern' => '(:any)/', 'action' => function ($path) { return go('/' . trim($path, '/'), 301); } ]
Common pitfalls
- Route patterns that shadow
or.json
representations..rss - Expecting
to execute route logic.kirby:kirby_render_page
Workflow
- Clarify the URL pattern, HTTP methods, response type, and language behavior.
- Call
and readkirby:kirby_init
to locate config and template roots.kirby://roots - Read
to understand current route configuration.kirby://config/routes - If runtime is available, call
to see registered patterns; otherwise runkirby:kirby_routes_index
andkirby:kirby_runtime_status
first.kirby:kirby_runtime_install - Inspect existing templates/controllers to avoid collisions:
kirby:kirby_templates_indexkirby:kirby_controllers_index
- For content representations, add
and optionalsite/templates/<template>.<type>.php
.site/controllers/<template>.<type>.php - For routes, add or adjust
inroutes
or a plugin. Avoid greedy patterns that shadowsite/config/config.php
/.json
representations..rss - Validate output:
- use
for representationskirby:kirby_render_page(contentType: json|xml|rss) - manually hit route URLs for router behavior (render does not execute the router)
- use
- Search the KB with
(examples: "custom routes", "json content representation", "filtering via routes", "sitemap.xml", "trailing slash").kirby:kirby_search