Analyze the directory responsibilities of projects in any language and incrementally adjust their file structures and references.
A natural-language request is sufficient to trigger it; no legacy slash paths, argument interpolation, or designated assistant is required. Explicitly parse the project, target files, options, and output location from the current request; use the file, search, CLI, and browser capabilities actually provided by the current host.
Verify project dependency versions and external APIs at execution time; do not assume that examples reflect current configurations. Resolve bundled scripts from the Skill root and business files from the target project root. Read the current state first, protecting existing uncommitted content and the staged content of other tasks.
Keep analysis and preview requests read-only; perform modifications, commits, pushes, deployments, and releases only within the explicit scope of the current request. Do not bypass safeguards, automatically send messages, forcibly terminate user processes, or seize the foreground. On failure, preserve the original error for diagnosis.
-
Read the manifest, entry points, build configuration, tests, and Git status to identify the language, framework, and whether the project is a single package or a monorepo. Existing project conventions take precedence; do not assess quality based on a fixed file count or directory depth.
-
Build a map of file responsibilities and dependencies, identifying mixed responsibilities, duplicate structures, naming conflicts, and scattered tests. Provide a minimal migration mapping and support minimal, verbose, and analysis-only modes.
-
Handle low-coupling moves first, then modularize; update imports, build paths, test discovery, documentation, and asset references. Read an existing .projectstructure.yaml only as user configuration; do not treat example pseudocode as an implemented tool.
-
Before cleanup, distinguish source code, build artifacts, caches, and user backups. Deletion requires an explicit scope; prefer recoverable archives. Do not delete node_modules or directories currently in use merely because their files are ignored.
-
Run the actual build and relevant tests, read back each reference, and output the new directory structure, change list, and recoverable paths. Do not invent health scores, interactive interfaces, or performance gains.
Before execution, read this package's
and
Profile Contract. The priority order is: current request, project context, this Skill's records, shared preferences, brand/user Profile, and security defaults.
Read only declared fields; hosts without a dedicated runtime can use
to read the shared Profile. If configuration is missing, ask only the one question that affects the result. Values that the user explicitly asks to store long-term are written atomically through this script, and the actual path is reported; do not store inferred information, credentials, or materials from other tasks.