feat: v4.45.0 — xagent skill: delegate subtasks to external agentic CLIs (opencode/GLM, Codex, custom)#31
Open
sadewadee wants to merge 2 commits into
Open
feat: v4.45.0 — xagent skill: delegate subtasks to external agentic CLIs (opencode/GLM, Codex, custom)#31sadewadee wants to merge 2 commits into
sadewadee wants to merge 2 commits into
Conversation
Adds skills/xagent/ — a manual-invoke skill (/dev-squad:xagent) that hands a self-contained coding/analysis subtask to an EXTERNAL agentic CLI (opencode driving GLM, OpenAI Codex, or a user-defined custom command) instead of a Claude subagent. Two uses: cross-model second-opinion / fresh-eyes debugging (review mode, read-only), and offloading grunt work to cheaper GLM quota (implement mode). Safety model: dev-squad's guard/lint/reuse protections are all PreToolUse/ PostToolUse hooks that are blind to an external subprocess, so the worker is NEVER pointed at the live tree. It always runs inside an isolated git worktree; review mode discards it, implement mode keeps it and prints the diff for the in-session agent to review before merge (where the hooks do fire). - scripts/xagent.sh: tool resolution (config-driven via .dev-squad/xagent.json, else auto-detect opencode > codex), worktree isolation, diff capture, cleanup on failure/review. Task text passed via env var, never interpolated as shell — adversarially tested against command injection (task text + custom template) and space-in-path; both hardened. - xagent.example.json: GLM/opencode + codex + custom-command profiles. - SKILL.md, CLAUDE.md skills section. Manual-invoke, isolated, review-gated — a deliberate user-approved extension of the no-headless-in-swarm stance, not autonomous build/audit/ship automation. Co-Authored-By: Claude Opus <noreply@anthropic.com>
xagent now requires AskUserQuestion before dispatching external worker. User chooses tool profile (GLM/Codex/Custom) or cancels. In auto-mode, agent infers default and logs assumption per auto-guard rules. Fulfills user requirement: 'xagent wajib askquestion ya'.
Owner
Author
Update: User Consent Gate Added (Commit c61df43)Per user request ("xagent wajib askquestion ya, jadi biar user decide"), added mandatory Step 0 to Before running xagent.sh for ANY task, the agent MUST ask the user via AskUserQuestion which tool profile to use (or cancel).
This ensures the user always decides whether to delegate to an external worker — the agent does not unilaterally dispatch it. Safety backstop: |
3 tasks
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.
Summary
Adds
skills/xagent/— a manual-invoke skill (/dev-squad:xagent) that delegates a self-contained subtask to an external agentic CLI instead of a Claude subagent.Two uses:
opencode, saving Anthropic subscription budget.Backends (config-driven): opencode + GLM (already authed on the maintainer's machine via Z.AI/Zhipu), OpenAI Codex (
codex exec), and a custom command slot for any other CLI. No config = auto-detect (opencode>codex).Safety model (the reason worktrees are mandatory)
dev-squad's protections —
guard-dangerous-ops,guard-unsafe-code,auto-lint,check-component-reuse,observe-learning— are all PreToolUse/PostToolUse hooks, blind to an external subprocess. So the worker is never pointed at the live tree:git worktree.reviewdiscards the worktree (any stray edits die with it — live tree untouched).implementkeeps the worktree, prints the diff + branch + merge steps; the in-session agent reviews and re-applies/merges (where the hooks do fire). No blind-merge.Adversarial verification (per
feedback_adversarial_verify_safety_hooks)Tested in a scratch git repo. Found + fixed one real bug: custom-command placeholder substitution was not space-safe (worktree path contains a space). Now both
{DIR}and{PROMPT}substitute as quoted env-var references — injection-safe (task text stays data, never re-parsed as shell) and space-safe. Verified:--task(;,\$(...), backticks) — task reaches worker as literal data, no executionFiles
skills/xagent/SKILL.md— entrypoint, flow, when-not-to-useskills/xagent/scripts/xagent.sh— runner (tool resolution, worktree isolation, diff, cleanup)skills/xagent/xagent.example.json— GLM/opencode + codex + custom profilesNote on versioning
Branched off
main. Open PR #30 (auto-intent-routing) claims 4.44.0, so this claims 4.45.0 to avoid a tag collision — assumes #30 merges first. If #30 is abandoned, re-tag this as 4.44.0 before tagging. Both PRs edit the version line inplugin.json/marketplace.json, so whichever merges second needs a trivial rebase.Test plan (live)
/dev-squad:xagent --mode reviewagainst a real file with theglmprofile and confirm findings stream back + worktree is discarded--mode implementand confirm the diff prints and the worktree/branch are created for review