refactor: one file per command and per MCP tool; flatten internal/tiger - #179
Draft
nathanjcochran wants to merge 1 commit into
Draft
refactor: one file per command and per MCP tool; flatten internal/tiger#179nathanjcochran wants to merge 1 commit into
nathanjcochran wants to merge 1 commit into
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.
Pure file/package reorganization to make the repo easier to navigate and to bring it in line with how ghost is laid out. Three changes:
Moved everything from
internal/tiger/up intointernal/. The extra level of hierarchy wasn't buying us anything.Split the CLI command files so each command gets its own file in
internal/cmd/, named to match the command in snake_case (tiger service create→service_create.go).service.gowas 2000+ lines anddb.goandmcp.goweren't far behind. Group commands keep their own file and hold the helpers shared across their subcommands. Test files follow the same layout, with package-wide test scaffolding inmain_test.go.Split the MCP tool files the same way — one file per tool, each laid out as input/output schemas, then a
new*Tool()constructor, then the handler. Tool registration moved intoserver.go, so adding a tool is one new file plus oneaddToolline.No behavior changes. The only code that isn't a straight move is the MCP tool registration: the inline
&mcp.Tool{...}literals becamenew*Tool()functions, andregisterServiceTools/registerDatabaseToolsare now just lists ofaddToolcalls. Everything else is byte-identical to before, verified by diffing every top-level declaration's source text against main.CLAUDE.md and docs/development.md are updated to describe the new conventions.