Repository navigation
feat(qodercn): add Qoder CN target with the ~/.qoder-cn/ user root - #4000
Merged
Merged
Conversation
Qoder CN (Qoder CLI CN and the Qoder CN desktop app) reads the same project files as Qoder but keeps user-level files under ~/.qoder-cn/ instead of ~/.qoder/, so `qoder --global` output never reached it. Add a `qodercn` target for rules, commands, subagents, skills, hooks, permissions and MCP. Each feature subclasses the qoder class and only swaps the global config directory; the qoder classes now read that directory (and their target name) from an overridable static instead of hardcoding `.qoder`. `qodercn` reads the `qoder` frontmatter section and the `qoder` hooks/permissions/MCP blocks, and joins the shared project `.mcp.json` group. Closes #3674 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
Keep the Qoder nested subproject rules from #3980 working for qodercn: resolve the rules directory and the imported target from the class. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
# Conflicts: # src/generated/docs-content.ts
…block qoder and qodercn read the shared qoder override block from different user files, so a qodercn import no longer replaces or deletes it: keys only the existing block has are kept, a qoder.permission pattern both define keeps the stricter action, and other overwritten values warn. Also warn about an ignored qodercn hooks block and document the qodercn aliases in the MCP, permissions, hooks and output-style references. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
Replace the semantic merge with a simpler rule: a qodercn permissions import imports only the canonical rules, leaves the shared qoder override block (or its absence) untouched, and warns which Qoder CN override keys it did not import. Qoder CN values therefore never reach qoder output, and a qoder import keeps replacing its own block. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
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 a
qodercntarget for Qoder CN, the China-region edition of Qoder (Qoder CLI CN and the Qoder CN desktop app). Qoder CN reads the same project files as Qoder, but its user-level root is~/.qoder-cn/, not~/.qoder/, soqoder --globaloutput never reached it.Upstream (checked against docs.qoder.cn on 2026-11-26):
~/.qoder-cn/settings.json, project.qoder/settings.json,.qoder/rules/,.qoder/skills/;QODERCN_CONFIG_DIRrelocates the user dir.~/.qoder-cn/AGENTS.md,~/.qoder-cn/rules/**/*.md, projectAGENTS.md,.qoder/rules/,AGENTS.local.md.mcpServersin~/.qoder-cn/settings.json, project.mcp.jsonor.qoder/settings.json..qoder/rules/and~/.qoder-cn/rules/. The.lingma/tree that the issue describes no longer appears in the CN docs.Changes
qodercn("Qoder CN") for rules, commands, subagents, skills, hooks, permissions and MCP, at project and global scope.qodercnclass (src/features/*/qodercn-*.ts) subclasses itsqoderclass and only overridesglobalConfigDir(.qoder-cn) and, wheretargetsmatching needs it, the target name. Theqoderclasses now read the global directory and their own target name from overridable statics instead of hardcoding.qoder/"qoder". They also build instances withnew this(...), so subclasses round-trip as themselves.QoderRule: the topic-rules and output-styles directories are resolved per scope. The root-file and output-style checks used at deletion time accept both spellings. Nested subproject rules from feat(qoder): write directory-scoped rules to <dir>/.qoder/rules #3980 work unchanged forqodercn; an import keepstargets: ["qodercn"].FrontmatterMarkdownToolCommand: newgetSectionKey()hook. It defaults to the tool target, andqodercnreturnsqoder.getOutputStyleRuleOptionWarnings: now takessectionKey, the target being generated, and the set of targets that write the same output style. As a result,targets: ["qoder", "qodercn"]no longer warns that the style "also targets other tools".qodercn → qoderin hooks (HOOKS_OVERRIDE_KEY_ALIASES), permissions (PERMISSION_OVERRIDE_KEY_ALIASES) and MCP (MCP_BLOCK_KEY_ALIASES). In project modeqodercnjoins the shared root.mcp.jsongroup.QODER_SETTINGS_DECLARATION, used for both.qoder/settings.jsonand.qoder-cn/settings.json..qoder-cn/settings.jsonis a shared user-managed config, so an empty global generate does not create{}.qoderHooksFactory(cls), so both targets share the event and matcher table.docs/reference/file-formats.md. The supported-tools tables anddocs-content.tsare regenerated, andqodercnis added to cspell.qodercnclass (global paths, project parity withqoder, targeting,qodersection and block reuse, global import, nested rules). E2E happy-path rows were added to the rules, commands, subagents, skills, MCP, hooks and permissions matrices (project and global). A global-permissions e2e test checks thatqodercnreads theqoderblock and leaves~/.qoder/alone. The qoder global non-root rule e2e now runs for both targets.Design decisions
.lingma/target or aqoderoption. The CN docs now put the IDE, plugins, CLI and desktop app on the.qoder/project tree, so only the user root differs. Rulesync picks tool homes per target, as with thekiro-cli/kiro-idepair, so this is a separate target that reuses theqoderclasses. This follows the triage plan.qodercnreads Qoder's sections and blocks. These are theqoder:frontmatter section and theqoderhooks, permissions and MCP override blocks. The file format is Qoder's, and the two targets write the same project files, so separate blocks would make the shared files depend on generation order. This is the same reason the Kiro targets sharekiro.targets: ["qodercn"]still selects the target on its own.*. In project mode they write byte-identical files, so selecting both is harmless (likekiro-cli+kiro-ide) and is not listed inCONFLICTING_TARGET_PAIRS. The docs tell users to pick the one for their edition..qoderignoreis not documented for Qoder CN.QODERCN_CONFIG_DIRis not followed. This changes the triage plan, which suggested honoring it.qoderdoes not followQODER_CONFIG_DIReither, and supporting a home override touches the output-root resolution, shared-config keys and the import root (compare theKIMI_CODE_HOMEwiring). It is better done for both Qoder targets together in a follow-up. The docs state this.qoder.autoModewarning now names both user files.Skipped items
.lingma/tree: no longer documented upstream (see above)..mcp.jsonandsettings.jsonpaths are covered.QODERCN_CONFIG_DIR: see Design decisions.Closes #3674. Also resolves open question 2 of #2949, which pointed here.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4