fix: skill invocation during plan mode takes precedence over generic plan mode

Adds a "Skill Invocation During Plan Mode" section to the preamble resolver so
all generated SKILL.md files include it. Fixes a bug where Claude treats loaded
skill content as reference material instead of executable instructions, and keeps
trying to ExitPlanMode instead of following the skill workflow step by step.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-04-03 23:03:30 -07:00
parent cf73db5f19
commit 8b9fdfa05b
31 changed files with 767 additions and 5 deletions
+12
View File
@@ -988,6 +988,18 @@ describe('Plan status footer in preamble', () => {
});
});
// --- Skill invocation during plan mode in preamble ---
describe('Skill invocation during plan mode in preamble', () => {
test('preamble contains skill invocation plan mode section', () => {
const content = fs.readFileSync(path.join(ROOT, 'office-hours', 'SKILL.md'), 'utf-8');
expect(content).toContain('Skill Invocation During Plan Mode');
expect(content).toContain('precedence over generic plan mode behavior');
expect(content).toContain('Do not continue the workflow');
expect(content).toContain('cancel the skill or leave plan mode');
});
});
// --- {{SPEC_REVIEW_LOOP}} resolver tests ---
describe('SPEC_REVIEW_LOOP resolver', () => {