resolve-entry-point

解析入口点:解析 HTTP 路由(例如 GET /api/orders)和控制台命令(例如 app:process-payments)到对应的处理程序文件;检测所用框架,查找路由或命令定义,提取处理类与方法,并通过 PSR-4 映射定位源文件。

仓库最近推送
GitHub Stars
109
Forks
26
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "resolve-entry-point":https://skillpi.com/zh/skills/deepskill-c5104e1e849752c56208384fc87ef6fe4f903503bd5b931bfc7f5b0065450efd。安装前核对上游来源和版本:https://github.com/dykyi-roman/awesome-claude-code。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

解析入口点:解析 HTTP 路由(例如 GET /api/orders)和控制台命令(例如 app:process-payments)到对应的处理程序文件;检测所用框架,查找路由或命令定义,提取处理类与方法,并通过 PSR-4 映射定位源文件。

0 下载

介绍来源: third_party · dykyi-roman · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: resolve-entry-point
description: Resolves HTTP routes (GET /api/orders) and console commands (app:process-payments) to their handler files. Detects framework, searches route/command definitions, extracts handler class and method, locates file via PSR-4 mapping.

Entry Point Resolver

Overview

Resolves user-provided HTTP routes or console commands to their handler file(s). Given a route like POST /api/orders or a command like app:process-payments, finds the exact handler class, method, file path, and surrounding context (middleware, route definition, schedule).

Input Types

HTTP Route

Pattern: ^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+/
Examples:
  GET /api/orders
  POST /api/orders/{id}/status
  DELETE /api/users/{id}

Console Command

Pattern: ^[a-z][a-z0-9_-]*:[a-z][a-z0-9:_-]*$
Examples:
  app:process-payments
  import:products
  cache:clear

Resolution Process

Step 1: Detect Framework

# Check for Symfony
Glob: "config/bundles.php"
Grep: "symfony/framework-bundle" --glob "composer.json"

# Check for Laravel
Glob: "artisan"
Grep: "laravel/framework" --glob "composer.json"

# Check for Slim
Grep: "slim/slim" --glob "composer.json"

# Fallback: generic PHP (attribute-based routing)

Step 2: Resolve HTTP Route

Extract HTTP method and path from input

Input: "POST /api/orders/{id}/status"
Method: POST
Path: /api/orders/{id}/status
Path pattern (regex-escaped): /api/orders/\{[^}]+\}/status
Path pattern (simplified): /api/orders/.*/status

Symfony Route Resolution

# 1. Search PHP attribute routes
Grep: "#\[Route\(" --glob "**/*.php" --output_mode content

# Then filter by path match:
# Look for exact path or path with parameter placeholders
Grep: "#\[Route\(['\"][^'\"]*(/api/orders)" --glob "**/*.php" --output_mode content

# 2. Search YAML route definitions
Grep: "path:\s.*(/api/orders)" --glob "config/routes*.yaml" --output_mode content
Grep: "path:\s.*(/api/orders)" --glob "config/routes/**/*.yaml" --output_mode content

# 3. Search XML route definitions
Grep: "path=\"[^\"]*(/api/orders)" --glob "config/routes*.xml" --output_mode content

# 4. Check for method restriction
# In the found route attribute, look for methods parameter
Grep: "methods:\s*\[.*POST" in matched file --output_mode content

Laravel Route Resolution

# 1. Search routes files
Grep: "Route::(post|any)\(\s*['\"]/?api/orders" --glob "routes/*.php" --output_mode content

# 2. Search for resource routes
Grep: "Route::apiResource\(['\"]orders" --glob "routes/*.php" --output_mode content
Grep: "Route::resource\(['\"]orders" --glob "routes/*.php" --output_mode content

# 3. Search controller annotations
Grep: "#\[Route\(" --glob "app/Http/Controllers/**/*.php" --output_mode content

Generic / Attribute-based Resolution

# Search all PHP files for route attributes matching the path
Grep: "#\[Route\(['\"][^'\"]*(/api/orders)" --glob "**/*.php" --output_mode content

# Search for Slim-style route definitions
Grep: "->(post|get|put|delete|patch)\(\s*['\"]/?api/orders" --glob "**/*.php" --output_mode content

Step 3: Resolve Console Command

Symfony Command Resolution

# 1. Search AsCommand attribute
Grep: "#\[AsCommand\(['\"]app:process-payments" --glob "**/*.php" --output_mode content

# 2. Search $defaultName property
Grep: "\\\$defaultName\s*=\s*['\"]app:process-payments" --glob "**/*.php" --output_mode content

# 3. Search configure() method for setName()
Grep: "setName\(['\"]app:process-payments" --glob "**/*.php" --output_mode content

# 4. Search services.yaml for command tag
Grep: "console.command" --glob "config/services*.yaml" --output_mode content

Laravel Command Resolution

# 1. Search $signature property
Grep: "\\\$signature\s*=\s*['\"]app:process-payments" --glob "**/*.php" --output_mode content

# 2. Search $name property
Grep: "\\\$name\s*=\s*['\"]app:process-payments" --glob "**/*.php" --output_mode content

# 3. Search Kernel commands registration
Grep: "app:process-payments" --glob "app/Console/Kernel.php" --output_mode content

Generic Resolution

# Search any PHP file containing the command name as a string
Grep: "['\"]app:process-payments['\"]" --glob "**/*.php" --output_mode content

Step 4: Extract Handler Details

Once the route/command definition file is found:

# Read the file containing the route/command definition
Read: matched_file

# Extract class name and namespace
Grep: "^namespace\s+" in matched_file --output_mode content
Grep: "^class\s+" in matched_file --output_mode content

# For route: extract the handler method
# - If class has __invoke → method is __invoke
# - If route attribute is on a specific method → that method
# - If route file points to Controller@method → extract method

# For command: handler method is execute() (Symfony) or handle() (Laravel)

Step 5: Locate Handler File via PSR-4

If the route definition references a different handler class:

# Read composer.json for PSR-4 autoload mapping
Read: composer.json → extract autoload.psr-4 section

# Convert namespace to path
# Example: App\Api\Action\CreateOrderAction
# PSR-4: "App\\" => "src/"
# Path: src/Api/Action/CreateOrderAction.php

# Verify file exists
Glob: "src/Api/Action/CreateOrderAction.php"

Step 6: Extract Middleware / Context

For HTTP Routes

# Symfony: find middleware (event listeners on kernel.request)
Grep: "kernel.request|kernel.controller" --glob "**/*.php" --output_mode content

# Check route-level middleware in attributes
Grep: "#\[IsGranted\(|#\[Security\(" in handler file --output_mode content

# Laravel: check middleware in route definition
Grep: "->middleware\(" in route definition context --output_mode content

# Check controller constructor middleware
Grep: "\$this->middleware\(" in handler file --output_mode content

For Console Commands

# Check if command is scheduled
# Symfony
Grep: "app:process-payments" --glob "config/scheduler*.{php,yaml}" --output_mode content
Grep: "RecurringMessage" --glob "**/*.php" --output_mode content

# Laravel
Grep: "app:process-payments" --glob "app/Console/Kernel.php" --output_mode content
Grep: "schedule\(" --glob "routes/console.php" --output_mode content

Output Format

HTTP Route Resolution

## Resolved Entry Point

| Field | Value |
|-------|-------|
| Type | HTTP Route |
| Input | POST /api/orders |
| Handler | App\Api\Action\CreateOrderAction::__invoke |
| File | src/Api/Action/CreateOrderAction.php |
| Route definition | config/routes/api.yaml:15 |
| HTTP Method | POST |
| Path | /api/orders |
| Path params | — |
| Middleware | auth, json-body |
| Auth | #[IsGranted('ROLE_USER')] |
| Framework | Symfony 7.x |

### Handler Chain
Route definition → Middleware (auth, json) → CreateOrderAction::__invoke → CreateOrderUseCase

Console Command Resolution

## Resolved Entry Point

| Field | Value |
|-------|-------|
| Type | Console Command |
| Input | app:process-payments |
| Handler | App\Console\Command\ProcessPaymentsCommand::execute |
| File | src/Console/Command/ProcessPaymentsCommand.php |
| Command definition | #[AsCommand('app:process-payments')] |
| Arguments | --batch-size (optional, default: 100) |
| Schedule | Daily at 02:00 (config/scheduler.php) |
| Framework | Symfony 7.x |

### Execution Chain
Schedule/Manual → ProcessPaymentsCommand::execute → ProcessPaymentUseCase

Resolution Failed

## Resolution Failed

| Field | Value |
|-------|-------|
| Input | GET /api/nonexistent |
| Type | HTTP Route |
| Framework | Symfony 7.x |

### Search Results
No matching route definition found.

### Suggestions
1. Check available routes: `php bin/console debug:router | grep api`
2. Verify the route path is correct (case-sensitive)
3. The route may be defined dynamically or via imported bundle
4. Try searching with a broader path: `/acc:explain GET /api/`

Multiple Matches

When multiple handlers match (e.g., versioned APIs, route overrides):

## Resolved Entry Points (multiple matches)

### Match 1 (primary)
| Field | Value |
|-------|-------|
| Handler | App\Api\V2\CreateOrderAction |
| File | src/Api/V2/CreateOrderAction.php |
| Route | config/routes/api_v2.yaml:8 |

### Match 2
| Field | Value |
|-------|-------|
| Handler | App\Api\V1\CreateOrderAction |
| File | src/Api/V1/CreateOrderAction.php |
| Route | config/routes/api_v1.yaml:12 |

**Note:** Multiple handlers found. Using Match 1 (most recent/specific definition).

Path Parameter Handling

When resolving routes with parameters:

Input: GET /api/orders/{id}/items
Search patterns:
  1. Exact: /api/orders/{id}/items
  2. Regex attr: /api/orders/\{[^}]+\}/items
  3. Simplified: orders.*items (fallback)

Integration

This skill is used by:

  • codebase-navigator — resolves user-provided routes/commands to handler files before navigation
  • explain-coordinator — Phase 0 resolution for route/command input types

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值85/100

亮点

  • 功能定位精准,解决开发者在大型 PHP 项目中快速定位路由/命令处理程序的实际痛点
  • 支持 Symfony、Laravel、Slim 等主流 PHP 框架,具有广泛的实用价值和受众基础
触发精准95/100

亮点

  • 触发描述清晰完整,明确区分 HTTP 路由和控制台命令两种输入类型
  • 提供了具体的模式示例和正则表达式,边界清晰,覆盖多种变体
结构规范95/100

亮点

  • 结构清晰完整,包含概述、输入类型、解析流程、输出格式等必要章节
  • 步骤划分明确,有详细的端到端示例和多种输出格式说明,便于理解和执行
执行可靠90/100

亮点

  • 执行流程详细且完整,涵盖框架检测、路由解析、处理程序提取、PSR-4 映射等关键步骤
  • 覆盖了主要异常情况(如解析失败、多匹配)并提供了相应的处理建议,可靠性高
证据可验 (前四项均值)91/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。