Execution Rules に cd 禁止ルールを追加
エージェントがBashコマンドで明示的にcdしてmainディレクトリで 作業してしまう問題を解決するため、「cdを使用しないでください」 というルールをmetadataに追加。
This commit is contained in:
parent
48e055ac8a
commit
0f2aa896ae
@ -199,6 +199,7 @@ describe('instruction-builder', () => {
|
|||||||
expect(rendered).toContain('- Working Directory: /project');
|
expect(rendered).toContain('- Working Directory: /project');
|
||||||
expect(rendered).toContain('## Execution Rules');
|
expect(rendered).toContain('## Execution Rules');
|
||||||
expect(rendered).toContain('Do NOT run git commit');
|
expect(rendered).toContain('Do NOT run git commit');
|
||||||
|
expect(rendered).toContain('Do NOT use `cd`');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should end with a trailing empty line', () => {
|
it('should end with a trailing empty line', () => {
|
||||||
@ -214,6 +215,7 @@ describe('instruction-builder', () => {
|
|||||||
expect(rendered).toContain('- 作業ディレクトリ: /project');
|
expect(rendered).toContain('- 作業ディレクトリ: /project');
|
||||||
expect(rendered).toContain('## 実行ルール');
|
expect(rendered).toContain('## 実行ルール');
|
||||||
expect(rendered).toContain('git commit を実行しないでください');
|
expect(rendered).toContain('git commit を実行しないでください');
|
||||||
|
expect(rendered).toContain('cd` を使用しないでください');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should include English note only for en, not for ja', () => {
|
it('should include English note only for en, not for ja', () => {
|
||||||
|
|||||||
@ -62,6 +62,7 @@ const METADATA_STRINGS = {
|
|||||||
workingDirectory: 'Working Directory',
|
workingDirectory: 'Working Directory',
|
||||||
rulesHeading: '## Execution Rules',
|
rulesHeading: '## Execution Rules',
|
||||||
noCommit: '**Do NOT run git commit.** Commits are handled automatically by the system after workflow completion.',
|
noCommit: '**Do NOT run git commit.** Commits are handled automatically by the system after workflow completion.',
|
||||||
|
noCd: '**Do NOT use `cd` in Bash commands.** Your working directory is already set correctly. Run commands directly without changing directories.',
|
||||||
note: 'Note: This section is metadata. Follow the language used in the rest of the prompt.',
|
note: 'Note: This section is metadata. Follow the language used in the rest of the prompt.',
|
||||||
},
|
},
|
||||||
ja: {
|
ja: {
|
||||||
@ -69,6 +70,7 @@ const METADATA_STRINGS = {
|
|||||||
workingDirectory: '作業ディレクトリ',
|
workingDirectory: '作業ディレクトリ',
|
||||||
rulesHeading: '## 実行ルール',
|
rulesHeading: '## 実行ルール',
|
||||||
noCommit: '**git commit を実行しないでください。** コミットはワークフロー完了後にシステムが自動で行います。',
|
noCommit: '**git commit を実行しないでください。** コミットはワークフロー完了後にシステムが自動で行います。',
|
||||||
|
noCd: '**Bashコマンドで `cd` を使用しないでください。** 作業ディレクトリは既に正しく設定されています。ディレクトリを変更せずにコマンドを実行してください。',
|
||||||
note: '',
|
note: '',
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
@ -88,6 +90,7 @@ export function renderExecutionMetadata(metadata: ExecutionMetadata): string {
|
|||||||
'',
|
'',
|
||||||
strings.rulesHeading,
|
strings.rulesHeading,
|
||||||
`- ${strings.noCommit}`,
|
`- ${strings.noCommit}`,
|
||||||
|
`- ${strings.noCd}`,
|
||||||
];
|
];
|
||||||
if (strings.note) {
|
if (strings.note) {
|
||||||
lines.push('');
|
lines.push('');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user