Skip to content

Fold per-command run-logic into commands/<cmd>/ packages#148

Merged
alexkroman merged 2 commits into
mainfrom
claude/command-folder-structure-ih0gcs
Jun 13, 2026
Merged

Fold per-command run-logic into commands/<cmd>/ packages#148
alexkroman merged 2 commits into
mainfrom
claude/command-folder-structure-ih0gcs

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

Each command that owns private run-logic becomes a package instead of a
flat module plus a sibling *_exec.py at the package root: init.py holds
the Typer app + SPEC, and its support modules sit beside it underscore-
prefixed (exec.py for the run body, plus _select/_data/_hf_api/_listen
helpers). This colocates a command's exec with the command file and follows
the Prefect/spaCy convention (flat file by default; promote to a folder only
when a command has earned multiple modules; underscore-prefix private modules,
which also dodges the webhooks listen command-vs-module name collision).

13 commands folded: stream, agent, speak, llm, clip, dictate, caption, dub,
evaluate, deploy, dev, share, webhooks. transcribe and init stay at the root
alongside doctor_checks/setup_exec because the onboarding wizard
(onboard/sections.py) reuses transcribe_exec/render/batch and init_exec, so
they are shared beyond a single command.

command_registry already discovers packages (pkgutil.iter_modules), so
registration, help ordering, and the snapshot partition are unchanged.
import-linter contract 1 drops the folded execs (now covered by contract 2's
independence rule) and contract 3 points at the new _select/_data paths; all
three contracts stay green. AGENTS.md documents the module-or-package rule.

https://claude.ai/code/session_01XfcMSCxZPLJgg2UQBy8a4v

claude and others added 2 commits June 13, 2026 05:13
Each command that owns private run-logic becomes a package instead of a
flat module plus a sibling *_exec.py at the package root: __init__.py holds
the Typer app + SPEC, and its support modules sit beside it underscore-
prefixed (_exec.py for the run_<cmd> body, plus _select/_data/_hf_api/_listen
helpers). This colocates a command's exec with the command file and follows
the Prefect/spaCy convention (flat file by default; promote to a folder only
when a command has earned multiple modules; underscore-prefix private modules,
which also dodges the webhooks `listen` command-vs-module name collision).

13 commands folded: stream, agent, speak, llm, clip, dictate, caption, dub,
evaluate, deploy, dev, share, webhooks. transcribe and init stay at the root
alongside doctor_checks/setup_exec because the onboarding wizard
(onboard/sections.py) reuses transcribe_exec/render/batch and init_exec, so
they are shared beyond a single command.

command_registry already discovers packages (pkgutil.iter_modules), so
registration, help ordering, and the snapshot partition are unchanged.
import-linter contract 1 drops the folded execs (now covered by contract 2's
independence rule) and contract 3 points at the new _select/_data paths; all
three contracts stay green. AGENTS.md documents the module-or-package rule.

https://claude.ai/code/session_01XfcMSCxZPLJgg2UQBy8a4v
@alexkroman alexkroman enabled auto-merge June 13, 2026 05:15
@alexkroman alexkroman added this pull request to the merge queue Jun 13, 2026
Merged via the queue into main with commit 02a8ac3 Jun 13, 2026
16 checks passed
@alexkroman alexkroman deleted the claude/command-folder-structure-ih0gcs branch June 13, 2026 05:23
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.

2 participants