Files
gemini-cli/packages/core/src/prompts/snippets.capability.test.ts
T
Aishanee Shah 25797bed8c feat(core): redesign system instruction to be modular and capability-driven
This change introduces an ultra-minimal Core SI skeleton and moves domain-specific workflows into modular Instruction Deltas within dynamic skills.

- Reduced Core SI from ~2000 to ~320 tokens.
- Added Self-Correction and Precision mandates.
- Implemented polymorphic snippet variants in PromptProvider.
- Extracted Software Engineering and New Application workflows to skills.
- Optimized tool descriptions for Gemini 3 Flash.
- Fixed pre-existing build errors in useGeminiStream.ts.
2026-02-25 16:23:54 +00:00

45 lines
1.4 KiB
TypeScript

/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
import { getCoreSystemPrompt } from './snippets.capability.js';
import type { SystemPromptOptions } from './snippets.js';
describe('snippets.capability', () => {
it('should render a minimized capability-driven prompt', () => {
const options: SystemPromptOptions = {
preamble: { interactive: true },
coreMandates: {
interactive: true,
hasSkills: true,
hasHierarchicalMemory: false,
},
agentSkills: [
{ name: 'test-skill', description: 'desc', location: 'loc' },
],
operationalGuidelines: {
interactive: true,
interactiveShellEnabled: true,
},
};
const prompt = getCoreSystemPrompt(options);
expect(prompt).toContain('You are Gemini CLI, an expert agent.');
expect(prompt).toContain('# Core Mandates');
expect(prompt).toContain('Precision:');
expect(prompt).toContain('Integrity:');
expect(prompt).toContain('Efficiency:');
expect(prompt).toContain('Self-Correction:');
expect(prompt).toContain('# Capabilities');
expect(prompt).toContain('# Operational Style');
// Should NOT contain the long Software Engineering workflow by default
expect(prompt).not.toContain('## Development Lifecycle');
expect(prompt).not.toContain('## New Applications');
});
});