Skip to content

feat(qwencode): forward prompt-hook fields and emit QWEN.local.md for localRoot rules - #2526

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-scrap-issue-2507-qwencode-followup
Jul 31, 2026
Merged

feat(qwencode): forward prompt-hook fields and emit QWEN.local.md for localRoot rules#2526
dyoshikawa merged 2 commits into
mainfrom
resolve-scrap-issue-2507-qwencode-followup

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Resolves two of the three Qwen Code gaps from the issue; the third is split out to #2525.

Hooks: prompt hooks emitted without prompt/model

Qwen Code's prompt hook type (PR #3388, hooks doc) requires a prompt body (with $ARGUMENTS interpolation) and accepts an optional model. rulesync admitted the type but never copied either field — the generated hook loaded in Qwen Code and failed silently at runtime — and import stripped both from existing prompt hooks.

  • Generate copies prompt/model gated on type === "prompt" (same pattern as the command/http gating).
  • Import: both fields added to QwencodeHookEntrySchema and the canonical conversion (round-trip covered by tests).
  • A prompt hook without a prompt body now warns at generate time.
  • The per-hook import conversion was extracted into a helper to stay under the complexity lint budget.

Rules: .qwen/QWEN.local.md (localRoot) support

Qwen Code v0.16.2 (PR #4394, memory doc) loads the personal project context file .qwen/QWEN.local.md after the shared QWEN.md. localRoot: true rules were silently dropped for qwencode.

  • qwencode joins the separate-local-file localRoot mode with QWEN.local.md under .qwen/ (project scope only — the processor already skips localRoot handling in global mode).
  • getLocalRootDeletionGlob override points deletion at .qwen/QWEN.local.md (the settable root dir is the project root).
  • Hand-maintained gitignore entry **/.qwen/QWEN.local.md (emitted but never committable; Qwen Code does not gitignore it), pnpm dev gitignore ran.

Deferred

Gap 3 (import reading the Claude-parity project .mcp.json, code-only in v0.18.1) is deferred to #2525 per the issue's own recommendation, until upstream documents the surface.

Docs updated in file-formats.md (hooks prose + Qwen rules note), mirrored to skills/rulesync/.

Closes #2507

🤖 Generated with Claude Code

… localRoot rules

Two Qwen Code follow-ups:

Hooks: prompt-type hooks (Qwen Code PR #3388) were emitted without their
required prompt body and optional model override — Qwen Code loaded the
hook and failed it silently at runtime — and import stripped both fields
from existing prompt hooks. Copy prompt/model gated on the prompt type
on generate, add both to the import entry schema and conversion, and
warn at generate time when a prompt hook has no prompt body.

Rules: Qwen Code v0.16.2 (PR #4394) added the personal project context
file .qwen/QWEN.local.md, loaded after the shared QWEN.md. localRoot
rules were silently dropped for qwencode; they now materialize as
.qwen/QWEN.local.md via the separate-local-file mode, with a deletion
glob override and a hand-maintained gitignore entry (Qwen Code does not
gitignore the file itself).

The remaining gap from the issue — import reading the Claude-parity
project .mcp.json (code-only surface in v0.18.1) — is deferred to #2525
until upstream documents it.

Closes #2507

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d comment

Address review findings on #2526: reference
QWENCODE_LOCAL_RULE_FILE_NAME from the gitignore entry and the rules
factory meta instead of duplicating the literal, and update the
canonical model-field comment that still claimed the qwencode adapter
does not forward it. The local-root import round-trip gap (codebase-wide
convention) is tracked in #2527.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dyoshikawa
dyoshikawa merged commit 3805325 into main Jul 31, 2026
9 checks passed
@dyoshikawa

Copy link
Copy Markdown
Owner Author

@dyoshikawa Thank you!

@dyoshikawa
dyoshikawa deleted the resolve-scrap-issue-2507-qwencode-followup branch July 31, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants