Source-linked AI summary
Toward Scalable Terminal Task Synthesis via Skill Graphs
Zhiyuan Fan, Tinghao Yu, Yuanjun Cai, Jiangtao Guan, Yun Yang, Dingxin Hu, Jiang Zhou, Xing Wu, Zhuo Han, Feng Zhang, Lilin Wang
TL;DR
Terminal-task synthesis scales task counts but offers limited control over trajectory diversity, with synthesized trajectories often redundant. SkillSynth samples workflows from a scenario-mediated skill graph and instantiates them automatically, achieving a 95.7% oracle pass rate while improving training effectiveness through more diverse trajectories.
Problem
Existing terminal-task synthesis provides limited control over execution-trajectory diversity, while synthesized tasks often reuse overlapping scenarios and skills.
Method
SkillSynth represents skills as scenario-to-scenario transitions, samples compositional paths from the resulting graph, and automatically instantiates them as executable tasks.
Results
95.7% oracle pass rate and 3,560 verified task instances were achieved in one fully automated run, while trajectory-diversity training improved model performance with higher data efficiency.
Takeaways & Limitations
SkillSynth provides a scalable way to produce verified terminal tasks, with experiments indicating that training effectiveness depends on trajectory diversity rather than task volume alone.
Takeaways & Limitations
Some oracle failures remain unrecoverable because buggy filesystem snapshots produced during initial synthesis persist through repair cycles.
Abstract
from arXiv · showhide
Terminal agents have demonstrated strong potential for autonomous command-line execution, yet their training remains constrained by the scarcity of high-quality and diverse execution trajectories. Existing approaches mitigate this bottleneck by synthesizing large-scale terminal task instances for trajectory sampling. However, they primarily focus on scaling the number of tasks while providing limited control over the diversity of execution trajectories that agents actually experience during training. In this paper, we present SkillSynth, an automated framework for terminal task synthesis built on a scenario-mediated skill graph. SkillSynth first constructs a large-scale skill graph, where scenarios serve as intermediate transition nodes that connect diverse command-line skills. It then samples paths from this graph as abstractions of real-world workflows, and uses a multi-agent harness to instantiate them into executable task instances. By grounding task synthesis in graph-sampled workflow paths, SkillSynth explicitly controls the diversity of minimal execution trajectories required to solve the synthesized tasks. Experiments on Terminal-Bench demonstrate the effectiveness of SkillSynth. Moreover, task instances synthesized by SkillSynth have been adopted to train Hy3 Preview, contributing to its enhanced agentic capabilities in terminal-based settings.
1 INTRODUCTION
SkillSynth addresses the scarcity and redundancy of terminal-agent training trajectories by modeling them as scenario-skill sequences and sampling workflows from a scenario-mediated skill graph. An automated multi-agent harness turns these paths into verified tasks, producing challenging and diverse instances at scale.
- Motivation: Terminal-agent training is constrained by the scarcity and high curation cost of high-quality, diverse executable trajectories.Terminal agents use CLI interaction for complex, long-horizon tasks, but manually curating executable terminal tasks is expensive and difficult to scale.
- Trajectory representation: Execution trajectories are characterized jointly by the intermediate scenarios agents traverse and the skills they apply at each scenario.This representation supports analyzing and controlling trajectory diversity along both scenario coverage and skill usage.
- Limitations of existing methods: Existing synthesis methods mainly scale task counts, but generated taxonomies may diverge from real-world usage and repository-derived tasks remain narrowly focused on software engineering.Different task instances also expose agents to overlapping scenarios and reuse similar skills, creating redundancy in synthesized trajectories.
- SkillSynth framework: SkillSynth organizes practical skills into a scenario-mediated skill graph, samples compositional workflow paths, and automatically instantiates them into executable tasks with dual verification and iterative repair.The graph links skills through precondition and postcondition scenarios, while the harness checks solvability through execution and specification quality through rubrics.
- Results and contributions: 3,560 verified task instances were produced from 3,721 sampled paths, achieving a 95.7% oracle pass rate at an average cost of $27.3 per verified task.Claude Opus 4.6 required 37 steps on average, and 121 tasks remained unsolved after three independent rollouts; the graph contains 82,073 scenarios, 57,214 filtered skills, and 185,529 verified bridges.
2 PROBLEM FORMULATION
The paper formulates terminal-agent tasks as partially observable interactions verified at the final state, then abstracts executions into scenario-conditioned skills. This abstraction shows that learning capacity depends on training-data coverage of the scenario–skill space, motivating diverse synthetic trajectories.
- Terminal agent task: A terminal-agent task is a tuple τ = (E, s0, g, V ) in which policy π interacts with executable environment E from s0 to achieve goal g.At each step, the agent receives partial observations and samples actions conditioned on history and goal.
- Terminal agent task: An execution is successful when its final state satisfies the external verifier, V (sT ) = 1.The low-level trajectory contains alternating observations and actions through the terminal state.
- Scenario and skill abstraction: Scenarios abstract decision-relevant observations and serve as sufficient statistics of interaction history for the agent’s next decision.Skills map one scenario to the next and consist of action sequences, jointly representing high-level execution structure.
- Learning objective: Training reduces to predicting skills conditioned on scenarios, equivalently optimizing standard next-token prediction over low-level interaction trajectories.The training objective uses the empirical distribution D induced by training trajectories.
- Learning objective: Learnable capacity is confined to the support of D, so maximizing it requires dense coverage of admissible scenario–skill pairs.Scenarios with pD(σ | g) = 0 are unobservable, while skills with pD(κ | σ, g) = 0 are unexercised; this motivates maximizing execution diversity in synthetic tasks.
3 APPROACH
SkillSynth builds a scenario-mediated skill graph, samples compositional paths with controlled diversity, and instantiates those paths into executable terminal task instances through a multi-agent harness. The approach combines filtered, aligned skill transitions with inverse-frequency path sampling and decoupled task planning and construction.
- Skill Graph Construction: The skill graph G = (Ω, K) represents skills as directed transitions between scenarios, so each directed path forms a sequential workflow.Each skill’s postcondition serves as the next skill’s precondition.
- Skill Graph Construction: SkillSynth retains Linux-executable, structured-workflow skills that avoid adversarial content and produce deterministic, objectively verifiable outputs.The pool is drawn from human-written skills in ClawHub and public GitHub repositories.
- Skill Graph Construction: Scenario inference, semantic deduplication, bidirectional cross-skill alignment, and LLM-based merging and filtering convert atomic skills into valid unified scenario-skill-scenario transitions.Deduplication uses clustering, with hierarchical agglomerative clustering and Louvain-based coarse bucketing performing best empirically.
- Path Sampling: Paths interleave L skill transitions with L + 1 scenarios, retaining lengths from Lmin = 1 through Lmax = 7 for single-skill and compositional tasks.This range covers single-skill tasks with L ∈{1, 2, 3} and multi-step tasks with L ≥4.
- Path Sampling: Inverse-frequency weighting samples underrepresented scenarios and skills, reducing the redundancy produced by uniform random walks over frequently traversed graph structures.Sampling uses visit counts ν(σ) and usage counts µ(κ), with probabilities proportional to (ν(σ)+1)−1 and (µ(κ)+1)−1.
- Task Instantiation: For each sampled path, the multi-agent harness produces an executable task with an instruction, filesystem snapshot, containerized environment, verification scripts, and oracle solution.Planning is separated from implementation: a planner creates sub-objectives and expected outputs before a constructor generates the task instance.
4 EXPERIMENTS
Experiments show that SkillSynth produces high-yield, difficult task instances and diverse workflows, while training on its trajectories improves terminal-agent performance across model scales. Ablations further indicate that graph-guided workflow structure, rather than random skill composition, is central to these gains.
- Synthesis yield: 95.7% of synthesized instances pass the oracle check, 92.0% pass both quality checks, and one automatic run yields 3,560 usable task instances.Interactive verify-then-repair recovers 721 first-round failures, supporting high-yield synthesis at scale.
- Failure analysis: 77% of failed rubric checks arise from instruction–test misalignment, so such instances are retained for supervised fine-tuning but discarded for reinforcement learning.Corrupted filesystem snapshots dominate unrecoverable oracle failures after repair cycles.
- Task difficulty: 38% of the 3,560 usable tasks have 0/3 successful attempts, while 37% have 1/3 or 2/3, indicating substantial task difficulty.Difficulty is assigned from three Hy3 Preview attempts per task.
- Downstream training: All three Qwen3 sizes improve over their baselines, with gains scaling by model size; Qwen3-32B + SS also outperforms Qwen 3 Coder 480B on Terminal-Bench 2.0.Training uses 10,680 trajectories, including both successful and failed trajectories to preserve diversity and coverage.
- Ablation study: SkillSynth-trained models outperform single-skill models by 8.4 points on TB 1.0 and 8.3 points on TB 2.0, and multi-skill models by 3.0 and 3.8 points, respectively.Randomly composed skills lack sequential dependencies, producing lower-quality tasks with simplified execution requirements.
- Diversity analysis: The skill graph includes long-tail domains, with 85.6% of scenarios in its largest weakly connected component and 16,632,220 enumerated paths requiring at least seven skills.These properties support broad structural diversity in sampled workflows.
5 RELATED WORK
Related work spans terminal-agent evaluation and scaffolding, synthetic task generation for scaling domain coverage or instance counts, and structured organizations of reusable agent skills. These directions motivate SkillSynth’s focus on diverse terminal execution trajectories and skill-graph-based synthesis.
- Terminal Agents: Terminal-agent research studies LLMs interacting with real-world computing systems through command-line interfaces, with Terminal-Bench evaluating end-to-end workflows in containerized Docker environments.Terminal-Bench provides hand-crafted tasks spanning diverse domains.
- Terminal Agents: Open-source models remain substantially behind proprietary results, motivating scalable synthesis of diverse terminal execution trajectories for training.
- Synthetic Data for Terminal Agents: Prior terminal-agent data-generation efforts scale synthetic task instances through dimensions including domain coverage and the number of task instances.LLM-generated taxonomies support diverse-domain generation, while other approaches increase task-instance counts.
- Skill Topology: Skill-topology research organizes reusable agent skills into structured libraries, hierarchical trees, DAG-based orchestration graphs, and relational graphs.This line builds on Voyager’s reusable skill library and repositories such as ClawHub.
6 CONCLUSION
SkillSynth models agentic trajectories as sequences of scenarios and skills, then synthesizes diverse terminal tasks by sampling compositional paths from a constructed skill graph. It enables scalable production of verified instances, while experiments show training effectiveness depends on trajectory diversity rather than task volume alone.
- 6 CONCLUSION: SkillSynth models agentic trajectories as sequences of scenarios and skills and synthesizes diverse terminal task instances through compositional path sampling over a constructed skill graph.The framework is designed to analyze trajectory diversity and generate task instances from graph-sampled paths.
- 6 CONCLUSION: SkillSynth achieves a high synthesis pass rate at relatively low cost, enabling scalable production of verified task instances.The conclusion characterizes the resulting synthesis process as both scalable and verification-oriented.
- 6 CONCLUSION: Experimental results show that training effectiveness depends on trajectory diversity, not merely on task volume.The conclusion identifies trajectory diversity as the relevant training factor beyond simply increasing the number of tasks.
ETHICS STATEMENT
SkillSynth’s data-construction skills come from publicly available GitHub repositories and ClawHub, and are used under their respective open-source licenses.
- ETHICS STATEMENT: The skills used to construct the data are sourced from publicly available GitHub repositories and ClawHub.Their use follows the respective open-source licenses.
A PROOF OF EQUIVALENCE
Under three assumptions, the skill-level objective reduces to the standard next-action objective. This equivalence means scenario–skill properties transfer directly to the token-level loss without additional training machinery.
- Assumptions: The reduction requires deterministic ζ 7→ξ mapping, scenario sufficiency for the next decision, and autoregressive skill execution.These are assumptions (A1), (A2), and (A3), respectively.
- Derivation: Under scenario sufficiency and autoregressive execution, the chain rule expands each skill probability into conditional next-action probabilities.
- Derivation: Summing across skills and using action contiguity collapses the double sum into a single sum over all actions, with expectations and deterministic mapping completing the reduction.The contiguity condition is it+1 = jt + 1.
- Implication: The scenario–skill abstraction adds no training machinery, and scenario–skill properties such as Equation 4’s coverage criterion transfer directly to the token-level loss.
B SKILL GRAPH CONSTRUCTION DISCUSSION
Skill graph construction uses LLM-based pairwise scenario alignment and a scalable two-stage clustering procedure. Clustering thresholds are selected to merge equivalent scenarios while separating semantically distinct states.
- Graph construction strategies: LLM-based pairwise alignment produces higher-quality graphs than embedding-based scenario alignment or single-pass subgraph generation.All LLM calls use DeepSeek Reasoner (v3.2) for extraction quality and reliability.
- Scalable scenario clustering: Scenario clustering first applies Louvain detection to a sparse embedding-similarity graph, then complete-linkage agglomerative clustering within each bucket.The two-stage procedure avoids the quadratic memory cost of global hierarchical clustering while retaining complete linkage’s desirable property.
- Clustering hyperparameters: The agglomerative distance threshold is chosen from held-out samples by balancing merge quality against over-fragmentation.The selected threshold merges clear paraphrases and near-equivalent states while separating negations and pre/post condition changes.
C SUPERVISED FINE-TUNING
Supervised fine-tuning uses AdamW with cosine scheduling, warmup, and specified regularization, while training runs for 5 epochs in bfloat16 with gradient clipping and gradient accumulation for long trajectories.
- Optimization: AdamW uses β1 = 0.9, β2 = 0.95, a cosine learning rate schedule, and a 10% warmup ratio.The peak learning rate is 2 × 10−5 and weight decay is 1×10−4 unless otherwise noted.
- Training Configuration: Models are trained for 5 epochs in bfloat16 precision with a maximum gradient-clipping norm of 1.0.Gradient clipping is applied to stabilize optimization on long terminal trajectories.
- Batching: Training uses a micro-batch size of 1 per GPU and gradient accumulation.Gradient accumulation is used to achieve the intended effective batch size.
D SKILL GRAPH ANALYSIS · E PROMPTS
The skill graph is heavy-tailed and largely connected, with hub scenarios linking many skills into a traversable subgraph. The accompanying prompts define trajectory segmentation into scenario–skill transitions and embedding-based retrieval for deduplicating scenarios and skills.
- D SKILL GRAPH ANALYSIS: Table 6 summarizes the skill graph’s structural statistics and connected-component size distribution.The table is paired with figures showing skill category and degree distributions.
- D SKILL GRAPH ANALYSIS: The skill graph has a heavy-tailed degree distribution, with median degree 2 and hub scenarios reaching degree 752.These hubs represent generic intermediate states compatible with many skills and motivate inverse-frequency sampling.
- D SKILL GRAPH ANALYSIS: A giant connected component contains 118,806 nodes, or 85.6% of the graph, indicating that most skills form one traversable subgraph.The passage attributes this connectivity to the cross-skill alignment stage.
- E PROMPTS: The trajectory-analysis prompt asks an agent to segment terminal trajectories into ordered (scenario, skill) pairs.A scenario is the environment’s semantic state at a decision point, while a skill is the multi-step workflow transitioning to the next scenario.
- E PROMPTS: The extraction prompt requires JSON-only output with step ranges and brief scenario and skill descriptions under 15 words each.It specifies returning only the JSON array without additional text.
- E PROMPTS: Embedding prompts retrieve scenarios describing the same real-world condition and skills performing the same workflow.DeepSeek Reasoner (v3.2) performs extraction, while Microsoft/Harrier-OSS-v1-27B generates embeddings for clustering unique instances.