directory-structure-router

star 0

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.

a6232241 By a6232241 schedule Updated 3/1/2026

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

  1. Use the run_command tool to run git status -s (or git status -u) to identify all unstaged, modified, or added (but not deleted) files in the repository.
  2. Group the modified files by their root directories.
  3. Compare the changed files against known routing rules below.
  4. If a matched rule exists, read the corresponding SKILL file using the view_file tool and proceed with its validation workflow.
  5. If multiple rules match, execute them sequentially.
  6. 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 in app/ and appear to contain newly injected UI logic that belongs in screens/.
  • 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 as utils/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).

Install via CLI
npx skills add https://github.com/a6232241/music-player --skill directory-structure-router
Repository Details
star Stars 0
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator