diff --git a/src/__tests__/instructionBuilder.test.ts b/src/__tests__/instructionBuilder.test.ts index c348516..a2fa4f8 100644 --- a/src/__tests__/instructionBuilder.test.ts +++ b/src/__tests__/instructionBuilder.test.ts @@ -192,13 +192,13 @@ describe('instruction-builder', () => { }); describe('renderExecutionMetadata', () => { - it('should render Working Directory only', () => { + it('should render Working Directory and Execution Rules', () => { const rendered = renderExecutionMetadata({ workingDirectory: '/project', language: 'en' }); expect(rendered).toContain('## Execution Context'); expect(rendered).toContain('- Working Directory: /project'); - expect(rendered).not.toContain('Project Root'); - expect(rendered).not.toContain('Mode:'); + expect(rendered).toContain('## Execution Rules'); + expect(rendered).toContain('Do NOT run git commit'); }); it('should end with a trailing empty line', () => { @@ -212,8 +212,8 @@ describe('instruction-builder', () => { expect(rendered).toContain('## 実行コンテキスト'); expect(rendered).toContain('- 作業ディレクトリ: /project'); - expect(rendered).not.toContain('Execution Context'); - expect(rendered).not.toContain('Working Directory'); + expect(rendered).toContain('## 実行ルール'); + expect(rendered).toContain('git commit を実行しないでください'); }); it('should include English note only for en, not for ja', () => { diff --git a/src/workflow/instruction-builder.ts b/src/workflow/instruction-builder.ts index 651d4f0..55ea988 100644 --- a/src/workflow/instruction-builder.ts +++ b/src/workflow/instruction-builder.ts @@ -60,11 +60,15 @@ const METADATA_STRINGS = { en: { heading: '## Execution Context', workingDirectory: 'Working Directory', + rulesHeading: '## Execution Rules', + noCommit: '**Do NOT run git commit.** Commits are handled automatically by the system after workflow completion.', note: 'Note: This section is metadata. Follow the language used in the rest of the prompt.', }, ja: { heading: '## 実行コンテキスト', workingDirectory: '作業ディレクトリ', + rulesHeading: '## 実行ルール', + noCommit: '**git commit を実行しないでください。** コミットはワークフロー完了後にシステムが自動で行います。', note: '', }, } as const; @@ -73,7 +77,7 @@ const METADATA_STRINGS = { * Render execution metadata as a markdown string. * * Pure function: ExecutionMetadata → string. - * Always includes heading + Working Directory. + * Always includes heading + Working Directory + Execution Rules. * Language determines the output language; 'en' includes a note about language consistency. */ export function renderExecutionMetadata(metadata: ExecutionMetadata): string { @@ -81,6 +85,9 @@ export function renderExecutionMetadata(metadata: ExecutionMetadata): string { const lines = [ strings.heading, `- ${strings.workingDirectory}: ${metadata.workingDirectory}`, + '', + strings.rulesHeading, + `- ${strings.noCommit}`, ]; if (strings.note) { lines.push('');