Skip to content

docs(agents): fix stale command syntax and sub_agents claim in Named Commands#3684

Merged
Sayt-0 merged 2 commits into
mainfrom
docs/fix-named-commands
Jul 16, 2026
Merged

docs(agents): fix stale command syntax and sub_agents claim in Named Commands#3684
Sayt-0 merged 2 commits into
mainfrom
docs/fix-named-commands

Conversation

@aheritier

@aheritier aheritier commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What

Fixes two pre-existing factual errors in the "Named Commands" section of docs/configuration/agents/index.md:

  1. Command argument syntax — replaces the non-working $1 / $2 placeholders with the actually-supported forms: ${args[0]}, ${args.join(" ")}, ${tool_name({...})}, and the legacy !tool_name(key=value) form. Adds a concise "Argument and expansion syntax" explanation.
  2. Agent-switching target scope — corrects the false claim that a command's target agent must be listed in the current agent's sub_agents; the target can be any agent defined in the team.

Notes

Docs-only. Verified against pkg/runtime/commands.go, pkg/runtime/agent_router.go, pkg/team/team.go, agent-schema.json, and the runtime/js tests. Passes canonical check + markdownlint.

Note

This PR (#3684) and #3683 both touch docs/configuration/agents/index.md. Whichever merges second will need a trivial rebase.

…Commands

The Named Commands section used the shell-style $1/$2 positional
syntax for command argument substitution, but the resolver
(pkg/runtime/commands.go) only recognises JS template expressions
(${args[0]}, ${args.join(" ")}, ${tool_name({...})}) and the legacy
!tool_name(key=value) call form. $1/$2 are silently left as literal
text in the rendered instruction.

The section also claimed a command's target agent must be listed in
the current agent's sub_agents array. agentRouter.SetValidated resolves
the target through team.Agent(name), which scans every agent in the
team (pkg/team/team.go), not just the current agent's sub_agents; the
schema's CommandConfig.agent doc confirms this ('must be defined in the
team configuration'). Correct the docs to match.
Named Commands only showed ${args.join(" ")} in examples without
explaining the other supported forms. Add a concise list covering
positional args, joined args, template tool-call expansion, and the
legacy !tool_name() form, verified against pkg/runtime/commands.go
and pkg/js/eval_test.go.
@aheritier
aheritier requested a review from a team as a code owner July 16, 2026 13:26
@aheritier aheritier added area/docs Documentation changes kind/docs Documentation-only changes labels Jul 16, 2026
@Sayt-0
Sayt-0 merged commit 3e4a7b9 into main Jul 16, 2026
19 checks passed
@Sayt-0
Sayt-0 deleted the docs/fix-named-commands branch July 16, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation changes kind/docs Documentation-only changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants