From ec790d4ce50e376a2504716df3ecd0ce6b9d837c Mon Sep 17 00:00:00 2001 From: Yiming Li Date: Thu, 10 Sep 2026 22:36:00 +0800 Subject: [PATCH 1/3] fix: keep Prettier and Biome away from installed skills Skills are installed into .agents with their hash recorded in skills-lock.json, but neither was ignored, so formatting a new project rewrote third-party skill files. Ignore both in the Prettier and Biome templates. --- template-biome/biome.json.template | 3 ++ template-prettier/.prettierignore | 4 +++ test/skills-ignore.test.ts | 52 ++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 test/skills-ignore.test.ts diff --git a/template-biome/biome.json.template b/template-biome/biome.json.template index 53f38c7..19c1698 100644 --- a/template-biome/biome.json.template +++ b/template-biome/biome.json.template @@ -1,5 +1,8 @@ { "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", + "files": { + "includes": ["**", "!**/.agents", "!**/skills-lock.json"] + }, "assist": { "actions": { "source": { diff --git a/template-prettier/.prettierignore b/template-prettier/.prettierignore index ac66857..fb0c735 100644 --- a/template-prettier/.prettierignore +++ b/template-prettier/.prettierignore @@ -2,3 +2,7 @@ package-lock.json pnpm-lock.yaml yarn.lock + +# Agent skills +.agents +skills-lock.json diff --git a/test/skills-ignore.test.ts b/test/skills-ignore.test.ts new file mode 100644 index 0000000..0da9f73 --- /dev/null +++ b/test/skills-ignore.test.ts @@ -0,0 +1,52 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { beforeEach, expect, test } from 'rstack/test'; +import { create } from '../src'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const fixturesDir = path.join(__dirname, 'fixtures', 'agents-md'); +const testDir = path.join(fixturesDir, 'test-temp-output-skills-ignore'); + +beforeEach(() => { + fs.rmSync(testDir, { recursive: true, force: true }); + fs.mkdirSync(testDir, { recursive: true }); + return () => fs.rmSync(testDir, { recursive: true, force: true }); +}); + +test('should keep Prettier and Biome away from installed skills', async () => { + const projectDir = path.join(testDir, 'formatters'); + + await create({ + name: 'test', + root: fixturesDir, + templates: ['vanilla'], + getTemplateName: async () => 'vanilla', + argv: [ + 'node', + 'test', + '--dir', + projectDir, + '--template', + 'vanilla', + '--tools', + 'prettier,biome', + ], + }); + + const prettierIgnore = fs.readFileSync( + path.join(projectDir, '.prettierignore'), + 'utf-8', + ); + expect(prettierIgnore).toContain('.agents'); + expect(prettierIgnore).toContain('skills-lock.json'); + + const biomeConfig = JSON.parse( + fs.readFileSync(path.join(projectDir, 'biome.json'), 'utf-8'), + ); + expect(biomeConfig.files.includes).toEqual([ + '**', + '!**/.agents', + '!**/skills-lock.json', + ]); +}); From f0b4952eead1eb72e3cd1f7d9b07f046ba4c855c Mon Sep 17 00:00:00 2001 From: Yiming Li Date: Fri, 11 Sep 2026 11:34:47 +0800 Subject: [PATCH 2/3] fix: only ignore skills-lock.json, not the whole .agents directory .agents can also hold skills a project maintains itself, which should follow its formatting rules, so leave excluding skill directories to each project. --- template-biome/biome.json.template | 2 +- template-prettier/.prettierignore | 3 +-- test/skills-ignore.test.ts | 9 ++------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/template-biome/biome.json.template b/template-biome/biome.json.template index 19c1698..81145cb 100644 --- a/template-biome/biome.json.template +++ b/template-biome/biome.json.template @@ -1,7 +1,7 @@ { "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", "files": { - "includes": ["**", "!**/.agents", "!**/skills-lock.json"] + "includes": ["**", "!**/skills-lock.json"] }, "assist": { "actions": { diff --git a/template-prettier/.prettierignore b/template-prettier/.prettierignore index fb0c735..ed0282f 100644 --- a/template-prettier/.prettierignore +++ b/template-prettier/.prettierignore @@ -3,6 +3,5 @@ package-lock.json pnpm-lock.yaml yarn.lock -# Agent skills -.agents +# Skills lock skills-lock.json diff --git a/test/skills-ignore.test.ts b/test/skills-ignore.test.ts index 0da9f73..6a8a63c 100644 --- a/test/skills-ignore.test.ts +++ b/test/skills-ignore.test.ts @@ -14,7 +14,7 @@ beforeEach(() => { return () => fs.rmSync(testDir, { recursive: true, force: true }); }); -test('should keep Prettier and Biome away from installed skills', async () => { +test('should keep Prettier and Biome away from skills-lock.json', async () => { const projectDir = path.join(testDir, 'formatters'); await create({ @@ -38,15 +38,10 @@ test('should keep Prettier and Biome away from installed skills', async () => { path.join(projectDir, '.prettierignore'), 'utf-8', ); - expect(prettierIgnore).toContain('.agents'); expect(prettierIgnore).toContain('skills-lock.json'); const biomeConfig = JSON.parse( fs.readFileSync(path.join(projectDir, 'biome.json'), 'utf-8'), ); - expect(biomeConfig.files.includes).toEqual([ - '**', - '!**/.agents', - '!**/skills-lock.json', - ]); + expect(biomeConfig.files.includes).toEqual(['**', '!**/skills-lock.json']); }); From 08f2b5928c3d0abc9217bc35c727c497e4fc3278 Mon Sep 17 00:00:00 2001 From: Yiming Li Date: Fri, 11 Sep 2026 11:46:16 +0800 Subject: [PATCH 3/3] test: drop the skills-lock.json ignore test --- test/skills-ignore.test.ts | 47 -------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 test/skills-ignore.test.ts diff --git a/test/skills-ignore.test.ts b/test/skills-ignore.test.ts deleted file mode 100644 index 6a8a63c..0000000 --- a/test/skills-ignore.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import fs from 'node:fs'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; -import { beforeEach, expect, test } from 'rstack/test'; -import { create } from '../src'; - -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const fixturesDir = path.join(__dirname, 'fixtures', 'agents-md'); -const testDir = path.join(fixturesDir, 'test-temp-output-skills-ignore'); - -beforeEach(() => { - fs.rmSync(testDir, { recursive: true, force: true }); - fs.mkdirSync(testDir, { recursive: true }); - return () => fs.rmSync(testDir, { recursive: true, force: true }); -}); - -test('should keep Prettier and Biome away from skills-lock.json', async () => { - const projectDir = path.join(testDir, 'formatters'); - - await create({ - name: 'test', - root: fixturesDir, - templates: ['vanilla'], - getTemplateName: async () => 'vanilla', - argv: [ - 'node', - 'test', - '--dir', - projectDir, - '--template', - 'vanilla', - '--tools', - 'prettier,biome', - ], - }); - - const prettierIgnore = fs.readFileSync( - path.join(projectDir, '.prettierignore'), - 'utf-8', - ); - expect(prettierIgnore).toContain('skills-lock.json'); - - const biomeConfig = JSON.parse( - fs.readFileSync(path.join(projectDir, 'biome.json'), 'utf-8'), - ); - expect(biomeConfig.files.includes).toEqual(['**', '!**/skills-lock.json']); -});