feat(cli): /scaffold command — discoverable at the prompt, wizard-safe in the browser#128
Merged
Conversation
…e in the browser Adds /scaffold as a first-class slash command so the scaffolder is reachable at the prompt (the #1 onboarding gap: users saw no obvious "start here"). It appears in /help text, the / palette, and typed dispatch. The /help capability browser does NOT get a generated command row for /scaffold: that path dispatches via fire-and-forget void runLine and handleHelp's finally immediately resumes the editor, racing the wizard for stdin (double-typed text). Instead /scaffold's browser home is the existing awaited "Build something new" wizard row. New COMMAND_WIZARD_HOME maps the command to that wizard opener; the anti-drift test now accepts a wizard home, and asserts /scaffold never gets a run/prefill row. The typed/palette paths await openScaffoldInRepl, so the wizard's own suspend/resume owns the screen for its lifetime. - capabilities.ts: COMMAND_WIZARD_HOME; skip wizard-homed commands in commandCapabilities - capabilities.test.ts: anti-drift accepts wizard home + asserts no /scaffold command row - repl.ts: case scaffold awaits openScaffoldInRepl (comment clarifies the browser path) - scripts/e2e-scaffold-command-pty.py: real pty test — /scaffold opens the wizard, Esc cancels cleanly, prompt is usable afterwards (proves suspend/resume, no double-stdin) - e2e-help-menu-pty.py: /scaffold no longer a browser row, capability order reverts
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.
What
Adds
/scaffoldas a first-class slash command so the scaffolder is reachable at the prompt — the #1 onboarding gap (users opened tsforge and saw no obvious "start here"). It now appears in/helptext, the/palette, and typed dispatch.Why the browser path is special
The
/helpcapability browser must NOT get a generated command row for/scaffold. That row would dispatch via fire-and-forgetvoid runLine, andhandleHelp'sfinallyimmediately resumes the editor — racing the wizard for stdin (the double-typed-text failure). Instead,/scaffold's browser home is the existing awaited "Build something new" wizard row.capabilities.ts: newCOMMAND_WIZARD_HOMEmaps/scaffold→ the scaffold wizard opener;commandCapabilities()skips wizard-homed commands.capabilities.test.ts: anti-drift now accepts a wizard home, and asserts/scaffoldnever gets arun/prefillcommand row.repl.ts:case "scaffold"awaitsopenScaffoldInRepl, extracted to anopenScaffoldhelper to keep thecommanddispatcher's cognitive complexity down.scripts/e2e-scaffold-command-pty.py: real pty test —/scaffoldopens the wizard, keystrokes (Enter → Review → Project directory) flow to the wizard (proves it owns stdin), Esc cancels cleanly, and the prompt is usable afterward (suspend/resume, no double-stdin).e2e-help-menu-pty.py:/scaffoldis no longer a browser command row, so the capability order reverts.Reviewer panel
Passed the local harness-review panel. Addressed its advisory findings: extracted the case to lower complexity, and strengthened the pty test to type while the wizard is active.
Known pre-existing limitation (follow-up, not a regression): in basic-input / very-small-terminal (non-editor) mode,
openScaffoldInRepl's suspend only controlseditorControl, so readline is not suspended during the wizard — identical to the existing/helpwizard path that calls the same function.