Skip to content

/ultracode authors + saves a workflow as a /<name> command (don't auto-run) - #330

Merged
agentforce314 merged 1 commit into
mainfrom
feature/ultracode-saves-workflow
Jun 13, 2026
Merged

/ultracode authors + saves a workflow as a /<name> command (don't auto-run)#330
agentforce314 merged 1 commit into
mainfrom
feature/ultracode-saves-workflow

Conversation

@agentforce314

Copy link
Copy Markdown
Owner

Why

Follow-up to #329. You asked: /ultracode "should only author the multi-agent workflow. Don't immediately run it. Instead, it will add a dynamic workflow to a slash command to run it, similar to the way we run /deep-research."

#329 made /ultracode author and immediately launch a background run. This reshapes it into a workflow generator.

New behavior

/ultracode build a scraper for the HN front page
  → Claude authors a pipeline script, writes .claude/workflows/hn-scraper.py,
    and replies: "Saved. Run it with /hn-scraper."
/hn-scraper
  → runs the saved workflow in the background, exactly like /deep-research
  • Directive (_ULTRACODE_DIRECTIVE): author a sandboxed-Python workflow mirroring src/workflow/bundled/deep_research.py, pick 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. Description → "Author a multi-agent workflow (pipeline) and save it as a / command".
  • In-session pickup (_refresh_workflow_commands): a workflow just saved becomes a dispatchable + autocompleting /<name> this session, no restart. mtime-gated on the project + personal .claude/workflows dirs; registers into the global registry (dispatch + suggestions) and the local one (bare /<name> routes to execution, parity with /deep-research). Runs at the REPL loop top.

The saved file → /<name> is handled by the #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

/ultracode directive:  authors+saves ✓ · does NOT run ✓ · references template ✓
/hn_scraper (saved):   kind=workflow · runs the saved script via Workflow tool (script_path) ✓
_refresh_workflow_commands: new file → /<name> in global registry + _built_in_commands ✓

Honest caveat

Tests + empirical checks cover the plumbing (directive content, save target, in-session registration, the /<name> run-directive). Whether the model writes a valid sandboxed-Python script to .claude/workflows/ is model behavior — I point it at deep_research.py as the template, but I haven't watched a live /ultracode author-then-run round-trip.

🤖 Generated with Claude Code

… (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 #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>
@agentforce314
agentforce314 merged commit ab1a986 into main Jun 13, 2026
peroxider pushed a commit to peroxider/clawcodex that referenced this pull request Jun 15, 2026
… authors + saves a /<name>

Follow the actual Claude Code approach: ultracode is triggered by the KEYWORD in a
prompt, never a slash command. Revert the /ultracode slash command (agentforce314#329/agentforce314#330/agentforce314#331)
and route everything through the keyword.

- Remove the /ultracode PromptCommand + its directive from workflows_integration.py;
  bundled_workflow_commands() now contributes only /workflows + /deep-research.
- src/workflow/ultracode.py: the keyword reminder (and the /effort ultracode session
  reminder) now instruct the model to AUTHOR a workflow and SAVE it to
  .claude/workflows/<name>.py (then run via /<name>) — not run it inline. Keeps the
  blunt imperative + inline skeleton + anti-tool-hunt language ("no ultracode tool/
  skill, do NOT use ToolSearch") that a live failure showed is necessary.

The saved file becomes /<name> via load_and_register_workflows, picked up mid-session
by _refresh_workflow_commands (unchanged), so the keyword -> /<name> handoff works
without a restart — like /deep-research.

Tests: assert there is NO /ultracode command (keyword-only); keyword reminder is the
author+save imperative; existing keyword detection / session-mode / refresh / effort
tests still pass. Full sweep: 267 passed.

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
…code-saves-workflow

/ultracode authors + saves a workflow as a /<name> command (don't auto-run)
singlaamitesh pushed a commit to singlaamitesh/clawcodex that referenced this pull request Jul 7, 2026
… authors + saves a /<name>

Follow the actual Claude Code approach: ultracode is triggered by the KEYWORD in a
prompt, never a slash command. Revert the /ultracode slash command (agentforce314#329/agentforce314#330/agentforce314#331)
and route everything through the keyword.

- Remove the /ultracode PromptCommand + its directive from workflows_integration.py;
  bundled_workflow_commands() now contributes only /workflows + /deep-research.
- src/workflow/ultracode.py: the keyword reminder (and the /effort ultracode session
  reminder) now instruct the model to AUTHOR a workflow and SAVE it to
  .claude/workflows/<name>.py (then run via /<name>) — not run it inline. Keeps the
  blunt imperative + inline skeleton + anti-tool-hunt language ("no ultracode tool/
  skill, do NOT use ToolSearch") that a live failure showed is necessary.

The saved file becomes /<name> via load_and_register_workflows, picked up mid-session
by _refresh_workflow_commands (unchanged), so the keyword -> /<name> handoff works
without a restart — like /deep-research.

Tests: assert there is NO /ultracode command (keyword-only); keyword reminder is the
author+save imperative; existing keyword detection / session-mode / refresh / effort
tests still pass. Full sweep: 267 passed.

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