refactor: reorganize src/ from flat files into deep modules#29
Merged
mfaux merged 12 commits intoApr 4, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reorganizes
src/from a flat ~97-file structure into deep modules by feature. Each cluster of related files moves into its own directory with a barrelindex.tsthat re-exports only the public API. Shared code moves intosrc/lib/organized by domain. Command modules each get their own directory.Closes #28
Changes
src/lib/git/—git.ts,gitignore.ts,github-trees.ts+ testssrc/lib/lock/—dotai-lock.ts,skill-lock.ts,local-lock.ts,lock-version-error.ts+ testssrc/lib/parsers/— source, prompt, agent, instruction, override parsers + testssrc/lib/transpilers/— prompt, agent, instruction transpilers + testssrc/lib/discovery/— context, skill, find discovery + testssrc/lib/install/— context installer/add/check, skill installer, collisions, append markers + testssrc/lib/agents/—agents.ts,target-agents.tssrc/lib/—types.ts,utils.ts,constants.ts,validation.ts,model-aliases.ts,telemetry.ts,plugin-manifest.ts,command-result.ts,test-utils.ts,prompts/,providers/src/add/— add command and all sub-modules + testssrc/check/,src/find/,src/init/,src/list/,src/remove/,src/restore/,src/sync/— each command in its own directory with barrel index.jsto.tsextensionstests/directory for new module locationsApproach
pnpm build,pnpm test,pnpm type-check, andpnpm format:checkall pass.Resulting structure