Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions skills/scripts/skills/lib/workflow/ast/dispatch_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def render_subagent_dispatch(node: SubagentDispatchNode) -> str:

# Wrap invoke in directive to signal immediate execution
lines.append(' <directive action="IMMEDIATELY invoke">')
lines.append(f' <invoke working-dir=".claude/skills/scripts" cmd="{node.command}" />')
lines.append(f' <invoke cmd="cd .claude/skills/scripts && {node.command}" />')
lines.append(' </directive>')

lines.append("</subagent_dispatch>")
Expand Down Expand Up @@ -198,7 +198,7 @@ def render_template_dispatch(node: TemplateDispatchNode) -> str:
lines.append(f" {prompt_line}" if prompt_line else "")
lines.append(" </prompt>")

lines.append(f' <invoke working-dir=".claude/skills/scripts" cmd="{e["command"]}" />')
lines.append(f' <invoke cmd="cd .claude/skills/scripts && {e["command"]}" />')
lines.append(" </agent>")
lines.append(" </agents>")

Expand Down Expand Up @@ -257,7 +257,7 @@ def render_roster_dispatch(node: RosterDispatchNode) -> str:
for task_line in agent_prompt.split("\n"):
lines.append(f" {task_line}" if task_line else "")
lines.append(" </task>")
lines.append(f' <invoke working-dir=".claude/skills/scripts" cmd="{node.command}" />')
lines.append(f' <invoke cmd="cd .claude/skills/scripts && {node.command}" />')
lines.append(" </agent>")
lines.append(" </agents>")

Expand Down
6 changes: 3 additions & 3 deletions skills/scripts/skills/lib/workflow/ast/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ def render_invoke_after(self, node: InvokeAfterNode) -> str:
Renderer assumes valid node, focuses solely on XML generation.
"""
if node.cmd is not None:
invoke = f'<invoke working-dir="{node.working_dir}" cmd="{node.cmd}" />'
invoke = f'<invoke cmd="cd {node.working_dir} && {node.cmd}" />'
return f"<invoke_after>\n{invoke}\n</invoke_after>"
else:
if_pass_invoke = f'<invoke working-dir="{node.working_dir}" cmd="{node.if_pass}" />'
if_fail_invoke = f'<invoke working-dir="{node.working_dir}" cmd="{node.if_fail}" />'
if_pass_invoke = f'<invoke cmd="cd {node.working_dir} && {node.if_pass}" />'
if_fail_invoke = f'<invoke cmd="cd {node.working_dir} && {node.if_fail}" />'
return f"<invoke_after>\n <if_pass>\n {if_pass_invoke}\n </if_pass>\n <if_fail>\n {if_fail_invoke}\n </if_fail>\n</invoke_after>"

def _render_node(self, node: Node) -> str:
Expand Down
8 changes: 4 additions & 4 deletions skills/scripts/skills/lib/workflow/prompts/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def format_step(body: str, next_cmd: str = "", title: str = "",
invoke = (
f"NEXT STEP (MANDATORY -- execute exactly one):\n"
f" Working directory: {SKILLS_DIR}\n"
f" ALL agents returned PASS -> {if_pass}\n"
f" ANY agent returned FAIL -> {if_fail}\n\n"
f" ALL agents returned PASS -> cd {SKILLS_DIR} && {if_pass}\n"
f" ANY agent returned FAIL -> cd {SKILLS_DIR} && {if_fail}\n\n"
f"This is a mechanical routing decision. Do not interpret, summarize, "
f"or assess the results.\n"
f"Count PASS vs FAIL, then execute the matching command."
Expand All @@ -45,11 +45,11 @@ def format_step(body: str, next_cmd: str = "", title: str = "",

elif next_cmd:
# Working directory is explicit because CLI execution context varies.
# Command is literal shell invocation for next step.
# Command is self-contained with cd prefix to avoid working directory issues.
invoke = (
f"NEXT STEP:\n"
f" Working directory: {SKILLS_DIR}\n"
f" Command: {next_cmd}\n\n"
f" Command: cd {SKILLS_DIR} && {next_cmd}\n\n"
f"Execute this command now."
)
return f"{body}\n\n{invoke}"
Expand Down
3 changes: 1 addition & 2 deletions skills/scripts/skills/lib/workflow/prompts/subagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
FIRST ACTION REQUIRED: Run this command via Bash tool before any other response.
Do NOT skip. Do NOT produce analysis first. Execute this command IMMEDIATELY.

Working directory: {working_dir}
Command: {cmd}
Command: cd {working_dir} && {cmd}
================================================================================
CRITICAL: Copy the block above EXACTLY. Do not paraphrase or summarize.
The subagent needs "FIRST ACTION REQUIRED" to know it must run the command."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


def get_step_guidance(
step: int) -> dict:
step: int, module_path: str = None, **kwargs) -> dict:
"""Return guidance for the given step."""
MODULE_PATH = module_path or "skills.planner.developer.exec_implement_qr_fix"
state_dir = kwargs.get("state_dir", "")
Expand Down
Loading