Skip to content

Dispatchable saved /<name> workflows + the ultracode authoring keyword - #303

Merged
agentforce314 merged 1 commit into
mainfrom
feature/workflow-commands-and-ultracode
Jun 11, 2026
Merged

Dispatchable saved /<name> workflows + the ultracode authoring keyword#303
agentforce314 merged 1 commit into
mainfrom
feature/workflow-commands-and-ultracode

Conversation

@agentforce314

Copy link
Copy Markdown
Owner

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_commands found .claude/workflows/*.py (project) + ~/.claude/workflows/*.py (personal), but only fed the aggregator's get_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-research until #267).

Confirmed empirically before the fix: a saved .claude/workflows/triage_issues.pyglobal registry (dispatch): False.

Fix: load_and_register_workflows(registry=None) — mirrors load_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 a workflow tag.

2. The ultracode authoring keyword was never built (§4.1, §4.8)

grep -ri ultracode src/ → 0 hits. 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() (beside 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 workflows are off.

Note: Python's effort pipeline is inert (no xhigh; settings.effort reaches no request builder), so /effort ultracode faithfully contributes the orchestration mode, not a reasoning level. Called out in the plan's "out of scope" section along with TUI keyword wiring and Option+W.

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 ultracode enable + /effort high reset + disabled-rejected + picker option gating.
  • Three base-effort picker tests gated to workflows-off so they keep asserting the bare option set (ultracode-in-menu covered separately).

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

…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>
@agentforce314
agentforce314 merged commit c320c3a into main Jun 11, 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>
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.

1 participant