Scaffold Router
Variables are defined in
.codex/skills/VARIABLES.md.
Goal
Given a change request, choose:
- •Maven module (
domain/app/infra/adapter/start) - •Package path consistent with existing
package-info.java - •The most specific skill to use next
This skill is a meta-skill: it does not generate code by itself unless a suitable generator skill does not exist.
Routing algorithm (must follow)
- •If the user provides a file path, route by path (see mapping below).
- •Resolve
{{domainModuleDir}}/{{appModuleDir}}/{{infraModuleDir}}/{{adapterModuleDir}}/{{startModuleDir}}:- •Prefer scanning
pom.xmland locating modules byartifactIdsuffix (-domain/-app/-infra/-adapter/-start).
- •Prefer scanning
- •Resolve
{{basePackage}}/{{basePackagePath}}fromsrc/main/java/**/package-info.javaif not provided. - •If module/package is still ambiguous, ask one question to confirm.
- •Infer module + package from:
- •existing
package-info.javapatterns in the target module - •the type of artifact requested (PO/Mapper/Flyway/Job/Consumer/etc.)
- •existing
- •Select one generator skill. Always apply
scaffold-architecture-guardrailsas a checklist.
Precedence rule
When multiple path patterns match, choose the most specific one:
- •
infra/repository/**,infra/query/**,infra/gateway/**override the genericinfra/**/po|mappermapping. - •
db/migration/**overrides generic infra mappings.
Path → skill mapping
The mapping below is module-agnostic. Apply it within the selected module directory.
More specific:
- •
**/db/migration/**→infra-flyway-migration-generator - •
**/infra/repository/biz/**→infra-bc-repository-generator - •
**/infra/query/biz/**→infra-bc-query-generator - •
**/infra/gateway/**→infra-system-gateway-generator - •
**/infra/**/po/**or**/infra/**/mapper/**→infra-mybatis-po-mapper-generator - •
**/adapter/scheduler/**→adapter-scheduler-job-generator - •
**/start/src/main/resources/**.yml/**.yaml→start-yaml-config-generator
One question policy
Ask one question when routing is ambiguous. Prefer multiple-choice.
Common disambiguations:
- •unit test vs integration test
- •event retry semantics (retryable vs non-retryable)
- •storage choice (single table vs 2 tables) where applicable