Dispatchable saved /<name> workflows + the ultracode authoring keyword - #303
Merged
Merged
Conversation
…oring keyword Closes two gaps in the workflow-engine port (workflow-engine.md §4.1 + §4.7), audited and planned in docs/workflow-commands-and-ultracode-plan.md. 1. Dynamic workflow slash commands were discovered but never dispatchable. load_workflow_commands fed only the aggregator's get_commands(), which has no real REPL consumers, so saved .claude/workflows/*.py never reached the global registry that dispatch + suggestions read (the same orphaning that hid /deep-research until #267). Add load_and_register_workflows(registry=None) — mirroring load_and_register_skills, same shadowing guard (builtins/bundled win; project beats personal) — and call it at REPL (_init_command_system) and TUI (app.py) startup. Saved workflows now dispatch AND autocomplete (workflow tag). Confirmed end-to-end: a saved file that was `dispatch: False` is now registered, suggested, and tagged. 2. The `ultracode` authoring keyword (§4.1) was never built (0 hits in src/). New src/workflow/ultracode.py: the standalone `\bultracode\b` keyword in a prompt (one-shot) and `/effort ultracode` (session-long mode) append a <system-reminder> nudging the model to author a workflow via the Workflow tool instead of working turn by turn. Wired into REPL chat() (next to the companion-intro append) and effort_command.py. Gated by is_workflows_enabled() — §4.8: the keyword no-ops and the option leaves the /effort menu when off. (Python's effort pipeline is inert, so /effort ultracode contributes the orchestration mode only, not a reasoning level.) Tests (48 new): saved-workflow registration + precedence + gating (test_workflow_dynamic_commands.py); keyword detection, reminder precedence, session toggle, and /effort ultracode (test_ultracode.py). Three base-effort picker tests gated to workflows-off so they keep asserting the bare option set (ultracode-in-menu is covered separately). Full sweep: 299 passed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 13, 2026
peroxider
pushed a commit
to peroxider/clawcodex
that referenced
this pull request
Jun 15, 2026
… (don't auto-run) Per user feedback: /ultracode should be a workflow *generator*, not a one-shot launcher. Reshape it to author a reusable pipeline and SAVE it, so the user runs it themselves via /<name> exactly like /deep-research — instead of immediately launching a background run. - Directive (workflows_integration._ULTRACODE_DIRECTIVE): author a sandboxed Python workflow script mirroring src/workflow/bundled/deep_research.py, choose a kebab-case name, Write it to .claude/workflows/<name>.py, and tell the user to run /<name>. Explicitly does NOT call the Workflow tool / does NOT run it. Command description updated to "...save it as a /<name> command". - In-session pickup (repl/core._refresh_workflow_commands): a workflow just saved to .claude/workflows/ becomes a dispatchable + autocompleting /<name> this session (no restart). mtime-gated on the project + personal dirs; registers into the global registry (dispatch + suggestions) and the local one (bare /<name> routes to execution, parity with /deep-research). Called at the run-loop top. The saved file is turned into /<name> by the agentforce314#303 discovery loader, whose directive runs the existing script via the Workflow tool with script_path — the same mechanism as /deep-research. Verified end-to-end. Tests: directive authors+saves (not launches); _refresh_workflow_commands picks up a new file → /<name> dispatchable + in _built_in_commands; mtime gate no-ops on no change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
singlaamitesh
pushed a commit
to singlaamitesh/clawcodex
that referenced
this pull request
Jul 7, 2026
…low-commands-and-ultracode Dispatchable saved /<name> workflows + the ultracode authoring keyword
singlaamitesh
pushed a commit
to singlaamitesh/clawcodex
that referenced
this pull request
Jul 7, 2026
… (don't auto-run) Per user feedback: /ultracode should be a workflow *generator*, not a one-shot launcher. Reshape it to author a reusable pipeline and SAVE it, so the user runs it themselves via /<name> exactly like /deep-research — instead of immediately launching a background run. - Directive (workflows_integration._ULTRACODE_DIRECTIVE): author a sandboxed Python workflow script mirroring src/workflow/bundled/deep_research.py, choose a kebab-case name, Write it to .claude/workflows/<name>.py, and tell the user to run /<name>. Explicitly does NOT call the Workflow tool / does NOT run it. Command description updated to "...save it as a /<name> command". - In-session pickup (repl/core._refresh_workflow_commands): a workflow just saved to .claude/workflows/ becomes a dispatchable + autocompleting /<name> this session (no restart). mtime-gated on the project + personal dirs; registers into the global registry (dispatch + suggestions) and the local one (bare /<name> routes to execution, parity with /deep-research). Called at the run-loop top. The saved file is turned into /<name> by the agentforce314#303 discovery loader, whose directive runs the existing script via the Workflow tool with script_path — the same mechanism as /deep-research. Verified end-to-end. Tests: directive authors+saves (not launches); _refresh_workflow_commands picks up a new file → /<name> dispatchable + in _built_in_commands; mtime gate no-ops on no change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Closes two gaps the design docs specify but the tree didn't have — audited + planned in
docs/workflow-commands-and-ultracode-plan.md.1. Saved
/<name>workflows were discovered but never dispatchable (§4.5 / §4.7)load_workflow_commandsfound.claude/workflows/*.py(project) +~/.claude/workflows/*.py(personal), but only fed the aggregator'sget_commands()— which has no real REPL consumers. So saved workflows never reached the global registry that dispatch + suggestions read (the same orphaning that hid/deep-researchuntil #267).Confirmed empirically before the fix: a saved
.claude/workflows/triage_issues.py→global registry (dispatch): False.Fix:
load_and_register_workflows(registry=None)— mirrorsload_and_register_skills(same shadowing guard: builtins/bundled win, project beats personal) — called at REPL (_init_command_system) and TUI (app.py) startup. After: that same file dispatches and autocompletes with aworkflowtag.2. The
ultracodeauthoring keyword was never built (§4.1, §4.8)grep -ri ultracode src/→ 0 hits. Newsrc/workflow/ultracode.py:\bultracode\bkeyword in a prompt (one-shot), and/effort ultracode(session-long mode)…append a
<system-reminder>nudging the model to author a workflow via the Workflow tool instead of working turn by turn. Wired into REPLchat()(beside the companion-intro append) andeffort_command.py. Gated byis_workflows_enabled()— §4.8: the keyword no-ops and the option leaves the/effortmenu when workflows are off.Tests — 48 new, full sweep 299 passed
test_workflow_dynamic_commands.py— registration, project-wins-personal, builtin-wins, disabled-registers-nothing, bad-file-skipped.test_ultracode.py— keyword detection (boundary/case/disabled), reminder precedence + gating, session toggle,/effort ultracodeenable +/effort highreset + disabled-rejected + picker option gating.Docs: saved plan + a status-correcting addendum to
workflow-engine-port-plan.md§10 (the Phase-7 row overstated discovery as wired).🤖 Generated with Claude Code