Skip to content

Refactor: split monolithic CLI and MCP server into smaller modules #2

Description

@selftwo

Problem

Both src/cli/index.ts and src/mcp/server.ts are large monolithic files. This makes them hard to test and difficult for contributors to navigate.

Proposed structure

CLI

src/cli/
  index.ts        # Entry point + command registration
  commands/
    init.ts
    scan.ts
    classify.ts
    move.ts
    status.ts
    trace.ts
    undo.ts
    archive.ts

MCP Server

src/mcp/
  server.ts       # Server setup
  tools/
    status.ts
    scan.ts
    classify.ts
    move.ts
    # ...etc

Prerequisite

This refactor should happen after a test suite is in place (see #1) to avoid regressions.

Impact

Unblocks external contributions — contributors can add a single command or MCP tool without reading the entire file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions