name: Directory Structure Router
description: This skill acts as a structural router. It is executed by the file-length-enforcer skill after file size validations are complete. It reads local unstaged and non-deleted files and routes matching file paths to the appropriate directory structure enforcement skills.
version: 0.1.0
Directory Structure Router
This skill acts as an intelligent router for enforcing directory structure rules. It analyzes the current unstaged changes and decides which specific validation skills to invoke. It should normally be called by the File Length Enforcer skill.
Execution Workflow
- Use the
run_commandtool to rungit status -s(orgit status -u) to identify all unstaged, modified, or added (but not deleted) files in the repository. - Group the modified files by their root directories.
- Compare the changed files against known routing rules below.
- If a matched rule exists, read the corresponding SKILL file using the
view_filetool and proceed with its validation workflow. - If multiple rules match, execute them sequentially.
- If no unstaged files are found, or if none of them match the routing rules, inform the user that all structural checks passed.
Crucial Note: All conversations, explanations, and responses to the user MUST be in Traditional Chinese (繁體中文).
Routing Rules
1. Screens Structure
- Condition: If any of the unstaged files fall under the
screens/directory, or if they are inapp/and appear to contain newly injected UI logic that belongs inscreens/. - Target Skill: Read and execute
../enforce-screens-structure/SKILL.md.
2. Assets Structure
- Condition: If any of the unstaged files fall under the
assets/directory. - Target Skill: Read and execute
../enforce-assets-structure/SKILL.md.
3. Components Structure
- Condition: If any of the unstaged files fall under the
components/directory. - Target Skill: Read and execute
../enforce-components-structure/SKILL.md.
4. Services Structure
- Condition: If any unstaged files fall under the
services/directory, or if there are modified unstructured files (such asutils/Apis/) that handle networking, databases, storage, etc. - Target Skill: Read and execute
../enforce-services-structure/SKILL.md.
More routing rules can be added here in the future as the project grows (e.g., hooks).