diff --git a/packages/cli/src/services/BundledSkillLoader.test.ts b/packages/cli/src/services/BundledSkillLoader.test.ts index 364fdf1b0..05f16a745 100644 --- a/packages/cli/src/services/BundledSkillLoader.test.ts +++ b/packages/cli/src/services/BundledSkillLoader.test.ts @@ -146,11 +146,15 @@ describe('BundledSkillLoader', () => { expect(result).toEqual({ type: 'submit_prompt', - content: [{ text: 'Review by qwen3-coder via Qwen Code' }], + content: [ + { + text: 'YOUR_MODEL_ID="qwen3-coder"\n\nReview by qwen3-coder via Qwen Code', + }, + ], }); }); - it('should use "unknown" for {{model}} when getModel returns undefined', async () => { + it('should use empty string for {{model}} when getModel returns undefined', async () => { const skill = makeSkill({ body: 'Review by {{model}}', }); @@ -166,7 +170,7 @@ describe('BundledSkillLoader', () => { expect(result).toEqual({ type: 'submit_prompt', - content: [{ text: 'Review by unknown' }], + content: [{ text: 'Review by ' }], }); }); @@ -188,11 +192,15 @@ describe('BundledSkillLoader', () => { expect(result).toEqual({ type: 'submit_prompt', - content: [{ text: 'Review by qwen3-coder\n\n/review 123' }], + content: [ + { + text: 'YOUR_MODEL_ID="qwen3-coder"\n\nReview by qwen3-coder\n\n/review 123', + }, + ], }); }); - it('should use "unknown" for {{model}} when getModel returns empty string', async () => { + it('should use empty string for {{model}} when getModel returns empty string', async () => { const skill = makeSkill({ body: 'Review by {{model}}', }); @@ -208,7 +216,7 @@ describe('BundledSkillLoader', () => { expect(result).toEqual({ type: 'submit_prompt', - content: [{ text: 'Review by unknown' }], + content: [{ text: 'Review by ' }], }); }); diff --git a/packages/cli/src/services/BundledSkillLoader.ts b/packages/cli/src/services/BundledSkillLoader.ts index 29fc3c680..41e974b97 100644 --- a/packages/cli/src/services/BundledSkillLoader.ts +++ b/packages/cli/src/services/BundledSkillLoader.ts @@ -59,11 +59,17 @@ export class BundledSkillLoader implements ICommandLoader { description: skill.description, kind: CommandKind.SKILL, action: async (context, _args): Promise => { - // Resolve template variables in skill body (e.g., {{model}}) + // Resolve template variables in skill body let body = skill.body; - if (body.includes('{{model}}')) { - const modelId = this.config?.getModel()?.trim() || 'unknown'; + const modelId = this.config?.getModel()?.trim() || ''; + if (body.includes('{{model}}') || body.includes('YOUR_MODEL_ID')) { body = body.replaceAll('{{model}}', modelId); + body = body.replaceAll('YOUR_MODEL_ID', modelId); + // Prepend model identity as a top-level declaration so the LLM + // cannot miss it even if it doesn't copy the template exactly. + if (modelId) { + body = `YOUR_MODEL_ID="${modelId}"\n\n${body}`; + } } const content = context.invocation?.args diff --git a/packages/core/src/skills/bundled/review/SKILL.md b/packages/core/src/skills/bundled/review/SKILL.md index 57f71a900..dbf073420 100644 --- a/packages/core/src/skills/bundled/review/SKILL.md +++ b/packages/core/src/skills/bundled/review/SKILL.md @@ -410,7 +410,7 @@ Use the **pre-autofix HEAD commit SHA** captured in Step 1. If not captured, fal { "path": "src/file.ts", "line": 42, - "body": "**[Critical]** issue description\n\n```suggestion\nfix code\n```\n\n_— {{model}} via Qwen Code /review_" + "body": "**[Critical]** issue description\n\n```suggestion\nfix code\n```\n\n_— YOUR_MODEL_ID via Qwen Code /review_" } ] } @@ -421,9 +421,9 @@ Rules: - `event`: `APPROVE` (no Critical), `REQUEST_CHANGES` (has Critical), or `COMMENT` (Suggestion only). Do NOT use `COMMENT` when there are Critical findings. - `body`: **empty `""`** when there are inline comments. Only put text here if some findings cannot be mapped to diff lines (those go in body as a last resort). Never put section headers, "Review Summary", or analysis in body. - `comments`: **ALL** high-confidence Critical/Suggestion findings go here. Skip Nice to have and low-confidence. Each must reference a line in the diff. -- Comment body format: `**[Severity]** description\n\n```suggestion\nfix\n```\n\n_— {{model}} via Qwen Code /review_` +- Comment body format: `**[Severity]** description\n\n```suggestion\nfix\n```\n\n_— YOUR_MODEL_ID via Qwen Code /review_` +- The variable `YOUR_MODEL_ID` is declared at the top of this prompt (e.g., `YOUR_MODEL_ID="glm-5.1"`). You MUST include it in every footer. Do NOT omit the model name. - Use ` ```suggestion ` for one-click fixes; regular code blocks if fix spans multiple locations. -- Footer must be copied exactly — do NOT rephrase. - Only ONE comment per unique issue. Then submit: