resolve-entry-point

Resolve entry points: map HTTP routes (e.g. GET /api/orders) and console commands (e.g. app:process-payments) to their handler files; detect the framework, locate route/command definitions, extract handler classes and methods, and locate source files via PSR-4 mapping.

Last repository push
GitHub Stars
109
Forks
26
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "resolve-entry-point" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-c5104e1e849752c56208384fc87ef6fe4f903503bd5b931bfc7f5b0065450efd. Verify the upstream source and version against https://github.com/dykyi-roman/awesome-claude-code before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Resolve entry points: map HTTP routes (e.g. GET /api/orders) and console commands (e.g. app:process-payments) to their handler files; detect the framework, locate route/command definitions, extract handler classes and methods, and locate source files via PSR-4 mapping.

0 Downloads

Introduction source: third_party · dykyi-roman · 0.0.1 Reference

SkillPi interpretation

Tasks
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.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
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

Current listing version

0.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

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

Highlights

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

Highlights

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

Highlights

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

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

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

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.