Skip to content

Commit 6664140

Browse files
authored
chore: escape markdown front matter (#38025)
1 parent ff5abc2 commit 6664140

File tree

7 files changed

+38
-25
lines changed

7 files changed

+38
-25
lines changed

examples/todomvc/.claude/agents/pwt-generator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: pwt-generator
3-
description: Use this agent when you need to create automated browser tests using Playwright. Examples: <example>Context: User wants to generate a test for the test plan item. <test-suite><!-- Verbatim name of the test spec group w/o ordinal like "Multiplication tests" --></test-suite> <test-name><!-- Name of the test case without the ordinal like "should add two numbers" --></test-name> <test-file><!-- Name of the file to save the test into, like tests/multiplication/should-add-two-numbers.spec.ts --></test-file> <seed-file><!-- Seed file path from test plan --></seed-file> <body><!-- Test case content including steps and expectations --></body></example>
4-
tools: Glob, Grep, Read, mcp__playwright-test__browser_click, mcp__playwright-test__browser_drag, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_file_upload, mcp__playwright-test__browser_handle_dialog, mcp__playwright-test__browser_hover, mcp__playwright-test__browser_navigate, mcp__playwright-test__browser_press_key, mcp__playwright-test__browser_select_option, mcp__playwright-test__browser_snapshot, mcp__playwright-test__browser_type, mcp__playwright-test__browser_verify_element_visible, mcp__playwright-test__browser_verify_list_visible, mcp__playwright-test__browser_verify_text_visible, mcp__playwright-test__browser_verify_value, mcp__playwright-test__browser_wait_for, mcp__playwright-test__generator_read_log, mcp__playwright-test__generator_setup_page, mcp__playwright-test__generator_write_test
3+
description: 'Use this agent when you need to create automated browser tests using Playwright Examples: <example>Context: User wants to generate a test for the test plan item. <test-suite><!-- Verbatim name of the test spec group w/o ordinal like "Multiplication tests" --></test-suite> <test-name><!-- Name of the test case without the ordinal like "should add two numbers" --></test-name> <test-file><!-- Name of the file to save the test into, like tests/multiplication/should-add-two-numbers.spec.ts --></test-file> <seed-file><!-- Seed file path from test plan --></seed-file> <body><!-- Test case content including steps and expectations --></body></example>'
4+
tools: Glob, Grep, Read, LS, mcp__playwright-test__browser_click, mcp__playwright-test__browser_drag, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_file_upload, mcp__playwright-test__browser_handle_dialog, mcp__playwright-test__browser_hover, mcp__playwright-test__browser_navigate, mcp__playwright-test__browser_press_key, mcp__playwright-test__browser_select_option, mcp__playwright-test__browser_snapshot, mcp__playwright-test__browser_type, mcp__playwright-test__browser_verify_element_visible, mcp__playwright-test__browser_verify_list_visible, mcp__playwright-test__browser_verify_text_visible, mcp__playwright-test__browser_verify_value, mcp__playwright-test__browser_wait_for, mcp__playwright-test__generator_read_log, mcp__playwright-test__generator_setup_page, mcp__playwright-test__generator_write_test
55
model: sonnet
66
color: blue
77
---

examples/todomvc/.claude/agents/pwt-healer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: pwt-healer
3-
description: Use this agent when you need to debug and fix failing Playwright tests.
4-
tools: Glob, Grep, Read, Edit, MultiEdit, Write, mcp__playwright-test__browser_console_messages, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_generate_locator, mcp__playwright-test__browser_network_requests, mcp__playwright-test__browser_snapshot, mcp__playwright-test__test_debug, mcp__playwright-test__test_list, mcp__playwright-test__test_run
3+
description: Use this agent when you need to debug and fix failing Playwright tests
4+
tools: Glob, Grep, Read, LS, Edit, MultiEdit, Write, mcp__playwright-test__browser_console_messages, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_generate_locator, mcp__playwright-test__browser_network_requests, mcp__playwright-test__browser_snapshot, mcp__playwright-test__test_debug, mcp__playwright-test__test_list, mcp__playwright-test__test_run
55
model: sonnet
66
color: red
77
---

examples/todomvc/.claude/agents/pwt-planner.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: pwt-planner
3-
description: Use this agent when you need to create comprehensive test plan for a web application or website.
4-
tools: Glob, Grep, Read, Edit, MultiEdit, Write, mcp__playwright-test__browser_click, mcp__playwright-test__browser_close, mcp__playwright-test__browser_console_messages, mcp__playwright-test__browser_drag, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_file_upload, mcp__playwright-test__browser_handle_dialog, mcp__playwright-test__browser_hover, mcp__playwright-test__browser_navigate, mcp__playwright-test__browser_navigate_back, mcp__playwright-test__browser_network_requests, mcp__playwright-test__browser_press_key, mcp__playwright-test__browser_select_option, mcp__playwright-test__browser_snapshot, mcp__playwright-test__browser_take_screenshot, mcp__playwright-test__browser_type, mcp__playwright-test__browser_wait_for, mcp__playwright-test__planner_setup_page
3+
description: Use this agent when you need to create comprehensive test plan for a web application or website
4+
tools: Glob, Grep, Read, LS, Edit, MultiEdit, Write, mcp__playwright-test__browser_click, mcp__playwright-test__browser_close, mcp__playwright-test__browser_console_messages, mcp__playwright-test__browser_drag, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_file_upload, mcp__playwright-test__browser_handle_dialog, mcp__playwright-test__browser_hover, mcp__playwright-test__browser_navigate, mcp__playwright-test__browser_navigate_back, mcp__playwright-test__browser_network_requests, mcp__playwright-test__browser_press_key, mcp__playwright-test__browser_select_option, mcp__playwright-test__browser_snapshot, mcp__playwright-test__browser_take_screenshot, mcp__playwright-test__browser_type, mcp__playwright-test__browser_wait_for, mcp__playwright-test__planner_setup_page
55
model: sonnet
66
color: green
77
---

examples/todomvc/.github/agents/pwt-generator.agent.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
name: pwt-generator
3-
description: Use this agent when you need to create automated browser tests using Playwright. Examples: <example>Context: User wants to generate a test for the test plan item. <test-suite><!-- Verbatim name of the test spec group w/o ordinal like "Multiplication tests" --></test-suite> <test-name><!-- Name of the test case without the ordinal like "should add two numbers" --></test-name> <test-file><!-- Name of the file to save the test into, like tests/multiplication/should-add-two-numbers.spec.ts --></test-file> <seed-file><!-- Seed file path from test plan --></seed-file> <body><!-- Test case content including steps and expectations --></body></example>
3+
description: 'Use this agent when you need to create automated browser tests
4+
using Playwright Examples: <example>Context: User wants to generate a test for
5+
the test plan item. <test-suite><!-- Verbatim name of the test spec group w/o
6+
ordinal like "Multiplication tests" --></test-suite> <test-name><!-- Name of
7+
the test case without the ordinal like "should add two numbers"
8+
--></test-name> <test-file><!-- Name of the file to save the test into, like
9+
tests/multiplication/should-add-two-numbers.spec.ts --></test-file>
10+
<seed-file><!-- Seed file path from test plan --></seed-file> <body><!-- Test
11+
case content including steps and expectations --></body></example>'
412
tools:
513
- search
614
- playwright-test/browser_click

examples/todomvc/.github/agents/pwt-healer.agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: pwt-healer
3-
description: Use this agent when you need to debug and fix failing Playwright tests.
3+
description: Use this agent when you need to debug and fix failing Playwright tests
44
tools:
55
- search
66
- edit

examples/todomvc/.github/agents/pwt-planner.agent.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
name: pwt-planner
3-
description: Use this agent when you need to create comprehensive test plan for a web application or website.
3+
description: Use this agent when you need to create comprehensive test plan for
4+
a web application or website
45
tools:
56
- search
67
- edit

packages/playwright/src/agents/generateAgents.ts

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class ClaudeGenerator {
136136

137137
static agentSpec(agent: Agent): string {
138138
const claudeToolMap = new Map<string, string[]>([
139-
['search', ['Glob', 'Grep', 'Read']],
139+
['search', ['Glob', 'Grep', 'Read', 'LS']],
140140
['edit', ['Edit', 'MultiEdit', 'Write']],
141141
]);
142142

@@ -149,13 +149,15 @@ export class ClaudeGenerator {
149149

150150
const examples = agent.examples.length ? ` Examples: ${agent.examples.map(example => `<example>${example}</example>`).join('')}` : '';
151151
const lines: string[] = [];
152+
const header = {
153+
name: agent.header.name,
154+
description: agent.header.description + examples,
155+
tools: agent.header.tools.map(tool => asClaudeTool(tool)).join(', '),
156+
model: agent.header.model,
157+
color: agent.header.color,
158+
};
152159
lines.push(`---`);
153-
lines.push(`name: ${agent.header.name}`);
154-
lines.push(`description: ${agent.header.description}.${examples}`);
155-
lines.push(`tools: ${agent.header.tools.map(tool => asClaudeTool(tool)).join(', ')}`);
156-
lines.push(`model: ${agent.header.model}`);
157-
lines.push(`color: ${agent.header.color}`);
158-
lines.push(`---`);
160+
lines.push(yaml.stringify(header, { lineWidth: 100000 }) + `---`);
159161
lines.push('');
160162
lines.push(agent.instructions);
161163
return lines.join('\n');
@@ -258,12 +260,14 @@ export class CopilotGenerator {
258260
static agentSpec(agent: Agent): string {
259261
const examples = agent.examples.length ? ` Examples: ${agent.examples.map(example => `<example>${example}</example>`).join('')}` : '';
260262
const lines: string[] = [];
263+
const header = {
264+
name: agent.header.name,
265+
description: agent.header.description + examples,
266+
tools: agent.header.tools,
267+
model: 'Claude Sonnet 4',
268+
};
261269
lines.push(`---`);
262-
lines.push(`name: ${agent.header.name}`);
263-
lines.push(`description: ${agent.header.description}.${examples}`);
264-
lines.push(`tools:\n${agent.header.tools.map(tool => ` - ${tool}`).join('\n')}`);
265-
lines.push(`model: Claude Sonnet 4`);
266-
lines.push(`---`);
270+
lines.push(yaml.stringify(header) + `---`);
267271
lines.push('');
268272
lines.push(agent.instructions);
269273
lines.push('');
@@ -362,7 +366,7 @@ export class VSCodeGenerator {
362366
}
363367

364368
async function writeFile(filePath: string, content: string, icon: string, description: string) {
365-
console.log(`- ${icon} ${path.relative(process.cwd(), filePath)} ${colors.dim('- ' + description)}`);
369+
console.log(` ${icon} ${path.relative(process.cwd(), filePath)} ${colors.dim('- ' + description)}`);
366370
await mkdirIfNeeded(filePath);
367371
await fs.promises.writeFile(filePath, content, 'utf-8');
368372
}
@@ -375,7 +379,7 @@ async function deleteFile(filePath: string, description: string) {
375379
return;
376380
}
377381

378-
console.log(`- ✂️ ${path.relative(process.cwd(), filePath)} ${colors.dim('- ' + description)}`);
382+
console.log(` ✂️ ${path.relative(process.cwd(), filePath)} ${colors.dim('- ' + description)}`);
379383
await fs.promises.unlink(filePath);
380384
}
381385

@@ -387,7 +391,7 @@ type RepoParams = {
387391

388392
async function initRepo(config: FullConfigInternal, projectName: string, options: RepoParams) {
389393
const project = seedProject(config, projectName);
390-
console.log(`- 🎭 Using project "${project.project.name}" as a primary project`);
394+
console.log(` 🎭 Using project "${project.project.name}" as a primary project`);
391395

392396
if (!fs.existsSync('specs')) {
393397
await fs.promises.mkdir('specs');
@@ -422,7 +426,7 @@ This is a directory for test plans.
422426
}
423427

424428
function initRepoDone() {
425-
console.log('✅ Done.');
429+
console.log(' ✅ Done.');
426430
}
427431

428432
async function loadPrompt(file: string, params: Record<string, string>) {

0 commit comments

Comments
 (0)