Skip to content

Refactor pack create and setup orchestration #1277

Description

@cedric013

Summary

The code review found two high-complexity CLI/setup paths that are hard to maintain:

  • cmd_pack_create mixes argument parsing, validation, package building, registry installation, and reporting.
  • run_setup_with_options orchestrates many setup side effects in one large function.

Proposed change

Refactor these paths into smaller helpers without changing behavior:

  • Extract PackCreateArgs and parse_pack_create_args from cmd_pack_create.
  • Split setup orchestration into focused helpers for shell hook, daemon, editor config, rules, skills, hooks, proxy, doctor, project-root warning, report construction, and report persistence.

Validation

  • rustfmt --edition 2024 --check rust/src/cli/pack_cmd.rs rust/src/setup/mod.rs
  • git diff --check -- rust/src/cli/pack_cmd.rs rust/src/setup/mod.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliCLI commands / dispatchenhancementNew feature or requestpriority: lowNice to havestatus: integratedFix merged to main but NOT yet in a tagged release

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions