From Java Web project source codeextractall HTTP routes and request parameter structures, providing complete route data for downstream vulnerability audit Skills.Do not perform security vulnerability assessment, code quality analysis, or output anything beyond the scope of route extraction.
⚠️ Core requirement: complete output
This skill must output all discovered interfaces; omission is not allowed.
- ✅ Every interface must have complete parameter analysis
- ✅ Output the total number of interfaces and a list for verification
- ❌ Omission using "...", "etc.", or "other" is prohibited
- ❌ Outputting only "key interfaces" or "important interfaces" is prohibited
- ❌ Omission due to large quantity is prohibited
⚠️ CRITICAL rules summary (mandatory enforcement)
The following rules are mandatory requirements; violating any one of them will result in unqualified output.
CRITICAL 1: Mandatory expansion of wildcard/dynamic routes (pattern family + URL list)
Core strategy: Wildcard routes must all be identified, butdo not repeat the complete template. For each namespace's wildcard configuration, write onlyonce the pattern family header(including HTTP method, Content-Type, parameter structure source), and below list only the URL → 入口方法签名 mapping list. When the downstream agent needs the parameter structure, it can obtain it by decompiling on its own.
Not allowed: repeating the complete template (HTTP method, Content-Type, parameter structure, etc.) for every expanded URL — this causes dozens of times token waste with no information gain.
1.1 Struts2 wildcard routes
Applicable scenarios(present in struts.xml):
name="*_*"double wildcard /name="user_*"single wildcard /name="*"full match
Mandatory execution steps:
- Identify wildcard configurations:
<action name="*_*" class="{1}Action" method="{2}"> - Decompile all Action classes under that namespace (excluding getters/setters and methods inherited from ActionSupport)
- Outputpattern family + instance list:
=== Pattern: {action}_{method}.action (namespace: /admin) === 入口模板: {ActionClass}.{methodName}() HTTP 方法: POST Content-Type: application/x-www-form-urlencoded 参数来源: 各 Action 类的字段(下游 agent-5 反编译时提取) 展开实例(共 {N} 个): - /admin/user_login.action → UserAction.login() - /admin/user_logout.action → UserAction.logout() - /admin/user_register.action → UserAction.register() - ... [逐行列出全部 N 个,禁止省略,禁止用 "..." / "等" / "其余"]
1.2 Spring MVC path variables
Path variables ({id}、/**)do not belong to wildcard expansion—the same controller method handles all path variable values, so there is no need to expand instances. Output directly in the normal route format, and annotate in the parameter structure Path: {id}:Long。
1.2.1 Spring MVC WebMvcConfigurer path prefix
WebMvcConfigurer#configurePathMatch in PathMatchConfigurer#addPathPrefix will change the Controller's final external URL, and must be extracted and applied before enumerating @RequestMapping routes.
Mandatory execution steps:
- Scan all
WebMvcConfigurerimplementation classes and@Configurationconfiguration classes - Search
configurePathMatch、PathMatchConfigurer、addPathPrefix - Extract each
addPathPrefix(prefix, predicate)'s prefix, matching conditions, and source code location - Apply the matching conditions to all
@Controller/@RestControllerclasses - When outputting the complete path, combine according to
context-path + addPathPrefix + 类级别路径 + 方法级别路径Combination - Annotate the prefix source in the route details; predicates that cannot be statically determined must be recorded as "requires manual confirmation"; silently ignoring them is prohibited
Example:
configurer.addPathPrefix("/admin", c -> c.isAnnotationPresent(AdminController.class));
If @AdminController exists on the @RequestMapping("/users")class and @GetMapping("/{id}")exists on the method, then the final URL must be output as /admin/users/{id}, and must not output only /users/{id}。
1.3 JAX-RS Path Parameters
Same as 1.2, path parameters (@PathParam) are output in the normal route format, without expanding instances.
1.4 Servlet URL Pattern Wildcards
Applicable scenarios:/api/*、*.do , etc. If the Servlet uses request.getPathInfo() to internally dispatch to different methods, it must be output according to thepattern family + instance listformat (refer to the 1.1 format); otherwise, handle it as a normal route.
CRITICAL 2: Complete Output Rules for Web Service Methods
2.1 Configuration File Priority Principle
The URL path of a Web Service must be read from the configuration file, and must absolutely not be inferred from the class name or endpoint id!
Parsing priority (executed in order):
- Read the configuration file - applicationContext.xml or other Spring configuration
- Extract the address attribute - This is the only source of truth for the Web Service path
- Verify the Servlet mapping - Obtain /ws/* or /services/* from web.xml
- Assemble the complete URL - Context path + Servlet mapping + address
- Decompile the implementation class - Only used to extract method signatures, not to infer paths
URL composition formula:
完整URL = 上下文路径 + web.xml中的Servlet映射 + address属性值
示例: /myapp + /services/ + /UserApi = /myapp/services/UserApi
Incorrect examples (must be avoided):
- ❌ Infer from class name:
UserServiceImpl→/UserService - ❌ Infer from id:
userWebService→/userWebService - ✅ Read configuration:
address="/UserApi"→/myapp/services/UserApi
2.2 CXF/JAX-WS Services
Mandatory execution steps:
-
Obtain all endpoints from the configuration file
<jaxws:endpoint id="userService" implementor="#userServiceImpl" address="/UserService"/> -
Decompile each Service implementation class
-
Extract all public methods - Method name, parameter list, return type
-
Record the complete method signature and parameter list for each method
-
Record the configuration source - Configuration file path, line number, address attribute value, implementor class name
2.3 Axis/Axis2 Services
Mandatory execution steps:
-
Read server-config.wsdd or services.xml
<service name="UserService" provider="java:RPC"> <parameter name="className" value="com.example.UserService"/> </service> -
Extract the service name and implementation class
-
Decompile the implementation class to obtain the method list
-
URL composition:
/axis/services/{serviceName}
2.4 Special Handling for executeInterface-Type Services
For generic execution interfaces that use the interfaceId parameter for routing:
- Decompile the implementation class and find all interfaceId definitions
- Record an independent parameter structure for each interfaceId
CRITICAL 3: Prohibited Output Formats
The following output formats are absolutely prohibited:
| Prohibited pattern | Incorrect example | Correct approach |
|---|---|---|
| Using "etc." to omit | LoginAction, UserAction等 |
List all Actions |
| Using "..." to omit | method1, method2, ... |
List all methods |
| Using "other" to omit | 以及其他20个方法 |
List all 20 methods |
| Using "more" to omit | 更多接口请查看源码 |
List all interfaces directly |
| Using placeholders | {action}_{method}.action |
Expand to actual URL |
| Use range notation | 001 ~ 050 |
List one by one 001, 002, ..., 050 |
| Describe the alternative list | 方法列表: 用户管理相关 |
List specific method names |
| Only give the WSDL address | 请通过 WSDL 查看可用方法 |
List all SOAP methods |
| Only list class names, not methods | UserAction 支持多个方法 |
List the complete template for each method |
CRITICAL 4: Required output format for each framework
4.1 Struts2 Routing
=== [1] login_login.action ===
URL: `/admin/login_login.action`
方法: LoginAction.login()
HTTP 方法: POST
Content-Type: application/x-www-form-urlencoded
参数结构:
Body: loginName (String), password (String)
4.2 Spring MVC Routing
=== [1] GET /api/users/{id} ===
位置: UserController.getUser (UserController.java:45)
HTTP 方法: GET
URL 路径: /api/users/{id}
参数结构:
Path: {id} (Long) - 用户ID
Header: Authorization - Bearer Token
4.3 JAX-RS Routing
=== [1] GET /rest/users/{userId} ===
位置: UserResource.getUser (UserResource.java:32)
HTTP 方法: GET
URL 路径: /rest/users/{userId}
参数结构:
Path: {userId} (Long)
Query: includeOrders (boolean, 可选)
4.4 Servlet Routing
=== [1] POST /api/upload ===
位置: UploadServlet.doPost (UploadServlet.java:28)
HTTP 方法: POST
URL 路径: /api/upload
参数结构:
Body: multipart/form-data
- file (File) - 上传文件
- description (String) - 文件描述
4.5 Web Service (SOAP) Methods
### UserService (共 5 个方法)
- **配置文件**: applicationContext.xml:42
- **address 属性**: /UserApi
- **完整 URL**: /myapp/services/UserApi
=== [WS-1] login ===
方法签名: login(String loginName, String password)
返回类型: String
参数结构:
Body: SOAP XML
- loginName (String) - 登录名
- password (String) - 密码
CRITICAL 5: Mandatory validation before output
This validation must pass before writing to the file; if validation fails, supplementary content must be returned.
5.1 Quantity consistency check
| Check item | Calculation formula | Pass condition |
|---|---|---|
| Struts2 Routing | Actual interface count ÷ Action class count | ≥ 3 |
| Spring MVC interfaces | Actual interface count ÷ Controller class count | ≥ 2 |
| JAX-RS interfaces | Actual interface count ÷ Resource class count | ≥ 2 |
| Servlet interfaces | Actual interface count ÷ Servlet class count | ≥ 1 |
| Web Service Methods | Actual interface count ÷ number of methods obtained by decompilation | = 100% |
5.2 Omission word detection
Scan the output content; when any omission marker is detected, it must be replaced with the complete content.
5.3 File integrity check
- Each module in the main index has a corresponding detail file
- Each detail file contains complete routing and parameter information (not a summary)
- Each service in the Web Service index has a complete method list
- There is no case of "see xxx for details" but the xxx file does not exist
5.4 Handling process when validation fails
- Stop the current output
- Identify the type of missing content
- Perform decompilation to obtain complete information
- Supplement the missing interface and parameter information
- Re-run validation
- Write to the file only after validation passes
CRITICAL 6: Completeness checklist (mandatory execution)
Before marking the task complete, the following checks must be performed:
6.1 Module integrity check
□ 主索引中列出的每个模块都已生成对应的详情文件
演示案例:
==========
假设主索引文件的"模块索引"表格如下:
| 模块 | 文件 | 接口数量 |
|:-----|:-------|:-----|
| admin | [admin/myapp_module_admin.md](admin/myapp_module_admin.md) | 218 |
| user | [user/myapp_module_user.md](user/myapp_module_user.md) | 85 |
| api | [api/myapp_module_api.md](api/myapp_module_api.md) | 45 |
验证步骤:
1. 检查 admin/myapp_module_admin.md 是否存在
2. 检查 user/myapp_module_user.md 是否存在
3. 检查 api/myapp_module_api.md 是否存在
4. 确认模块数量(3) = 实际文件数量(3)
□ Web Service 索引中的每个服务都已生成对应的详情文件
□ 没有"详见xxx"但xxx文件不存在的情况
6.2 Cross-validation checklist
□ 文件数量一致性
演示案例:主索引列出5个模块 → 必须有5个对应的模块子目录,且每个子目录中都有对应的 module_xxx.md 文件
□ 文件名一致性
演示案例:主索引引用 admin/myapp_module_admin.md → 实际相对路径和文件名必须完全匹配
□ 链接有效性
演示案例:点击主索引中的 [admin/myapp_module_admin.md] 链接应能成功打开
6.3 Content completeness check
□ 每个详情文件都包含:
- 模块概览(项目名称、上下文路径、框架)
- 框架配置(配置文件位置)
- 路由详细列表(每个接口的完整信息)
□ 对于空模块(无路由的模块):
演示案例:
==========
某模块 upload 只有静态资源,没有业务路由
正确做法:仍然生成 upload/myapp_module_upload.md
```markdown
# MyApp - upload 模块详情
## 模块概览
该模块主要用于静态文件上传,未检测到业务路由。
## 检查结果
- WEB-INF目录:不存在
- 配置文件:无
- 路由接口:无
Incorrect practice: skip and do not generate the file
#### 6.4 执行验证命令
**演示案例:在完成所有文件生成后,运行以下命令验证**
```bash
# 假设项目名称为 myapp,输出目录为 route_mapper/,生成的文件如下:
# route_mapper/myapp_route_mapper_20260129.md (主索引)
# route_mapper/admin/myapp_module_admin_20260129.md (admin模块)
# route_mapper/user/myapp_module_user_20260129.md (user模块)
# route_mapper/api/myapp_module_api_20260129.md (api模块)
# 验证命令1: 检查生成的模块子目录和文件
find route_mapper/ -name "*_module_*.md" -type f
# 预期输出:应该看到3个模块详情文件
# 验证命令2: 从主索引中提取所有引用的文件路径
grep -oP '[a-z]+/myapp_module_[^)]*md' route_mapper/myapp_route_mapper_20260129.md | sort -u
# 验证命令3: 检查引用的文件是否都存在
grep -oP '[a-z]+/myapp_[^)]*md' route_mapper/myapp_route_mapper_20260129.md | while read f; do
if [ ! -f "route_mapper/$f" ]; then
echo "❌ 缺失文件: route_mapper/$f"
else
echo "✅ 存在文件: route_mapper/$f"
fi
done
6.5 Completion confirmation
Demonstration case: complete inspection process
假设分析了一个名为 myshop 的电商项目,包含以下模块:
步骤1: 生成主索引文件
✅ route_mapper/myshop_route_mapper_20260129.md
步骤2: 检查主索引中的模块列表
主索引显示:product, order, user, payment (4个模块)
步骤3: 验证模块子目录和详情文件是否存在
✅ route_mapper/product/myshop_module_product_20260129.md
✅ route_mapper/order/myshop_module_order_20260129.md
✅ route_mapper/user/myshop_module_user_20260129.md
✅ route_mapper/payment/myshop_module_payment_20260129.md
步骤4: 生成README文档(**仅 standalone 模式**;pipeline/多 agent 模式下由 agent-1-merge 统一生成,worker 跳过此步骤)
✅ route_mapper/myshop_README_20260129.md
步骤5: 执行验证命令
$ find route_mapper/ -name "*_module_*.md" -type f | wc -l
4 (与主索引中模块数量一致)
步骤6: 确认完成
所有检查项通过 → 可以标记任务完成
The task can be marked as complete only when all of the following conditions are satisfied:
- The main index file has been generated (in pipeline mode, generated by agent-1-merge; worker skips it)
- The README documentation has been generated (in pipeline mode, generated by agent-1-merge; worker skips it)
- Each module listed in the main index has a corresponding detail file
- Each detail file contains complete routing information (or explicitly states that there is no routing)
- All file links are accessible
- Has been checked with validation commands
If missing files are found, you must:
- Immediately supplement the missing files
- Update main index (if links do not match)
- Re-run integrity check
Workflow
1. Project Scan Initialization
输入: 项目源码路径
可选: 项目上下文路径、已知框架信息
Initialization steps:
- Identify project type and framework (via configuration files and directory structure) - Support mixed multi-framework projects
- Determine route loading method (annotation-driven / XML configuration / hybrid)
- Extract context path and base URL
2. Framework Identification and Task Formulation
Multi-framework support: A project may use multiple web frameworks at the same time, which need to be identified separately and analysis tasks formulated for each.
| Framework | Identification features | Reference materials |
|---|---|---|
| Spring MVC | @Controller、@RequestMapping |
SPRING_MVC.md |
| Spring Boot | application.properties/yml、Spring Boot starter |
SPRING_MVC.md |
| Servlet | web.xml、@WebServlet |
SERVLET.md |
| JAX-RS | @Path、@GET、@POST |
JAXRS.md |
| Struts 2 | struts.xml |
STRUTS.md |
| CXF Web Services | /ws/*、@WebService、applicationContext.xml |
WEBSERVICE.md |
Task formulation rules:
- Generate an independent analysis task for each detected framework
- Tasks are arranged in execution order (framework initialization → route scanning → parameter parsing)
- Mixed configuration (annotations + XML) requires simultaneous analysis of both methods
3. Route Enumeration
Scan the project source code and extract all externally accessible HTTP routes.
Scan scope:
@Controller/@RestControllerclasses@RequestMappingand their variant annotationsWebMvcConfigurer#configurePathMatch/PathMatchConfigurer#addPathPrefixpath prefix configuration- Servlet configuration (web.xml, @WebServlet)
- JAX-RS annotations (@Path, @GET, @POST, etc.)
- Struts2 Action configuration
- Web Service endpoint configuration
Output information:
- HTTP method
- URL path (full path)
- Corresponding controller class and method
4. Parameter Structure Parsing
Parse the parameter structure of each route.
Parameter sources:
- Path variables:
@PathVariable、@PathParam - Query parameters:
@RequestParam、@QueryParam - Body parameters:
@RequestBody, request object, Form form - Header parameters:
@RequestHeader、@HeaderParam - Cookie parameters:
@CookieValue、@CookieParam
Parameter type parsing:
- Primitive types (String, int, long, etc.)
- Object types (POJO)
- Collection types (List, Map, Set)
- Enum types
5. Decompilation Support (when necessary)
When interface definitions or method signatures are located in compiled .class files or third-party JARs:
- Use the CFR decompiler to decompile the target files
- Extract method signatures and parameter type definitions
- Restore the parameter structure
Decompilation strategy:
- Only decompile classes containing the target interface or parameter definitions
- Prefer existing source code
- Record the decompilation source for traceability
6. Generate Output
Important: All discovered interfaces must be output; do not omit or use a summary.
Foreachinterface, generate a complete route and parameter structure record, including:
- All routes (even if the number is very large)
- The complete parameter structure of each route
Prohibited operations:
- ❌ Do not use "..." to omit interfaces
- ❌ Do not use "etc.", "other" to omit
- ❌ Do not output only "key interfaces" or "important interfaces"
- ❌ Do not use a table summary because of the large quantity
- ❌ Do not say "due to the large quantity, only part is listed"
- ❌ Do not output only the WSDL address without listing the specific SOAP methods
- ❌ Do not list only the Action class names without listing the specific routes and parameters
Mandatory requirements:
- ✅ Every Struts2 action route must have a corresponding parameter structure
- ✅ Every REST interface must have a complete parameter structure
- ✅ Every Web Service method must have an independent method signature and parameter list
- ✅ For services of the executeInterface type, an independent parameter structure must be listed for each methodId
Required output format (each):
=== [序号] 接口标识 ===
注解: (仅复制源码中的 @ApiOperation 或 Javadoc 原文,无注解时留空)
位置: ClassName.methodName (源文件:行号)
HTTP 方法: GET/POST/PUT/DELETE 等
URL 路径: /完整/路径/结构
Content-Type: application/json 等
参数结构:
Path: {pathVar1}, {pathVar2}
Query: param1, param2 (类型: String)
Body: ContentType (类型定义)
Header: X-Custom-Header
Cookie: sessionId
7. File Splitting Strategy
The output must be in MD file format, split by hierarchical directory (one MD file per level).
When the number of interfaces is large, the output files must be split to ensure that every interface has a complete template.
7.1 Splitting Trigger Conditions
Splitting is triggered when any of the following conditions is met:
- Number of interfaces in a single module > 50
- Number of interfaces in a single namespace > 20
- Number of methods in a single Web Service > 10
- Estimated output file size > 100KB
7.2 File Name and Directory Strategy
Create subdirectories by module, and generate file names dynamically.
| File Type | Naming Format | Example |
|---|---|---|
| Main Index | route_mapper/{项目名}_route_mapper_{时间戳}.md |
route_mapper/myapp_route_mapper_20260121.md |
| Module Details | route_mapper/{模块名}/{项目名}_module_{模块名}_{时间戳}.md |
route_mapper/admin/myapp_module_admin_20260121.md |
| Web Service | route_mapper/webservice/{项目名}_ws_{服务名}_{时间戳}.md |
route_mapper/webservice/myapp_ws_userservice_20260121.md |
| Namespace Split | route_mapper/{模块名}/{项目名}_{namespace}_{时间戳}.md |
route_mapper/admin/myapp_admin_user_20260121.md |
| README | route_mapper/{项目名}_README_{时间戳}.md |
route_mapper/myapp_README_20260121.md |
Directory creation rules:
- The main index and README are placed in
route_mapper/root directory - Each module's detail file is placed under the
route_mapper/{模块名}/subdirectory - All Web Service files are placed under the
route_mapper/webservice/subdirectory - Subdirectories are created as needed by the route-mapper agent (
mkdir -p)
Dynamic module name examples:
| Actual module/namespace | Subdirectory | Generated file name |
|---|---|---|
admin |
admin/ |
admin/myapp_module_admin_20260121.md |
user |
user/ |
user/myapp_module_user_20260121.md |
config |
config/ |
config/myapp_module_config_20260121.md |
api |
api/ |
api/myapp_module_api_20260121.md |
product |
product/ |
product/myapp_module_product_20260121.md |
order |
order/ |
order/myapp_module_order_20260121.md |
/ (root namespace) |
root/ |
root/myapp_module_root_20260121.md |
Module identification sources:
- Directory structure - subdirectory names under webapps
- Context path - Context Path configuration
- Struts2 namespace - package namespace in struts.xml
- Spring @RequestMapping - class-level path prefix
- Spring WebMvcConfigurer -
addPathPrefixDynamically added Controller prefix - Web Service path - such as
/services/,/ws/
7.3 Splitting Strategy
Strategy A: Split by module subdirectory (recommended)
One subdirectory per module, with the main index placed in the root directory:
route_mapper/
├── {project_name}_route_mapper_{timestamp}.md # 主索引文件(根目录)
├── {project_name}_README_{timestamp}.md # 说明文档(根目录)
├── admin/ # admin 模块子目录
│ └── {project_name}_module_admin_{timestamp}.md # 接口 ≤ 50 → 单文件
├── user/ # user 模块子目录
│ ├── {project_name}_module_user_{timestamp}.md # 接口 > 50 → 模块概览 + namespace 拆分
│ ├── {project_name}_user_manage_{timestamp}.md # namespace 详情
│ └── {project_name}_user_auth_{timestamp}.md # namespace 详情
└── webservice/ # Web Service 子目录
└── {project_name}_ws_orderService_{timestamp}.md
Links in the main index file point to subdirectories:
## 模块索引
| 模块 | 文件 | 接口数量 | 框架 |
|:-----|:-------|:-----|:-----|
| admin | [admin/myapp_module_admin_20260121.md](admin/myapp_module_admin_20260121.md) | 35 | Struts2 |
| user | [user/myapp_module_user_20260121.md](user/myapp_module_user_20260121.md) | 218 | Struts2+Spring |
## Web Service 索引
| 服务 | 文件 | 方法数量 |
|:-----|:----|:--------|
| OrderService | [webservice/myapp_ws_orderService_20260121.md](webservice/myapp_ws_orderService_20260121.md) | 40 |
Splitting trigger rules:
| Condition | Behavior |
|---|---|
| Module interfaces ≤ 50 | A single file is placed under the module subdirectory |
| Module interfaces > 50 | Module overview + split by namespace, both placed under the module subdirectory |
Strategy B: Split by namespace (applicable when a single module has an extremely large number of interfaces)
When a single module has > 50 interfaces, continue splitting by namespace within that module's subdirectory:
route_mapper/admin/
├── {project_name}_module_admin_{timestamp}.md # 模块概览(含子文件索引)
├── {project_name}_admin_device_{timestamp}.md # /device namespace
├── {project_name}_admin_channel_{timestamp}.md # /channel namespace
└── {project_name}_admin_login_{timestamp}.md # / namespace (登录相关)
7.4 Splitting Implementation Rules
-
Analyze first, then split
- After completing route analysis, count the number of interfaces for each module/namespace
- Determine the splitting strategy based on the count
-
Generate the main index file
- Include project overview, module index, and statistics summary
- Links pointing to each detail file
-
Create module subdirectories and generate detail files
- Execute for each module
mkdir -p {output_path}/route_mapper/{模块名}/ - Web Service uniformly placed into
mkdir -p {output_path}/route_mapper/webservice/ - Each module/namespace is independently written to a file under the corresponding subdirectory
- Execute for each module
-
Ensure traceability
- The main index contains each detail file'srelative subdirectory path(e.g.,
admin/myapp_module_admin_xxx.md) - The top of the detail file indicates the module it belongs to and the generation time
- The main index contains each detail file'srelative subdirectory path(e.g.,
7.5 Web Service Method Splitting
For execute type or similar dynamically invoked Web Services:
Incorrect approach:
#### UserService
支持的方法ID: user_001_001, user_001_002, ... (共40个)
Correct approach - split into independent files:
Main file:
#### UserService (服务路径: /services/UserService)
详细方法列表见: [webservice/myapp_ws_user_20260121.md](webservice/myapp_ws_user_20260121.md)
Detail file webservice/myapp_ws_user_20260121.md:
# UserService 方法详情
=== [1] user.create ===
方法ID: user_001_001
描述: 创建用户
参数: {"username": "...", "email": "...", "role": "..."}
方法签名: executeInterface(String interfaceId, String jsonParam)
Content-Type: text/xml; charset=utf-8
完整 URL: /admin/services/UserService
参数结构:
Body: SOAP XML
- interfaceId: user_001_001
- jsonParam: {"username": "...", "email": "...", "role": "..."}
=== [2] user.update ===
[完整参数结构]
[所有40个方法都有完整参数结构...]
8. Output File Structure
Strictly generate output files according to the fill-in templates in the references/ directory.
| File type | Template | Naming format | Quantity |
|---|---|---|---|
| Main index | OUTPUT_TEMPLATE_INDEX.md | route_mapper/{project_name}_route_mapper_{YYYYMMDD_HHMMSS}.md |
1 |
| Module details | OUTPUT_TEMPLATE_MODULE.md | route_mapper/{module_name}/{project_name}_module_{module_name}_{YYYYMMDD_HHMMSS}.md |
N (by module) |
| WS details | OUTPUT_TEMPLATE_MODULE.md | route_mapper/webservice/{project_name}_ws_{service_name}_{YYYYMMDD_HHMMSS}.md |
N (by service) |
| Documentation | OUTPUT_TEMPLATE_README.md | route_mapper/{project_name}_route_README_{YYYYMMDD_HHMMSS}.md |
1 (In pipeline mode, written by agent-1-merge; not generated by worker) |
Key rules:
- All [fill in] placeholders must be replaced with actual content
- Each interface must have a complete parameter structure
- No interface may be omitted
- File names are dynamically generated based on the module names/namespaces discovered in the actual project
- General specification reference: java-shared/OUTPUT_STANDARD.md
Saving steps:
- Complete all route analysis
- Count the number of interfaces for each module/namespace
- Determine the splitting strategy based on the splitting trigger conditions
- Generate the main index file according to the template
- Generate detail files for each module/namespace according to the template
- Generate the documentation according to the template
- Execute the self-check list at the end of each template
- Inform the user in the output of the save location of all files
Batch Processing Strategy for Large Projects
Trigger conditions
Enable batch processing when any of the following conditions is met:
- Estimated total number of interfaces > 100
- Number of interfaces in a single namespace > 30
- Number of methods in a single Web Service > 20
Batch processing steps
Step 1: Group by namespace/module Step 2: Process namespace by namespace(decompile → extract methods → generate parameter structure → verify → write) Step 3: Incremental writing(write to file immediately after every 10 interfaces completed) Step 4: Progress checkpoints(verify the number of interfaces after each namespace is completed)
File naming rules
For large projects, split files by module subdirectory + namespace:
route_mapper/
├── {project}_route_mapper_{date}.md # 主索引
├── {module}/
│ ├── {project}_module_{module}_{date}.md # 模块概览
│ └── {project}_{module}_{namespace}_{date}.md # namespace 详情
└── webservice/
└── {project}_ws_{service}_{date}.md # Web Service 详情
Automatic correction rules
When omitted content is detected, automatically apply corrections:
| Detected issue | Automatic correction action |
|---|---|
Action1, Action2等 |
Decompile to obtain the complete Action list, replace with all |
{action}_{method}.action |
Decompile to obtain the actual methods, expand into specific URLs |
方法列表: 描述文字 |
Decompile to obtain the method signatures, replace with specific methods |
共N个方法 but lists < N |
Add the missing methods until the count matches |
interfaceId: xxx ~ yyy |
Expand into individual interfaceIds |
Troubleshooting
| Issue | Solution |
|---|---|
| Unable to identify the framework | Check the configuration file in the project root directory, refer to FRAMEWORK_PATTERNS.md |
| Incomplete route path | Check the class-level @RequestMapping, context path configuration,WebMvcConfigurer#configurePathMatch / addPathPrefix |
| Unknown parameter type | Use a decompilation tool to obtain the complete type definition |
| Generated route information is incomplete | Confirm that it is not restricted by a security interceptor/filter |
| The module name is not as expected | The file name is dynamically generated based on the actually discovered module/namespace |