一键导入
horse-advanced-routing
Guidelines and workflows for developing and maintaining regular expressions and optional parameter routing features in the Horse framework.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guidelines and workflows for developing and maintaining regular expressions and optional parameter routing features in the Horse framework.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guidelines for registering, executing, and optimizing native high-precision telemetry hooks (AddOnTelemetry) in the Horse Web Framework.
Guidelines for instantiating and configuring independent Horse server instances (THorseInstance) running concurrently on different ports.
Guide for setting up thread-safe database connection pooling (FireDAC / UniDAC) in multithreaded Horse applications.
Guide for managing request-scoped contextual services and IoC (dependency injection) in Delphi and Lazarus.
Guide to using standard Horse middlewares (CORS, Jhonson, compression, basic-auth, logger) and pipeline registration order.
Guidelines for setting up endpoints, defining path parameters, route wildcards, and structuring HTTP controllers.
| name | horse-advanced-routing |
| description | Guidelines and workflows for developing and maintaining regular expressions and optional parameter routing features in the Horse framework. |
This skill guides AI agents in maintaining, expanding, and debugging Advanced Routing features (Regular Expression constraints and Optional path parameters) within the Horse framework.
:paramName?
/users/:id?:paramName(regexPattern)
/users/:id(\d+)(regexPattern) (Keep for backwards compatibility only)
/users/(\d+)src/Horse.Core.Regex.pas)Always use the unified THorseRegex abstraction. Do NOT import System.RegularExpressions (Delphi) or RegExpr (FPC) directly in routers to prevent cross-compilation breaks.
THorseRegex.Create(APattern) to instantiate.THorseRegex.Match(AContent) which returns Boolean indicating if the exact string matches the pattern.TRadixNode.Destroy / THorseRouterTree.Destroy).When a path segment matches a route parameter, always ensure it is registered in THorseRequest.Params even if optional and empty:
Params.Items['param'] = ''.CallNextPath (Tree) and FindNode (Radix) clears parameters during path rejection to prevent parameters from bleeding into other matched paths.When routing, the engines prioritize matches as follows:
/users/new)/users/:id(\d+))/users/:id?)tests/src/tests/Tests.Integration.AdvancedRouting.pas verifying both THorseRadixRouter and THorseRouterTree.System.Net.HttpClient to confirm full transport compatibility.ClearGlobalState helper.