
Agent Behavior Alignment
Matches a reference agent's behavior by comparing traces until they align.
Install
npx skills add QwenLM/qwen-code --skill agent-reproduce-align -g -a claude-code -y- Repository
- QwenLM/qwen-code28.9k
- Category
- AI and agents
- Updated
- 3d ago
- License
- Apache-2.0
- Context cost
- Lightabout 987 tokens
- Runs scripts
- Yes, review before use
What it does
Use after a Codex or Claude Code feature has been implemented in Qwen Code to run the selected reference agent and Qwen Code under the same scenario, capture HTTP and terminal traces, compare request bodies, tool/function schemas, outputs, and iterate until the reproduced behavior is close enough.
Agent Reproduce Align
Purpose
Use this skill when Qwen Code already has a candidate implementation and needs evidence-based parity with a selected reference agent: codex or claude-code. The goal is not byte-for-byte equality; it is matching the observable contract that matters for the feature.
Default target repo: the current working directory. Use a user-specified path only when the user explicitly provides one.
Reference Agent Selection
Use the same reference agent selected during $agent-reproduce-feature. If the earlier choice is unavailable, ask once and record the answer in the scenario or run notes.
Workflow
- Re-state the parity target:
- feature name and trigger
- selected reference agent
- one baseline prompt or interaction script
- acceptable differences
- must-match fields
- Run the reference agent and Qwen Code in separate capture directories with the same scenario.
- Capture the selected reference agent's local state before and after the reference run when state may affect parity.
- Normalize traces with
scripts/normalize_trace.py. - Compare normalized traces with
scripts/compare_traces.py. - Inspect differences in this order:
- reference-agent state changes that explain behavior
- missing tool/function names
- schema shape and required fields
- model settings and response mode
- prompt role/order differences that affect behavior
- terminal-visible output and exit status
- Patch Qwen Code, rerun the smallest failing scenario, and repeat.
- Preserve only redacted minimal fixtures in the repo.
Read references/alignment-workflow.md before the first comparison pass.
Common Commands
Normalize:
.qwen/skills/agent-reproduce-align/scripts/normalize_trace.py \
.repro-runs/reference/http.jsonl \
> .repro-runs/reference/normalized.json
Compare:

