From 7b15b9c31e5386f95da760b19ba4fff5be260320 Mon Sep 17 00:00:00 2001 From: Yiming Li Date: Thu, 10 Sep 2026 22:34:32 +0800 Subject: [PATCH] fix: list the Biome and Rslint scripts correctly in AGENTS.md Biome adds check and format scripts, but its AGENTS.md pointed to a lint script that only exists when ESLint or Rslint is also selected. The Rslint AGENTS.md put an empty Tools section before a Docs section, so the Rslint entry was merged under Docs. Move it under Tools. --- template-biome/AGENTS.md | 2 +- template-rslint/AGENTS.md | 8 ++--- test/agents.test.ts | 63 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 67 insertions(+), 6 deletions(-) diff --git a/template-biome/AGENTS.md b/template-biome/AGENTS.md index a5be109..b108806 100644 --- a/template-biome/AGENTS.md +++ b/template-biome/AGENTS.md @@ -2,5 +2,5 @@ ### Biome -- Run `{{ packageManager }} run lint` to lint your code +- Run `{{ packageManager }} run check` to lint your code - Run `{{ packageManager }} run format` to format your code diff --git a/template-rslint/AGENTS.md b/template-rslint/AGENTS.md index bd57b79..97ee1c5 100644 --- a/template-rslint/AGENTS.md +++ b/template-rslint/AGENTS.md @@ -1,9 +1,9 @@ ## Tools -## Docs - -- Rslint: https://rslint.rs/llms.txt - ### Rslint - Run `{{ packageManager }} run lint` to lint your code + +## Docs + +- Rslint: https://rslint.rs/llms.txt diff --git a/test/agents.test.ts b/test/agents.test.ts index f14914a..c44ab37 100644 --- a/test/agents.test.ts +++ b/test/agents.test.ts @@ -118,7 +118,7 @@ test('should generate AGENTS.md with single tool selected', async () => { ### Biome - - Run \`pnpm run lint\` to lint your code + - Run \`pnpm run check\` to lint your code - Run \`pnpm run format\` to format your code ## Template Info @@ -131,6 +131,67 @@ test('should generate AGENTS.md with single tool selected', async () => { `); }); +test('should generate AGENTS.md with rslint tool selected', async () => { + const projectDir = path.join(testDir, 'rslint-tool'); + + await create({ + name: 'test', + root: fixturesDir, + templates: ['vanilla'], + getTemplateName: async () => 'vanilla', + argv: [ + 'node', + 'test', + '--dir', + projectDir, + '--template', + 'vanilla', + '--tools', + 'rslint', + ], + }); + + const content = fs.readFileSync(path.join(projectDir, 'AGENTS.md'), 'utf-8'); + expect(content).toMatchInlineSnapshot(` + "# Project Overview + + This section provides common guidance for all templates. + + ## Development + + ### Common Development + + - Common development instructions + - Available in all templates + + ## Tools + + ### Common Tools + + - Tools that apply to all templates + + ### Rstest + + - Run \`pnpm run test\` to test your code + + ### Rslint + + - Run \`pnpm run lint\` to lint your code + + ## Template Info + + ### Vanilla Template + + - This is vanilla template specific content + - Only available in vanilla template + + ## Docs + + - Rslint: https://rslint.rs/llms.txt + " + `); +}); + test('should generate AGENTS.md with eslint tool and template mapping', async () => { const projectDir = path.join(testDir, 'eslint-tool');