Skip to content

Commit 84799da

Browse files
committed
do stone age
1 parent 3033a1d commit 84799da

File tree

4 files changed

+9
-26
lines changed

4 files changed

+9
-26
lines changed

packages/playwright/src/agents/generateAgents.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function saveAsClaudeCode(agent: Agent): string {
129129
lines.push(`color: ${agent.header.color}`);
130130
lines.push(`---`);
131131
lines.push('');
132-
lines.push(renderInstructions(agent));
132+
lines.push(agent.instructions);
133133
return lines.join('\n');
134134
}
135135

@@ -244,7 +244,7 @@ function saveAsVSCodeChatmode(agent: Agent): string {
244244
lines.push(`tools: [${tools}]`);
245245
lines.push(`---`);
246246
lines.push('');
247-
lines.push(renderInstructions(agent));
247+
lines.push(agent.instructions);
248248
for (const example of agent.examples)
249249
lines.push(`<example>${example}</example>`);
250250

@@ -289,18 +289,10 @@ export async function initOpencodeRepo() {
289289

290290
await fs.promises.mkdir('.opencode/prompts', { recursive: true });
291291
for (const agent of agents) {
292-
const prompt = [];
293-
prompt.push(renderInstructions(agent));
292+
const prompt = [agent.instructions];
294293
prompt.push('');
295294
prompt.push(...agent.examples.map(example => `<example>${example}</example>`));
296295
await writeFile(`.opencode/prompts/playwright-test-${agent.header.name}.md`, prompt.join('\n'));
297296
}
298297
await writeFile('opencode.json', saveAsOpencodeJson(agents));
299298
}
300-
301-
function renderInstructions(agent: Agent): string {
302-
let instructions = agent.instructions;
303-
for (const tool of agent.header.tools)
304-
instructions = instructions.replace(`%${tool}%`, tool.split('/')[1]);
305-
return instructions;
306-
}

packages/playwright/src/agents/healer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ resolving Playwright test failures. Your mission is to systematically identify,
2424
broken Playwright tests using a methodical approach.
2525

2626
Your workflow:
27-
1. **Initial Execution**: Run all tests using %playwright-test/test_run% tool to identify failing tests
28-
2. **Debug failed tests**: For each failing test run %playwright-test/test_debug%.
27+
1. **Initial Execution**: Run all tests using `test_run` tool to identify failing tests
28+
2. **Debug failed tests**: For each failing test run `test_debug`.
2929
3. **Error Investigation**: When the test pauses on errors, use available Playwright MCP tools to:
3030
- Examine the error details
3131
- Capture page snapshot to understand the context

packages/playwright/src/agents/planner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ You will:
3838
- Invoke the `planner_setup_page` tool once to set up page before using any other tools
3939
- Explore the browser snapshot
4040
- Do not take screenshots unless absolutely necessary
41-
- Use browser_* tools to navigate and discover interface
41+
- Use `browser_*` tools to navigate and discover interface
4242
- Thoroughly explore the interface, identifying all interactive elements, forms, navigation paths, and functionality
4343

4444
2. **Analyze User Flows**

tests/mcp/init-agents.spec.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ test('init claude agents', async ({ }) => {
8686
});
8787
expect(fs.existsSync(path.join(baseDir, '.claude', 'agents', 'playwright-test-planner.md'))).toBe(true);
8888
expect(fs.existsSync(path.join(baseDir, '.claude', 'agents', 'playwright-test-generator.md'))).toBe(true);
89-
90-
const healer = fs.readFileSync(path.join(baseDir, '.claude', 'agents', 'playwright-test-healer.md'), 'utf-8');
91-
expect(healer).toContain('Run all tests using test_run tool');
89+
expect(fs.existsSync(path.join(baseDir, '.claude', 'agents', 'playwright-test-healer.md'))).toBe(true);
9290
});
9391

9492
test('init vscode agents', async ({ }) => {
@@ -104,11 +102,7 @@ test('init vscode agents', async ({ }) => {
104102
});
105103
expect(fs.existsSync(path.join(baseDir, '.github', 'chatmodes', '🎭 generator.chatmode.md'))).toBe(true);
106104
expect(fs.existsSync(path.join(baseDir, '.github', 'chatmodes', ' 🎭 planner.chatmode.md'))).toBe(true);
107-
108-
const healer = fs.readFileSync(path.join(baseDir, '.github', 'chatmodes', '🎭 healer.chatmode.md'), 'utf-8');
109-
expect(healer).toContain('Run all tests using test_run tool');
110-
expect(healer).toContain('For each failing test run test_debug');
111-
105+
expect(fs.existsSync(path.join(baseDir, '.github', 'chatmodes', '🎭 healer.chatmode.md'))).toBe(true);
112106
expect(fs.existsSync(path.join(baseDir, '.vscode', 'mcp.json'))).toBe(true);
113107
});
114108

@@ -125,9 +119,6 @@ test('init opencode agents', async ({ }) => {
125119
});
126120
expect(fs.existsSync(path.join(baseDir, '.opencode', 'prompts', 'playwright-test-planner.md'))).toBe(true);
127121
expect(fs.existsSync(path.join(baseDir, '.opencode', 'prompts', 'playwright-test-generator.md'))).toBe(true);
128-
129-
const healer = fs.readFileSync(path.join(baseDir, '.opencode', 'prompts', 'playwright-test-healer.md'), 'utf-8');
130-
expect(healer).toContain('Run all tests using test_run tool');
131-
122+
expect(fs.existsSync(path.join(baseDir, '.opencode', 'prompts', 'playwright-test-healer.md'))).toBe(true);
132123
expect(fs.existsSync(path.join(baseDir, 'opencode.json'))).toBe(true);
133124
});

0 commit comments

Comments
 (0)