Skip to content

refactor: one file per command and per MCP tool; flatten internal/tiger - #179

Draft
nathanjcochran wants to merge 1 commit into
mainfrom
nathan/restructure
Draft

refactor: one file per command and per MCP tool; flatten internal/tiger#179
nathanjcochran wants to merge 1 commit into
mainfrom
nathan/restructure

Conversation

@nathanjcochran

@nathanjcochran nathanjcochran commented Jul 27, 2026

Copy link
Copy Markdown
Member

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:

  1. Moved everything from internal/tiger/ up into internal/. The extra level of hierarchy wasn't buying us anything.

  2. 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 createservice_create.go). service.go was 2000+ lines and db.go and mcp.go weren'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 in main_test.go.

  3. 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 into server.go, so adding a tool is one new file plus one addTool line.

No behavior changes. The only code that isn't a straight move is the MCP tool registration: the inline &mcp.Tool{...} literals became new*Tool() functions, and registerServiceTools/registerDatabaseTools are now just lists of addTool calls. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant